Packages

final case class ServerImpl(username: String) extends Server with Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, Server, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ServerImpl
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Server
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ServerImpl(username: String)

Type Members

  1. type ServerState = ServerState.Value
    Definition Classes
    Server

Value Members

  1. 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.

    Definition Classes
    ServerImplServer
  2. def bind(actorRef: ActorRef): Unit

    Binds this instance with the input ActorRef.

    Binds this instance with the input ActorRef.

    actorRef

    The ActorRef.

    Definition Classes
    ServerImplServer
  3. 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.

    Definition Classes
    ServerImplServer
  4. def closeLobby(): Unit

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

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

    Definition Classes
    ServerImplServer
  5. 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.

    Definition Classes
    ServerImplServer
  6. 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.

    Definition Classes
    ServerImplServer
  7. def getLobbyPlayers: Seq[ReferablePlayer]

    Gets the lobby players.

    Gets the lobby players.

    returns

    All players in the lobby.

    Definition Classes
    ServerImplServer
  8. def getState: ServerState

    Gets the state of the server.

    Gets the state of the server.

    returns

    The server state.

    Definition Classes
    ServerImplServer
  9. 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.

    Definition Classes
    ServerImplServer
  10. def getUsername: String

    Gets the username of the player representing the server.

    Gets the username of the player representing the server.

    returns

    The username.

    Definition Classes
    ServerImplServer
  11. 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.

    Definition Classes
    ServerImplServer
  12. def kill(): Unit

    Kills this instance.

    Kills this instance.

    Definition Classes
    ServerImplServer
  13. def notifyClientInputEvent(event: MouseEventWrapper): Unit

    Notifies server about new client input event.

    Notifies server about new client input event.

    event

    The event.

    Definition Classes
    ServerImplServer
  14. 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.

    Definition Classes
    ServerImplServer
  15. def removePlayerFromLobby(username: String): Unit

    Removes a player from the lobby.

    Removes a player from the lobby.

    username

    The username of the player.

    Definition Classes
    ServerImplServer
  16. 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.

    Definition Classes
    ServerImplServer
  17. def stopGame(winner: String = username): 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.

    Definition Classes
    ServerImplServer
  18. implicit val timeout: Timeout
    Definition Classes
    Server
  19. implicit val who: String
    Definition Classes
    Server