Packages

trait Server extends AnyRef

Trait representing a Server

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Server
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type ServerState = ServerState.Value

Abstract Value Members

  1. abstract def addPlayerToLobby(actorRef: ActorRef, player: BasePlayer): Boolean

    Adds a player to the lobby.

    Adds a player to the lobby.

    actorRef

    The actor ref.

    player

    The player to add.

    returns

    True, if the player is added correctly; false if the lobby is full.

  2. abstract def bind(actorRef: ActorRef): Unit

    Binds this instance with the input ActorRef.

    Binds this instance with the input ActorRef.

    actorRef

    The ActorRef.

  3. abstract def broadcastMessage(message: Any, clientsToExclude: String*): Unit

    Broadcasts a message to all connected clients.

    Broadcasts a message to all connected clients.

    message

    The message to send.

    clientsToExclude

    Specify clients to which the delivery must not be performed.

  4. abstract def closeLobby(): Unit

    Closes the lobby, all further requests to enter it are ignored.

  5. abstract def createLobby(lobbyContext: LobbyContext): Unit

    Creates a lobby and enters it, all further requests to enter it are handled.

    Creates a lobby and enters it, all further requests to enter it are handled.

    lobbyContext

    The lobby context.

  6. abstract def deliverMessage(username: String, message: Any): Unit

    Delivers a message to a specified client.

    Delivers a message to a specified client.

    username

    The player username.

    message

    The message.

  7. abstract def getLobbyPlayers: Seq[ReferablePlayer]

    Gets the lobby players.

    Gets the lobby players.

    returns

    All players in the lobby.

  8. abstract def getState: ServerState

    Gets the state of the server.

    Gets the state of the server.

    returns

    The server state.

  9. abstract def getUUID: String

    Gets the uuid of the cell entity that represents this client.

    Gets the uuid of the cell entity that represents this client.

    returns

    The uuid.

  10. abstract def getUsername: String

    Gets the username of the player representing the server.

    Gets the username of the player representing the server.

    returns

    The username.

  11. abstract def initGame(level: Level): Promise[Boolean]

    Signals all clients that the game needs to be started and checks that they all reply.

    Signals all clients that the game needs to be started and checks that they all reply.

    level

    The level.

    returns

    Promise that completes with true if all clients replied before the timeout; otherwise false.

  12. abstract def kill(): Unit

    Kills this instance.

  13. abstract def notifyClientInputEvent(event: MouseEventWrapper): Unit

    Notifies server about new client input event.

    Notifies server about new client input event.

    event

    The event.

  14. abstract def removePlayerFromGame(username: String, notify: Boolean = false): Unit

    Removes the player from the game.

    Removes the player from the game.

    username

    The player username.

    notify

    If the player client needs to be notified.

  15. abstract def removePlayerFromLobby(username: String): Unit

    Removes a player from the lobby.

    Removes a player from the lobby.

    username

    The username of the player.

  16. abstract def startGame(levelContext: MultiPlayerLevelContext, levelInfo: LevelInfo): Unit

    Starts the game by notifying the interface and passing the level context to use.

    Starts the game by notifying the interface and passing the level context to use.

    levelContext

    The level context.

    levelInfo

    The level info.

  17. abstract def stopGame(winner: String = ""): Unit

    Signals all clients that the game have been stopped.

    Signals all clients that the game have been stopped.

    winner

    The username of the player who won, if not declared the winner is assumed to be the server.

Concrete Value Members

  1. implicit val timeout: Timeout
  2. implicit val who: String