aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/database/sv_queries.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/core/database/sv_queries.lua')
-rw-r--r--gamemode/core/database/sv_queries.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/gamemode/core/database/sv_queries.lua b/gamemode/core/database/sv_queries.lua
index 07b54ac..6ef1201 100644
--- a/gamemode/core/database/sv_queries.lua
+++ b/gamemode/core/database/sv_queries.lua
@@ -4,7 +4,7 @@
local fn = nrequire("utility/fn.lua")
local track = nrequire("core/inventory/sv_invtracker.lua")
-
+local log = nrequire("log.lua")
local q = {}
function q.serialize_player(ply)
@@ -25,10 +25,14 @@ function q.serialize_player(ply)
end
function q.deserialize_player(ply,str)
+ log.debug("Deserializing player's data : " .. ply:Nick() .. "\n" .. str)
track.ClearInventories(ply)
ply.data = ply.data or {}
ply.data.inventories = ply.data.inventories or {}
local tbl = util.JSONToTable(str)
+ if not tbl then
+ log.error("Failed to deserialize player " .. ply:Nick() .. "\n" .. str)
+ end
local invs = tbl.inventories
print("Inventories was", invs)
PrintTable(invs)