Class P2PClient

java.lang.Object
VASSAL.chat.peer2peer.P2PClient
All Implemented Interfaces:
org.litesoft.p2pchat.UserDialog, ServerConnection, ChatServerConnection, PlayerEncoder, ChatControlsInitializer
Direct Known Subclasses:
ClientTest

public class P2PClient extends Object implements ChatServerConnection, ChatControlsInitializer, org.litesoft.p2pchat.UserDialog, PlayerEncoder
  • Field Details

    • peerMgr

      protected org.litesoft.p2pchat.ActivePeerManager peerMgr
  • Constructor Details

  • Method Details

    • getRoomMgr

      public RoomManager getRoomMgr()
    • sendToOthers

      public void sendToOthers(Command c)
      Description copied from interface: ServerConnection
      Send a command to other players on the server
      Specified by:
      sendToOthers in interface ServerConnection
    • sendToAll

      public void sendToAll(String msg)
    • sendToOthers

      public void sendToOthers(String msg)
    • sendTo

      public void sendTo(Player recipient, Command c)
      Description copied from interface: ChatServerConnection
      Send a Command to a particular player
      Specified by:
      sendTo in interface ChatServerConnection
    • getRoom

      public Room getRoom()
      Description copied from interface: ChatServerConnection
      Return the room currently occupied by the player
      Specified by:
      getRoom in interface ChatServerConnection
    • setRoom

      public void setRoom(Room r)
      Description copied from interface: ChatServerConnection
      Join the given room
      Specified by:
      setRoom in interface ChatServerConnection
    • getAvailableRooms

      public Room[] getAvailableRooms()
      Description copied from interface: ChatServerConnection
      Return an array of all rooms on the server
      Specified by:
      getAvailableRooms in interface ChatServerConnection
    • getUserInfo

      public Player getUserInfo()
      Description copied from interface: ChatServerConnection
      Return a Player instance representing the current player
      Specified by:
      getUserInfo in interface ChatServerConnection
    • setUserInfo

      public void setUserInfo(Player p)
      Description copied from interface: ChatServerConnection
      Set the Player instance representing this player
      Specified by:
      setUserInfo in interface ChatServerConnection
    • setConnected

      public void setConnected(boolean connect)
      Specified by:
      setConnected in interface ServerConnection
    • fireStatus

      protected void fireStatus(String msg)
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface ServerConnection
    • getStatusServer

      public ServerStatus getStatusServer()
    • stringToPlayer

      public Player stringToPlayer(String s)
      Specified by:
      stringToPlayer in interface PlayerEncoder
    • playerToString

      public String playerToString(Player p)
      Specified by:
      playerToString in interface PlayerEncoder
    • addPropertyChangeListener

      public void addPropertyChangeListener(String propertyName, PropertyChangeListener l)
      Description copied from interface: ServerConnection
      Register a PropertyChangeListener. Changes to connection status triggers a PropertyChangeEvent, and concrete implementations may define other properties
      Specified by:
      addPropertyChangeListener in interface ServerConnection
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener l)
    • setActivePeerManager

      public void setActivePeerManager(org.litesoft.p2pchat.ActivePeerManager pActivePeerManager)
      Specified by:
      setActivePeerManager in interface org.litesoft.p2pchat.UserDialog
    • setPendingPeerManager

      public void setPendingPeerManager(org.litesoft.p2pchat.PendingPeerManager pPendingPeerManager)
      Specified by:
      setPendingPeerManager in interface org.litesoft.p2pchat.UserDialog
    • showUnrecognized

      public void showUnrecognized(org.litesoft.p2pchat.PeerInfo pPeerInfo, String pBadMessage)
      Specified by:
      showUnrecognized in interface org.litesoft.p2pchat.UserDialog
    • showStreamsFailed

      public void showStreamsFailed(org.litesoft.p2pchat.PeerInfo pPeerInfo)
      Specified by:
      showStreamsFailed in interface org.litesoft.p2pchat.UserDialog
    • showConnectFailed

      public void showConnectFailed(org.litesoft.p2pchat.PeerInfo pPeerInfo)
      Specified by:
      showConnectFailed in interface org.litesoft.p2pchat.UserDialog
    • showConnect

      public void showConnect(org.litesoft.p2pchat.PeerInfo pPeerInfo)
      Specified by:
      showConnect in interface org.litesoft.p2pchat.UserDialog
    • showDisconnect

      public void showDisconnect(org.litesoft.p2pchat.PeerInfo pPeerInfo)
      Specified by:
      showDisconnect in interface org.litesoft.p2pchat.UserDialog
    • showCHAT

      public void showCHAT(org.litesoft.p2pchat.PeerInfo pPeerInfo, String msg)
      Specified by:
      showCHAT in interface org.litesoft.p2pchat.UserDialog
    • showPMSG

      public void showPMSG(org.litesoft.p2pchat.PeerInfo pPeerInfo, String msg)
      Specified by:
      showPMSG in interface org.litesoft.p2pchat.UserDialog
    • showNAME

      public void showNAME(org.litesoft.p2pchat.PeerInfo pPeerInfo)
      Specified by:
      showNAME in interface org.litesoft.p2pchat.UserDialog
    • showHELO

      public void showHELO(org.litesoft.p2pchat.PeerInfo pPeerInfo)
      Specified by:
      showHELO in interface org.litesoft.p2pchat.UserDialog
    • initializeControls

      public void initializeControls(ChatServerControls controls)
      Description copied from interface: ChatControlsInitializer
      Register all event listeners
      Specified by:
      initializeControls in interface ChatControlsInitializer
    • uninitializeControls

      public void uninitializeControls(ChatServerControls controls)
      Description copied from interface: ChatControlsInitializer
      Remove all previously-registered event listeners
      Specified by:
      uninitializeControls in interface ChatControlsInitializer