2012-10-11 10:30:28 -04:00
|
|
|
function OnLogin(Client, ProtocolVersion, Username)
|
|
|
|
if( Username ~= "" ) then
|
|
|
|
if( BannedPlayersIni:GetValueB("Banned", Username, false) == true ) then
|
2012-01-26 18:10:49 -05:00
|
|
|
local Server = cRoot:Get():GetServer()
|
2012-10-11 10:30:28 -04:00
|
|
|
Server:SendMessage( Username .. " tried to join, but is banned!" )
|
|
|
|
LOGINFO( Username .. " tried to join, but is banned!")
|
2012-01-26 18:10:49 -05:00
|
|
|
return true -- Player is banned, return true to deny access
|
|
|
|
end
|
|
|
|
if( WhiteListIni:GetValueB("WhiteListSettings", "WhiteListOn", false ) == true ) then
|
2012-10-11 10:30:28 -04:00
|
|
|
if( WhiteListIni:GetValueB("WhiteList", Username, false ) == false ) then -- not on whitelist
|
2012-01-26 18:10:49 -05:00
|
|
|
local Server = cRoot:Get():GetServer()
|
2012-10-11 10:30:28 -04:00
|
|
|
Server:SendMessage( Username .. " tried to join, but is not on the whitelist." )
|
|
|
|
LOGINFO( Username .. " tried to join, but is not on the whitelist." )
|
2012-01-26 18:10:49 -05:00
|
|
|
return true -- Deny access to the server
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return false
|
|
|
|
end
|