mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-22 04:12:19 +00:00
Fixed lastseen and seen NULL for new players
This commit is contained in:
parent
6eeec2d20a
commit
cd7ad4fd9c
2 changed files with 3 additions and 3 deletions
|
@ -31,8 +31,8 @@ local con
|
|||
local cur
|
||||
|
||||
-- players
|
||||
function sqlite3.addplayer(guid, ip)
|
||||
cur = assert(con:execute("INSERT INTO `player` (`guid`, `ip`, `level_id`) VALUES ('"..util.escape(guid).."', '"..util.escape(ip).."', 0)"))
|
||||
function sqlite3.addplayer(guid, ip, lastSeen, seen)
|
||||
cur = assert(con:execute("INSERT INTO `player` (`guid`, `ip`, `level_id`, `lastseen`, `seen`) VALUES ('"..util.escape(guid).."', '"..util.escape(ip).."', "..tonumber(lastSeen)..", "..tonumber(seen)..")"))
|
||||
end
|
||||
|
||||
function sqlite3.updateplayer(guid, ip, lastSeen)
|
||||
|
|
|
@ -139,7 +139,7 @@ function players.onClientConnect(clientId, firstTime, isBot)
|
|||
db.addalias(player["id"], data[clientId]["name"], os.time())
|
||||
end
|
||||
else
|
||||
db.addplayer(data[clientId]["guid"], data[clientId]["ip"])
|
||||
db.addplayer(data[clientId]["guid"], data[clientId]["ip"], os.time(), 1)
|
||||
|
||||
local player = db.getplayer(data[clientId]["guid"])
|
||||
db.addalias(player["id"], data[clientId]["name"], os.time())
|
||||
|
|
Loading…
Reference in a new issue