diff options
Diffstat (limited to 'gamemode/core')
| -rw-r--r-- | gamemode/core/clienteffects/cl_effects.lua | 2 | ||||
| -rw-r--r-- | gamemode/core/combat/cl_damage.lua | 1 | ||||
| -rw-r--r-- | gamemode/core/combat/cl_weaponswing.lua | 7 | ||||
| -rw-r--r-- | gamemode/core/database/sv_queries.lua | 6 | ||||
| -rw-r--r-- | gamemode/core/database/sv_setup.lua | 11 | ||||
| -rw-r--r-- | gamemode/core/inventory/sv_invtracker.lua | 30 | ||||
| -rw-r--r-- | gamemode/core/mapstich/sv_mapstich.lua | 22 |
7 files changed, 9 insertions, 70 deletions
diff --git a/gamemode/core/clienteffects/cl_effects.lua b/gamemode/core/clienteffects/cl_effects.lua index db84b24..eff8dba 100644 --- a/gamemode/core/clienteffects/cl_effects.lua +++ b/gamemode/core/clienteffects/cl_effects.lua @@ -24,7 +24,7 @@ end) net.Receive("art_clienteffect",function() local effectname = net.ReadString() local effectdata = net.ReadData(net.ReadUInt(32)) - print("Got effect name",effectname) + log.debug("Got effect name",effectname) effects[effectname](effectdata) end) diff --git a/gamemode/core/combat/cl_damage.lua b/gamemode/core/combat/cl_damage.lua index a45cb72..ed21b8a 100644 --- a/gamemode/core/combat/cl_damage.lua +++ b/gamemode/core/combat/cl_damage.lua @@ -3,7 +3,6 @@ local drawables = {} net.Receive("art_damage_ent",function() - --print("Notified of damage") local who = net.ReadEntity() local dmg = net.ReadDouble() diff --git a/gamemode/core/combat/cl_weaponswing.lua b/gamemode/core/combat/cl_weaponswing.lua index 7f2c927..61c31b0 100644 --- a/gamemode/core/combat/cl_weaponswing.lua +++ b/gamemode/core/combat/cl_weaponswing.lua @@ -6,7 +6,6 @@ function finddmgpoint(name) local filetext = file.Read(filepath,"DATA") local outfit = CompileString(string.format("return {%s}",filetext),name)() ball = LocalPlayer():FindPACPart(outfit, "wep_point") - print("point is",ball,type(ball)) end function finddmgbox(who,name) local filepath = string.format(CLIENT_PAC_DIR .. "/%s.txt",name) @@ -61,7 +60,6 @@ net.Receive("artery_doanimation",function() --pac.SetupENT(who) finddmgbox(who,pacname) animent = who - print("Doing animation:",animname,animtime,echoname) who:SetupBones() who:SetLuaAnimation(animname) stt.invopen = true @@ -71,7 +69,6 @@ net.Receive("artery_doanimation",function() timer.Simple(animtime,function() tracking = false stt.invopen = false - print("Stopping animation",animname) who:StopLuaAnimation(animname) net.Start("artery_notifyserverofswing") net.WriteString(wepname) @@ -99,10 +96,8 @@ local lastpos hook.Add("Tick","trace_weppos",function() if not IsValid(ball) or not IsValid(ball.Entity) then return end if lastpos == nil then lastpos = ball.Entity:GetPos() end - --print("Distance between ", ball.Entity:GetPos(), "and", lastpos, " is" ,ball.Entity:GetPos():Distance(lastpos)) - if --[[ball.Entity:GetPos():Distance(lastpos) > 0.5 and]] tracking then + if tracking then swingtbl[#swingtbl + 1] = ball.Entity:GetPos() - animent:GetPos() - --print(ball.Entity:GetPos() - animent:GetPos()) lastpos = ball.Entity:GetPos() end end) diff --git a/gamemode/core/database/sv_queries.lua b/gamemode/core/database/sv_queries.lua index 3c5f309..4d659b2 100644 --- a/gamemode/core/database/sv_queries.lua +++ b/gamemode/core/database/sv_queries.lua @@ -41,18 +41,12 @@ function q.deserialize_player(ply,str) log.error("Failed to deserialize player " .. ply:Nick() .. "\n" .. str) end local invs = tbl.inventories - print("Inventories was", invs) - PrintTable(invs) for k,v in pairs(invs) do - print("Giveing inventory",v[1],v[2]) track.GiveInventoryWithData(ply,v[1],v[2]) - print("Gave inventory ", v[1]) end ply.data.skills = tbl.skills or {} ply.data.quests = tbl.quests or {} ply.data.credits = tbl.credits or 100 - print("After deserializeing player, their .data is",ply.data) - PrintTable(ply.data) track.SendPlayerData(ply) end diff --git a/gamemode/core/database/sv_setup.lua b/gamemode/core/database/sv_setup.lua index 3fa1823..c98a8e4 100644 --- a/gamemode/core/database/sv_setup.lua +++ b/gamemode/core/database/sv_setup.lua @@ -58,19 +58,14 @@ function sql.GetPlayerData(ply) local s64 = ply:SteamID64() local q_str = q.s_fmt(fetch_player_query,s64) local q_suc = function(res,li) - print("Got player's data:",res,type(res)) if res == nil then - print("Was nil, createing player data") sql.CreatePlayerTable(ply) else - PrintTable(res) assert(#res == 1,"Not unique!") local meta = res[1].MetaData local plyd = res[1].PlayerData local mtbl = util.JSONToTable(meta) - print("About to check if we are on the right server") if mtbl.lastserver ~= game.GetIPAddress() then - print("Connecting player to ", mtbl.lastserver, " was on ", game.GetIPAddress()) --ply:ConCommand("connect " .. mtbl.lastserver) net.Start("art_sendtoserver") net.WriteString(mtbl.lastserver) @@ -106,14 +101,8 @@ function sql.CreatePlayerTable(ply) --print("steamid was", s64) local plytbl = data.newdata() local plymet = data.newmeta() - print("creating player, before uttj, plytbl is") - PrintTable(plytbl) local plydata =util.TableToJSON(plytbl) - print("after, plydata is") - print(plydata) local metdata = util.TableToJSON(plymet) - print("plydata", plydata) - print("metdata", metdata) local q_str = q.s_fmt(create_player_query,s64,plydata,metdata) local q_suc = function(res,li) --print("Inserted new player",ply) diff --git a/gamemode/core/inventory/sv_invtracker.lua b/gamemode/core/inventory/sv_invtracker.lua index 67e32a1..32388d7 100644 --- a/gamemode/core/inventory/sv_invtracker.lua +++ b/gamemode/core/inventory/sv_invtracker.lua @@ -77,14 +77,6 @@ net.Receive("art_RequestInvDrop",function(len,ply) local frominvid = net.ReadUInt(32) local frompos = net.ReadTable() assert(not froment:IsPlayer() or froment == ply, "Player tried to drop an item that was from another players inventory") - print("Using data for drop:") - PrintTable({ - ["froment"] = froment, - ["frominvid"] = frominvid, - ["frompos"] = frompos - }) - print("Player's data is:") - PrintTable(froment.data) local frominv = froment.data.inventories[frominvid] local item = frominv:Get(frompos) frominv:Remove(frompos) @@ -119,11 +111,8 @@ end --@tparam player ply The player we want to provide the updates to --@tparam number invid The inventory number on the player we want to provide the updates to function track.MakeInventoryObserver(ply,invid) - print("Making observer...") local observer = {} observer.Put = function(self,pos,item) - print("In observer, item was", item) - PrintTable(item) local name = item.Name local data = item:Serialize() net.Start("art_UpdateInventory") @@ -142,7 +131,6 @@ function track.MakeInventoryObserver(ply,invid) net.WriteTable(pos) net.Send(ply) end - print("Returning observer...") return observer end @@ -157,7 +145,6 @@ function track.NotifyPlayerOfInventory(ply,tinv) net.WriteString(tinv.Name) net.WriteUInt(#initaldat,32) net.WriteData(initaldat,#initaldat) - print("Before sending, inv owner is", tinv.Owner, "and type is",tinv.Name) net.WriteEntity(tinv.Owner) net.WriteTable({}) net.Send(ply) @@ -199,18 +186,12 @@ end --@tparam table|nil higharchy The spot in the higharchy to place the inventory. function track.GiveInventoryWithData(ply,name,data,higharchy) local hi = higharchy or {} - print("Giveing inventory with data") local i = inv.CreateInventoryFromData(name,data,ply) - print("Created inventory track",ply,ply.data,ply.data.inventories) local nid = #ply.data.inventories + 1 - print("got nid") local observer = track.MakeInventoryObserver(ply,nid) - print("Made observer for", i) i.id = nid i:AddObserver(observer) - print("Added observer") ply.data.inventories[nid] = i - print("About to tell client to observe") net.Start("art_ObserveInventory") net.WriteUInt(nid,32) net.WriteString(name) @@ -218,11 +199,7 @@ function track.GiveInventoryWithData(ply,name,data,higharchy) net.WriteData(data,#data) net.WriteEntity(ply) net.WriteTable(hi) - print("About to send...") net.Send(ply) - - print("Finished giving inventory with data, ply.data is now ", ply.data) - PrintTable(ply.data) end @@ -249,14 +226,9 @@ end --@tparam table tbl The position the item is in (returned by plymeta:HasItem()) --@treturn itemtbl The item that was removed function plymeta:RemoveItem(tbl) - print("Got remove table, it was",tbl) - PrintTable(tbl) local nid = tbl[1] local pos = tbl[2] - print("Self inventory was") - PrintTable(self.data.inventories[nid]) local item = self.data.inventories[nid]:Remove(pos) - print("sv_invtracker's item was", item) return item end @@ -275,7 +247,6 @@ function plymeta:GiveItem(tbl) log.debug("inventory " .. k .. " couldn't fit it...") end end - PrintTable(tbl) error("Unable to find place to put item") end @@ -288,7 +259,6 @@ end ---Sets a player's credits. -- To be depriciated function plymeta:SetCredits(num) - print("Set credits called") self.data.credits = num net.Start("art_load_player_data") net.WriteTable({ 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) |
