|
SecurePlayLibray J2SE v2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.SecurePlay.Comms.SPCGenericCommsServer.SPCGenericCommsServerClass
Generic Comms server class. This class is a generic comms server.
![]() |
![]() |
![]() |
![]() |
| Field Summary | |
private SPCGenericCommsDriverClass |
commsDriver
Comms driver associated with this server. |
private java.lang.String |
commsID
Comms id of this comms class. |
private SPMap |
gamePlayerAddress
Property that stores the player id associated with an address. |
private SPMap |
internalRelayList
map |
private SPMap |
printernalGameList
Property that stores the game id associated with a comms manager of the game. |
| Constructor Summary | |
SPCGenericCommsServerClass(SPCGenericCommsDriverClass driver)
Constructor |
|
| Method Summary | |
boolean |
addGame(java.lang.String gid,
SPCommsManagerCommsInterface game)
This method adds an internal game to a specific comms service. |
boolean |
addPlayer(java.lang.String gid,
java.lang.String pid)
This method adds a player ID of a remote player serviced by this comm service. |
java.lang.String[] |
getAddresses(java.lang.String gid,
java.lang.String[] playerIDs)
Returns a list of addresses that are associated with the player id list. |
SPCGenericCommsDriverClass |
getCommsDriver()
Returns the comms driver. |
java.lang.String |
getCommsID()
Gets the comms id. |
java.lang.String |
getCommsServiceType()
This method returns a unique identifier for the type of comms service instance. |
SPMap |
getGameplayerList()
Getter function that returns the property: gameplayerList |
java.lang.String[] |
getInternalGameIDList()
Getter function that returns the property: internalGameIDList |
java.lang.String |
getOneInternalGameID()
Returns the first game id of internal games. |
java.lang.String |
getOneInternalPlayerID(java.lang.String gid)
Returns the first player id of the specified game. |
java.lang.String |
getPlayerAddress(java.lang.String gid,
java.lang.String pid)
Gets the address of a player in a game. |
java.lang.String[] |
getPlayerList(java.lang.String gid)
Gets the player list of a game. |
SPMap |
getPrinternalGameList()
Getter function that returns the property: printernalGameList |
int |
includedPlayerCount(java.lang.String[] playerarray,
java.lang.String gid)
Checks to see how many players in the player id list are in the game. |
boolean |
isAddressUsed(java.lang.String address)
Checks to see if the address is used by any player. |
boolean |
isGameInternal(java.lang.String gid)
This method returns whether a game is handled internally by a comms service |
boolean |
isReady()
Goes through every player and checks to see if everyone has an address set. |
void |
processincoming(SPMessageClass inmess)
This method processes the incoming message. |
protected boolean |
prreceive(SPMessageClass[] message)
This standard method handles incoming serialized messages that have been separated out of incoming data streams by the incoming method. |
boolean |
removeGame(java.lang.String gid)
This method removes the association of a game with the comms service. |
boolean |
removePlayer(java.lang.String gid,
java.lang.String pid)
This method removes a player from the list of remote players served by this comm service. |
int |
sendMessage(SPMessageClass clearmessage,
SPMessageClass alternatemessage)
This method returns a number based on the input array to indicate how many of the input array's player IDs are included in the comms service playerIDList (This method takes the message and sends it over the network, if they are served by this comms service.) |
int |
sendMessage(java.lang.String[] receivers,
SPMessageClass clearmessage,
SPMessageClass alternatemessage)
This method returns a number based on the input array to indicate how many of the input array's player IDs are included in the comms service playerIDList This method is depreceated and will be removed in a future version of the software (This method takes the message and sends it over the network, if they are served by this comms service.) |
boolean |
setcommsID(java.lang.String cid)
This method sets the internal ID for a comms service if it has not been set. |
boolean |
setGamePlayerAddress(java.lang.String gid,
java.lang.String pid,
java.lang.String address,
boolean relay)
Sets a player of a game to an address. |
void |
SPdeserializeProcessDouble(byte[] doubleMessages)
Deserializes and processes double messages not single or multiple. |
void |
SPdeserializeProcessMess(byte[] messages)
Deserializes amd processes multiple or single messages not doubple. |
boolean |
unsetGamePlayerAddress(java.lang.String gid,
java.lang.String pid)
Unsets an address of a player in a game. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private SPCGenericCommsDriverClass commsDriver
private java.lang.String commsID
private SPMap gamePlayerAddress
private SPMap printernalGameList
private SPMap internalRelayList
| Constructor Detail |
public SPCGenericCommsServerClass(SPCGenericCommsDriverClass driver)
| Method Detail |
public boolean setcommsID(java.lang.String cid)
setcommsID in interface SPAbstractCommsInterfacecid - String - comms id
public boolean addGame(java.lang.String gid,
SPCommsManagerCommsInterface game)
addGame in interface SPAbstractCommsInterfacegid - String - game idgame - SPCommsManagerCommsInterface - the comms object to be added to a game
public boolean removeGame(java.lang.String gid)
removeGame in interface SPAbstractCommsInterfacegid - String - game id
public boolean addPlayer(java.lang.String gid,
java.lang.String pid)
addPlayer in interface SPAbstractCommsInterfacepid - String - player id to be addedgid - String - game id for the player to be added
public boolean removePlayer(java.lang.String gid,
java.lang.String pid)
removePlayer in interface SPAbstractCommsInterfacepid - String - player id to ber removed.gid - String - game id from which the player is to be removed.
public boolean setGamePlayerAddress(java.lang.String gid,
java.lang.String pid,
java.lang.String address,
boolean relay)
gid - String - game idpid - String - player idaddress - String - addressrelay - boolean - relay flag
public boolean unsetGamePlayerAddress(java.lang.String gid,
java.lang.String pid)
gid - String - game idpid - String - player id
public boolean isReady()
public SPCGenericCommsDriverClass getCommsDriver()
public java.lang.String getCommsID()
getCommsID in interface SPAbstractCommsInterfacepublic java.lang.String getCommsServiceType()
getCommsServiceType in interface SPAbstractCommsInterfacepublic SPMap getGameplayerList()
getGameplayerList in interface SPAbstractCommsInterface
public java.lang.String getPlayerAddress(java.lang.String gid,
java.lang.String pid)
gid - String - game idpid - String - player id
public java.lang.String[] getAddresses(java.lang.String gid,
java.lang.String[] playerIDs)
gid - playerIDs -
public java.lang.String[] getPlayerList(java.lang.String gid)
gid - String - game id.
public java.lang.String[] getInternalGameIDList()
getInternalGameIDList in interface SPAbstractCommsInterfacepublic java.lang.String getOneInternalGameID()
public java.lang.String getOneInternalPlayerID(java.lang.String gid)
gid - String - game id
public SPMap getPrinternalGameList()
getPrinternalGameList in interface SPAbstractCommsInterfacepublic boolean isGameInternal(java.lang.String gid)
isGameInternal in interface SPAbstractCommsInterfacegid - - String
public boolean isAddressUsed(java.lang.String address)
address - String - the address to be checked.
public int includedPlayerCount(java.lang.String[] playerarray,
java.lang.String gid)
playerarray - String[] - player id listgid - String - game id.
protected boolean prreceive(SPMessageClass[] message)
message - String - the incoming message
public void processincoming(SPMessageClass inmess)
inmess - SPMessageClass - the incoming message
void
public int sendMessage(SPMessageClass clearmessage,
SPMessageClass alternatemessage)
sendMessage in interface SPAbstractCommsInterfaceclearmessage - SPMessageClass - message for receiversalternatemessage - SPMessageClass - message or other game players
public int sendMessage(java.lang.String[] receivers,
SPMessageClass clearmessage,
SPMessageClass alternatemessage)
receivers - String[] - array of playerIDsclearmessage - SPMessageClass - message for receiversalternatemessage - SPMessageClass - message or other game players
public void SPdeserializeProcessDouble(byte[] doubleMessages)
doubleMessages - voidpublic void SPdeserializeProcessMess(byte[] messages)
messages - void
|
SecurePlayLibray J2SE v2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||