mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-10 14:51:54 +00:00
Minor bugfixes regarding new players
This commit is contained in:
parent
9d4aaa7a62
commit
2d4191f03f
2 changed files with 8 additions and 5 deletions
|
@ -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"
|
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)
|
||||||
|
if player then
|
||||||
|
local playerId = player["id"]
|
||||||
local ban = db.getBanByPlayer(playerId)
|
local ban = db.getBanByPlayer(playerId)
|
||||||
if ban then
|
if ban then
|
||||||
return "\n\nYou have been banned for "..ban["duration"].." seconds, Reason: "..ban["reason"]
|
return "\n\nYou have been banned for "..ban["duration"].." seconds, Reason: "..ban["reason"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
events.trigger("onClientConnect", clientId, firstTime, isBot)
|
events.trigger("onClientConnect", clientId, firstTime, isBot)
|
||||||
end
|
end
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue