Engine
core.engine.disconnect_peer
ServerDisconnects 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_iddoes not belong to a connected peer.
Parameters
| Type | Name | Description |
|---|---|---|
int | peer_id | Peer id to disconnect |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
util.event.on("network:peer:join", function(peer_id)
core.engine.disconnect_peer(peer_id)
end)