|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.SecurePlay.SPGameAPIClass
The Game API Class is the interface used to communicate with the Game Object as well as to manage the creation of the various types of transactions and other activities associated with controlling a Game.
![]() |
![]() |
![]() |
![]() |
| Constructor Summary | |
SPGameAPIClass(SPGameClass gameinstance)
Constructor |
|
| Method Summary | |
boolean |
APIAddListener(SPEventInterface gameobj)
This method adds a listener object for Game API events |
boolean |
APIBcreateTransaction(java.lang.String transtype,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
This method allows the creation of a new, internally controlled transaction. |
boolean |
APIbeginGame(java.lang.String playerID)
This method safely begins the game |
boolean |
APIClearListeners()
This method clears the listener objects for Game API events |
boolean |
APIcloseTransaction(java.lang.String transID)
This method removes a transaction from the game instance's open transaction list. |
SPTBlastClass |
APIcreateBlastTransaction(java.lang.String pid,
java.lang.String[] transcontent)
This method creates a default Blast Transaction for this library. |
SPAbstractTransactionInterface |
APIcreateTransaction(java.lang.String transtype,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
This method allows the creation of a new, internally controlled transaction. |
boolean |
APIendGame(java.lang.String playerID)
This method safely ends a game. |
SPLogInterface |
APIgetGameLog()
Gets the messagelog object from the gameinstance |
java.lang.Object |
APIgetGameLogCurrentEntry()
Returns current entry from the messagelog object of comms |
int |
APIgetGameLogLength()
returns the number entries in messagelog |
java.lang.Object |
APIgetGameLogNextEntry()
Returns the next entry from the messagelog object of comms |
java.lang.Object |
APIgetGameLogPreviousEntry()
Returns the previous entry from the messagelog object of the comms |
java.lang.String |
APIgetLicenseSummary()
This method returns a summary of the licensee information for the current game instance. |
int |
APIGetListenerCount()
This method returns the number of listener objects for Game API events |
java.lang.Object[] |
APIGetListeners()
This method returns a list of listener objects for Game API events |
java.lang.String[] |
APIgetOpenTransactionIDs()
Returns a vector that contains a list of open transaction IDs |
SPPlayerInterface |
APIgetPlayer(java.lang.String pid)
This method gets the player from the game instance using the player ID |
java.lang.String[] |
APIgetPlayerIDList()
This method gets the player id list list associated with this game. |
SPAbstractTransactionInterface |
APIgetTransaction(java.lang.String tid)
This method gets the transaction from the game instance using the transaction ID |
SPAbstractTransactionAPIInterface |
APIgetTransactionAPI(java.lang.String tid)
This method returns the transaction API of the game transaction using sid. |
boolean |
APInewGameBlock(java.lang.String pid,
java.lang.String[] receivers,
java.lang.String gameblocktype,
java.lang.String gameblockID,
java.lang.String[] gameblockparameters)
This method notifies other players of a new GameBlock. |
boolean |
APIPlayerJoin(java.lang.String sender,
java.lang.String pid,
java.lang.String cid)
This method allows the Game instance Master to safely add a new player during the course of a game and to notify the remote players of this information. |
boolean |
APIPlayerJoin(java.lang.String sender,
java.lang.String pid,
java.lang.String cid,
boolean rflag)
This method allows the Game instance Master to safely add a new player during the course of a game and to notify the remote players of this information. |
boolean |
APIRemoveListener(SPEventInterface gameobj)
This method removes a listener object for Game API events |
boolean |
APIrequestbeginGame(java.lang.String playerID)
This method sends a request to the game instance master to begin the game. |
boolean |
APIrequestcreateTransaction(java.lang.String pid,
java.lang.String transmaster,
java.lang.String transtype,
java.lang.String[] playerIDList,
boolean privateflagIN)
This method safely allows a player to request the creation of a new transaction of a given type and parameters. |
boolean |
APIrequestendGame(java.lang.String playerID)
This method sends a message from the specified player to the game instance master to end the game. |
boolean |
APIrequestPlayerJoin(java.lang.String sender,
java.lang.String pid,
java.lang.String cid,
boolean rflagIN)
This method sends a request to a remote game instance to add a player during a game. |
SPAbstractTransactionAPIInterface |
APITAOcreateTransaction(java.lang.String transtype,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
This method allows the creation of a new, internally controlled transaction. |
SPAbstractTransactionInterface |
buildTransaction(java.lang.String transtype,
SPGameClass gameobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean privateflag,
java.lang.String transactionID)
This method builds a local transaction associated with a game instance. |
SPGameClass |
getGameinstance()
Getter function that returns the property: gameinstance |
java.lang.String |
GetNextGameSegmentID(java.lang.String currentsegment)
This method gets automatically called by the Game any time the conditions for a new Game Segment are met according to the SecurePlay Library license. |
boolean |
isLibrarytestmode()
Getter function that returns the property: librarytestmode |
boolean |
isPlayerIncluded(java.lang.String pid)
This method tests to determine if a specified player is a transaction participant. |
boolean |
isPlayerInternal(java.lang.String pid)
This method checks to see whether a specified playerID is internal to the local SecurePlay library process |
boolean |
joinPlayer(java.lang.String pid,
java.lang.String cid,
boolean rflag)
This method carries out the local process of adding a new Player to the local game instance. |
void |
logError()
This is a shell function for future use. |
void |
onBlast(SPMessageClass messObj)
This method handles incoming new Blast Transactions |
void |
onnewGameBlock(SPMessageClass messObj)
This method handles incoming new Game Blocks |
boolean |
onnewTransaction(SPMessageClass incoming)
This method handles messages for new incoming transactions. |
boolean |
onPlayerJoin(SPMessageClass messObj)
This method safely handles remote messages for the addition of a player to the local game instance. |
boolean |
onrequestcreateTransaction(SPMessageClass incoming)
This method handles incoming requests for the creation of new transactions. |
boolean |
onrequestPlayerJoin(SPMessageClass messObj)
Safely handles requests to add a player. |
boolean |
rulesbeginGame(java.lang.String requesterID)
This is a shell function to allow the insertion of rules code for the decision to begin a game. |
boolean |
rulescreateTransaction(java.lang.String sender,
java.lang.String transtype,
java.lang.String master,
java.lang.String[] players,
boolean pflag)
This method safely allows a player to request the creation of a new transaction of a given type and parameters. |
boolean |
rulesendGame(java.lang.String requesterID)
This is a shell method to allow the evaluation of the game rules to determine if the game should be allowed to end. |
boolean |
rulesnewplayerconfig(java.lang.String pid,
java.lang.String cid,
boolean rflag)
This shell method takes an incoming proposed configuration for a new player and maps it against the local preference for that player, if different. |
boolean |
rulesPlayerJoin(java.lang.String sender,
java.lang.String[] messbody)
This is a shell method to determine if a player will be allowed to join in midgame. |
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 is a wrapper for the game instance sendMessage() method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SPGameAPIClass(SPGameClass gameinstance)
gameinstance - SPGameClass - this parameter is set to this.gameinstance| Method Detail |
public boolean APIbeginGame(java.lang.String playerID)
SPGameAPIInterface
APIbeginGame in interface SPGameAPIInterfaceplayerID - String - player id is the master.
public boolean APIendGame(java.lang.String playerID)
SPGameAPIInterface
APIendGame in interface SPGameAPIInterfaceplayerID - String - player id is the master.
public java.lang.String GetNextGameSegmentID(java.lang.String currentsegment)
SPGameAPIInterface
GetNextGameSegmentID in interface SPGameAPIInterfacecurrentsegment - String - current game segment, but currently not used because the method is a shell.
public boolean isPlayerInternal(java.lang.String pid)
SPGameAPIInterface
isPlayerInternal in interface SPGameAPIInterfacepid - String - player id to be checked.
public boolean isPlayerIncluded(java.lang.String pid)
SPGameAPIInterface
isPlayerIncluded in interface SPGameAPIInterfacepid - String - player id to be checked.
public SPAbstractTransactionInterface buildTransaction(java.lang.String transtype,
SPGameClass gameobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean privateflag,
java.lang.String transactionID)
transtype - String - specified transaction type.gameobj - SPGameClass - the game to associated with.master - String - the master of the gameplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.transactionID - String - This variable holds the unique identifier for the transaction instance within a game instance.
public boolean APIcloseTransaction(java.lang.String transID)
SPGameAPIInterface
APIcloseTransaction in interface SPGameAPIInterfacetransID - String - transaction id to beremoved.
public SPAbstractTransactionInterface APIcreateTransaction(java.lang.String transtype,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
SPGameAPIInterface
APIcreateTransaction in interface SPGameAPIInterfacetranstype - String - specified transaction typetransmaster - String - player id of the master of the transactionplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
public boolean APIBcreateTransaction(java.lang.String transtype,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
SPGameAPIInterface
APIBcreateTransaction in interface SPGameAPIInterfacetranstype - String - specified transaction typetransmaster - String - player id of the master of the transactionplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
public SPAbstractTransactionAPIInterface APITAOcreateTransaction(java.lang.String transtype,
java.lang.String transmaster,
java.lang.String[] playerIDList,
boolean privateflag)
SPGameAPIInterface
APITAOcreateTransaction in interface SPGameAPIInterfacetranstype - String - specified transaction typetransmaster - String - player id of the master of the transactionplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
public boolean onnewTransaction(SPMessageClass incoming)
SPGameAPIInterface
onnewTransaction in interface SPGameAPIInterfaceincoming - SPMessageClass - the incoming message.
public boolean APIPlayerJoin(java.lang.String sender,
java.lang.String pid,
java.lang.String cid)
SPGameAPIInterface
APIPlayerJoin in interface SPGameAPIInterfacesender - String - player id of the senderpid - String - player id to be joinedcid - String - comms id to be used
public boolean APIPlayerJoin(java.lang.String sender,
java.lang.String pid,
java.lang.String cid,
boolean rflag)
SPGameAPIInterface
APIPlayerJoin in interface SPGameAPIInterfacesender - String - player id of the senderpid - String - player id to be joinedcid - String - comms id to be usedrflag - boolean - relay flag
public boolean onPlayerJoin(SPMessageClass messObj)
SPGameAPIInterface
onPlayerJoin in interface SPGameAPIInterfacemessObj - SPMessageClass - incoming Message Object
public boolean joinPlayer(java.lang.String pid,
java.lang.String cid,
boolean rflag)
SPGameAPIInterface
joinPlayer in interface SPGameAPIInterfacepid - String - player id to be joinedcid - String - comms id to usedrflag - boolean - relay flag
public boolean rulesnewplayerconfig(java.lang.String pid,
java.lang.String cid,
boolean rflag)
SPGameAPIInterface
rulesnewplayerconfig in interface SPGameAPIInterfacepid - String - player id of the player to be configuredcid - String - comms idrflag - boolean - relay flag
public boolean APIrequestbeginGame(java.lang.String playerID)
SPGameAPIInterface
APIrequestbeginGame in interface SPGameAPIInterfaceplayerID - String - id of player who is requesting
public boolean APIrequestendGame(java.lang.String playerID)
SPGameAPIInterface
APIrequestendGame in interface SPGameAPIInterfaceplayerID - String - id of the player requesting
public boolean APIrequestcreateTransaction(java.lang.String pid,
java.lang.String transmaster,
java.lang.String transtype,
java.lang.String[] playerIDList,
boolean privateflagIN)
SPGameAPIInterface
APIrequestcreateTransaction in interface SPGameAPIInterfacepid - String - player id of the player who is requesting (cannot be the master)transmaster - String - player id of the master.transtype - String - transaction type to be createdplayerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.privateflagIN - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
public boolean APIrequestPlayerJoin(java.lang.String sender,
java.lang.String pid,
java.lang.String cid,
boolean rflagIN)
SPGameAPIInterface
APIrequestPlayerJoin in interface SPGameAPIInterfacesender - String - player id of the player who is requesting (can not be the master).pid - String - player id of the master.cid - String - comms id.rflagIN - boolean - relay flag
public boolean onrequestcreateTransaction(SPMessageClass incoming)
SPGameAPIInterface
onrequestcreateTransaction in interface SPGameAPIInterfaceincoming - SPMessageClass - incoming message
public boolean onrequestPlayerJoin(SPMessageClass messObj)
SPGameAPIInterface
onrequestPlayerJoin in interface SPGameAPIInterfacemessObj - SPMessageClass - incoming Message Object
public boolean rulesbeginGame(java.lang.String requesterID)
SPGameAPIInterface
rulesbeginGame in interface SPGameAPIInterfacerequesterID - String - the id of the player who requested the request.
public boolean rulesendGame(java.lang.String requesterID)
SPGameAPIInterface
rulesendGame in interface SPGameAPIInterfacerequesterID - String - the id of the player who requested the request.
public boolean rulesPlayerJoin(java.lang.String sender,
java.lang.String[] messbody)
SPGameAPIInterface
rulesPlayerJoin in interface SPGameAPIInterfacesender - String - the id of the player who requested the request.messbody - String[] - the message
public boolean rulescreateTransaction(java.lang.String sender,
java.lang.String transtype,
java.lang.String master,
java.lang.String[] players,
boolean pflag)
SPGameAPIInterface
rulescreateTransaction in interface SPGameAPIInterfacesender - String - the id of the player who requested the request.transtype - String - the transaction type to be createdmaster - String - the id of the master of the transaction.players - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.pflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
public java.lang.String APIgetLicenseSummary()
SPGameAPIInterface
APIgetLicenseSummary in interface SPGameAPIInterfacepublic SPLogInterface APIgetGameLog()
SPGameAPIInterface
APIgetGameLog in interface SPGameAPIInterfacepublic java.lang.Object APIgetGameLogCurrentEntry()
SPGameAPIInterface
APIgetGameLogCurrentEntry in interface SPGameAPIInterfacepublic int APIgetGameLogLength()
SPGameAPIInterface
APIgetGameLogLength in interface SPGameAPIInterfacepublic java.lang.Object APIgetGameLogNextEntry()
SPGameAPIInterface
APIgetGameLogNextEntry in interface SPGameAPIInterfacepublic java.lang.Object APIgetGameLogPreviousEntry()
SPGameAPIInterface
APIgetGameLogPreviousEntry in interface SPGameAPIInterfacepublic java.lang.String[] APIgetOpenTransactionIDs()
SPGameAPIInterface
APIgetOpenTransactionIDs in interface SPGameAPIInterfacepublic SPAbstractTransactionAPIInterface APIgetTransactionAPI(java.lang.String tid)
SPGameAPIInterface
APIgetTransactionAPI in interface SPGameAPIInterfacetid - String - the transaction id.
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)
SPGameAPIInterface
sendMessage in interface SPGameAPIInterfacesender - - 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 SPAbstractTransactionInterface APIgetTransaction(java.lang.String tid)
SPGameAPIInterface
APIgetTransaction in interface SPGameAPIInterfacetid - String - the transaction id
public boolean APIAddListener(SPEventInterface gameobj)
SPGameAPIInterface
APIAddListener in interface SPGameAPIInterfacegameobj - SPEventInterface - the object to be added, that inplement the listener interface
SPRootTransactionClass.APIAddListener(SPEventInterface gameobj)public boolean APIRemoveListener(SPEventInterface gameobj)
SPGameAPIInterface
APIRemoveListener in interface SPGameAPIInterfacegameobj - SPEventInterface - the object to be removed, that inplement the listener interface
SPRootTransactionClass.APIRemoveListener(SPEventInterface gameobj)public java.lang.Object[] APIGetListeners()
SPGameAPIInterface
APIGetListeners in interface SPGameAPIInterfaceSPRootTransactionClass.APIGetListeners()public boolean APIClearListeners()
SPGameAPIInterface
APIClearListeners in interface SPGameAPIInterfaceSPRootTransactionClass.APIClearListeners()public int APIGetListenerCount()
SPGameAPIInterface
APIGetListenerCount in interface SPGameAPIInterfaceSPRootTransactionClass.APIGetListenerCount()
public SPTBlastClass APIcreateBlastTransaction(java.lang.String pid,
java.lang.String[] transcontent)
SPGameAPIInterface
APIcreateBlastTransaction in interface SPGameAPIInterfacepid - String - player id.transcontent - String[] - content of this transaction.
public void onBlast(SPMessageClass messObj)
SPGameAPIInterface
onBlast in interface SPGameAPIInterfacemessObj - SPMessageClass - incoming Message Objectpublic SPPlayerInterface APIgetPlayer(java.lang.String pid)
SPGameAPIInterface
APIgetPlayer in interface SPGameAPIInterfacepid - String - the player ID
public SPGameClass getGameinstance()
SPGameAPIInterface
getGameinstance in interface SPGameAPIInterfacepublic boolean isLibrarytestmode()
public java.lang.String[] APIgetPlayerIDList()
SPGameAPIInterface
APIgetPlayerIDList in interface SPGameAPIInterface
public boolean APInewGameBlock(java.lang.String pid,
java.lang.String[] receivers,
java.lang.String gameblocktype,
java.lang.String gameblockID,
java.lang.String[] gameblockparameters)
pid - String - player id of the masterreceivers - String[] - array of receiversgameblocktype - String - type of GameBlockgameblockID - String - unique ID of GameBlockgameblockparameters - String[] - GameBlock parameters
public void onnewGameBlock(SPMessageClass messObj)
SPGameAPIInterface
onnewGameBlock in interface SPGameAPIInterfacemessObj - SPMessageClass - incoming Message Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||