summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump/Hooks/OnLogin.lua
blob: f71c3ade40d36070a226827c61f387bb6ddc3d58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
return
{
	HOOK_LOGIN =
	{
		CalledWhen = "Right before player authentication. If auth is disabled, right after the player sends their name.",
		DefaultFnName = "OnLogin",  -- also used as pagename
		Desc = [[
			This hook is called whenever a client logs in. It is called right before the client's name is sent
			to be authenticated. Plugins may refuse the client from accessing the server. Note that when this
			callback is called, the {{cPlayer}} object for this client doesn't exist yet - the client has no
			representation in any world. To process new players when their world is known, use a later callback,
			such as {{OnPlayerJoined|HOOK_PLAYER_JOINED}} or {{OnPlayerSpawned|HOOK_PLAYER_SPAWNED}}.
		]],
		Params =
		{
			{ Name = "Client", Type = "{{cClientHandle}}", Notes = "The client handle representing the connection" },
			{ Name = "ProtocolVersion", Type = "number", Notes = "Versio of the protocol that the client is talking" },
			{ Name = "UserName", Type = "string", Notes = "The name that the client has presented for authentication. This name will be given to the {{cPlayer}} object when it is created for this client." },
		},
		Returns = [[
			If the function returns true, no other plugins are called for this event and the client is kicked.
			If the function returns false or no value, Cuberite calls other plugins' callbacks and finally
			sends an authentication request for the client's username to the auth server. If the auth server
			is disabled in the server settings, the player object is immediately created.
		]],
	},  -- HOOK_LOGIN
}