Package org.collebol.server
Class Server
java.lang.Object
org.collebol.server.Server
- All Implemented Interfaces:
AutoCloseable
This is the server side of the EJGEngine project. This is the base of an external server socket.
You can use this for example to make a multiplayer option to run a part of the game external.
This class is responsible for setting up and running the server.
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()abstract voidrunning()static voidshutdown()Shutdown the server.voidstart()Starts the server by performing the following steps: Calls thestarting()method. Calls therunning()method. Sets theserverStatetoServerState.RUNNING. Setting up theServerConsole.consoleListener()Opening the socket.abstract voidstarting()abstract voidstopping()
-
Constructor Details
-
Server
- Throws:
IOException
-
-
Method Details
-
start
public void start()Starts the server by performing the following steps:- Calls the
starting()method. - Calls the
running()method. - Sets the
serverStatetoServerState.RUNNING. - Setting up the
ServerConsole.consoleListener() - Opening the socket.
- Calls the
-
starting
public abstract void starting() -
running
public abstract void running() -
stopping
public abstract void stopping() -
shutdown
public static void shutdown()Shutdown the server. -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-