Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Rewrite a bit of the team chat logic #15615
Team chat is...
Note that team chat currently does not get disabled if you are the only player left on your team. However, that shouldn't be too hard to do if we want that fixed, too.
pchote left a comment •
Every time I try to review this I run into the ridiculously twisty chat logic,
I suspect the real problem is that the desired behaviour is not consistent, or maybe is just being modeled wrong. Would implementing a separate "SpectatorChat" order help here?
We also need to be careful about player status changing while orders are in flight. IMO its not right for a message that was valid team chat when it was sent to be rendered in the global chat (possibly only for some players! chat orders are immediate, so there may be a way for different clients to validate e.g. before / after simulating a player losing) because of unfortunate timing.
If we want to keep the current behaviour then we could make the implementation signficantly more understandable by pulling out a
This can then be used from
matjaeck left a comment •
I accidentally tested on bleed first and all the "issues" that I found there (and noted below if you're interested) are fixed here (I repeated these testcases). Additionally tested switching teams including joining and leaving spectator chat in the lobby and everything seems to work here as intended. Dead players now speak in the spectator team chat if available.
I have tested this in the constellation of 2 clients in team A vs 2 clients in team B with 2 clients as spectators and noticed the following: - dead player of team A could not see the spectator chat, his team chat messages have been visible for all - team chat was still available after the other player of team A lost and the game ended - when players from team A used the team chat now, it was visible to everybody - when spectators used the team chat, only other spectators saw it - when players from team B used the spec chat, only players of team B saw it