mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-25 13:41:21 +00:00
Level history is now stored in player_level
This commit is contained in:
parent
de9e7b50fe
commit
73d66589e7
2 changed files with 8 additions and 8 deletions
|
@ -137,13 +137,13 @@ function mysql.getlastalias(playerid)
|
||||||
return alias
|
return alias
|
||||||
end
|
end
|
||||||
|
|
||||||
-- setlevels
|
-- level history
|
||||||
function mysql.addsetlevel(playerid, level, adminid, datetime)
|
function mysql.addsetlevel(playerid, level, adminid, datetime)
|
||||||
cur = assert(con:execute("INSERT INTO `level` (`player_id`, `level`, `admin_id`, `datetime`) VALUES ("..tonumber(playerid)..", "..tonumber(level)..", "..tonumber(adminid)..", "..tonumber(datetime)..")"))
|
cur = assert(con:execute("INSERT INTO `player_level` (`player_id`, `level`, `admin_id`, `datetime`) VALUES ("..tonumber(playerid)..", "..tonumber(level)..", "..tonumber(adminid)..", "..tonumber(datetime)..")"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function mysql.getlevelscount(playerid)
|
function mysql.getlevelscount(playerid)
|
||||||
cur = assert(con:execute("SELECT COUNT(`id`) AS `count` FROM `level` WHERE `player_id`="..tonumber(playerid)..""))
|
cur = assert(con:execute("SELECT COUNT(`id`) AS `count` FROM `player_level` WHERE `player_id`="..tonumber(playerid)..""))
|
||||||
|
|
||||||
local count = tonumber(cur:fetch({}, "a")["count"])
|
local count = tonumber(cur:fetch({}, "a")["count"])
|
||||||
cur:close()
|
cur:close()
|
||||||
|
@ -155,7 +155,7 @@ function mysql.getlevels(playerid, limit, offset)
|
||||||
limit = limit or 30
|
limit = limit or 30
|
||||||
offset = offset or 0
|
offset = offset or 0
|
||||||
|
|
||||||
cur = assert(con:execute("SELECT * FROM `level` WHERE `player_id`="..tonumber(playerid).." LIMIT "..tonumber(limit).." OFFSET "..tonumber(offset)))
|
cur = assert(con:execute("SELECT * FROM `player_level` WHERE `player_id`="..tonumber(playerid).." LIMIT "..tonumber(limit).." OFFSET "..tonumber(offset)))
|
||||||
|
|
||||||
local levels = {}
|
local levels = {}
|
||||||
local row = cur:fetch({}, "a")
|
local row = cur:fetch({}, "a")
|
||||||
|
|
|
@ -137,13 +137,13 @@ function sqlite3.getlastalias(playerid)
|
||||||
return alias
|
return alias
|
||||||
end
|
end
|
||||||
|
|
||||||
-- setlevels
|
-- level history
|
||||||
function sqlite3.addsetlevel(playerid, level, adminid, datetime)
|
function sqlite3.addsetlevel(playerid, level, adminid, datetime)
|
||||||
cur = assert(con:execute("INSERT INTO `level` (`player_id`, `level`, `admin_id`, `datetime`) VALUES ("..tonumber(playerid)..", "..tonumber(level)..", "..tonumber(adminid)..", "..tonumber(datetime)..")"))
|
cur = assert(con:execute("INSERT INTO `player_level` (`player_id`, `level`, `admin_id`, `datetime`) VALUES ("..tonumber(playerid)..", "..tonumber(level)..", "..tonumber(adminid)..", "..tonumber(datetime)..")"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function sqlite3.getlevelscount(playerid)
|
function sqlite3.getlevelscount(playerid)
|
||||||
cur = assert(con:execute("SELECT COUNT(`id`) AS `count` FROM `level` WHERE `player_id`="..tonumber(playerid)..""))
|
cur = assert(con:execute("SELECT COUNT(`id`) AS `count` FROM `player_level` WHERE `player_id`="..tonumber(playerid)..""))
|
||||||
|
|
||||||
local count = tonumber(cur:fetch({}, "a")["count"])
|
local count = tonumber(cur:fetch({}, "a")["count"])
|
||||||
cur:close()
|
cur:close()
|
||||||
|
@ -155,7 +155,7 @@ function sqlite3.getlevels(playerid, limit, offset)
|
||||||
limit = limit or 30
|
limit = limit or 30
|
||||||
offset = offset or 0
|
offset = offset or 0
|
||||||
|
|
||||||
cur = assert(con:execute("SELECT * FROM `level` WHERE `player_id`="..tonumber(playerid).." LIMIT "..tonumber(limit).." OFFSET "..tonumber(offset)))
|
cur = assert(con:execute("SELECT * FROM `player_level` WHERE `player_id`="..tonumber(playerid).." LIMIT "..tonumber(limit).." OFFSET "..tonumber(offset)))
|
||||||
|
|
||||||
local levels = {}
|
local levels = {}
|
||||||
local row = cur:fetch({}, "a")
|
local row = cur:fetch({}, "a")
|
||||||
|
|
Loading…
Reference in a new issue