Skip to content

ServerSystem

jmpala edited this page Aug 13, 2020 · 1 revision
  • ServerSystem manages the server side connections to and from the client with sendTo() and received()

  • 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 in netQueue

  • We have access through methods, to the relationship of playerByConnection and connectionByPlayer

<< Back to Server Systems

Get Starting

Requirements

Source Code

Reference

run

Graphics

balance

external documentation

Clone this wiki locally