Package de.coreengine.network
Class TCPServer
- java.lang.Object
-
- de.coreengine.network.TCPServer
-
-
Constructor Summary
Constructors Constructor Description TCPServer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addBannedAddress(InetAddress addr)
static void
banClient(int id, String message)
Banning client from the serverstatic int
clientCount()
static TCPServerClient[]
getClients()
Getting an array of all clients that are connected to the server.static int
getMaxPlayers()
static boolean
isFull()
static void
kickClient(int id, String message)
Kicking client from the servervoid
run()
-
-
-
Method Detail
-
isFull
public static boolean isFull()
- Returns:
- Is the server full
-
clientCount
public static int clientCount()
- Returns:
- How many clients are currently connected to the server
-
banClient
public static void banClient(int id, String message)
Banning client from the server- Parameters:
id
- Client id to banmessage
- Message to send by banning
-
kickClient
public static void kickClient(int id, String message)
Kicking client from the server- Parameters:
id
- Client id to kickmessage
- Message to send by kicking
-
addBannedAddress
public static void addBannedAddress(InetAddress addr)
- Parameters:
addr
- Address to ban
-
getMaxPlayers
public static int getMaxPlayers()
- Returns:
- Max player count of the server
-
getClients
public static TCPServerClient[] getClients()
Getting an array of all clients that are connected to the server. The id if the array is the id of the client. Ifa client at id x is equal to null, thn the id x has still no client!- Returns:
- Array of the connected clients
-
-