trait Server extends AnyRef
Trait representing a Server
- Alphabetic
- By Inheritance
- Server
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type ServerState = ServerState.Value
Abstract Value Members
-
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.
-
abstract
def
bind(actorRef: ActorRef): Unit
Binds this instance with the input ActorRef.
Binds this instance with the input ActorRef.
- actorRef
The ActorRef.
-
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.
-
abstract
def
closeLobby(): Unit
Closes the lobby, all further requests to enter it are ignored.
-
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.
-
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.
-
abstract
def
getLobbyPlayers: Seq[ReferablePlayer]
Gets the lobby players.
Gets the lobby players.
- returns
All players in the lobby.
-
abstract
def
getState: ServerState
Gets the state of the server.
Gets the state of the server.
- returns
The server state.
-
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.
-
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.
-
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.
-
abstract
def
kill(): Unit
Kills this instance.
-
abstract
def
notifyClientInputEvent(event: MouseEventWrapper): Unit
Notifies server about new client input event.
Notifies server about new client input event.
- event
The event.
-
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.
-
abstract
def
removePlayerFromLobby(username: String): Unit
Removes a player from the lobby.
Removes a player from the lobby.
- username
The username of the player.
-
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.
-
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- implicit val timeout: Timeout
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- implicit val who: String