OnClientConnectionRequest: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Event|Server|1.0}} | {{Info|Event|Server|1.0}} | ||
{{FuncDescription|Early callback of when a client tries to connect to the server. Client is not fully authorized by the server in this state. You can | {{FuncDescription|Early callback of when a client tries to connect to the server. Client is not fully authorized by the server in this state. You can return '''false''' in this event to disconnect the client immediately.}} | ||
{{FuncSyntax|OnClientConnectionRequest(ip, port)}} | {{FuncSyntax|OnClientConnectionRequest(ip, port)}} | ||
Line 10: | Line 10: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | |||
AddEvent("OnClientConnectionRequest", function(ip, port) | |||
-- you can check for blacklisted IP and return false to stop them! | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
*[[OnClientConnectionRequest]] | |||
*[[OnPlayerServerAuth]] | |||
*[[OnPlayerJoin]] |
Latest revision as of 11:29, 1 September 2020
Description
Early callback of when a client tries to connect to the server. Client is not fully authorized by the server in this state. You can return false in this event to disconnect the client immediately.
Syntax
OnClientConnectionRequest(ip, port)
Parameters
- ip
IP address of the client connecting. - port
Port of the client connecting. This is not the server port.
Example
AddEvent("OnClientConnectionRequest", function(ip, port)
-- you can check for blacklisted IP and return false to stop them!
end)