diff --git a/luamods/wolfadmin/db/sqlite3.lua b/luamods/wolfadmin/db/sqlite3.lua index 3add9f8..429221f 100644 --- a/luamods/wolfadmin/db/sqlite3.lua +++ b/luamods/wolfadmin/db/sqlite3.lua @@ -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) diff --git a/luamods/wolfadmin/players/players.lua b/luamods/wolfadmin/players/players.lua index d13d4a9..e33b7e5 100644 --- a/luamods/wolfadmin/players/players.lua +++ b/luamods/wolfadmin/players/players.lua @@ -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())