Packagecom.whirled.contrib.persist
Classpublic class CookieManager
InheritanceCookieManager Inheritance flash.events.EventDispatcher



Public Properties
 PropertyDefined by
  loaded : Boolean
[read-only]
CookieManager
Protected Properties
 PropertyDefined by
  _cookieFactory : CookieFactory
CookieManager
  _debug : Boolean
CookieManager
  _gameCtrl : GameControl
CookieManager
  _lastWrite : int = 0
CookieManager
  _loaded : Boolean = false
CookieManager
  _playerId : int
CookieManager
  _properties : Map
CookieManager
  _propertyDefaults : Map
CookieManager
  _receivedUpdates : Boolean = false
CookieManager
  _stopped : Boolean = false
CookieManager
  _timer : Timer = null
CookieManager
Public Methods
 MethodDefined by
  
CookieManager(gameCtrl:GameControl, properties:Map, cookieFactory:CookieFactory, playerId:int = 0, debugLogging:Boolean = false)
CookieManager
  
cookiePropertyUpdated(... ignored):void
CookieManager
  
CookieManager
  
resumeWrites():void
Will allow cookie updates to cause a write to the server cookie once again.
CookieManager
  
stopWrites():void
CookieManager
Protected Methods
 MethodDefined by
  
CookieManager
  
gotCookie(cookie:Object, occupantId:int):void
CookieManager
  
readBytes(bytes:ByteArray):void
CookieManager
  
writeBytes(bytes:ByteArray):void
CookieManager
  
writeCookie(... ignored):void
CookieManager
Protected Constants
 ConstantDefined by
  log : Log
[static]
CookieManager
  VERSION : int = 2
[static] Version bumps are not required when adding new data types.
CookieManager
  WRITE_DELAY : int = 2000
[static] Write out the cookie at most every 2 seconds, in order to prevent this manager from sucking up network resources
CookieManager
Property detail
_cookieFactoryproperty
protected var _cookieFactory:CookieFactory
_debugproperty 
protected var _debug:Boolean
_gameCtrlproperty 
protected var _gameCtrl:GameControl
_lastWriteproperty 
protected var _lastWrite:int = 0
_loadedproperty 
protected var _loaded:Boolean = false
loadedproperty 
loaded:Boolean  [read-only]Implementation
    public function get loaded():Boolean
_playerIdproperty 
protected var _playerId:int
_propertiesproperty 
protected var _properties:Map
_propertyDefaultsproperty 
protected var _propertyDefaults:Map
_receivedUpdatesproperty 
protected var _receivedUpdates:Boolean = false
_stoppedproperty 
protected var _stopped:Boolean = false
_timerproperty 
protected var _timer:Timer = null
Constructor detail
CookieManager()constructor
public function CookieManager(gameCtrl:GameControl, properties:Map, cookieFactory:CookieFactory, playerId:int = 0, debugLogging:Boolean = false)Parameters
gameCtrl:GameControl
 
properties:Map
 
cookieFactory:CookieFactory
 
playerId:int (default = 0)
 
debugLogging:Boolean (default = false)
Method detail
cookiePropertyUpdated()method
public function cookiePropertyUpdated(... ignored):voidParameters
... ignored
dispatchLoaded()method 
protected function dispatchLoaded():void
getProperty()method 
public function getProperty(name:String):CookiePropertyParameters
name:String

Returns
CookieProperty
gotCookie()method 
protected function gotCookie(cookie:Object, occupantId:int):voidParameters
cookie:Object
 
occupantId:int
readBytes()method 
protected function readBytes(bytes:ByteArray):voidParameters
bytes:ByteArray
resumeWrites()method 
public function resumeWrites():void

Will allow cookie updates to cause a write to the server cookie once again. If any updates happend after stopWrites() was called, a single write will be done now.

stopWrites()method 
public function stopWrites():void
writeBytes()method 
protected function writeBytes(bytes:ByteArray):voidParameters
bytes:ByteArray
writeCookie()method 
protected function writeCookie(... ignored):voidParameters
... ignored
Constant detail
logconstant
protected static const log:Log
VERSIONconstant 
protected static const VERSION:int = 2

Version bumps are not required when adding new data types. Only if another form of storing data in the cookie is fashioned should a version bump be necessary.

WRITE_DELAYconstant 
protected static const WRITE_DELAY:int = 2000

Write out the cookie at most every 2 seconds, in order to prevent this manager from sucking up network resources