fix: fixed bug where spectators sending character selection would blow up the server
This commit is contained in:
		@ -139,13 +139,19 @@ public class LobbyManager {
 | 
			
		||||
     * @return true if handled successfully, and false otherwise
 | 
			
		||||
     */
 | 
			
		||||
    public boolean handleSelection(Client client, CharacterSelectionMessage message) {
 | 
			
		||||
        Logger.debug("Handling characterSelection...");
 | 
			
		||||
        if (!participants.containsKey(client.id)) {
 | 
			
		||||
            Logger.trace("Participant didn't exist, returning...");
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        Participant participant = participants.get(client.id);
 | 
			
		||||
 | 
			
		||||
        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;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user