-
Notifications
You must be signed in to change notification settings - Fork 12
Server API
Everything below is what GodotServer exposes as an API to you.
virtual void OnPeerDisconnect(Event netEvent) - Called when a client disconnects from the server.
void Send(ServerPacket packet, Peer peer) - Sent a packet to a client.
void Broadcast(ServerPacket packet, params Peer[] clients) - Sent a packet to multiple clients.
void RegisterPacketHandler<TPacket>(Action<TPacket, Peer> handler) - Register and do something when a ClientPacket is received by the server.
void Log(object message) - Log a message as the server. Using GD.Print may lead to crashes if printing from multiple threads so always use Log.
void Ban(uint id) - Ban someone.
void BanAll() - Ban everyone.
void Kick(uint id, DisconnectOpcode opcode) - Kick someone.
void KickAll(DisconnectOpcode opcode) - Kick everyone.