Package VASSAL.chat.peer2peer
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 Summary
Fields inherited from interface VASSAL.chat.ChatServerConnection
AVAILABLE_ROOMS, DEFAULT_ROOM_NAME, INCOMING_MSG, PLAYER_INFO, ROOM, STATUS, STATUS_SERVER
Fields inherited from interface VASSAL.build.module.ServerConnection
CONNECTED, CONNECTION_LOST
-
Constructor Summary
ConstructorDescriptionP2PClient
(CommandEncoder encoder, WelcomeMessageServer welcomeMessageServer, PeerPool pool) P2PClient
(CommandEncoder encoder, WelcomeMessageServer welcomeMessageServer, PeerPool pool, Properties param) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addPropertyChangeListener
(String propertyName, PropertyChangeListener l) Register a PropertyChangeListener.protected void
fireStatus
(String msg) Room[]
Return an array of all rooms on the servergetRoom()
Return the room currently occupied by the playerReturn a Player instance representing the current playervoid
initializeControls
(ChatServerControls controls) Register all event listenersboolean
void
Send a Command to a particular playervoid
void
sendToOthers
(String msg) void
Send a command to other players on the servervoid
setActivePeerManager
(org.litesoft.p2pchat.ActivePeerManager pActivePeerManager) void
setConnected
(boolean connect) void
setPendingPeerManager
(org.litesoft.p2pchat.PendingPeerManager pPendingPeerManager) void
Join the given roomvoid
Set the Player instance representing this playervoid
void
showConnect
(org.litesoft.p2pchat.PeerInfo pPeerInfo) void
showConnectFailed
(org.litesoft.p2pchat.PeerInfo pPeerInfo) void
showDisconnect
(org.litesoft.p2pchat.PeerInfo pPeerInfo) void
showHELO
(org.litesoft.p2pchat.PeerInfo pPeerInfo) void
showNAME
(org.litesoft.p2pchat.PeerInfo pPeerInfo) void
void
showStreamsFailed
(org.litesoft.p2pchat.PeerInfo pPeerInfo) void
showUnrecognized
(org.litesoft.p2pchat.PeerInfo pPeerInfo, String pBadMessage) void
uninitializeControls
(ChatServerControls controls) Remove all previously-registered event listeners
-
Field Details
-
peerMgr
protected org.litesoft.p2pchat.ActivePeerManager peerMgr
-
-
Constructor Details
-
P2PClient
-
P2PClient
public P2PClient(CommandEncoder encoder, WelcomeMessageServer welcomeMessageServer, PeerPool pool, Properties param)
-
-
Method Details
-
getRoomMgr
-
sendToOthers
Description copied from interface:ServerConnection
Send a command to other players on the server- Specified by:
sendToOthers
in interfaceServerConnection
-
sendToAll
-
sendToOthers
-
sendTo
Description copied from interface:ChatServerConnection
Send a Command to a particular player- Specified by:
sendTo
in interfaceChatServerConnection
-
getRoom
Description copied from interface:ChatServerConnection
Return the room currently occupied by the player- Specified by:
getRoom
in interfaceChatServerConnection
-
setRoom
Description copied from interface:ChatServerConnection
Join the given room- Specified by:
setRoom
in interfaceChatServerConnection
-
getAvailableRooms
Description copied from interface:ChatServerConnection
Return an array of all rooms on the server- Specified by:
getAvailableRooms
in interfaceChatServerConnection
-
getUserInfo
Description copied from interface:ChatServerConnection
Return a Player instance representing the current player- Specified by:
getUserInfo
in interfaceChatServerConnection
-
setUserInfo
Description copied from interface:ChatServerConnection
Set the Player instance representing this player- Specified by:
setUserInfo
in interfaceChatServerConnection
-
setConnected
public void setConnected(boolean connect) - Specified by:
setConnected
in interfaceServerConnection
-
fireStatus
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfaceServerConnection
-
getStatusServer
-
stringToPlayer
- Specified by:
stringToPlayer
in interfacePlayerEncoder
-
playerToString
- Specified by:
playerToString
in interfacePlayerEncoder
-
addPropertyChangeListener
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 interfaceServerConnection
-
addPropertyChangeListener
-
setActivePeerManager
public void setActivePeerManager(org.litesoft.p2pchat.ActivePeerManager pActivePeerManager) - Specified by:
setActivePeerManager
in interfaceorg.litesoft.p2pchat.UserDialog
-
setPendingPeerManager
public void setPendingPeerManager(org.litesoft.p2pchat.PendingPeerManager pPendingPeerManager) - Specified by:
setPendingPeerManager
in interfaceorg.litesoft.p2pchat.UserDialog
-
showUnrecognized
- Specified by:
showUnrecognized
in interfaceorg.litesoft.p2pchat.UserDialog
-
showStreamsFailed
public void showStreamsFailed(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showStreamsFailed
in interfaceorg.litesoft.p2pchat.UserDialog
-
showConnectFailed
public void showConnectFailed(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showConnectFailed
in interfaceorg.litesoft.p2pchat.UserDialog
-
showConnect
public void showConnect(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showConnect
in interfaceorg.litesoft.p2pchat.UserDialog
-
showDisconnect
public void showDisconnect(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showDisconnect
in interfaceorg.litesoft.p2pchat.UserDialog
-
showCHAT
- Specified by:
showCHAT
in interfaceorg.litesoft.p2pchat.UserDialog
-
showPMSG
- Specified by:
showPMSG
in interfaceorg.litesoft.p2pchat.UserDialog
-
showNAME
public void showNAME(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showNAME
in interfaceorg.litesoft.p2pchat.UserDialog
-
showHELO
public void showHELO(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showHELO
in interfaceorg.litesoft.p2pchat.UserDialog
-
initializeControls
Description copied from interface:ChatControlsInitializer
Register all event listeners- Specified by:
initializeControls
in interfaceChatControlsInitializer
-
uninitializeControls
Description copied from interface:ChatControlsInitializer
Remove all previously-registered event listeners- Specified by:
uninitializeControls
in interfaceChatControlsInitializer
-