forked from TeamUlysses/ulib
Fixes #103, removes some old cruft that's not longer needed.
This commit is contained in:
parent
a364c2adef
commit
2068c71efc
@ -906,31 +906,18 @@ end
|
||||
hook.Add( "PlayerAuthed", "ULibAuth", ucl.probe, -4 ) -- Run slightly after garry-auth
|
||||
|
||||
|
||||
local function sendAuthToClients( ply )
|
||||
-- Check if it's a bot
|
||||
--if hook.isInHook( "PlayerInitialSpawn" ) and ply:IsBot() and not ucl.authed[ ply:UniqueID() ] then
|
||||
local function botCheck( ply )
|
||||
if ply:IsBot() and not ucl.authed[ ply:UniqueID() ] then
|
||||
ply:SetUserGroup( ULib.ACCESS_ALL, true ) -- Give it a group!
|
||||
ucl.probe( ply )
|
||||
--return -- We'll be called again
|
||||
end
|
||||
|
||||
-- We want to officially auth after both of these hooks occur for the player
|
||||
--[[if hook.isInHook( "PlayerAuthed" ) or hook.isInHook( "PlayerInitialSpawn" ) then
|
||||
if not ply.ulib_auth_next then
|
||||
ply.ulib_auth_next = true
|
||||
return
|
||||
else
|
||||
ply.ulib_auth_next = nil
|
||||
end
|
||||
end]]
|
||||
|
||||
--ULib.queueFunctionCall( function()
|
||||
ULib.clientRPC( _, "authPlayerIfReady", ply, ply:UserID() ) -- Call on client
|
||||
--end )
|
||||
end
|
||||
--hook.Add( ULib.HOOK_UCLAUTH, "ULibSendAuthToClients", sendAuthToClients, -20 )
|
||||
hook.Add( "PlayerInitialSpawn", "ULibSendAuthToClients", sendAuthToClients, -20 )
|
||||
hook.Add( "PlayerInitialSpawn", "ULibSendAuthToClients", botCheck, -20 )
|
||||
|
||||
local function sendAuthToClients( ply )
|
||||
ULib.clientRPC( _, "authPlayerIfReady", ply, ply:UserID() ) -- Call on client--
|
||||
end
|
||||
hook.Add( ULib.HOOK_UCLAUTH, "ULibSendAuthToClients", sendAuthToClients, -20 )
|
||||
|
||||
local function sendUCLDataToClient( ply )
|
||||
ULib.clientRPC( ply, "ULib.ucl.initClientUCL", ucl.authed, ucl.groups ) -- Send all UCL data (minus offline users) to all loaded users
|
||||
@ -939,17 +926,6 @@ local function sendUCLDataToClient( ply )
|
||||
end
|
||||
hook.Add( ULib.HOOK_LOCALPLAYERREADY, "ULibSendUCLDataToClient", sendUCLDataToClient, -20 )
|
||||
|
||||
--[[
|
||||
local function playerLoaded( ply )
|
||||
local plys = player.GetAll()
|
||||
for i=1, #plys do
|
||||
if plys[ i ] ~= ply then
|
||||
ULib.clientRPC( ply, "authPlayerIfReady", plys[ i ], plys[ i ]:UserID() )
|
||||
end
|
||||
end
|
||||
end
|
||||
hook.Add( "PlayerInitialSpawn", "ULibSendUCLToClients", playerLoaded )]]
|
||||
|
||||
local function playerDisconnected( ply )
|
||||
local uid = ply:UniqueID()
|
||||
ULib.queueFunctionCall( function()
|
||||
|
Loading…
Reference in New Issue
Block a user