Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
611 B
2
Indexable
Never
package ballistickemu.Lobby.handlers;

import ballistickemu.Lobby.LobbyServer;
import ballistickemu.Main;
import ballistickemu.Tools.StickPacketMaker;
import ballistickemu.Types.StickClient;
import ballistickemu.Types.StickClientRegistry;
import java.util.Collection;

public class CheckCapacityHandler
{
  public static void HandlePacket(StickClient client)
  {
    if (Main.getLobbyServer().getClientRegistry().getAllClients().size() >= Main.maxPlayers) {
      client.write(StickPacketMaker.getErrorPacket("0"));
    } else {
      client.write(StickPacketMaker.ServerHello());
    }
  }
}