summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump/Hooks/OnDisconnect.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-09-06 10:05:18 +0200
committerMattes D <github@xoft.cz>2015-09-06 10:05:18 +0200
commit7da79fdc19a9825b29cda58a698da1fa3cfb8e57 (patch)
treeec17a9703fe734956e4f151cb5306befc4fd7571 /Server/Plugins/APIDump/Hooks/OnDisconnect.lua
parentMerge pull request #2459 from cuberite/fixes (diff)
parentRenamed output directory to Server (diff)
downloadcuberite-7da79fdc19a9825b29cda58a698da1fa3cfb8e57.tar
cuberite-7da79fdc19a9825b29cda58a698da1fa3cfb8e57.tar.gz
cuberite-7da79fdc19a9825b29cda58a698da1fa3cfb8e57.tar.bz2
cuberite-7da79fdc19a9825b29cda58a698da1fa3cfb8e57.tar.lz
cuberite-7da79fdc19a9825b29cda58a698da1fa3cfb8e57.tar.xz
cuberite-7da79fdc19a9825b29cda58a698da1fa3cfb8e57.tar.zst
cuberite-7da79fdc19a9825b29cda58a698da1fa3cfb8e57.zip
Diffstat (limited to 'Server/Plugins/APIDump/Hooks/OnDisconnect.lua')
-rw-r--r--Server/Plugins/APIDump/Hooks/OnDisconnect.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/Server/Plugins/APIDump/Hooks/OnDisconnect.lua b/Server/Plugins/APIDump/Hooks/OnDisconnect.lua
new file mode 100644
index 000000000..ae872a3ad
--- /dev/null
+++ b/Server/Plugins/APIDump/Hooks/OnDisconnect.lua
@@ -0,0 +1,38 @@
+return
+{
+ HOOK_DISCONNECT =
+ {
+ CalledWhen = [[
+ A client has disconnected, either by explicitly sending the disconnect packet (in older protocols) or
+ their connection was terminated
+ ]],
+ DefaultFnName = "OnDisconnect", -- also used as pagename
+ Desc = [[
+ This hook is called when a client has disconnected from the server, for whatever reason. It is also
+ called when the client sends the Disconnect packet (only in pre-1.7 protocols). This hook is not called
+ for server ping connections.</p>
+ <p>
+ Note that the hook is called even for connections to players who failed to auth. In such a case there's
+ no {{cPlayer}} object associated with the client.</p>
+ <p>
+ See also the {{OnHandshake|HOOK_HANDSHAKE}} hook which is called when the client connects (and presents
+ a handshake message, so that they are not just status-pinging). If you need to store a per-player
+ object, use the {{OnPlayerJoined|HOOK_PLAYER_JOINED}} and {{OnPlayerDestroyed|HOOK_PLAYER_DESTROYED}}
+ hooks instead, those are guaranteed to have the {{cPlayer}} object associated.
+ ]],
+ Params =
+ {
+ { Name = "Client", Type = "{{cClientHandle}}", Notes = "The client who has disconnected" },
+ { Name = "Reason", Type = "string", Notes = "The reason that the client has sent in the disconnect packet" },
+ },
+ Returns = [[
+ If the function returns false or no value, Cuberite calls other plugins' callbacks for this event.
+ If the function returns true, no other plugins are called for this event. In either case,
+ the client is disconnected.
+ ]],
+ }, -- HOOK_DISCONNECT
+}
+
+
+
+