Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
fix: forgot to deserialize spectate msg
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Oct 2, 2024
1 parent 94d85bf commit 45c52cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/src/game/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export class Game {
| net.InputMsg
| net.EmoteMsg
| net.DropItemMsg
| net.SpectateMsg
| net.PerkModeRoleSelectMsg
| undefined = undefined;

Expand All @@ -232,6 +233,10 @@ export class Game {
msg = new net.DropItemMsg();
msg.deserialize(stream);
break;
case net.MsgType.Spectate:
msg = new net.SpectateMsg();
msg.deserialize(stream);
break;
case net.MsgType.PerkModeRoleSelect:
msg = new net.PerkModeRoleSelectMsg();
msg.deserialize(stream);
Expand Down Expand Up @@ -262,6 +267,8 @@ export class Game {
return;
}

if (!msg) return;

if (type === net.MsgType.Join && !player) {
this.playerBarn.addPlayer(socketId, msg as net.JoinMsg);
return;
Expand Down

0 comments on commit 45c52cf

Please sign in to comment.