Class LobbyServer

java.lang.Object
it.polimi.ingsw.Server.LobbyServer
All Implemented Interfaces:
Runnable

public class LobbyServer extends Object implements Runnable
Handler of game events, responsible for communication of game related information with a single client.
  • Field Details

  • Constructor Details

    • LobbyServer

      private LobbyServer(SocketWrapper sw)
      Creates the server around a SocketWrapper
      Parameters:
      sw - the socket to use to communicate with the client
  • Method Details

    • spawn

      public static void spawn(SocketWrapper socketWrapper)
      Start a server on the provided socket wrapper
      Parameters:
      socketWrapper - the wrapped connection to the client of the server
    • getEventQueue

      private BlockingQueue<ClientEvent> getEventQueue()
      Get the event queue this server listens on
      Returns:
      the BlockingQueue<ClientEvent> linked to this server
    • run

      public void run()
      When run, polls for events from the client and sends appropriate responses while handling interactions with the game
      Specified by:
      run in interface Runnable
    • generateUUID

      private static UUID generateUUID()
      generates a unique UUID for a lobby
      Returns:
      a not yet in use UUID for the lobby