diff options
author | Alexander Harkness <me@bearbin.net> | 2014-09-27 16:33:35 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2014-09-27 16:33:35 +0200 |
commit | 400a4d1083fa8ea29898a045ea1bb7815b3a4fcb (patch) | |
tree | b81a8c6866259526f915fbf6e26a0bb4fa0213f8 /MCServer/Plugins/APIDump/Hooks | |
parent | Merge pull request #1459 from Masy98/blocks (diff) | |
download | cuberite-400a4d1083fa8ea29898a045ea1bb7815b3a4fcb.tar cuberite-400a4d1083fa8ea29898a045ea1bb7815b3a4fcb.tar.gz cuberite-400a4d1083fa8ea29898a045ea1bb7815b3a4fcb.tar.bz2 cuberite-400a4d1083fa8ea29898a045ea1bb7815b3a4fcb.tar.lz cuberite-400a4d1083fa8ea29898a045ea1bb7815b3a4fcb.tar.xz cuberite-400a4d1083fa8ea29898a045ea1bb7815b3a4fcb.tar.zst cuberite-400a4d1083fa8ea29898a045ea1bb7815b3a4fcb.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/APIDump/Hooks/OnServerPing.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua b/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua new file mode 100644 index 000000000..8a710e047 --- /dev/null +++ b/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua @@ -0,0 +1,24 @@ + (cClientHandle & a_ClientHandle, AString & a_ServerDescription, int & a_OnlinePlayersCount, int & a_MaxPlayersCount, AString & a_Favicon); + +return +{ + HOOK_SERVER_PING = + { + CalledWhen = "Client pings the server from the server list.", + DefaultFnName = "OnServerPing", -- also used as pagename + Desc = [[ + A plugin may implement an OnServerPing() function and register it as a Hook to process pings from + clients in the server server list. + ]], + Params = { + { Name = "ClientHandle", Type = "{{cClientHandle}}", Notes = "The client handle that pinged the server" }, + { Name = "ServerDescription", Type = "string", Notes = "The server description" }, + { Name = "OnlinePlayersCount", Type = "number", Notes = "The number of players currently on the server" }, + { Name = "MaxPlayersCount", Type = "number", Notes = "The current player cap for the server" }, + { Name = "Favicon", Type = "string", Notes = "The base64 encoded favicon to be displayed in the server list for compatible clients" }, + }, + Returns = [[ + The plugin may return a boolean of whether to respond to the client that pinged. + ]], + }, -- HOOK_SERVER_PING +} |