Package pp.battleship.server
Klasse BattleshipServer
java.lang.Object
pp.battleship.server.BattleshipServer
- Alle implementierten Schnittstellen:
com.jme3.network.ConnectionListener
,com.jme3.network.MessageListener<com.jme3.network.HostedConnection>
,pp.battleship.game.server.ServerSender
public class BattleshipServer
extends Object
implements com.jme3.network.MessageListener<com.jme3.network.HostedConnection>, com.jme3.network.ConnectionListener, pp.battleship.game.server.ServerSender
Server implementing the visitor pattern as MessageReceiver for ClientMessages
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
connectionAdded
(com.jme3.network.Server server, com.jme3.network.HostedConnection hostedConnection) void
connectionRemoved
(com.jme3.network.Server server, com.jme3.network.HostedConnection hostedConnection) static void
Starts the Battleships server.void
messageReceived
(com.jme3.network.HostedConnection source, com.jme3.network.Message message) void
run()
void
send
(int id, pp.battleship.message.server.ServerMessage message) Send the specified message to the specified connection.
-
Methodendetails
-
main
Starts the Battleships server. -
run
public void run() -
messageReceived
public void messageReceived(com.jme3.network.HostedConnection source, com.jme3.network.Message message) - Angegeben von:
messageReceived
in Schnittstellecom.jme3.network.MessageListener<com.jme3.network.HostedConnection>
-
connectionAdded
public void connectionAdded(com.jme3.network.Server server, com.jme3.network.HostedConnection hostedConnection) - Angegeben von:
connectionAdded
in Schnittstellecom.jme3.network.ConnectionListener
-
connectionRemoved
public void connectionRemoved(com.jme3.network.Server server, com.jme3.network.HostedConnection hostedConnection) - Angegeben von:
connectionRemoved
in Schnittstellecom.jme3.network.ConnectionListener
-
send
public void send(int id, pp.battleship.message.server.ServerMessage message) Send the specified message to the specified connection.- Angegeben von:
send
in Schnittstellepp.battleship.game.server.ServerSender
- Parameter:
id
- the connection idmessage
- the message
-