Untitled

 avatar
unknown
plain_text
3 years ago
974 B
4
Indexable
package ballistickemu.Lobby.handlers;

import ballistickemu.Lobby.LobbyServer;
import ballistickemu.Main;
import ballistickemu.Types.StickClient;
import ballistickemu.Types.StickClientRegistry;
import ballistickemu.Types.StickRoom;


public class FindRequestHandler
{
  public static void HandlePacket(StickClient client, String packet)
  {
    String playerName = packet.substring(2).replaceAll("\000", "");
    StickClient target = Main.getLobbyServer().getClientRegistry().getClientfromName(playerName);
    if (target == null)
    {
      client.writeCallbackMessage("Player " + playerName + " was not found.");
      return; }
    if (target.getLobbyStatus().booleanValue())
    {
      client.writeCallbackMessage("Player " + playerName + " is in the lobby.");
    } else if (target.getRoom() != null)
    {
      client.writeCallbackMessage("Player " + playerName + " is in the game called " + client.getRoom().getName() + ".");
    }
  }
}
Editor is loading...