docs.unity3d.com
    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    Buffer
    Namespace: Unity.Services.Analytics.Internal
    Syntax
    public class Buffer : object, IBuffer

    Constructors

    Buffer()

    Declaration
    public Buffer()

    Properties

    InstallID

    Declaration
    public string InstallID { get; set; }
    Property Value
    Type Description
    String
    Implements
    IBuffer.InstallID

    PlayerID

    Declaration
    public string PlayerID { get; set; }
    Property Value
    Type Description
    String
    Implements
    IBuffer.PlayerID

    SessionID

    Declaration
    public string SessionID { get; set; }
    Property Value
    Type Description
    String
    Implements
    IBuffer.SessionID

    UserID

    Declaration
    public string UserID { get; set; }
    Property Value
    Type Description
    String
    Implements
    IBuffer.UserID

    Methods

    ClearBuffer()

    Declaration
    public void ClearBuffer()
    Implements
    IBuffer.ClearBuffer()

    ClearDiskCache()

    Declaration
    public void ClearDiskCache()
    Implements
    IBuffer.ClearDiskCache()

    CloneTokens()

    Declaration
    public List<Buffer.Token> CloneTokens()
    Returns
    Type Description
    List<Buffer.Token>
    Implements
    IBuffer.CloneTokens()

    FlushToDisk()

    Declaration
    public void FlushToDisk()
    Implements
    IBuffer.FlushToDisk()

    InsertTokens(List<Buffer.Token>)

    Declaration
    public void InsertTokens(List<Buffer.Token> tokens)
    Parameters
    Type Name Description
    List<Buffer.Token> tokens
    Implements
    IBuffer.InsertTokens(List<Buffer.Token>)

    LoadFromDisk()

    Declaration
    public void LoadFromDisk()
    Implements
    IBuffer.LoadFromDisk()

    PushArrayEnd()

    Declaration
    public void PushArrayEnd()
    Implements
    IBuffer.PushArrayEnd()

    PushArrayStart(String)

    Declaration
    public void PushArrayStart(string name = null)
    Parameters
    Type Name Description
    String name
    Implements
    IBuffer.PushArrayStart(String)

    PushBool(Boolean, String)

    Declaration
    public void PushBool(bool val, string name = null)
    Parameters
    Type Name Description
    Boolean val
    String name
    Implements
    IBuffer.PushBool(Boolean, String)

    PushDouble(Double, String)

    Declaration
    public void PushDouble(double val, string name = null)
    Parameters
    Type Name Description
    Double val
    String name
    Implements
    IBuffer.PushDouble(Double, String)

    PushEndEvent()

    Declaration
    public void PushEndEvent()
    Implements
    IBuffer.PushEndEvent()

    PushEvent(Event)

    Declaration
    public void PushEvent(Event evt)
    Parameters
    Type Name Description
    Event evt
    Implements
    IBuffer.PushEvent(Event)

    PushFloat(Single, String)

    Declaration
    public void PushFloat(float val, string name = null)
    Parameters
    Type Name Description
    Single val
    String name
    Implements
    IBuffer.PushFloat(Single, String)

    PushInt(Int32, String)

    Declaration
    public void PushInt(int val, string name = null)
    Parameters
    Type Name Description
    Int32 val
    String name
    Implements
    IBuffer.PushInt(Int32, String)

    PushInt64(Int64, String)

    Declaration
    public void PushInt64(Int64 val, string name = null)
    Parameters
    Type Name Description
    Int64 val
    String name
    Implements
    IBuffer.PushInt64(Int64, String)

    PushObjectEnd()

    Declaration
    public void PushObjectEnd()
    Implements
    IBuffer.PushObjectEnd()

    PushObjectStart(String)

    Declaration
    public void PushObjectStart(string name = null)
    Parameters
    Type Name Description
    String name
    Implements
    IBuffer.PushObjectStart(String)

    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
    IBuffer.PushStartEvent(String, DateTime, Nullable<Int64>, Boolean)

    PushString(String, String)

    Declaration
    public void PushString(string val, string name = null)
    Parameters
    Type Name Description
    String val
    String name
    Implements
    IBuffer.PushString(String, String)

    PushTimestamp(DateTime, String)

    Declaration
    public void PushTimestamp(DateTime val, string name)
    Parameters
    Type Name Description
    DateTime val
    String name
    Implements
    IBuffer.PushTimestamp(DateTime, String)

    SaveDateTime(DateTime)

    Declaration
    public static string SaveDateTime(DateTime dateTime)
    Parameters
    Type Name Description
    DateTime dateTime
    Returns
    Type Description
    String

    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
    Type Name Description
    List<Buffer.Token> tokens
    Returns
    Type Description
    String

    String of JSON or Null

    Implements
    IBuffer.Serialize(List<Buffer.Token>)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023