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,10 +52,13 @@ 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" 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 end
local playerId = db.getplayer(guid)["id"] local player = db.getplayer(guid)
local ban = db.getBanByPlayer(playerId) if player then
if ban then local playerId = player["id"]
return "\n\nYou have been banned for "..ban["duration"].." seconds, Reason: "..ban["reason"] local ban = db.getBanByPlayer(playerId)
if ban then
return "\n\nYou have been banned for "..ban["duration"].." seconds, Reason: "..ban["reason"]
end
end end
end end

View File

@ -32,7 +32,7 @@ local cur = nil
-- players -- players
function sqlite3.addplayer(guid, ip) 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 end
function sqlite3.updateplayerip(guid, ip) function sqlite3.updateplayerip(guid, ip)