Skip to main content

MasterClock

Master clock on the server

Functions

new

MasterClock.new(
remoteEventRemoteEvent,
remoteFunctionRemoteFunction
) → MasterClock

Constructs a new MasterClock

GetClockFunction

MasterClock.GetClockFunction(selfMasterClock) → function

Gets a function that can be used as a clock, like time and tick are.

ObservePing

MasterClock.ObservePing(_selfMasterClock) → Observable<number>

Observes how much ping the clock has

IsSynced

MasterClock.IsSynced(_selfMasterClock) → boolean

Returns true if the manager has synced with the server

GetPing

MasterClock.GetPing(_selfMasterClock) → number

Returns estimated ping in seconds

GetTime

MasterClock.GetTime(_selfMasterClock) → number

Returns the sycncronized time

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new MasterClock",
            "params": [
                {
                    "name": "remoteEvent",
                    "desc": "",
                    "lua_type": "RemoteEvent"
                },
                {
                    "name": "remoteFunction",
                    "desc": "",
                    "lua_type": "RemoteFunction"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "MasterClock"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 35,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "GetClockFunction",
            "desc": "Gets a function that can be used as a clock, like `time` and `tick` are.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "MasterClock"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "function"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 72,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "ObservePing",
            "desc": "Observes how much ping the clock has",
            "params": [
                {
                    "name": "_self",
                    "desc": "",
                    "lua_type": "MasterClock"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 81,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "IsSynced",
            "desc": "Returns true if the manager has synced with the server",
            "params": [
                {
                    "name": "_self",
                    "desc": "",
                    "lua_type": "MasterClock"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 89,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "GetPing",
            "desc": "Returns estimated ping in seconds",
            "params": [
                {
                    "name": "_self",
                    "desc": "",
                    "lua_type": "MasterClock"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 97,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "GetTime",
            "desc": "Returns the sycncronized time",
            "params": [
                {
                    "name": "_self",
                    "desc": "",
                    "lua_type": "MasterClock"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 105,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "MasterClock",
    "desc": "Master clock on the server",
    "source": {
        "line": 6,
        "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
    }
}