mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-22 12:21:43 +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
|
local cur
|
||||||
|
|
||||||
-- players
|
-- players
|
||||||
function sqlite3.addplayer(guid, ip)
|
function sqlite3.addplayer(guid, ip, lastSeen, seen)
|
||||||
cur = assert(con:execute("INSERT INTO `player` (`guid`, `ip`, `level_id`) VALUES ('"..util.escape(guid).."', '"..util.escape(ip).."', 0)"))
|
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
|
end
|
||||||
|
|
||||||
function sqlite3.updateplayer(guid, ip, lastSeen)
|
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())
|
db.addalias(player["id"], data[clientId]["name"], os.time())
|
||||||
end
|
end
|
||||||
else
|
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"])
|
local player = db.getplayer(data[clientId]["guid"])
|
||||||
db.addalias(player["id"], data[clientId]["name"], os.time())
|
db.addalias(player["id"], data[clientId]["name"], os.time())
|
||||||
|
|
Loading…
Reference in a new issue