Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.2 kB
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 ballistickemu.Types.StickPacket;
import ballistickemu.Types.StickRoom;
import ballistickemu.Types.StickRoomRegistry;
import java.io.PrintStream;
import java.util.Collection;


public class RoomDetailRequestHandler
{
  public static void HandlePacket(StickClient client, String Packet)
  {
    try
    {
      String RoomName = Packet.substring(2, Packet.length()).replaceAll("\000", "");
      StickRoom Room = Main.getLobbyServer().getRoomRegistry().GetRoomFromName(RoomName);
      if (Room != null)
      {
        StickPacket response = StickPacketMaker.getSendRoundDetail(Room.getMapID(), Room.getCycleMode(), Room.GetCR().getAllClients().size(), Room.getCurrentRoundTime());
        client.write(response);
      }
    }
    catch (Exception e)
    {
      System.out.println("Exception parsing RoomDetailRequest packet");
      System.out.println(e.toString());
    }
  }
}