Minor bugfixes regarding new players

This commit is contained in:
Timo Smit 2017-01-15 12:27:18 +01:00
parent 9d4aaa7a62
commit 2d4191f03f
2 changed files with 8 additions and 5 deletions

View file

@ -52,12 +52,15 @@ function admin.onconnectattempt(clientId, firstTime, isBot)
return "\n\nIt appears you do not have a ^7GUID^9/^7etkey^9. In order to play on this server, enable ^7PunkBuster ^9(use ^7\\pb_cl_enable^9) ^9and/or create an ^7etkey^9.\n\nMore info: ^7www.etkey.org"
end
local playerId = db.getplayer(guid)["id"]
local player = db.getplayer(guid)
if player then
local playerId = player["id"]
local ban = db.getBanByPlayer(playerId)
if ban then
return "\n\nYou have been banned for "..ban["duration"].." seconds, Reason: "..ban["reason"]
end
end
end
events.trigger("onClientConnect", clientId, firstTime, isBot)
end

View file

@ -32,7 +32,7 @@ local cur = nil
-- players
function sqlite3.addplayer(guid, ip)
cur = assert(con:execute("INSERT INTO `player` (`guid`, `ip`) VALUES ('"..util.escape(guid).."', '"..util.escape(ip).."')"))
cur = assert(con:execute("INSERT INTO `player` (`guid`, `ip`, `level`) VALUES ('"..util.escape(guid).."', '"..util.escape(ip).."', 0)"))
end
function sqlite3.updateplayerip(guid, ip)