-
Notifications
You must be signed in to change notification settings - Fork 37
ServerSystem
-
ServerSystem manages the server side connections to and from the client with
sendTo()
andreceived()
-
On
ServerSystem()
, the system initialize the super class with an instance of NetworkDictionary and ServerStrategy -
NetworkDictionary.java
holds all the classes that are going to be registered into the system, so the server can send and receive those classes through the net with the client (the client must register the same classes on the same order) -
On
initialize()
, the system fetches the ports where the server is going to wait the client, and then start the port listener -
Inside there is defined the NetworkJob class. The same holds the connectionId (used to track the conection between the server and client) and the receivedObject (used to hold the object that travelled between the server and client).
-
Deque<NetworkJob> netQueue
contains all the received objects from the clients -
The class extends MarshalSystem, that the same extends BaseSystem. Therefore, on each iteration of the "game loop", ServerSystem processes one
NetworkJob
contained innetQueue
-
We have access through methods, to the relationship of playerByConnection and connectionByPlayer
- IntelliJ
- Windows JDK
- Linux JDK
- Run client and server localhost
- Host a public server
- Import project to IntelliJ