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 Typ
    Methode
    Beschreibung
    void
    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
    main(String[] args)
    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.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Methodendetails

    • main

      public static void main(String[] args)
      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 Schnittstelle com.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 Schnittstelle com.jme3.network.ConnectionListener
    • connectionRemoved

      public void connectionRemoved(com.jme3.network.Server server, com.jme3.network.HostedConnection hostedConnection)
      Angegeben von:
      connectionRemoved in Schnittstelle com.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 Schnittstelle pp.battleship.game.server.ServerSender
      Parameter:
      id - the connection id
      message - the message