-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host Settings Menu #767
base: main
Are you sure you want to change the base?
Host Settings Menu #767
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address comments
Server has warnings
When you change someones name mid game, styled text explodes because the text itself doesnt change
You absolutely dont need to be able to change peoples names mid game
If you can do that, then you should be able to edit others messages mid game
Make it so you cant change peoples names mid game to fix this IMO
This review was nit picky idk why
@@ -215,6 +223,13 @@ export default function messageListener(packet: ToClientPacket){ | |||
); | |||
} | |||
break; | |||
case "hostData": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crazy
@@ -78,7 +91,9 @@ type GameState = { | |||
ticking: boolean, | |||
|
|||
clientState: PlayerGameState | {type: "spectator"}, | |||
host: boolean, | |||
host: null | { | |||
clients: ListMap<LobbyClientID, GameClient> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cant call this game client and then have it only exist if you are the host. Right you just like??? I guess the clients dont need it
This code is not self-explanatory
@@ -16,6 +16,9 @@ export type LobbyPreviewData = { | |||
|
|||
export type ToClientPacket = { | |||
type: "pong", | |||
} | { | |||
type: "hostData", | |||
clients: ListMapData<LobbyClientID, GameClient> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wild
GAME_MANAGER.state.phaseState.type === "finalWords" | ||
)) | ||
GAME_MANAGER.state.phaseState.playerOnTrial = packet.playerIndex; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt be in this PR but whateva
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick
@@ -178,6 +178,8 @@ export type ToServerPacket = { | |||
type: "ping", | |||
} | { | |||
type: "lobbyListRequest", | |||
} | { | |||
type: "hostDataRequest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like
for client in clients.iter_mut() { | ||
if let GameClientLocation::Spectator(index) = &mut client.1.client_location { | ||
if *index > idx { | ||
*index -= 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saturating sub. Do we have to decrease it?
} | ||
Self::set_player_name(id, name, clients); | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename packets :P
|
||
GamePlayers{players: Vec<String>}, | ||
GameInitializationComplete, | ||
BackToLobby, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this really not exist before?
What?
Oh right this is that packet i said to rename i forgot again lol
// Game | ||
|
||
GamePlayers{players: Vec<String>}, | ||
GameInitializationComplete, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking around and im not entirely sure why we need this
The start game packet is supposed to be the signal to swap to the gamescreen
im sure there is a good reason
HostDataRequest, | ||
EndGame, | ||
SkipPhase, | ||
SetPlayerName { id: LobbyClientID, name: String }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better names PLEASE!!!
This also removes the playerOnTrial packet since that data is already sent in the phaseState packet