fix: fixed bug where spectators sending character selection would blow up the server
This commit is contained in:
parent
6122c55025
commit
8d26c3f2ea
@ -139,13 +139,19 @@ public class LobbyManager {
|
|||||||
* @return true if handled successfully, and false otherwise
|
* @return true if handled successfully, and false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean handleSelection(Client client, CharacterSelectionMessage message) {
|
public boolean handleSelection(Client client, CharacterSelectionMessage message) {
|
||||||
|
Logger.debug("Handling characterSelection...");
|
||||||
if (!participants.containsKey(client.id)) {
|
if (!participants.containsKey(client.id)) {
|
||||||
|
Logger.trace("Participant didn't exist, returning...");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Participant participant = participants.get(client.id);
|
Participant participant = participants.get(client.id);
|
||||||
|
|
||||||
if (participant.state != ParticipantState.Assigned) {
|
if (participant.state != ParticipantState.Assigned) {
|
||||||
|
Logger.trace("Participant wasn't assigned, exiting...");
|
||||||
|
return false;
|
||||||
|
} else if (participant.type == ParticipantType.Spectator) {
|
||||||
|
Logger.trace("Spectator sent message, returning...");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user