|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.asdf.server.Server
public class Server
Contains server and client socket handling functionality.
Field Summary | |
---|---|
boolean |
running
Switch for running Can be set false from anywhere to stop execution gracefully. |
Constructor Summary | |
---|---|
Server()
|
Method Summary | |
---|---|
void |
ban(ClientConnection client)
Ban client by IP. |
int |
clientsConnected()
Get number of clients connected. |
void |
dispose()
Can be called to free resources. |
AccountManager |
getAccountManager()
Getter for AccountManager |
GameManager |
getGameManager()
Getter for GameManager |
SessionManager |
getSessionManager()
Getter for SessionManager |
void |
run()
Server event loop. |
void |
runOnce()
Main event loop of the server. |
void |
send(java.nio.channels.SocketChannel socket,
java.nio.ByteBuffer data)
Adds data to socket's queue for sending. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean running
Constructor Detail |
---|
public Server()
Method Detail |
---|
public void run() throws java.io.IOException
java.io.IOException
public void runOnce() throws java.io.IOException
java.io.IOException
public void send(java.nio.channels.SocketChannel socket, java.nio.ByteBuffer data) throws java.io.IOException
socket
- data
- Data to be sent
java.io.IOException
public int clientsConnected()
public void ban(ClientConnection client)
client
- Client to banpublic GameManager getGameManager()
public AccountManager getAccountManager()
public SessionManager getSessionManager()
public void dispose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |