Skip to main content

DataStoreWriter

This item only works when running on the server. Server

Captures a snapshot of data to write and then merges it with the original.

Functions​

new​

DataStoreWriter.new(debugName: string) → DataStoreWriter

Constructs a new DataStoreWriter. In general, you will not use this API directly.

SetSaveDataSnapshot​

DataStoreWriter.SetSaveDataSnapshot(
saveDataSnapshot: table | any
) → ()

Sets the ray data to write

AddSubWriter​

DataStoreWriter.AddSubWriter(
name: DataStoreStageKey,
) → ()

Adds a recursive child writer to use at the key name

GetWriter​

DataStoreWriter.GetWriter(
name: DataStoreStageKey
) → DataStoreWriter

Gets a sub writer

ComputeDiffSnapshot​

DataStoreWriter.ComputeDiffSnapshot(
incoming: any
) → ()

Merges the incoming data.

Won't really perform a delete operation because we can't be sure if we were suppose to have reified this stuff or not.

SetUserIdList​

DataStoreWriter.SetUserIdList(
userIdList: {number}
) → ()

Set of user ids to write with the data (only applies to top-level writer)

GetUserIdList​

DataStoreWriter.GetUserIdList(self: DataStoreWriter) → userIdList{number}

User ids to associate with data

WriteMerge​

DataStoreWriter.WriteMerge(
original: any
) → any--

The original value

Merges the new data into the original value

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new DataStoreWriter. In general, you will not use this API directly.",
            "params": [
                {
                    "name": "debugName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 41,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "SetSaveDataSnapshot",
            "desc": "Sets the ray data to write",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                },
                {
                    "name": "saveDataSnapshot",
                    "desc": "",
                    "lua_type": "table | any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 58,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "AddSubWriter",
            "desc": "Adds a recursive child writer to use at the key `name`",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "DataStoreStageKey"
                },
                {
                    "name": "writer",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 101,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "GetWriter",
            "desc": "Gets a sub writer",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "DataStoreStageKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 115,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "ComputeDiffSnapshot",
            "desc": "Merges the incoming data.\n\nWon't really perform a delete operation because we can't be sure if we were suppose to have reified this stuff or not.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                },
                {
                    "name": "incoming",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 128,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "SetUserIdList",
            "desc": "Set of user ids to write with the data (only applies to top-level writer)",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                },
                {
                    "name": "userIdList",
                    "desc": "",
                    "lua_type": "{ number }"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 208,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "GetUserIdList",
            "desc": "User ids to associate with data",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "userIdList { number }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 219,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "WriteMerge",
            "desc": "Merges the new data into the original value",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                },
                {
                    "name": "original",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "The original value",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 302,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "DataStoreWriter",
    "desc": "Captures a snapshot of data to write and then merges it with the original.",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 7,
        "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
    }
}