Class Buffer
Captures the data as tokens so that can be used to build up the JSON
Later. We do this so as not to serialize inside other peoples functions
but also because we might not have all the info we need to serialize at
that point in time.
This is NOT a thread safe buffer, its the job of the calling code to
handle that.
Syntax
public class Buffer : object, IBuffer
Constructors
Buffer()
Declaration
Properties
InstallID
Declaration
public string InstallID { get; set; }
Property Value
Implements
PlayerID
Declaration
public string PlayerID { get; set; }
Property Value
Implements
SessionID
Declaration
public string SessionID { get; set; }
Property Value
Implements
UserID
Declaration
public string UserID { get; set; }
Property Value
Implements
Methods
ClearBuffer()
Declaration
public void ClearBuffer()
Implements
ClearDiskCache()
Declaration
public void ClearDiskCache()
Implements
CloneTokens()
Declaration
public List<Buffer.Token> CloneTokens()
Returns
Implements
FlushToDisk()
Declaration
public void FlushToDisk()
Implements
InsertTokens(List<Buffer.Token>)
Declaration
public void InsertTokens(List<Buffer.Token> tokens)
Parameters
Implements
LoadFromDisk()
Declaration
public void LoadFromDisk()
Implements
PushArrayEnd()
Declaration
public void PushArrayEnd()
Implements
PushArrayStart(String)
Declaration
public void PushArrayStart(string name = null)
Parameters
| Type |
Name |
Description |
| String |
name |
|
Implements
PushBool(Boolean, String)
Declaration
public void PushBool(bool val, string name = null)
Parameters
Implements
PushDouble(Double, String)
Declaration
public void PushDouble(double val, string name = null)
Parameters
Implements
PushEndEvent()
Declaration
public void PushEndEvent()
Implements
PushEvent(Event)
Declaration
public void PushEvent(Event evt)
Parameters
| Type |
Name |
Description |
| Event |
evt |
|
Implements
PushFloat(Single, String)
Declaration
public void PushFloat(float val, string name = null)
Parameters
Implements
PushInt(Int32, String)
Declaration
public void PushInt(int val, string name = null)
Parameters
Implements
PushInt64(Int64, String)
Declaration
public void PushInt64(Int64 val, string name = null)
Parameters
| Type |
Name |
Description |
| Int64 |
val |
|
| String |
name |
|
Implements
PushObjectEnd()
Declaration
public void PushObjectEnd()
Implements
PushObjectStart(String)
Declaration
public void PushObjectStart(string name = null)
Parameters
| Type |
Name |
Description |
| String |
name |
|
Implements
PushStartEvent(String, DateTime, Nullable<Int64>, Boolean)
Declaration
public void PushStartEvent(string name, DateTime datetime, Int64? eventVersion, bool addPlayerIdsToEventBody = false)
Parameters
| Type |
Name |
Description |
| String |
name |
|
| DateTime |
datetime |
|
| Nullable<Int64> |
eventVersion |
|
| Boolean |
addPlayerIdsToEventBody |
|
Implements
PushString(String, String)
Declaration
public void PushString(string val, string name = null)
Parameters
Implements
PushTimestamp(DateTime, String)
Declaration
public void PushTimestamp(DateTime val, string name)
Parameters
| Type |
Name |
Description |
| DateTime |
val |
|
| String |
name |
|
Implements
SaveDateTime(DateTime)
Declaration
public static string SaveDateTime(DateTime dateTime)
Parameters
| Type |
Name |
Description |
| DateTime |
dateTime |
|
Returns
Serialize(List<Buffer.Token>)
If the DataBuffer knows about the UserID and the Session ID calling this function
will return a JSON blob of all the data in the buffer, it will then clear the
internal data.
Declaration
public string Serialize(List<Buffer.Token> tokens)
Parameters
Returns
| Type |
Description |
| String |
String of JSON or Null
|
Implements