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
FieldsFields inherited from interface VASSAL.chat.ChatServerConnection
AVAILABLE_ROOMS, DEFAULT_ROOM_NAME, INCOMING_MSG, PLAYER_INFO, ROOM, STATUS, STATUS_SERVERFields inherited from interface VASSAL.build.module.ServerConnection
CONNECTED, CONNECTION_LOST -
Constructor Summary
ConstructorsConstructorDescriptionP2PClient(CommandEncoder encoder, WelcomeMessageServer welcomeMessageServer, PeerPool pool) P2PClient(CommandEncoder encoder, WelcomeMessageServer welcomeMessageServer, PeerPool pool, Properties param) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener l) Register a PropertyChangeListener.protected voidfireStatus(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 playervoidinitializeControls(ChatServerControls controls) Register all event listenersbooleanvoidSend a Command to a particular playervoidvoidsendToOthers(String msg) voidSend a command to other players on the servervoidsetActivePeerManager(org.litesoft.p2pchat.ActivePeerManager pActivePeerManager) voidsetConnected(boolean connect) voidsetPendingPeerManager(org.litesoft.p2pchat.PendingPeerManager pPendingPeerManager) voidJoin the given roomvoidSet the Player instance representing this playervoidvoidshowConnect(org.litesoft.p2pchat.PeerInfo pPeerInfo) voidshowConnectFailed(org.litesoft.p2pchat.PeerInfo pPeerInfo) voidshowDisconnect(org.litesoft.p2pchat.PeerInfo pPeerInfo) voidshowHELO(org.litesoft.p2pchat.PeerInfo pPeerInfo) voidshowNAME(org.litesoft.p2pchat.PeerInfo pPeerInfo) voidvoidshowStreamsFailed(org.litesoft.p2pchat.PeerInfo pPeerInfo) voidshowUnrecognized(org.litesoft.p2pchat.PeerInfo pPeerInfo, String pBadMessage) voiduninitializeControls(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:ServerConnectionSend a command to other players on the server- Specified by:
sendToOthersin interfaceServerConnection
-
sendToAll
-
sendToOthers
-
sendTo
Description copied from interface:ChatServerConnectionSend a Command to a particular player- Specified by:
sendToin interfaceChatServerConnection
-
getRoom
Description copied from interface:ChatServerConnectionReturn the room currently occupied by the player- Specified by:
getRoomin interfaceChatServerConnection
-
setRoom
Description copied from interface:ChatServerConnectionJoin the given room- Specified by:
setRoomin interfaceChatServerConnection
-
getAvailableRooms
Description copied from interface:ChatServerConnectionReturn an array of all rooms on the server- Specified by:
getAvailableRoomsin interfaceChatServerConnection
-
getUserInfo
Description copied from interface:ChatServerConnectionReturn a Player instance representing the current player- Specified by:
getUserInfoin interfaceChatServerConnection
-
setUserInfo
Description copied from interface:ChatServerConnectionSet the Player instance representing this player- Specified by:
setUserInfoin interfaceChatServerConnection
-
setConnected
public void setConnected(boolean connect) - Specified by:
setConnectedin interfaceServerConnection
-
fireStatus
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceServerConnection
-
getStatusServer
-
stringToPlayer
- Specified by:
stringToPlayerin interfacePlayerEncoder
-
playerToString
- Specified by:
playerToStringin interfacePlayerEncoder
-
addPropertyChangeListener
Description copied from interface:ServerConnectionRegister a PropertyChangeListener. Changes to connection status triggers a PropertyChangeEvent, and concrete implementations may define other properties- Specified by:
addPropertyChangeListenerin interfaceServerConnection
-
addPropertyChangeListener
-
setActivePeerManager
public void setActivePeerManager(org.litesoft.p2pchat.ActivePeerManager pActivePeerManager) - Specified by:
setActivePeerManagerin interfaceorg.litesoft.p2pchat.UserDialog
-
setPendingPeerManager
public void setPendingPeerManager(org.litesoft.p2pchat.PendingPeerManager pPendingPeerManager) - Specified by:
setPendingPeerManagerin interfaceorg.litesoft.p2pchat.UserDialog
-
showUnrecognized
- Specified by:
showUnrecognizedin interfaceorg.litesoft.p2pchat.UserDialog
-
showStreamsFailed
public void showStreamsFailed(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showStreamsFailedin interfaceorg.litesoft.p2pchat.UserDialog
-
showConnectFailed
public void showConnectFailed(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showConnectFailedin interfaceorg.litesoft.p2pchat.UserDialog
-
showConnect
public void showConnect(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showConnectin interfaceorg.litesoft.p2pchat.UserDialog
-
showDisconnect
public void showDisconnect(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showDisconnectin interfaceorg.litesoft.p2pchat.UserDialog
-
showCHAT
- Specified by:
showCHATin interfaceorg.litesoft.p2pchat.UserDialog
-
showPMSG
- Specified by:
showPMSGin interfaceorg.litesoft.p2pchat.UserDialog
-
showNAME
public void showNAME(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showNAMEin interfaceorg.litesoft.p2pchat.UserDialog
-
showHELO
public void showHELO(org.litesoft.p2pchat.PeerInfo pPeerInfo) - Specified by:
showHELOin interfaceorg.litesoft.p2pchat.UserDialog
-
initializeControls
Description copied from interface:ChatControlsInitializerRegister all event listeners- Specified by:
initializeControlsin interfaceChatControlsInitializer
-
uninitializeControls
Description copied from interface:ChatControlsInitializerRemove all previously-registered event listeners- Specified by:
uninitializeControlsin interfaceChatControlsInitializer
-