-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsteamCheck.lua
More file actions
31 lines (25 loc) · 873 Bytes
/
Copy pathsteamCheck.lua
File metadata and controls
31 lines (25 loc) · 873 Bytes
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
AddEventHandler('playerConnecting', function(name, setKickReason, deferrals)
local src = source
if not src or src == -1 then
deferrals.done("Connection denied. Unexpected connection error.")
return
end
deferrals.defer()
Wait(0)
deferrals.update("Verifying Steam session...")
local steamIdentifier = nil
local identifiers = GetPlayerIdentifiers(src) or {}
for _, identifier in ipairs(identifiers) do
if string.sub(identifier, 1, 6) == "steam:" then
steamIdentifier = identifier
break
end
end
Wait(200)
if not steamIdentifier then
deferrals.done("Connection denied. Steam must be running to join this server.")
-- print(("[STEAM CHECK] Connection denied for %s. Steam is not running."):format(name))
return
end
deferrals.done()
end)