Skip to main content

Comm

Remote communication library.

This exposes the raw functions that are used by the ServerComm and ClientComm classes. Those two classes should be preferred over accessing the functions directly through this Comm library.

-- Server
local ServerComm = require(ReplicatedStorage.Packages.Comm).ServerComm
local serverComm = ServerComm.new(somewhere, "MyComm")
serverComm:BindFunction("Hello", function(player: Player)
	return "Hi"
end)

-- Client
local ClientComm = require(ReplicatedStorage.Packages.Comm).ClientComm
local clientComm = ClientComm.new(somewhere, false, "MyComm")
local comm = clientComm:BuildObject()
print(comm:Hello()) --> Hi

Properties

ServerComm

Comm.ServerComm: ServerComm

ClientComm

Comm.ClientComm: ClientComm
Show raw api
{
    "functions": [],
    "properties": [
        {
            "name": "ServerComm",
            "desc": "",
            "lua_type": "ServerComm",
            "source": {
                "line": 12,
                "path": "modules/comm/Server/init.lua"
            }
        },
        {
            "name": "ClientComm",
            "desc": "",
            "lua_type": "ClientComm",
            "source": {
                "line": 16,
                "path": "modules/comm/Server/init.lua"
            }
        }
    ],
    "types": [
        {
            "name": "Server",
            "desc": "Server Comm",
            "fields": [
                {
                    "name": "BindFunction",
                    "lua_type": "(parent: Instance, name: string, fn: FnBind, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction",
                    "desc": ""
                },
                {
                    "name": "WrapMethod",
                    "lua_type": "(parent: Instance, tbl: table, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction",
                    "desc": ""
                },
                {
                    "name": "CreateSignal",
                    "lua_type": "(parent: Instance, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteSignal",
                    "desc": ""
                },
                {
                    "name": "CreateProperty",
                    "lua_type": "(parent: Instance, name: string, value: any, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteProperty",
                    "desc": ""
                }
            ],
            "private": true,
            "source": {
                "line": 27,
                "path": "modules/comm/Server/init.lua"
            }
        },
        {
            "name": "Client",
            "desc": "Client Comm",
            "fields": [
                {
                    "name": "GetFunction",
                    "lua_type": "(parent: Instance, name: string, usePromise: boolean, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?): (...: any) -> any",
                    "desc": ""
                },
                {
                    "name": "GetSignal",
                    "lua_type": "(parent: Instance, name: string, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?): ClientRemoteSignal",
                    "desc": ""
                },
                {
                    "name": "GetProperty",
                    "lua_type": "(parent: Instance, name: string, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?): ClientRemoteProperty",
                    "desc": ""
                }
            ],
            "private": true,
            "source": {
                "line": 36,
                "path": "modules/comm/Server/init.lua"
            }
        }
    ],
    "name": "Comm",
    "desc": "Remote communication library.\n\nThis exposes the raw functions that are used by the `ServerComm` and `ClientComm` classes.\nThose two classes should be preferred over accessing the functions directly through this\nComm library.\n\n```lua\n-- Server\nlocal ServerComm = require(ReplicatedStorage.Packages.Comm).ServerComm\nlocal serverComm = ServerComm.new(somewhere, \"MyComm\")\nserverComm:BindFunction(\"Hello\", function(player: Player)\n\treturn \"Hi\"\nend)\n\n-- Client\nlocal ClientComm = require(ReplicatedStorage.Packages.Comm).ClientComm\nlocal clientComm = ClientComm.new(somewhere, false, \"MyComm\")\nlocal comm = clientComm:BuildObject()\nprint(comm:Hello()) --> Hi\n```",
    "source": {
        "line": 28,
        "path": "modules/comm/init.lua"
    }
}