diff options
Diffstat (limited to 'gamemode/core/mapstich')
| -rw-r--r-- | gamemode/core/mapstich/sv_mapstich.lua | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/gamemode/core/mapstich/sv_mapstich.lua b/gamemode/core/mapstich/sv_mapstich.lua index 5fd8129..f4208dd 100644 --- a/gamemode/core/mapstich/sv_mapstich.lua +++ b/gamemode/core/mapstich/sv_mapstich.lua @@ -6,14 +6,18 @@ nrequire("sv_mysqlite.lua") if not nrequire("sh_zones.lua") then return end local q = nrequire("core/database/sv_queries.lua") +local log = nrequire("log.lua") --if not zones then error("This thing needs zones to function!") end -print("Hello from sv_mapstich.lua") util.AddNetworkString("art_zonechange") util.AddNetworkString("art_sendtoserver") local dontupdatedisconnect = {} +local function sqlerror(err,sql) + log.error("Query error:\nQuery:",sql,"\nError:",err) +end + local function SavePlayerData(ply) local query local pdat = q.serialize_player(ply) @@ -31,16 +35,11 @@ local function SavePlayerData(ply) lastserver = game.GetIPAddress(), lastlocation = tostring(ply:GetPos()) }) - print("pmet turns out to be",pmet) query = q.s_fmt(query,pdat,pmet,ply:SteamID64()) end MySQLite.query(query,function(data) - end,function(err,sql) - print("Query error:") - print("Query",sql) - print("Error",err) - end) + end,sqlerror) end ---Saves the player. @@ -64,21 +63,14 @@ net.Receive("art_zonechange",function(len,ply) lastserver = zone.toserver, lastlocation = tostring(zone.topos) }) - print("pmet is", pmet) local fquery = q.s_fmt(query,pmet,ply:SteamID64()) - print("fquery was", fquery) - print("Running query:",qc) MySQLite.query(fquery,function(data) --Holy shit fuck garry for breaking this --ply:ConCommand("connect " .. zone.toserver) net.Start("art_sendtoserver") net.WriteString(zone.toserver) net.Send(ply) - end,function(err,sql) - print("Query error:") - print("Query",sql) - print("Error",err) - end) + end,sqlerror) end end) end) |
