feat: now ignoring empty request messages instead of sending them
This commit is contained in:
parent
80ad60a658
commit
7f717f5fe2
@ -212,13 +212,15 @@ public class Lobby {
|
||||
}
|
||||
|
||||
private void accept(Participant source, List<Event> accepted) {
|
||||
Logger.debug("Accepting requests from participant '{}', broadcasting events to all except source",
|
||||
source.id.getName());
|
||||
connection.broadcastToAllExcept(source, accepted.toArray(new Event[0]));
|
||||
if (!accepted.isEmpty()) {
|
||||
Logger.debug("Accepting requests from participant '{}', broadcasting events to all except source",
|
||||
source.id.getName());
|
||||
connection.broadcastToAllExcept(source, accepted.toArray(new Event[0]));
|
||||
|
||||
Logger.trace("Adding ack and sending back to originParticipant");
|
||||
accepted.add(0, new EventBuilder(EventType.Ack).buildGameStateEvent());
|
||||
connection.sendEvents(source, accepted.toArray(new Event[0]));
|
||||
Logger.trace("Adding ack and sending back to originParticipant");
|
||||
accepted.add(0, new EventBuilder(EventType.Ack).buildGameStateEvent());
|
||||
connection.sendEvents(source, accepted.toArray(new Event[0]));
|
||||
}
|
||||
badRequests = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user