2006 Copyright Filed by IT GlobalSecure, Inc. All Rights Reserved. Not to be used without authorization by Author. SecurePlay, IT GlobalSecure, and IT Armor are registered trademarks by IT GlobalSecure, Inc. Software protected by software license, and one or more the following U.S. and International patent numbers: U.S. Patent 6,030,288, U.S. Patent 6,165,072, European Patent Office EP1016049A1,and World Intellectual Property Organization WO9912135C1 and additional filings worldwide.
Main Page | Class Hierarchy | Class List | Class Members

SecurePlayLibrary::SPTRandomClass Class Reference

#include <SPTRandomClass.h>

Inheritance diagram for SecurePlayLibrary::SPTRandomClass:

SecurePlayLibrary::SPAbstractTransactionClass SecurePlayLibrary::SPRootTransactionClass SecurePlayLibrary::SPAbstractTransactionInterface List of all members.

Public Member Functions

 SPTRandomClass (SPGameInterface *gameobj, string master, vector< string > playerIDList, bool privateflag, string transactionID, string AGE, int decksize, bool replacement, int expiration)
void pruniqueinit ()
bool APIconfigureTransaction (string sender)
bool APIgenerateRandomEvent (string sender, vector< string > receivers, bool privacy, int count)
int APIgetRandomEvent (int index)
vector< string > APIgetlastRandomEvents ()
bool APIcompleteTransaction (string pid)
SPUEctf APIverifyRandom ()
bool pronincomingTransaction (SPMessageClass *incoming)
int APIgetRandomEventCount ()
bool isBuilt ()
vector< string > getDealtEventList ()
int getLastCount ()
int getDeckSize ()
int getExpireEventCount ()
int getKeySize ()
SPMap< string, string > getPlayerKeyList ()
SPMap< string, string > getPlayerKeyTransformList ()
vector< int > getRemainingValuesList ()
bool isReplacement ()
SPAbstractTransactionInterfaceAPIcreateTransaction (SPGameInterface *gameapiobj, SPMessageClass *message)

Static Public Member Functions

string gettranstype ()
bool registerTransaction ()
SPAbstractTransactionInterfacecreateRandom (SPGameInterface *gameobj, string master, vector< string > playerIDList, bool pflag, string AGE, int decksize, bool replacement, int expiration)

Protected Member Functions

vector< int > getKeyArray ()

Detailed Description

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
Author:
IT GlobalSecure
See also:
SecurePlay License Information


Constructor & Destructor Documentation

SPTRandomClass::SPTRandomClass SPGameInterface gameobj,
string  master,
vector< string >  playerIDList,
bool  privateflag,
string  transactionID,
string  AGE,
int  decksize,
bool  replacement,
int  expiration
 

Overloaded Constructor

Parameters:
gameobj SPGameInterface - the game object with which the transaction will be associated
master String - the master of the transaction
playerIDList String[] - the player id list
privateflag boolean - private flag
transactionID String - the transaction id


Member Function Documentation

bool SPTRandomClass::APIcompleteTransaction string  pid  )  [virtual]
 

This method overrides the SPAbstractTransactionClass method. It supports the distribution of the Random master player key to allow the Random to be subsequently verified.

Parameters:
pid String - ID of requesting Player
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

Reimplemented from SecurePlayLibrary::SPAbstractTransactionClass.

bool SPTRandomClass::APIconfigureTransaction string  sender  ) 
 

This method handles the specific configuration required for a Random

Parameters:
sender String - player id of the sender

SPAbstractTransactionInterface* SecurePlayLibrary::SPTRandomClass::APIcreateTransaction SPGameInterface gameapiobj,
SPMessageClass message
[virtual]
 

Reimplemented from SecurePlayLibrary::SPAbstractTransactionClass.

bool SPTRandomClass::APIgenerateRandomEvent string  sender,
vector< string >  receivers,
bool  privacy,
int  count
 

This method handles either requests or local generation of random events by the Random master. Either a request message will be sent to the Random master or the Random master will generate the number of random events specified by (count) and send them to the specified receivers. This value is protected based on the privacy flag.

Parameters:
sender String - sender
receivers String - player id list of the recievers
privacy boolean - privacy policy
count int - the number of random events to be generated
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

vector< string > SPTRandomClass::APIgetlastRandomEvents  ) 
 

This method returns an array that includes the last set of random events provided by the Random master.

Returns:
rmevents - String[] - the last batch of random events

int SPTRandomClass::APIgetRandomEvent int  index  ) 
 

This method returns a random event from the dealtEventList property as specified by the index.

Parameters:
index int - the specifier of the random event
Returns:
rmevent - int - the corresponding dealtEventList entry to the index

int SPTRandomClass::APIgetRandomEventCount  ) 
 

SPUEctf SPTRandomClass::APIverifyRandom  ) 
 

This method verifies a Random once the transaction has been completed. There is a third state that is possible - where a Random was used for private events that did not include specific players. If those events are not exchanged elsewhere, a partial verification is all that is possible - that the Random is "consistent" with known data.

Returns:
result - Boolean: TRUE, if successful, FALSE, if not, "consistent" if consistent, but not completely verified

SPAbstractTransactionInterface* SecurePlayLibrary::SPTRandomClass::createRandom SPGameInterface gameobj,
string  master,
vector< string >  playerIDList,
bool  pflag,
string  AGE,
int  decksize,
bool  replacement,
int  expiration
[static]
 

This method creates a new Random Class

Parameters:
gameobj 
master 
playerIDList 
pflag 
AGE 
decksize 
replacement 
expiration 
Returns:
SPAbstractTransactionInterface - returns random class created

vector< string > SPTRandomClass::getDealtEventList  ) 
 

Getter function that returns the property: dealtEventList

Returns:
dealtEventList - String[]

int SPTRandomClass::getDeckSize  ) 
 

Getter function that returns the property: prdeckSize

Returns:
prdeckSize - int

int SPTRandomClass::getExpireEventCount  ) 
 

Getter function that returns the property: prexpireeventcount

Returns:
prexpireeventcount - int

Integer[] SPTRandomClass::getKeyArray  )  [protected]
 

Getter function that returns the property: prkeyArray

Returns:
prkeyArray - Integer[]

int SPTRandomClass::getKeySize  ) 
 

Getter function that returns the property: prkeySize

Returns:
prkeySize - int

int SPTRandomClass::getLastCount  ) 
 

Getter function that returns the property: lastcount

Returns:
lastcount - int

SPMap SPTRandomClass::getPlayerKeyList  ) 
 

Getter function that returns the property: prplayerKeyList

Returns:
prplayerKeyList - SPHashtable

SPMap SPTRandomClass::getPlayerKeyTransformList  ) 
 

Getter function that returns the property: prplayerKeyTransformList

Returns:
prplayerKeyTransformList - SPHashtable

Integer[] SPTRandomClass::getRemainingValuesList  ) 
 

Getter function that returns the property: prremainingValuesList

Returns:
prremainingValuesList - Integer[]

string SPTRandomClass::gettranstype  )  [static]
 

This method gets the transaction type.

Returns:
String

Reimplemented from SecurePlayLibrary::SPAbstractTransactionClass.

bool SPTRandomClass::isBuilt  ) 
 

Getter function that returns the property: built

Returns:
built - bolean

bool SPTRandomClass::isReplacement  ) 
 

Getter function that returns the property: prreplacement

Returns:
prreplacement - boolean

bool SecurePlayLibrary::SPTRandomClass::pronincomingTransaction SPMessageClass incoming  ) 
 

This method provides the unique handlers for incoming Secret turn message types

Parameters:
incoming SPMessageClass - incoming message
Returns:
Boolean - TRUE, if handled internally, FALSE, if not

Reimplemented from SecurePlayLibrary::SPAbstractTransactionClass.

void SPTRandomClass::pruniqueinit  ) 
 

Unique initialization method

Reimplemented from SecurePlayLibrary::SPAbstractTransactionClass.

bool SPTRandomClass::registerTransaction  )  [static]
 

Registers this transaction.

Returns:
boolean


The documentation for this class was generated from the following files: 2006 Copyright Filed by IT GlobalSecure, Inc. All Rights Reserved. Not to be used without authorization by Author. SecurePlay, IT GlobalSecure, and IT Armor are registered trademarks by IT GlobalSecure, Inc. Software protected by software license, and one or more the following U.S. and International patent numbers: U.S. Patent 6,030,288, U.S. Patent 6,165,072, European Patent Office EP1016049A1,and World Intellectual Property Organization WO9912135C1 and additional filings worldwide.