|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.SecurePlay.SPRootTransactionClass
com.SecurePlay.SPGameClass
This is the general class that holds a game instance. It is also the transaction class for the basic game transaction.
![]() |
![]() |
![]() |
![]() |
| Field Summary |
| Fields inherited from class com.SecurePlay.SPRootTransactionClass |
EventListenerList, gameID, master, playerIDList, transactionID |
| Constructor Summary | |
SPGameClass()
Default Constructor Consructor |
|
| Method Summary | |
boolean |
addComms(java.lang.String commsID)
This method associates a comms service specified by the commsID string to a game instance. |
boolean |
addPlayer(java.lang.String pid)
This method safely adds an existing Player, specified by the playerID to the game instance. |
boolean |
addTransaction(SPAbstractTransactionInterface transObj)
This safely adds a transaction to a game instance and appropriately updates the game state. |
boolean |
attach(java.lang.String gid,
SecurePlayClass lib,
java.lang.String master,
boolean signaturepolicy,
boolean encryptionpolicy,
SPLogInterface log,
SPSecurityManagerInterface security)
This method attaches an empty game object instance and configures it for use in the SecurePlay library as a game NOTE: This method does not set the classAPI because it is an attached game. |
boolean |
closeTransaction(java.lang.String transID)
Safely removes a transaction from a game instance. |
boolean |
gameComplete()
This method allows external entities to review the status of the game instance without directly accessing its internals. |
int |
getBasicGameTransactionCount()
Getter function that returns the property: prBasicGameTransactionCount |
SPCommsManagerClass |
getCommsManager()
Gets the comms manager object |
java.lang.String |
getCurrentGameSegment()
Getter function that returns the property: prcurrentGameSegment |
SPGameAPIInterface |
getGameAPI()
This method returns the handler for the Game API object. |
SPPlayerInterface |
getGamePlayer(java.lang.String playerID)
This method returns the player object specified by the playerID. |
int |
getGameSegmentCount()
Getter function that returns the property: prgamesegmentcount |
java.lang.String |
getGamestatus()
Getter function that returns the property: gamestatus |
SPAbstractTransactionInterface |
getGameTransaction(java.lang.String tid)
This method returns a specific transaction associated with a given game instance. |
byte[] |
getHashText(java.lang.String plainText,
java.lang.String algorithm)
This method gets the hashed string |
java.lang.String |
getNextGameSegment()
Getter function that returns the property: prnextGameSegment |
java.lang.String[] |
getOpentransactionIDList()
Getter function that returns the open transaction IDs |
SPPlayerInterface[] |
getPlayers()
Getter function that returns the players from prplayerlist |
int |
getPreloadGameSegment()
Getter function that returns the property: prpreloadGameSegment |
SecurePlayClass |
getSecurePlay()
This method returns the unique SecurePlay library object associated with the game instance object. |
SPSecurityManagerInterface |
getSecurityManager()
This method returns the security manager class associated with this game. |
SPAbstractTransactionInterface[] |
getTransactions()
Getter function that returns the transactions from propentransactionlist |
boolean |
incrementBasicGameTransactionCount(int count)
This method increments the game’s transaction counter to support certain licensing models |
boolean |
isPlayerInternal(java.lang.String pid)
Checks to see if the player is internal |
void |
logError()
This method is a placeholder for future internal logging |
boolean |
onbeginGame(SPMessageClass messObj)
This method handles requests to begin the local game. |
boolean |
onendGame(SPMessageClass messObj)
This method safely ends the local game instance. |
void |
onIncomingTransaction(SPMessageClass messObj)
This method is the generic handler for incoming Game transaction methods. |
boolean |
onnextGameSegmentID(SPMessageClass messObj)
This method supports the SecurePlay licensing system to maintain synchronization of game segment IDs within a game. |
void |
onrequestbeginGame(SPMessageClass messObj)
This method handles incoming requests to begin a game It passes the requests on to the API rules parser. |
void |
onrequestendGame(SPMessageClass messObj)
This method passes a request to end a game on to the game master's rule parser. |
java.lang.String |
prsetTransactionID(SPAbstractTransactionInterface transObj)
This method generates a transactionID for a transaction object |
void |
prUpdateGameStatus()
This method does a self-check on the game instance object and updates its status appropriately. |
boolean |
removeComms(java.lang.String commsID)
This method removes the association of a communications service with a game instance. |
boolean |
removePlayer(java.lang.String pid)
This method safely removes a Player instance from an existing Game Instance. |
boolean |
sendMessage(java.lang.String sender,
java.lang.String[] receivers,
boolean encryptflag,
boolean privateflag,
java.lang.String messagetype,
java.lang.String[] messagebody,
java.lang.String[] altmessage)
This method actually constructs messages to be sent by the Game object to other game object instances via the Comms Manager |
boolean |
setPlayerComms(java.lang.String playerID,
java.lang.String commsID,
boolean relayflag)
This method associates a specific player instance, specified by the playerID, with a specific communications service, specified by the commsID. |
byte[] |
SPcreateBHash(java.lang.String input,
java.lang.String gameid)
This is a wrapper function for creating a hash of a string. |
byte[] |
SPcreateBSignature(java.lang.String senderID,
byte[] input,
java.lang.String gameid)
This is a wrapper function for creating a digital signature based on an existing hashed string and a Sender ID. |
java.lang.String |
SPcreateHash(java.lang.String input,
java.lang.String gameid)
This is a wrapper function for creating a hash of a string. |
java.lang.String |
SPcreateSignature(java.lang.String senderID,
java.lang.String input,
java.lang.String gameid)
This is a wrapper function for creating a digital signature based on an existing hashed string and a Sender ID. |
java.lang.String[] |
SPdecrypt(java.lang.String[] input,
java.lang.String senderID,
java.lang.String[] recvrs,
java.lang.String gameID,
java.lang.String messageID)
This is a placeholder for an decryption function. |
java.lang.String[] |
SPencrypt(java.lang.String[] input,
java.lang.String senderID,
java.lang.String[] recvrs,
java.lang.String gameID,
java.lang.String messageID)
This is a placeholder for an encryption function. |
java.lang.String |
SPtransform(java.lang.String input,
java.lang.String gameid)
This function performs an irreversible transform on an input string to generate an output string. |
boolean |
SPverifySignature(byte[] sigToVerify,
java.lang.String senderID,
byte[] testhash,
java.lang.String gameid)
This is a wrapper for a digital signature verification function. |
boolean |
SPverifySignature(java.lang.String signature,
java.lang.String senderID,
java.lang.String testhash,
java.lang.String gameid)
This is a wrapper for a digital signature verification function. |
boolean |
transactionincluded(java.lang.String tid)
This method checks the specified transaction ID against the currently included transaction IDs in the game instance. |
boolean |
updateGameSegment(java.lang.String currentseg,
java.lang.String nextseg)
This method supports the administration of game segment IDs and counters. |
| Methods inherited from class com.SecurePlay.SPRootTransactionClass |
APIAddListener, APIClearListeners, APIGetListenerCount, APIGetListeners, APIRemoveListener, getGameID, getMaster, getPlayerIDList, getTransactionID, isPlayerIncluded, SPnotify |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.SecurePlay.SPGameInterface |
getGameID, getMaster, getPlayerIDList, getTransactionID, SPnotify |
| Constructor Detail |
public SPGameClass()
| Method Detail |
public boolean attach(java.lang.String gid,
SecurePlayClass lib,
java.lang.String master,
boolean signaturepolicy,
boolean encryptionpolicy,
SPLogInterface log,
SPSecurityManagerInterface security)
SPGameInterface
attach in interface SPGameInterfacegid - String - game idlib - SecurePlayClass - the secure play librarymaster - String - the master of the gamesignaturepolicy - boolean - signature policyencryptionpolicy - boolean - encryption policylog - security - public SPGameAPIInterface getGameAPI()
SPGameInterface
getGameAPI in interface SPGameInterfacepublic boolean addPlayer(java.lang.String pid)
SPGameInterface
addPlayer in interface SPGameInterfacepid - String - the id of the player to be added
public boolean removePlayer(java.lang.String pid)
SPGameInterface
removePlayer in interface SPGameInterfacepid - String - id of the player to be removed
public boolean setPlayerComms(java.lang.String playerID,
java.lang.String commsID,
boolean relayflag)
SPGameInterface
setPlayerComms in interface SPGameInterfaceplayerID - String - id of the player to be addedcommsID - String - id of the comms object to be addedrelayflag - Boolean - relay flag
public SPPlayerInterface getGamePlayer(java.lang.String playerID)
SPGameInterface
getGamePlayer in interface SPGameInterfaceplayerID - String - the id of the player to get
public void prUpdateGameStatus()
public boolean gameComplete()
SPGameInterface
gameComplete in interface SPGameInterfacepublic boolean addComms(java.lang.String commsID)
SPGameInterface
addComms in interface SPGameInterfacecommsID - String - id of the comms to be added
public boolean removeComms(java.lang.String commsID)
SPGameInterface
removeComms in interface SPGameInterfacecommsID - String - id of the comms to be removed
public boolean addTransaction(SPAbstractTransactionInterface transObj)
SPGameInterface
addTransaction in interface SPGameInterfacetransObj - SPAbstractTransactionInterface - the transaction Object handler
public boolean closeTransaction(java.lang.String transID)
SPGameInterface
closeTransaction in interface SPGameInterfacetransID - String - the id of the transaction to be closed
public SPAbstractTransactionInterface getGameTransaction(java.lang.String tid)
SPGameInterface
getGameTransaction in interface SPGameInterfacetid - String - identifier for transaction object
public java.lang.String prsetTransactionID(SPAbstractTransactionInterface transObj)
transObj - SPAbstractTransactionInterface - the transaction object from which the id is retrieved
public boolean transactionincluded(java.lang.String tid)
SPGameInterface
transactionincluded in interface SPGameInterfacetid - String - the id of the transaction in question
public boolean onbeginGame(SPMessageClass messObj)
messObj - SPMessageClass - incoming Message Object
public boolean onendGame(SPMessageClass messObj)
SPGameInterface
onendGame in interface SPGameInterfacemessObj - SPMessageClass - incoming Message Object
* @return result - Boolean: TRUE, if successful, FALSE, if notpublic void onrequestbeginGame(SPMessageClass messObj)
messObj - SPMessageClass - incoming Message Objectpublic void onrequestendGame(SPMessageClass messObj)
messObj - SPMessageClass - incoming Message Object
public boolean updateGameSegment(java.lang.String currentseg,
java.lang.String nextseg)
currentseg - String - current segmentnextseg - String - next segment
public boolean incrementBasicGameTransactionCount(int count)
SPGameInterface
incrementBasicGameTransactionCount in interface SPGameInterfacecount - int - number of increments
public boolean onnextGameSegmentID(SPMessageClass messObj)
messObj - SPMessageClass - incoming Message Object
public void onIncomingTransaction(SPMessageClass messObj)
SPGameInterface
onIncomingTransaction in interface SPGameInterfacemessObj - SPMessageClass - incoming Message Objectpublic boolean isPlayerInternal(java.lang.String pid)
SPGameInterface
isPlayerInternal in interface SPGameInterfacepid - String - id of the player to be checked
public void logError()
public boolean sendMessage(java.lang.String sender,
java.lang.String[] receivers,
boolean encryptflag,
boolean privateflag,
java.lang.String messagetype,
java.lang.String[] messagebody,
java.lang.String[] altmessage)
sender - - id of the senderreceivers - - ids of the recievers of the messageencryptflag - - encryption flagprivateflag - - private flagmessagetype - - the type of messagemessagebody - - the message bodyaltmessage - - alternative message
public SPCommsManagerClass getCommsManager()
SPGameInterface
getCommsManager in interface SPGameInterfacepublic SecurePlayClass getSecurePlay()
SPGameInterface
getSecurePlay in interface SPGameInterfacepublic java.lang.String getGamestatus()
public java.lang.String[] getOpentransactionIDList()
public SPAbstractTransactionInterface[] getTransactions()
public int getBasicGameTransactionCount()
public java.lang.String getCurrentGameSegment()
public int getGameSegmentCount()
public java.lang.String getNextGameSegment()
public SPPlayerInterface[] getPlayers()
public int getPreloadGameSegment()
public SPSecurityManagerInterface getSecurityManager()
SPGameInterface
getSecurityManager in interface SPGameInterface
public byte[] getHashText(java.lang.String plainText,
java.lang.String algorithm)
plainText - String - string to be hashedalgorithm - String - The algorithm to use like MD2, MD5, SHA-1, etc.
public byte[] SPcreateBHash(java.lang.String input,
java.lang.String gameid)
SPcreateBHash in interface SPGameInterfaceinput - String
public byte[] SPcreateBSignature(java.lang.String senderID,
byte[] input,
java.lang.String gameid)
SPcreateBSignature in interface SPGameInterfacesenderID - Stringinput - Stringgameid - String
public java.lang.String SPcreateHash(java.lang.String input,
java.lang.String gameid)
SPcreateHash in interface SPGameInterfaceinput - String
public java.lang.String SPcreateSignature(java.lang.String senderID,
java.lang.String input,
java.lang.String gameid)
SPcreateSignature in interface SPGameInterfacesenderID - Stringinput - Stringgameid - String
public java.lang.String[] SPdecrypt(java.lang.String[] input,
java.lang.String senderID,
java.lang.String[] recvrs,
java.lang.String gameID,
java.lang.String messageID)
SPdecrypt in interface SPGameInterfaceinput - String[] - input message body to be decryptedsenderID - String - sender idrecvrs - String[] - receiver id listgameID - String - game idmessageID - String - message id
public java.lang.String[] SPencrypt(java.lang.String[] input,
java.lang.String senderID,
java.lang.String[] recvrs,
java.lang.String gameID,
java.lang.String messageID)
SPencrypt in interface SPGameInterfaceinput - String[] - message body to be encryptedsenderID - String - sender idrecvrs - String[] - receiver id listgameID - String - game idmessageID - String - message id
public java.lang.String SPtransform(java.lang.String input,
java.lang.String gameid)
input - String
public boolean SPverifySignature(byte[] sigToVerify,
java.lang.String senderID,
byte[] testhash,
java.lang.String gameid)
SPverifySignature in interface SPGameInterfacesigToVerify - byte[]senderID - Stringtesthash - String
public boolean SPverifySignature(java.lang.String signature,
java.lang.String senderID,
java.lang.String testhash,
java.lang.String gameid)
SPverifySignature in interface SPGameInterfacesignature - StringsenderID - Stringtesthash - String
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||