diff options
27 files changed, 24 insertions, 264 deletions
diff --git a/entities/entities/art_chest/cl_init.lua b/entities/entities/art_chest/cl_init.lua index 41a98d9..e7357ea 100644 --- a/entities/entities/art_chest/cl_init.lua +++ b/entities/entities/art_chest/cl_init.lua @@ -23,7 +23,6 @@ local namecache = {} net.Receive("openchestinv",function(len,ply) if oldpanel ~= nil then oldpanel:Remove() end - print("Opening chest inventory") local what = net.ReadEntity() local chest = invfuncs.DeSerializeBackpack() ShowInventory() @@ -46,7 +45,6 @@ net.Receive("openchestinv",function(len,ply) local invpanel = dat.panel invpanel:SetPos( width - (width / 4), 0 ) invpanel:SetSize( width / 4, height ) - print("Trying to get name",name) if namecache[what] == nil then net.Start("requestchestname") net.WriteEntity(what) diff --git a/entities/entities/art_chest/init.lua b/entities/entities/art_chest/init.lua index fb0fef5..60f82c8 100644 --- a/entities/entities/art_chest/init.lua +++ b/entities/entities/art_chest/init.lua @@ -25,7 +25,6 @@ function ENT:Initialize() myinv.Owner = self timer.Simple(0, function() - print("Chest has creation id", self:GetCreationID()) myinv.id = self:GetCreationID() self.data.inventories[myinv.id] = myinv end) --Wait until the entity is initalized @@ -41,7 +40,6 @@ end net.Receive("closechestinv", function(ln, ply) local chest = net.ReadEntity() - print("closeing chest of ", ply, chest) local obsid = chest.Observers[ply] chest.data.inventories[chest:GetCreationID()]:RemoveObserver(obsid) chest.Observers[ply] = nil @@ -49,7 +47,6 @@ end) --NOTE:Why is it important to allow a table to this argument? function ENT:SendInventory(towho) - print("Sending inventory to ", towho) local observer = track.MakeInventoryObserver(towho, self:GetCreationID()) local obsid = self.data.inventories[self:GetCreationID()]:AddObserver(observer) self.Observers[towho] = obsid @@ -57,6 +54,5 @@ function ENT:SendInventory(towho) end function ENT:Use(ply) - print("Ply opened:", ply) self:SendInventory(ply) end diff --git a/entities/entities/art_droppeditem/cl_init.lua b/entities/entities/art_droppeditem/cl_init.lua index eaea39b..3cf68e8 100644 --- a/entities/entities/art_droppeditem/cl_init.lua +++ b/entities/entities/art_droppeditem/cl_init.lua @@ -24,7 +24,6 @@ hook.Add("Tick","pickupitemstick",function() for k,v in pairs(ae) do local ei = v:EntIndex() if (not sentrequests[ei]) and v.GetClass and v:GetClass() == "art_droppeditem" then - print("Sending request to pick up", ei) net.Start("art_requestpickup") net.WriteUInt(ei,16) net.SendToServer() @@ -38,11 +37,9 @@ end) net.Receive("art_informmodel",function() - print("Player received model information") local ei = net.ReadUInt(16) local m = net.ReadString() local e = Entity(ei) - print(m) e:SetModel(m) e.newmodel = m end) diff --git a/entities/entities/art_droppeditem/init.lua b/entities/entities/art_droppeditem/init.lua index 1ebb9c8..b9d5ec8 100644 --- a/entities/entities/art_droppeditem/init.lua +++ b/entities/entities/art_droppeditem/init.lua @@ -16,24 +16,11 @@ function ENT:Initialize() self.ItemName = self.Item.Name self.ItemData = self.Item.Data local phoney = itm.GetItemFromData(self.ItemName,self.ItemData) - print("About to check for onDropped",phoney,phoney.onDropped) - PrintTable(phoney) if phoney.onDropped ~= nil then timer.Simple(1,function() --Can't be 0, because pac needs to know about the entity phoney:onDropped(self) - print("After doing phoney's ondropped, model is",self:GetModel()) - print("After ondropped, angles are",self:GetAngles(),"and color is", self:GetColor()) - --self:SetColor(Color(0,0,0,0)) end) - -- print("Item had onDropped") - -- self:SetColor(Color(0,0,0,0)) - -- timer.Simple(0,function() - -- if self and self.Item then - -- self.Item:onDropped(self) - -- end - -- end) end - print("Dropped item spawned at", self:GetPos()) self:DrawShadow(false) self:SetMoveType(MOVETYPE_NONE) self:SetSolid(SOLID_NONE) @@ -42,7 +29,6 @@ end --A client is near enough to draw the item, tell them what to draw. net.Receive("art_requestmodel",function(len,pl) - print(pl," requested a model") local ei = net.ReadUInt(16) local e = Entity(ei) assert(e.Model ~= nil,"Attempted to request model for non-art_droppeditem entity") @@ -55,44 +41,20 @@ end) net.Receive("art_requestpickup",function(len,pl) local ei = net.ReadUInt(16) local e = Entity(ei) - print("Got request to pick up", e) local ep = e:GetPos() - print("got ep pos") local plp = pl:GetPos() - print("got pl pos") local d = ep:Distance(plp) - print("Got distance") - if d < 30 then - print("Inside if statement") + if d < 100 then local i = itm.GetItemFromData(e.ItemName, e.ItemData) - print("Created item") xpcall(function() pl:GiveItem(i) e:Remove() end,function() - print("Unable to put item into player's inventory") --We couldn't put the item in the player's inventory! --Don't do anything I guess end) - else - print("Player not close enough!") end end) function ENT:Use(activator, caller, usetype) - print("a",activator,"c",caller,"u",usetype) end - -print("Remove the concommand in art_droppeditem/init.lua") -concommand.Add("dropmellon",function(ply,cmd,args) - if not ply:IsAdmin() then return end - local e = ents.Create("art_droppeditem") - e.Model = "models/props_junk/Rock001a.mdl" - e.Item = itm.GetItemByName("Watermelon") - local hitpos = ply:GetEyeTrace().HitPos + Vector(0,0,10) - print("Traceresult was") - PrintTable(ply:GetEyeTrace()) - print("Hitpos was", hitpos) - e:SetPos(hitpos) - e:Spawn() -end) diff --git a/entities/entities/art_lootchest/init.lua b/entities/entities/art_lootchest/init.lua index 4e6dd52..37d7006 100644 --- a/entities/entities/art_lootchest/init.lua +++ b/entities/entities/art_lootchest/init.lua @@ -3,6 +3,7 @@ AddCSLuaFile( "shared.lua" ) include("shared.lua") +--TODO:Finish the loot chest function CreateRandomLoot(time) end diff --git a/entities/entities/info_huntablespawn/init.lua b/entities/entities/info_huntablespawn/init.lua index 709c019..9fa7f7e 100644 --- a/entities/entities/info_huntablespawn/init.lua +++ b/entities/entities/info_huntablespawn/init.lua @@ -1,7 +1,6 @@ --[[ This entity gives townies things to do ]] -print("hello test") AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) diff --git a/entities/entities/info_townienode/shared.lua b/entities/entities/info_townienode/shared.lua index fe72ac8..4b52977 100644 --- a/entities/entities/info_townienode/shared.lua +++ b/entities/entities/info_townienode/shared.lua @@ -2,6 +2,6 @@ ENT.Base = "base_entity" function ENT:DoActivity(npc) if not self.onActivity() then - print("Node without activity, this might be an error!") + error("Node without activity, this might be an error!") end end diff --git a/entities/entities/npc_huntable/init.lua b/entities/entities/npc_huntable/init.lua index f1e7ac2..d6df045 100644 --- a/entities/entities/npc_huntable/init.lua +++ b/entities/entities/npc_huntable/init.lua @@ -4,12 +4,8 @@ include("shared.lua") local applyfields = {"Model", "Stats"} function ENT:Initialize() - --print("NPC spawned!") - --self:SetMoveType(MOVETYPE_STEP) - --self:SetSolid(SOLID_OBB) self:SetCollisionGroup(COLLISION_GROUP_PUSHAWAY ) - --self:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE) for _, v in pairs(applyfields) do assert(self[v], "NPC created without " .. v .. " this might be a bug!") end @@ -19,7 +15,7 @@ function ENT:Initialize() if (self.Stats["Vitality"]) then self:SetHealth(self.Stats["Vitality"]) else - print("NPC created with no stat for vitality, this might be a bug!") + error("NPC created with no stat for vitality, this might be a bug!") end if (self.Stats["Accel"]) then @@ -44,7 +40,6 @@ function ENT:Initialize() end function ENT:OnInjured(dmg) - print("Ent OnInjured fired! dmg was", dmg) if self.OnDammage ~= nil then self:OnDammage(dmg) end @@ -53,22 +48,6 @@ end function ENT:OnKilled(dmg) if (CLIENT) then return end if not self.Drops then return end - --print("Looks like we have some drops") - --error("You need to code how item drops work!") - --local itemstodrop = {} - - -- for k, v in pairs(self.Drops) do - -- local rng = math.random(0, 100) - -- local itemname = self.Drops[k][1] - -- local itemchance = self.Drops[k][2] - -- local heightoffset = 10 - -- - -- if rng < itemchance then - -- --local drop = ART.GetItemByName(itemname) - -- --print("Createing a drop of",drop) - -- --ART.CreateDroppedItem(drop, self:GetPos()) - -- end - -- end self:BecomeRagdoll(dmg) end diff --git a/entities/entities/npc_huntable/shared.lua b/entities/entities/npc_huntable/shared.lua index 619e2b4..01abfe8 100644 --- a/entities/entities/npc_huntable/shared.lua +++ b/entities/entities/npc_huntable/shared.lua @@ -17,7 +17,6 @@ end function ENT:DefaultBehaviour() - print("In default behavior") self.lastrun = CurTime() --Set some stuff up for navigation @@ -27,12 +26,10 @@ function ENT:DefaultBehaviour() local delta = CurTime() - self.lastrun self:AI(delta) while (true) do - --print("Inside defaultbehaviour") --Sets all the values needed for the rest of this function to do it's thing --Main loop for ai - --print("Going into behavior for " .. self.Name) --Update aware enemies delta = CurTime() - self.lastrun if delta > 0.1 then @@ -40,7 +37,7 @@ function ENT:DefaultBehaviour() end if self.TargetPos ~= nil then - if ( !path:IsValid() ) then print("Path wasn't valid!") end + if ( !path:IsValid() ) then --[[path wasn't valid]] end if ( path:GetAge() > 0.1 ) then -- Since we are following the player we have to constantly repath path:Compute( self, self.TargetPos ) -- Compute the path towards the enemy's position again path:Update( self ) -- This function moves the bot along the path @@ -65,7 +62,6 @@ end function ENT:AI(num) - --print("Inside behaveupdate") local players = player.GetAll() for k, v in pairs(players) do @@ -82,11 +78,6 @@ function ENT:AI(num) for k, v in pairs(self.AwareEnemies) do local priority = self:AttackPriority(v) - if (priority == nil) then - --print("Nill priority hit after ") - --PrintTable(self) - end - if (priority > maxpriority) then maxpriority = priority maxprioritytarget = v @@ -94,16 +85,12 @@ function ENT:AI(num) end self.Target = maxprioritytarget - --print("My target is",self.Target) --If we can't find anyone to attack, just stay idle if (self.Target == nil) then - --print("Couldn't find anyone to attack!") --Play an idle sequence local randanim = math.Round(math.Rand(0, #self.IdleSequences)) - --print("Playing sequence",self.IdleSequences[randanim]) self:PlaySequenceAndWait(self.IdleSequences[randanim]) self:StartActivity(ACT_IDLE) - --print("Acting idle") --If there's noone within 4000 units, just remove ourselves to save server resources local closest = 5000 @@ -116,7 +103,6 @@ function ENT:AI(num) end if (closest > 4000) then - --print("Closes player is " .. closest .. " removeing self...") self:BecomeRagdoll(DamageInfo()) end else @@ -148,30 +134,18 @@ function ENT:AI(num) end end - --[[ - print("Before running, behavethread was", self.BehaveThread) - local ok, message = coroutine.resume( self.BehaveThread ) - if not ok then - self.BehaveThread = nil - Msg( self, "error: ", message, "\n" ); - end - ]] - if (self.Act) then self:Act(num) else - print("NPC spawned without an Act function, this might be an error!") + error("NPC spawned without an Act function, this might be an error!") end end function ENT:RunBehaviour() - print("Running behavior") if (self.Behave) then - print("Doing self.behave") self:Behave() else - print("Doing default behavior") self:DefaultBehaviour() end end diff --git a/entities/entities/npc_shop/init.lua b/entities/entities/npc_shop/init.lua index 022f80e..deedddf 100644 --- a/entities/entities/npc_shop/init.lua +++ b/entities/entities/npc_shop/init.lua @@ -16,17 +16,16 @@ function ENT:Initialize() self:SetSolid(SOLID_BBOX ) self:SetCollisionGroup(COLLISION_GROUP_NPC ) - print("Initalizeing shop npc") if self.Model then self:SetModel(self.Model) - else print("NPC created without model, this might be a bug!") end + else error("NPC created without model, this might be a bug!") end if self.Pos then self:SetPos(self.Pos) - else print("NPC created without a position, this might be a bug!") end + else error("NPC created without a position, this might be a bug!") end self.talking = false if self.Name then self:SetName(self.Name) - else print("NPC created without a name! They won't be able to open doors!") end + else error("NPC created without a name! They won't be able to open doors!") end if self.OnSpawn then self.OnSpawn(self) end @@ -34,8 +33,6 @@ function ENT:Initialize() end function ENT:Use(ply) - print("In shop npc, shop is", shop) - PrintTable(shop) --TODO:Fix shop shop.OpenShop(self.shopitems,ply) end diff --git a/entities/entities/npc_townie/init.lua b/entities/entities/npc_townie/init.lua index 00eaa63..7adc571 100644 --- a/entities/entities/npc_townie/init.lua +++ b/entities/entities/npc_townie/init.lua @@ -9,7 +9,6 @@ util.AddNetworkString( "closenpcdialog" ) util.AddNetworkString( "updatenpcdialog") function ENT:Initialize() - --print("NPC spawned!") --self:SetMoveType(MOVETYPE_VPHYSICS) self:SetSolid(SOLID_BBOX ) self:SetCollisionGroup(COLLISION_GROUP_NPC ) @@ -28,15 +27,15 @@ function ENT:Initialize() self.lastdooropen = CurTime() if self.Model then self:SetModel(self.Model) - else print("NPC created without model, this might be a bug!") end + else error("NPC created without model, this might be a bug!") end if self.Pos then self:SetPos(self.Pos) - else print("NPC created without a position, this might be a bug!") end + else error("NPC created without a position, this might be a bug!") end self.talking = false if self.Name then self:SetName(self.Name) - else print("NPC created without a name! They won't be able to open doors!") end + else error("NPC created without a name! They won't be able to open doors!") end if self.Ang then self:SetAngles(self.Ang) end @@ -77,7 +76,7 @@ function ENT:BehaveUpdate(num) self.nodereached = true else if self.curnode.IsDone(self) then - print("Finished action") + error("Finished action") self.curnode = self:selectNewNode() self.nodereached = false end @@ -91,9 +90,7 @@ function ENT:BehaveUpdate(num) } local tr = util.TraceLine(trdata) local ecl - --print("tr",tr,"tr.entity",tr.Entity) if (tr ~= nil) and (tr.Entity ~= nil) and tr.Entity:IsValid() then - --print("Not returning") ecl = tr.Entity:GetClass() end if tr.Hit and removeblock[ecl] ~= nil then @@ -109,7 +106,6 @@ end function ENT:OnKilled(dmg) if not self.Drops then return end - --print("Looks like we have some drops") for k,v in pairs(self.Drops) do local rng = math.random(0,100) local itemname = self.Drops[k][1] diff --git a/entities/entities/npc_townie/shared.lua b/entities/entities/npc_townie/shared.lua index 4962681..80b9cbc 100644 --- a/entities/entities/npc_townie/shared.lua +++ b/entities/entities/npc_townie/shared.lua @@ -7,7 +7,7 @@ function ENT:BehaveAct() if self.Act then self:Act() else - print("NPC spawned without an Act function, this might be an error!") + error("NPC spawned without an Act function, this might be an error!") end end @@ -16,7 +16,6 @@ function ENT:Use() end function ENT:OnStuck() - print("I'm stuck!") self.curnode = self:selectNewNode() self.nodereached = false end @@ -33,7 +32,6 @@ end function ENT:RunBehaviour() while true do - --print("In runbehaviour") local opts = { lookahead = 50, tolerance = 20, draw = false, @@ -43,7 +41,6 @@ function ENT:RunBehaviour() self.curnode = self:selectNewNode() end if self.curnode == nil then - print("Townie could not find any nodes!") while true do coroutine.yield() end @@ -52,7 +49,6 @@ function ENT:RunBehaviour() self:MoveToPos( self.curnode:GetPos(), opts ) self:StartActivity(ACT_WALK ) end - --print("Called movetopos") coroutine.yield() end end @@ -67,9 +63,7 @@ function SendableDialog(tbl) end net.Receive("closenpcdialog",function(len,ply) - print("player closed dialog1") local npc = net.ReadEntity() - print("player closed dialog") npc.DialogCursors[ply] = nil if next(npc.DialogCursors) == nil and npc.loco:GetMaxYawRate() == 0 and diff --git a/entities/weapons/hands.lua b/entities/weapons/hands.lua index 57c56d9..8d97ab7 100644 --- a/entities/weapons/hands.lua +++ b/entities/weapons/hands.lua @@ -62,8 +62,6 @@ function SWEP:Tick() local targetang = self.Owner:EyeAngles() + self.PickupAngles local angvel = self.Pickup:GetAngles() - targetang local deltaang = self.Pickup:GetPhysicsObject():GetAngleVelocity() - angvel:Forward() - print("target",targetang,"vel",angvel,"delta",deltaang) - print("Cur is", self.Pickup:GetPhysicsObject():GetAngleVelocity()) self.Pickup:GetPhysicsObject():AddAngleVelocity(angvel:Forward()) end end diff --git a/gamemode/client/cl_inventory.lua b/gamemode/client/cl_inventory.lua index 105f1b3..838cdfb 100644 --- a/gamemode/client/cl_inventory.lua +++ b/gamemode/client/cl_inventory.lua @@ -15,15 +15,11 @@ local itm = nrequire("core/inventory/common/items.lua") --local qpray = nrequire("cl_qprayers.lua") local inv = {} ---print("Hello from cl_inventory.lua") ---debug.Trace() - local prayerequiped = { false,false,false,false,false } net.Receive("equiphelpprayer",function() - --print("equiphelp received client side!") prayerequiped[4] = "Noob Help" end) @@ -67,7 +63,7 @@ end local function BuildInventory() if qframe and IsValid(qframe) then return end - if not player_data then print("no player data!") player_data = {credits = 0} end + if not player_data then error("no player data!") player_data = {credits = 0} end qframe = vgui.Create("DFrame") qframe:SetPos(0,0) qframe:SetSize(width / 4, height) @@ -104,7 +100,6 @@ end ---Shows the player's inventory. -- If the player's inventory hasn't been built yet, builds the inventory, then displays it. function inv.ShowInventory() - --print("qframe is ", qframe) if not qframe then BuildInventory() else qframe:Show() end state.invopen = true 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) diff --git a/gamemode/inventorysystem/cl_common.lua b/gamemode/inventorysystem/cl_common.lua index 505c5d9..559c8f0 100644 --- a/gamemode/inventorysystem/cl_common.lua +++ b/gamemode/inventorysystem/cl_common.lua @@ -27,21 +27,6 @@ function com.generatereceiver() local fromid,toid = panels[1].info.id,self.info.id local frompos,topos = panels[1].info.pos,self.info.pos local frominv,toinv = panels[1].info.inv,self.info.inv - print("Something was dropped on:",x,y) - PrintTable(panels) - print("self is", self) - print("self.info is", self.info) - PrintTable(self.info) - print("froment:",froment) - print("toent:",toent) - print("fromid",fromid) - print("toid",toid) - print("frompos:",frompos) - PrintTable(panels[1].info.pos) - print("topos:",topos) - PrintTable(self.info.pos) - print("frominv",frominv) - print("toinv",toinv) --Do nothing if we don't actually want to move anything anywhere local posequal = true @@ -57,12 +42,10 @@ function com.generatereceiver() if posequal then return end local item = frominv:Get(frompos) - print("item was", item) --Fake remove the item, in case the position we want to move it to overlaps with where it is now. frominv:Remove(frompos) local cf = toinv:CanFitIn(topos,item) frominv:Put(frompos,item) - print("canfit was:",cf) if cf == true then --Send the request net.Start("art_RequestInvMove") diff --git a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua index dde523f..d74b629 100644 --- a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua +++ b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua @@ -46,7 +46,6 @@ end --Draw the item in a position local function drawitemat(self,x,y,item) - print("Drawing item at ",x,y) local tp = self.gridpanels[x][y] if tp == nil then error("Unable to continue, could not find item at (" .. x .. "," .. y .. ")") @@ -67,7 +66,6 @@ local function drawitemat(self,x,y,item) end end if item.DoOnPanel then - print("Calling cl_shaped's DoOnPanel") item:DoOnPanel(tp) end if item.Paint then @@ -139,11 +137,9 @@ inv.DrawOnDPanel = function(self,panel) local observer = {} observer.Put = function(obs,position,item) - print("observer's put was called") drawitemat(self,position[1],position[2],item) end observer.Remove = function(obs,position) - print("observer's remove was called") undrawitemat(self,position[1],position[2]) end return observer diff --git a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua index e9b2e91..5de6272 100644 --- a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua +++ b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua @@ -21,7 +21,6 @@ local function canfitin(self,arow,acol,shape) for rn,row in ipairs(shape) do for cn,col in ipairs(row) do local absrow,abscol = arow + rn - 1, acol + cn - 1 - print("absrow was",absrow,"abscol was",abscol) local slot = calcposition(self.width,self.height,absrow,abscol) if col and ((self.tracker[slot] ~= nil) or (absrow > self.width) or (abscol > self.height)) then return false @@ -53,7 +52,6 @@ function inv:CanFitIn(tbl,item) end function inv:Put(tbl,item) - print("Calling put") --Set the item's shape to true for rn,row in ipairs(item.Shape) do @@ -66,9 +64,7 @@ function inv:Put(tbl,item) end --Now set the item in the correct slot - print("Put item at ",tbl[1],tbl[2]) local slot = calcposition(self.width,self.height,tbl[1],tbl[2]) - print("Slot is",slot) self.tracker[slot] = item end @@ -81,10 +77,8 @@ function inv:Has(ptr) end for k,v in pairs(self.tracker) do if type(v) == "table" and compare_func(v) then - print("Found item in spot:",k) local row = math.ceil(k / self.width) local col = ((k - 1) % self.width) + 1 - print("Has is retuning",row,col) return {row,col} end end @@ -93,7 +87,6 @@ end function inv:Remove(tbl) local slot = calcposition(self.width,self.height,tbl[1],tbl[2]) - print("Slot is",slot) local item = self.tracker[slot] self.tracker[slot] = nil for rn,row in ipairs(item.Shape) do @@ -104,7 +97,6 @@ function inv:Remove(tbl) end end end - print("shaped is returning",item) return item end @@ -127,19 +119,13 @@ function inv:Serialize() end function inv:DeSerialize(str) - print("Deserialize str is", str) local ret = table.Copy(self) local tbl = util.JSONToTable(str) - print("unjsoned is",tbl,type(tbl)) - PrintTable(tbl) for k,v in pairs(tbl) do local name = k local pos = v[1] local data = v[2] local item = itm.GetItemFromData(name,data) - print("Got item",item) - PrintTable(item) - print("got pos",pos) ret:Put(pos,item) --ret.tracker[pos] = itm.GetItemFromData(name,data) end diff --git a/gamemode/inventorysystem/skills/cl_skills.lua b/gamemode/inventorysystem/skills/cl_skills.lua index fed0f46..d0a5421 100644 --- a/gamemode/inventorysystem/skills/cl_skills.lua +++ b/gamemode/inventorysystem/skills/cl_skills.lua @@ -16,17 +16,12 @@ local levelfunc = function(val) end local set_xp_of = function(name,ammt) - print("setting xp of", name," to ", ammt) local lvl,frac = levelfunc(ammt) elements[name].label:SetText(string.format("%s : %d (%2.5f%%)",name,lvl,frac)) elements[name].bar:SetFraction(frac) end inv.DrawOnDPanel = function(self,panel) - print("Drawing skills on panel") - PrintTable(sc.SkillList()) - print("with") - PrintTable(self.skills) local sheet = vgui.Create( "DColumnSheet", panel ) sheet:Dock( FILL ) @@ -59,14 +54,10 @@ inv.DrawOnDPanel = function(self,panel) local prox = {} prox.Put = function(s,position,item) - print("Calling inventory's put") - print("At time of call, skill was") - PrintTable(self) set_xp_of(position[1],self.skills[position[1]] or item.ammt)--Observer might be called before our put() end prox.Remove = function(s,position) - print("Calling inventory's remove") set_xp_of(position[1],self.skills[position[1]] or itm.ammt) end diff --git a/gamemode/inventorysystem/skills/sh_skillcommon.lua b/gamemode/inventorysystem/skills/sh_skillcommon.lua index fd05eaa..9640421 100644 --- a/gamemode/inventorysystem/skills/sh_skillcommon.lua +++ b/gamemode/inventorysystem/skills/sh_skillcommon.lua @@ -39,8 +39,6 @@ local lib = {} local skills = {} --Skillname is a table of {string_group,string_name} function lib.RegisterSkill(skillname) - print("funcs.RegisterSkill called with") - PrintTable(skillname) local group,name = skillname[1],skillname[2] if not skills[group] then skills[group] = {} @@ -57,8 +55,6 @@ function lib.RegisterSkill(skillname) else skills[group][#skills[group] + 1] = name end - print("After registering skill, skills is") - PrintTable(skills) end function lib.SkillList() diff --git a/gamemode/inventorysystem/skills/sh_skills.lua b/gamemode/inventorysystem/skills/sh_skills.lua index 9b6edd5..a1c878f 100644 --- a/gamemode/inventorysystem/skills/sh_skills.lua +++ b/gamemode/inventorysystem/skills/sh_skills.lua @@ -81,12 +81,9 @@ inv.skills = {} local function calculate_skills() for k,v in pairs(sc.SkillList()) do for i,j in pairs(v) do - print("settings inv's skills' ", j, " to 0") inv.skills[j] = 0 end end - print("After calculating skills, inv was") - PrintTable(inv) end calculate_skills() @@ -99,15 +96,9 @@ item should be } ]] inv.FindPlaceFor = function(self, item) - print("finding place for ") - PrintTable(item) if not item.isskill then return nil end - print("Skill inventory trying to find place for, looking in ") - PrintTable(inv.skills) - print("for") - print(item.name) if inv.skills[item.name] then return {item.name} else @@ -120,8 +111,6 @@ inv.CanFitIn = function(self,position,item) end inv.Put = function(self,position,item) - print("item is") - PrintTable(item) self.skills[position[1]] = (self.skills[position[1]] or 0) + item.ammt end @@ -155,17 +144,11 @@ inv.DeSerialize = function(self,data) return table.Copy(inv) end calculate_skills() - print("At the time we deserialized, sc.skilllist was") - PrintTable(sc.SkillList()) - print("Before making a copy of, inv is") - PrintTable(inv) local cpy = table.Copy(self) local gen = util.JSONToTable(data) for k,v in pairs(gen) do cpy.skills[k] = v end - print("AFter deserializing inventory, it is") - PrintTable(cpy) return cpy end |
