Class Index | File Index

Classes


Namespace util.lock

These functions all deal with locking game state when there is some blocking action in progress. Like don't allow game simulations when a trade is being negotiated. For figuring out the current state, trust only the database.
Defined in: <js/util/lock.js>.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
util.lock.canStartGames(ot, cb)
Can new game simulations be started? Calls the callback function with either true or false.
<static>  
util.lock.canStartNegotiation(ot, cb)
Can a new contract negotiation be started? Calls the callback function with either true or false.
<static>  
util.lock.gamesInProgress(ot, cb)
Is game simulation in progress? Calls the callback function with either true or false depending on whether there is a game simulation currently in progress.
<static>  
util.lock.negotiationInProgress(ot, cb)
Is a negotiation in progress? Calls the callback function with either true or false depending on whether there is an ongoing negoation.
<static>  
util.lock.unreadMessage(ot, cb)
Is there an undread message from the owner? Calls the callback function with either true or false.
Namespace Detail
util.lock
Method Detail
<static> util.lock.canStartGames(ot, cb)
Can new game simulations be started? Calls the callback function with either true or false. If games are in progress or any contract negotiation is in progress, false.
Parameters:
{IDBObjectStore|IDBTransaction|null} ot
An IndexedDB object store or transaction on gameAttributes and negotiations; if null is passed, then a new transaction will be used.
{function(boolean)} cb
Callback.

<static> util.lock.canStartNegotiation(ot, cb)
Can a new contract negotiation be started? Calls the callback function with either true or false. If games are in progress or a free agent (not resigning!) is being negotiated with, false.
Parameters:
{IDBObjectStore|IDBTransaction|null} ot
An IndexedDB object store or transaction on gameAttributes and negotiations; if null is passed, then a new transaction will be used.
{function(boolean)} cb
Callback.

<static> util.lock.gamesInProgress(ot, cb)
Is game simulation in progress? Calls the callback function with either true or false depending on whether there is a game simulation currently in progress.
Parameters:
{IDBObjectStore|IDBTransaction|null} ot
An IndexedDB object store or transaction on gameAttributes; if null is passed, then a new transaction will be used.
{function(boolean)} cb
Callback.

<static> util.lock.negotiationInProgress(ot, cb)
Is a negotiation in progress? Calls the callback function with either true or false depending on whether there is an ongoing negoation.
Parameters:
{IDBObjectStore|IDBTransaction|null} ot
An IndexedDB object store or transaction on negotiations; if null is passed, then a new transaction will be used.
{function(boolean)} cb
Callback.

<static> util.lock.unreadMessage(ot, cb)
Is there an undread message from the owner? Calls the callback function with either true or false.
Parameters:
{IDBObjectStore|IDBTransaction|null} ot
An IndexedDB object store or transaction on messages; if null is passed, then a new transaction will be used.
{function(boolean)} cb
Callback.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 10 2013 23:08:32 GMT-0400 (EDT)