Engine

core.engine.disconnect_peer

Server

Disconnects a connected peer from the server

Syntax

local status = core.engine.disconnect_peer(
    peer_id
)

The peer must be currently connected.

  • An error is raised if peer_id does not belong to a connected peer.

Parameters

TypeNameDescription
intpeer_idPeer id to disconnect

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Disconnect a peer when it joins
util.event.on("network:peer:join", function(peer_id)
    core.engine.disconnect_peer(peer_id)
end)

On this page