mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-10 06:41:53 +00:00
Added connection count and last connection information
This commit is contained in:
parent
935f71d4ab
commit
fafc53710b
2 changed files with 4 additions and 2 deletions
|
@ -14,6 +14,8 @@ CREATE TABLE IF NOT EXISTS `player` (
|
|||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`guid` TEXT NOT NULL UNIQUE,
|
||||
`ip` TEXT NOT NULL,
|
||||
`lastseen` INTEGER NOT NULL,
|
||||
`seen` INTEGER NOT NULL,
|
||||
`level_id` INTEGER NOT NULL,
|
||||
CONSTRAINT `player_level` FOREIGN KEY (`level_id`) REFERENCES `level` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
);
|
||||
|
|
|
@ -35,8 +35,8 @@ function sqlite3.addplayer(guid, ip)
|
|||
cur = assert(con:execute("INSERT INTO `player` (`guid`, `ip`, `level_id`) VALUES ('"..util.escape(guid).."', '"..util.escape(ip).."', 0)"))
|
||||
end
|
||||
|
||||
function sqlite3.updateplayerip(guid, ip)
|
||||
cur = assert(con:execute("UPDATE `player` SET `ip`='"..util.escape(ip).."' WHERE `guid`='"..util.escape(guid).."'"))
|
||||
function sqlite3.updateplayer(guid, ip, lastSeen)
|
||||
cur = assert(con:execute("UPDATE `player` SET `ip`='"..util.escape(ip).."', `lastseen`="..lastSeen..", `seen`=`seen`+1 WHERE `guid`='"..util.escape(guid).."'"))
|
||||
end
|
||||
|
||||
function sqlite3.updateplayerlevel(id, level)
|
||||
|
|
Loading…
Reference in a new issue