Summary
Game server crashes when this.loadout array is undefined during client setup.
Affected Code
server-game/src/client.js:139-143, 160-164, 489, 523-527
this.player.changeCharacter(
this.classIdx,
this.loadout[ItemType.Primary], // CRASH if this.loadout undefined
this.loadout[ItemType.Secondary],
this.colorIdx,
this.loadout[ItemType.Hat],
this.loadout[ItemType.Stamp],
);
Vulnerability
If client initialization fails before loadout is set.
Impact
- Game server crash on player join
- Denial of service
Recommended Fix
Initialize loadout with defaults:
if (!this.loadout) {
this.loadout = [];
}
Or use optional chaining:
this.loadout?.[ItemType.Primary]
References