From 534103be54a129d8255988fc1e75a21a63c6021f Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 15 Jul 2018 19:57:27 -0400 Subject: Finished gather quest arcs Finished base quest system, and added "Gather" arcs, where players gather a certain number of a certain item. --- gamemode/core/database/sv_setup.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gamemode/core/database/sv_setup.lua') diff --git a/gamemode/core/database/sv_setup.lua b/gamemode/core/database/sv_setup.lua index becdcf5..4aba3db 100644 --- a/gamemode/core/database/sv_setup.lua +++ b/gamemode/core/database/sv_setup.lua @@ -100,7 +100,7 @@ function sql.GetPlayerData(ply) local s64 = ply:SteamID64() local q_str = q.s_fmt(fetch_player_query,s64) local q_suc = function(res,li) - log.debug("Loading player, res is" .. tostring(res)) + log.debug("Loading player, res is " .. tostring(res)) if res == nil then log.debug("Creating new player") sql.CreatePlayerTable(ply) @@ -120,7 +120,12 @@ function sql.GetPlayerData(ply) local vec = {x,y,z} for k,v in pairs(vec) do vec[k] = tonumber(v) end ply:SetPos(Vector(unpack(vec))) - q.deserialize_player(ply,plyd) + xpcall(function() + q.deserialize_player(ply,plyd) + end,function(err) + log.error("Failed to load:" .. ply:Nick() .. ":" .. err) + log.error(debug.traceback()) + end) end end --print("doing query",q_str) @@ -128,7 +133,7 @@ function sql.GetPlayerData(ply) end ---Manually loads data for the caller. --- Forefully loads a player's data. ![Requires admin](./req_admin) +-- Forefully loads a player's data. --@concommand artery_loadplayer concommand.Add("artery_loadplayer",function(ply,cmd,args) if not ply:IsAdmin() then return end @@ -183,7 +188,7 @@ function sql.SendPlayerToInstance(ply,ls,ll) end ---Do queries related to the player creation. --- Create the caller's data, Reload the coller's data, or Send the caller to another instance ![Requires admin](./req_admin) +-- Create the caller's data, Reload the coller's data, or Send the caller to another instance --@usage artery_DoQuery (create|get|send ) --@concommand artery_DoQuery concommand.Add("artery_DoQuery",function(ply,cmd,args) -- cgit v1.2.3-70-g09d2