com.SecurePlay
Class SPGameAPIClass

java.lang.Object
  extended bycom.SecurePlay.SPGameAPIClass
All Implemented Interfaces:
SPGameAPIInterface

public class SPGameAPIClass
extends java.lang.Object
implements SPGameAPIInterface

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.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

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

SPGameAPIClass

public SPGameAPIClass(SPGameClass gameinstance)
Constructor

Parameters:
gameinstance - SPGameClass - this parameter is set to this.gameinstance
Method Detail

APIbeginGame

public boolean APIbeginGame(java.lang.String playerID)
Description copied from interface: SPGameAPIInterface
This method safely begins the game

Specified by:
APIbeginGame in interface SPGameAPIInterface
Parameters:
playerID - String - player id is the master.
Returns:
result - Boolean: TRUE- if successful, FALSE, if not

APIendGame

public boolean APIendGame(java.lang.String playerID)
Description copied from interface: SPGameAPIInterface
This method safely ends a game.

Specified by:
APIendGame in interface SPGameAPIInterface
Parameters:
playerID - String - player id is the master.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

GetNextGameSegmentID

public java.lang.String GetNextGameSegmentID(java.lang.String currentsegment)
Description copied from interface: SPGameAPIInterface
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. THIS FUNCTION IS A STUB - A global system for unique game segment generation needs to be created in compliance with the SecurePlay license. NOTE - An initial Game Segment needs to be set for each individual game played online this is highly variable - it could be set by a server, a client, a peer, or other system on a case-by-case basis. The base Game Segment ID is provided by SecurePlay.com. One party to the game or supporting the game is responsible for setting the Game Segment ID - the master for the game transaction in this reference implementation. REMOVAL, CIRCUMVENTION, OR DELETION OF THIS FUNCTION IS A VIOLATION OF THE SECUREPLAY LICENSE. ANY CHANGES MUST BE COORDINATED - SEE THE SECUREPLAY LICENSE FOR DETAILS.

Specified by:
GetNextGameSegmentID in interface SPGameAPIInterface
Parameters:
currentsegment - String - current game segment, but currently not used because the method is a shell.
Returns:
gameSegment - String - new game segement ID

isPlayerInternal

public boolean isPlayerInternal(java.lang.String pid)
Description copied from interface: SPGameAPIInterface
This method checks to see whether a specified playerID is internal to the local SecurePlay library process

Specified by:
isPlayerInternal in interface SPGameAPIInterface
Parameters:
pid - String - player id to be checked.
Returns:
result - Boolean: TRUE, if internal, FALSE, if not

isPlayerIncluded

public boolean isPlayerIncluded(java.lang.String pid)
Description copied from interface: SPGameAPIInterface
This method tests to determine if a specified player is a transaction participant.

Specified by:
isPlayerIncluded in interface SPGameAPIInterface
Parameters:
pid - String - player id to be checked.
Returns:
result - Boolean: TRUE, if internal, FALSE, if not

buildTransaction

public 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.

Parameters:
transtype - String - specified transaction type.
gameobj - SPGameClass - the game to associated with.
master - String - the master of the game
playerIDList - 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.
Returns:
tran - SPAbstractTransactionInterface(but returns the actual object) - if successful, null if not

APIcloseTransaction

public boolean APIcloseTransaction(java.lang.String transID)
Description copied from interface: SPGameAPIInterface
This method removes a transaction from the game instance's open transaction list.

Specified by:
APIcloseTransaction in interface SPGameAPIInterface
Parameters:
transID - String - transaction id to beremoved.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

APIcreateTransaction

public SPAbstractTransactionInterface APIcreateTransaction(java.lang.String transtype,
                                                           java.lang.String transmaster,
                                                           java.lang.String[] playerIDList,
                                                           boolean privateflag)
Description copied from interface: SPGameAPIInterface
This method allows the creation of a new, internally controlled transaction. It also sends a message to the other transaction and game participants about this new transaction. NOTE: Thims method may not be supported

Specified by:
APIcreateTransaction in interface SPGameAPIInterface
Parameters:
transtype - String - specified transaction type
transmaster - String - player id of the master of the transaction
playerIDList - 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.
Returns:
tran - SPAbstractTransactionInterface(but returns the actual object) - if successful, null if not

APIBcreateTransaction

public boolean APIBcreateTransaction(java.lang.String transtype,
                                     java.lang.String transmaster,
                                     java.lang.String[] playerIDList,
                                     boolean privateflag)
Description copied from interface: SPGameAPIInterface
This method allows the creation of a new, internally controlled transaction. It also sends a message to the other transaction and game participants about this new transaction. NOTE: Thims method may not be supported

Specified by:
APIBcreateTransaction in interface SPGameAPIInterface
Parameters:
transtype - String - specified transaction type
transmaster - String - player id of the master of the transaction
playerIDList - 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.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

APITAOcreateTransaction

public SPAbstractTransactionAPIInterface APITAOcreateTransaction(java.lang.String transtype,
                                                                 java.lang.String transmaster,
                                                                 java.lang.String[] playerIDList,
                                                                 boolean privateflag)
Description copied from interface: SPGameAPIInterface
This method allows the creation of a new, internally controlled transaction. It also sends a message to the other transaction and game participants about this new transaction. NOTE: Thims method may not be supported

Specified by:
APITAOcreateTransaction in interface SPGameAPIInterface
Parameters:
transtype - String - specified transaction type
transmaster - String - player id of the master of the transaction
playerIDList - 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.
Returns:
tran - SPAbstractTransactionAPIInterface - if successful, null if not

onnewTransaction

public boolean onnewTransaction(SPMessageClass incoming)
Description copied from interface: SPGameAPIInterface
This method handles messages for new incoming transactions. It ensures that the new transactions are safely instantiated and loaed into the game.

Specified by:
onnewTransaction in interface SPGameAPIInterface
Parameters:
incoming - SPMessageClass - the incoming message.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIPlayerJoin

public boolean APIPlayerJoin(java.lang.String sender,
                             java.lang.String pid,
                             java.lang.String cid)
Description copied from interface: SPGameAPIInterface
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.

Specified by:
APIPlayerJoin in interface SPGameAPIInterface
Parameters:
sender - String - player id of the sender
pid - String - player id to be joined
cid - String - comms id to be used
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIPlayerJoin

public boolean APIPlayerJoin(java.lang.String sender,
                             java.lang.String pid,
                             java.lang.String cid,
                             boolean rflag)
Description copied from interface: SPGameAPIInterface
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. This method will not be supported in the next version of the library.

Specified by:
APIPlayerJoin in interface SPGameAPIInterface
Parameters:
sender - String - player id of the sender
pid - String - player id to be joined
cid - String - comms id to be used
rflag - boolean - relay flag
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

onPlayerJoin

public boolean onPlayerJoin(SPMessageClass messObj)
Description copied from interface: SPGameAPIInterface
This method safely handles remote messages for the addition of a player to the local game instance.

Specified by:
onPlayerJoin in interface SPGameAPIInterface
Parameters:
messObj - SPMessageClass - incoming Message Object
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

joinPlayer

public boolean joinPlayer(java.lang.String pid,
                          java.lang.String cid,
                          boolean rflag)
Description copied from interface: SPGameAPIInterface
This method carries out the local process of adding a new Player to the local game instance.

Specified by:
joinPlayer in interface SPGameAPIInterface
Parameters:
pid - String - player id to be joined
cid - String - comms id to used
rflag - boolean - relay flag
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

rulesnewplayerconfig

public boolean rulesnewplayerconfig(java.lang.String pid,
                                    java.lang.String cid,
                                    boolean rflag)
Description copied from interface: SPGameAPIInterface
This shell method takes an incoming proposed configuration for a new player and maps it against the local preference for that player, if different.

Specified by:
rulesnewplayerconfig in interface SPGameAPIInterface
Parameters:
pid - String - player id of the player to be configured
cid - String - comms id
rflag - boolean - relay flag
Returns:
boolean - whether this is accepted or not

APIrequestbeginGame

public boolean APIrequestbeginGame(java.lang.String playerID)
Description copied from interface: SPGameAPIInterface
This method sends a request to the game instance master to begin the game.

Specified by:
APIrequestbeginGame in interface SPGameAPIInterface
Parameters:
playerID - String - id of player who is requesting
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

APIrequestendGame

public boolean APIrequestendGame(java.lang.String playerID)
Description copied from interface: SPGameAPIInterface
This method sends a message from the specified player to the game instance master to end the game.

Specified by:
APIrequestendGame in interface SPGameAPIInterface
Parameters:
playerID - String - id of the player requesting
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIrequestcreateTransaction

public boolean APIrequestcreateTransaction(java.lang.String pid,
                                           java.lang.String transmaster,
                                           java.lang.String transtype,
                                           java.lang.String[] playerIDList,
                                           boolean privateflagIN)
Description copied from interface: SPGameAPIInterface
This method safely allows a player to request the creation of a new transaction of a given type and parameters.

Specified by:
APIrequestcreateTransaction in interface SPGameAPIInterface
Parameters:
pid - 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 created
playerIDList - 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.
Returns:
result - Boolean: TRUE, if request sent successfully, FALSE, if not

APIrequestPlayerJoin

public boolean APIrequestPlayerJoin(java.lang.String sender,
                                    java.lang.String pid,
                                    java.lang.String cid,
                                    boolean rflagIN)
Description copied from interface: SPGameAPIInterface
This method sends a request to a remote game instance to add a player during a game. Note, only the game master can add a player.

Specified by:
APIrequestPlayerJoin in interface SPGameAPIInterface
Parameters:
sender - 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
Returns:
result - Boolean: TRUE, if request successfully sent, FALSE, if not.

onrequestcreateTransaction

public boolean onrequestcreateTransaction(SPMessageClass incoming)
Description copied from interface: SPGameAPIInterface
This method handles incoming requests for the creation of new transactions. Only the proposed transaction master can create a new transaction.

Specified by:
onrequestcreateTransaction in interface SPGameAPIInterface
Parameters:
incoming - SPMessageClass - incoming message
Returns:
Boolean - TRUE, if successful, FALSE, if not.

onrequestPlayerJoin

public boolean onrequestPlayerJoin(SPMessageClass messObj)
Description copied from interface: SPGameAPIInterface
Safely handles requests to add a player. Only the Game Master can add a player.

Specified by:
onrequestPlayerJoin in interface SPGameAPIInterface
Parameters:
messObj - SPMessageClass - incoming Message Object
Returns:
Boolean - TRUE, if successful, FALSE, if not.

rulesbeginGame

public boolean rulesbeginGame(java.lang.String requesterID)
Description copied from interface: SPGameAPIInterface
This is a shell function to allow the insertion of rules code for the decision to begin a game.

Specified by:
rulesbeginGame in interface SPGameAPIInterface
Parameters:
requesterID - String - the id of the player who requested the request.
Returns:
Boolean - TRUE, if successful, FALSE, if not

rulesendGame

public boolean rulesendGame(java.lang.String requesterID)
Description copied from interface: SPGameAPIInterface
This is a shell method to allow the evaluation of the game rules to determine if the game should be allowed to end.

Specified by:
rulesendGame in interface SPGameAPIInterface
Parameters:
requesterID - String - the id of the player who requested the request.
Returns:
Boolean, TRUE, if successful, FALSE, if not.

rulesPlayerJoin

public boolean rulesPlayerJoin(java.lang.String sender,
                               java.lang.String[] messbody)
Description copied from interface: SPGameAPIInterface
This is a shell method to determine if a player will be allowed to join in midgame. Only the Game Master can implement this request.

Specified by:
rulesPlayerJoin in interface SPGameAPIInterface
Parameters:
sender - String - the id of the player who requested the request.
messbody - String[] - the message
Returns:
Boolean - TRUE, if allowed, FALSE, if not

rulescreateTransaction

public boolean rulescreateTransaction(java.lang.String sender,
                                      java.lang.String transtype,
                                      java.lang.String master,
                                      java.lang.String[] players,
                                      boolean pflag)
Description copied from interface: SPGameAPIInterface
This method safely allows a player to request the creation of a new transaction of a given type and parameters.

Specified by:
rulescreateTransaction in interface SPGameAPIInterface
Parameters:
sender - String - the id of the player who requested the request.
transtype - String - the transaction type to be created
master - 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.
Returns:
result - Boolean: TRUE, if request sent successfully, FALSE, if not

APIgetLicenseSummary

public java.lang.String APIgetLicenseSummary()
Description copied from interface: SPGameAPIInterface
This method returns a summary of the licensee information for the current game instance. This information needs to be publicly available from any game instance, see SecurePlay license for details.

Specified by:
APIgetLicenseSummary in interface SPGameAPIInterface
Returns:
fulllicensetext - String - this string contains full license information.

APIgetGameLog

public SPLogInterface APIgetGameLog()
Description copied from interface: SPGameAPIInterface
Gets the messagelog object from the gameinstance

Specified by:
APIgetGameLog in interface SPGameAPIInterface
Returns:
messlog - SPLogInterface - this object contains the message logs of the game instance.

APIgetGameLogCurrentEntry

public java.lang.Object APIgetGameLogCurrentEntry()
Description copied from interface: SPGameAPIInterface
Returns current entry from the messagelog object of comms

Specified by:
APIgetGameLogCurrentEntry in interface SPGameAPIInterface
Returns:
messEntry - Object - this is the current entry in the message log

APIgetGameLogLength

public int APIgetGameLogLength()
Description copied from interface: SPGameAPIInterface
returns the number entries in messagelog

Specified by:
APIgetGameLogLength in interface SPGameAPIInterface
Returns:
length - int - this is the length or number of messages in the game message log object.

APIgetGameLogNextEntry

public java.lang.Object APIgetGameLogNextEntry()
Description copied from interface: SPGameAPIInterface
Returns the next entry from the messagelog object of comms

Specified by:
APIgetGameLogNextEntry in interface SPGameAPIInterface
Returns:
messEntry - Object - this is the next entry in the message log

APIgetGameLogPreviousEntry

public java.lang.Object APIgetGameLogPreviousEntry()
Description copied from interface: SPGameAPIInterface
Returns the previous entry from the messagelog object of the comms

Specified by:
APIgetGameLogPreviousEntry in interface SPGameAPIInterface
Returns:
messEntry - Object - this is the previous entry in the message log

APIgetOpenTransactionIDs

public java.lang.String[] APIgetOpenTransactionIDs()
Description copied from interface: SPGameAPIInterface
Returns a vector that contains a list of open transaction IDs

Specified by:
APIgetOpenTransactionIDs in interface SPGameAPIInterface
Returns:
v - Vector - the list of open transaction ids.

APIgetTransactionAPI

public SPAbstractTransactionAPIInterface APIgetTransactionAPI(java.lang.String tid)
Description copied from interface: SPGameAPIInterface
This method returns the transaction API of the game transaction using sid.

Specified by:
APIgetTransactionAPI in interface SPGameAPIInterface
Parameters:
tid - String - the transaction id.
Returns:
tranAPI - SPAbstractTransactionAPIInterface - the transaction API.

logError

public void logError()
This is a shell function for future use.


sendMessage

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)
Description copied from interface: SPGameAPIInterface
This method is a wrapper for the game instance sendMessage() method.

Specified by:
sendMessage in interface SPGameAPIInterface
Parameters:
sender - - id of the sender
receivers - - ids of the recievers of the message
encryptflag - - encryption flag
privateflag - - private flag
messagetype - - the type of message
messagebody - - the message body
altmessage - - alternative message
Returns:
Boolean - TRUE, if successful, FALSE, if not

APIgetTransaction

public SPAbstractTransactionInterface APIgetTransaction(java.lang.String tid)
Description copied from interface: SPGameAPIInterface
This method gets the transaction from the game instance using the transaction ID

Specified by:
APIgetTransaction in interface SPGameAPIInterface
Parameters:
tid - String - the transaction id
Returns:
tran - SPAbstractTransactionInterface(actual transaction obj) - the transaction from the game instance.

APIAddListener

public boolean APIAddListener(SPEventInterface gameobj)
Description copied from interface: SPGameAPIInterface
This method adds a listener object for Game API events

Specified by:
APIAddListener in interface SPGameAPIInterface
Parameters:
gameobj - SPEventInterface - the object to be added, that inplement the listener interface
Returns:
Boolean - TRUE, if successful, FALSE, if not
See Also:
SPRootTransactionClass.APIAddListener(SPEventInterface gameobj)

APIRemoveListener

public boolean APIRemoveListener(SPEventInterface gameobj)
Description copied from interface: SPGameAPIInterface
This method removes a listener object for Game API events

Specified by:
APIRemoveListener in interface SPGameAPIInterface
Parameters:
gameobj - SPEventInterface - the object to be removed, that inplement the listener interface
Returns:
Boolean - TRUE, if successful, FALSE, if not
See Also:
SPRootTransactionClass.APIRemoveListener(SPEventInterface gameobj)

APIGetListeners

public java.lang.Object[] APIGetListeners()
Description copied from interface: SPGameAPIInterface
This method returns a list of listener objects for Game API events

Specified by:
APIGetListeners in interface SPGameAPIInterface
Returns:
obj - Object[] - array of listener objects
See Also:
SPRootTransactionClass.APIGetListeners()

APIClearListeners

public boolean APIClearListeners()
Description copied from interface: SPGameAPIInterface
This method clears the listener objects for Game API events

Specified by:
APIClearListeners in interface SPGameAPIInterface
Returns:
Boolean - TRUE, if successful, FALSE, if not
See Also:
SPRootTransactionClass.APIClearListeners()

APIGetListenerCount

public int APIGetListenerCount()
Description copied from interface: SPGameAPIInterface
This method returns the number of listener objects for Game API events

Specified by:
APIGetListenerCount in interface SPGameAPIInterface
Returns:
count - int - the number of listeners
See Also:
SPRootTransactionClass.APIGetListenerCount()

APIcreateBlastTransaction

public SPTBlastClass APIcreateBlastTransaction(java.lang.String pid,
                                               java.lang.String[] transcontent)
Description copied from interface: SPGameAPIInterface
This method creates a default Blast Transaction for this library.

Specified by:
APIcreateBlastTransaction in interface SPGameAPIInterface
Parameters:
pid - String - player id.
transcontent - String[] - content of this transaction.
Returns:
SPTBlastClass - pointer to the created transaction.

onBlast

public void onBlast(SPMessageClass messObj)
Description copied from interface: SPGameAPIInterface
This method handles incoming new Blast Transactions

Specified by:
onBlast in interface SPGameAPIInterface
Parameters:
messObj - SPMessageClass - incoming Message Object

APIgetPlayer

public SPPlayerInterface APIgetPlayer(java.lang.String pid)
Description copied from interface: SPGameAPIInterface
This method gets the player from the game instance using the player ID

Specified by:
APIgetPlayer in interface SPGameAPIInterface
Parameters:
pid - String - the player ID
Returns:
player - SPPlayerInterface(actual player obj) - the player from the game instance.

getGameinstance

public SPGameClass getGameinstance()
Description copied from interface: SPGameAPIInterface
Getter function that returns the property: gameinstance

Specified by:
getGameinstance in interface SPGameAPIInterface
Returns:
gameinstance - SPGameClass

isLibrarytestmode

public boolean isLibrarytestmode()
Getter function that returns the property: librarytestmode

Returns:
librarytestmode - boolean

APIgetPlayerIDList

public java.lang.String[] APIgetPlayerIDList()
Description copied from interface: SPGameAPIInterface
This method gets the player id list list associated with this game.

Specified by:
APIgetPlayerIDList in interface SPGameAPIInterface
Returns:
String[] - player id list.

APInewGameBlock

public 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. GameBlocks are sets of rules or modules of code that can be associated with transactions.

Parameters:
pid - String - player id of the master
receivers - String[] - array of receivers
gameblocktype - String - type of GameBlock
gameblockID - String - unique ID of GameBlock
gameblockparameters - String[] - GameBlock parameters
Returns:
boolean - whether the message was sent or not.

onnewGameBlock

public void onnewGameBlock(SPMessageClass messObj)
Description copied from interface: SPGameAPIInterface
This method handles incoming new Game Blocks

Specified by:
onnewGameBlock in interface SPGameAPIInterface
Parameters:
messObj - SPMessageClass - incoming Message Object