|
SecurePlayLibray J2SE v2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.SecurePlay.SPRootTransactionClass
com.SecurePlay.SPAbstractTransactionClass
com.SecurePlay.SPTRandomClass
This transaction class extends the SPAbstractTransaction class. It provides for the generation of fair random events over a network based on a Random. The APIconfigureTransaction method sets the 3 unique parameters - deckSize, repacement, and expirecount for the Random. The Random class can be used for a typical game with a shared Random and a dealer or for games without shared Randoms (in which case each Random is a separate instance of the class). Randoms can contain multiple "decks", but this is handled at the game rules level outside of the SecurePlay library
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Field Summary | |
private boolean |
built
This property is set to boolean TRUE if the Random has been constructed and FALS E, if not |
private java.lang.String[] |
dealtEventList
This property holds the sequential array of dealt random events. |
private int |
lastcount
This property holds the last requested number of random events generated. |
private java.lang.String |
mt_completetransaction
|
private java.lang.String |
mt_preparerandom
|
private java.lang.String |
mt_randomevents
|
private java.lang.String |
mt_requestrandomevents
|
private java.lang.String |
mt_sendplayerkey
|
private java.lang.String |
mt_sendplayerkeytransform
|
private int |
prdeckSize
This property holds the size of the deck or Random. |
private int |
prexpireeventcount
This property sets the number of random events that can be generated from the deck. |
private java.lang.Integer[] |
prkeyArray
The keyArray is the computed key generated from all of the player keys. |
private int |
prkeySize
This property holds the size of the Random key. |
private SPMap |
prplayerKeyList
This is an associative array that holds the player key string associated with each player. |
private SPMap |
prplayerKeyTransformList
This property holds the associative array of transforms of the player keys. |
private java.lang.Integer[] |
prremainingValuesList
This array holds the remaining values that are possible for Randoms that are sampled without replacement. |
private boolean |
prreplacement
This flag determines whether the Random uses sampling with replacement (like rolling a dice) or sampling without replacement (like dealing cards from a deck or a lottery number draw). |
private java.lang.Integer[] |
prvremainingValuesList
This is a duplicate of the prremainingValuesList property that is used for Random verification. |
private java.lang.String |
status_complete
|
private java.lang.String |
status_new
|
private java.lang.String[] |
vdealtEventList
This is a duplicate of the dealtEventList array that is used for verification purposes only. |
(package private) SPUEctf |
verified
This property holds three states: TRUE, if the Random can be completely verified, FALSE, if verification fails or the Random is not complete, and CONSISTENT if the Random is complete and the data is consistent with a valid Random but the Random cannot be completely verified (due to private random events). |
| Fields inherited from class com.SecurePlay.SPAbstractTransactionClass |
AGE, configuration, gameinstance, mt_completeTransaction, mt_error, privateflag, releaseversion, status_error, status_ready, transactionstatus, transtype |
| Fields inherited from class com.SecurePlay.SPRootTransactionClass |
comms, EventListenerList, gameID, insend, master, playerIDList, ReSend_altmessage, ReSend_encryptflag, ReSend_messagebody, ReSend_messageID, ReSend_messagetype, ReSend_privateflag, ReSend_receivers, ReSend_sender, secureplay, transactionID |
| Constructor Summary | |
private |
SPTRandomClass()
Default Constructor |
|
SPTRandomClass(SPGameInterface gameobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean privateflag,
java.lang.String transactionID,
java.lang.String AGE,
int decksize,
boolean replacement,
int expiration)
Overloaded Constructor |
| Method Summary | |
boolean |
APIcompleteTransaction(java.lang.String pid)
This method overrides the SPAbstractTransactionClass method. |
boolean |
APIconfigureTransaction(java.lang.String sender)
This method handles the specific configuration required for a Random |
SPAbstractTransactionInterface |
APIcreateTransaction(SPGameInterface gameapiobj,
SPMessageClass message)
Creates a new instance of an Abstract Transaction class. |
boolean |
APIgenerateRandomEvent(java.lang.String sender,
java.lang.String[] receivers,
boolean privacy,
int count)
This method handles either requests or local generation of random events by the Random master. |
java.lang.String[] |
APIgetlastRandomEvents()
This method returns an array that includes the last set of random events provided by the Random master. |
int |
APIgetRandomEvent(int index)
This method returns a random event from the dealtEventList property as specified by the index. |
int |
APIgetRandomEventCount()
|
SPUEctf |
APIverifyRandom()
This method verifies a Random once the transaction has been completed. |
static SPAbstractTransactionInterface |
createRandom(SPGameInterface gameobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean pflag,
java.lang.String AGE,
int decksize,
boolean replacement,
int expiration)
This method creates a new Random Class |
java.lang.String[] |
getDealtEventList()
Getter function that returns the property: dealtEventList |
int |
getDeckSize()
Getter function that returns the property: prdeckSize |
int |
getExpireEventCount()
Getter function that returns the property: prexpireeventcount |
protected java.lang.Integer[] |
getKeyArray()
Getter function that returns the property: prkeyArray |
int |
getKeySize()
Getter function that returns the property: prkeySize |
int |
getLastCount()
Getter function that returns the property: lastcount |
SPMap |
getPlayerKeyList()
Getter function that returns the property: prplayerKeyList |
SPMap |
getPlayerKeyTransformList()
Getter function that returns the property: prplayerKeyTransformList |
java.lang.Integer[] |
getRemainingValuesList()
Getter function that returns the property: prremainingValuesList |
static java.lang.String |
gettranstype()
This method gets the transaction type. |
boolean |
isBuilt()
Getter function that returns the property: built |
boolean |
isReplacement()
Getter function that returns the property: prreplacement |
private boolean |
oncompleteTransaction(SPMessageClass incoming)
This method handles incoming mt_completetransaction messages. |
private boolean |
oncompleteTransaction(java.lang.String sourceid,
java.lang.String[] body)
This method handles incoming mt_completetransaction messages. |
private boolean |
onprepareRandom(SPMessageClass incoming)
This method/event handles the initial response to the APIconfigureTransaction call by the Transaction Master. |
private boolean |
onRandomEvents(SPMessageClass incoming)
This method handles incoming random events from the Random master. |
private void |
onrequestconfigureTransaction(SPMessageClass incoming)
This method handles the unique processing associated with incoming requests to configure a Random Class. |
private boolean |
onrequestRandomEvents(SPMessageClass incoming)
This method handles incoming requests to generate Random events. |
private boolean |
onsendPlayerKey(SPMessageClass incoming)
This method handles incoming mt_sendplayerkey messages. |
private boolean |
onsendPlayerKeyTransform(SPMessageClass incoming)
This method handles incoming mt_sendplayerkeytransform messages. |
private boolean |
prbuildRandom()
This method provides the core configuration common to all Randoms. |
private boolean |
prcheckPlayerKeyLoad()
This method is used to check the status of the loading of Player Keys during the Random configuration process. |
private void |
prcreateRandomKey()
This method actually builds the game key from the various player keys. |
private boolean |
prgetRandomValue(java.lang.String playverifyflag)
This method actually generates the random values. |
boolean |
pronincomingTransaction(SPMessageClass incoming)
This method provides the unique handlers for incoming Secret turn message types |
void |
pruniqueinit()
Unique initialization method |
static boolean |
registerTransaction()
Registers this transaction. |
| Methods inherited from class com.SecurePlay.SPAbstractTransactionClass |
APIgetAGE, APIgetConfiguration, APIgetGameinstance, APIgetPrivacyFlag, APIgetTransactionstatus, APIgetTransactionType, APIisPlayerInternal, APIisTransError, APIsetTransactionID, logError, onincomingTransaction, prinit, setAGE |
| Methods inherited from class com.SecurePlay.SPRootTransactionClass |
APIaddListener, APIclearListeners, APIgetGameID, APIgetGetReplayList, APIgetListenerCount, APIgetListeners, APIgetMaster, APIgetPlayerIDList, APIgetTransactionID, APIisPlayerIncluded, APIremoveListener, APIReplayRemoveOldSender, APIresendLastMessage, APIsetReplayList, APIsetSecurePlayClass, detectReplay, sendMessage, 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.SPAbstractTransactionInterface |
APIgetGameID, APIgetMaster, APIgetPlayerIDList, APIgetTransactionID, sendMessage |
| Field Detail |
private java.lang.String[] dealtEventList
private int lastcount
private int prdeckSize
private int prexpireeventcount
private int prkeySize
private java.lang.Integer[] prkeyArray
private SPMap prplayerKeyList
private SPMap prplayerKeyTransformList
private java.lang.Integer[] prremainingValuesList
private boolean prreplacement
private java.lang.Integer[] prvremainingValuesList
private java.lang.String[] vdealtEventList
private boolean built
SPUEctf verified
private java.lang.String status_complete
private java.lang.String status_new
private final java.lang.String mt_preparerandom
private final java.lang.String mt_sendplayerkeytransform
private final java.lang.String mt_sendplayerkey
private final java.lang.String mt_requestrandomevents
private final java.lang.String mt_randomevents
private final java.lang.String mt_completetransaction
| Constructor Detail |
private SPTRandomClass()
public SPTRandomClass(SPGameInterface gameobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean privateflag,
java.lang.String transactionID,
java.lang.String AGE,
int decksize,
boolean replacement,
int expiration)
gameobj - SPGameInterface - the game object with which the transaction will be associatedmaster - String - the master of the transactionplayerIDList - String[] - the player id listprivateflag - boolean - private flagtransactionID - String - the transaction id| Method Detail |
public void pruniqueinit()
pruniqueinit in class SPAbstractTransactionClasspublic boolean APIconfigureTransaction(java.lang.String sender)
sender - String - player id of the senderprivate boolean onprepareRandom(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
private boolean onsendPlayerKeyTransform(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
private boolean onsendPlayerKey(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
private boolean prcheckPlayerKeyLoad()
private boolean prbuildRandom()
private void prcreateRandomKey()
public boolean APIgenerateRandomEvent(java.lang.String sender,
java.lang.String[] receivers,
boolean privacy,
int count)
sender - String - senderreceivers - String - player id list of the recieversprivacy - boolean - privacy policycount - int - the number of random events to be generated
private boolean prgetRandomValue(java.lang.String playverifyflag)
playverifyflag - String
private boolean onrequestRandomEvents(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
private boolean onRandomEvents(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
public int APIgetRandomEvent(int index)
index - int - the specifier of the random event
public java.lang.String[] APIgetlastRandomEvents()
public boolean APIcompleteTransaction(java.lang.String pid)
APIcompleteTransaction in interface SPAbstractTransactionInterfaceAPIcompleteTransaction in class SPAbstractTransactionClasspid - String - ID of requesting Player
private boolean oncompleteTransaction(java.lang.String sourceid,
java.lang.String[] body)
sourceid - String - id of the sender.body - String[] - the mody of the message.
public SPUEctf APIverifyRandom()
public boolean pronincomingTransaction(SPMessageClass incoming)
pronincomingTransaction in class SPAbstractTransactionClassincoming - SPMessageClass - incoming message
private void onrequestconfigureTransaction(SPMessageClass incoming)
incoming - SPMessageClass - incoming messageprivate boolean oncompleteTransaction(SPMessageClass incoming)
incoming - SPMessageClass - incoming message
public int APIgetRandomEventCount()
public boolean isBuilt()
public java.lang.String[] getDealtEventList()
public int getLastCount()
public int getDeckSize()
public int getExpireEventCount()
protected java.lang.Integer[] getKeyArray()
public int getKeySize()
public SPMap getPlayerKeyList()
public SPMap getPlayerKeyTransformList()
public java.lang.Integer[] getRemainingValuesList()
public boolean isReplacement()
public static java.lang.String gettranstype()
public static boolean registerTransaction()
public static SPAbstractTransactionInterface createRandom(SPGameInterface gameobj,
java.lang.String master,
java.lang.String[] playerIDList,
boolean pflag,
java.lang.String AGE,
int decksize,
boolean replacement,
int expiration)
gameobj - master - playerIDList - pflag - AGE - decksize - replacement - expiration -
public SPAbstractTransactionInterface APIcreateTransaction(SPGameInterface gameapiobj,
SPMessageClass message)
SPAbstractTransactionClass
APIcreateTransaction in interface SPAbstractTransactionInterfaceAPIcreateTransaction in class SPAbstractTransactionClassgameapiobj - SPGameInterface - game associated with this transaction.message - SPMessageClass - message that contains all the configure info
|
SecurePlayLibray J2SE v2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||