From 0433de9955d500c6ab8b6819e4f64c06a7317f98 Mon Sep 17 00:00:00 2001 From: faketruth Date: Thu, 11 Oct 2012 14:30:28 +0000 Subject: Core: made ban and kick functions accessible to other plugins Core: fixed banning and whitelisting in OnLogin git-svn-id: http://mc-server.googlecode.com/svn/trunk@947 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Core/onlogin.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'MCServer/Plugins/Core/onlogin.lua') diff --git a/MCServer/Plugins/Core/onlogin.lua b/MCServer/Plugins/Core/onlogin.lua index a706f8024..07b8460ee 100644 --- a/MCServer/Plugins/Core/onlogin.lua +++ b/MCServer/Plugins/Core/onlogin.lua @@ -1,16 +1,16 @@ -function OnLogin( PacketData ) - if( PacketData.m_Username ~= "" ) then - if( BannedPlayersIni:GetValueB("Banned", PacketData.m_Username, false) == true ) then +function OnLogin(Client, ProtocolVersion, Username) + if( Username ~= "" ) then + if( BannedPlayersIni:GetValueB("Banned", Username, false) == true ) then local Server = cRoot:Get():GetServer() - Server:SendMessage( PacketData.m_Username .. " tried to join, but is banned!" ) - LOGINFO( PacketData.m_Username .. " tried to join, but is banned!") + Server:SendMessage( Username .. " tried to join, but is banned!" ) + LOGINFO( Username .. " tried to join, but is banned!") return true -- Player is banned, return true to deny access end if( WhiteListIni:GetValueB("WhiteListSettings", "WhiteListOn", false ) == true ) then - if( WhiteListIni:GetValueB("WhiteList", PacketData.m_Username, false ) == false ) then -- not on whitelist + if( WhiteListIni:GetValueB("WhiteList", Username, false ) == false ) then -- not on whitelist local Server = cRoot:Get():GetServer() - Server:SendMessage( PacketData.m_Username .. " tried to join, but is not on the whitelist." ) - LOGINFO( PacketData.m_Username .. " tried to join, but is not on the whitelist." ) + Server:SendMessage( Username .. " tried to join, but is not on the whitelist." ) + LOGINFO( Username .. " tried to join, but is not on the whitelist." ) return true -- Deny access to the server end end -- cgit v1.2.3