From 81d3d4eb333e226432a591461b84ed12f5ac9a3f Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 21 Jul 2018 19:08:34 -0400 Subject: Various updates * Animation api now allows sequences to be played * items now have a .inv attribute that is set when they are added to shaped or equipment inventories * Refactored the way skill inventory is structured * Added some more methods to cl_common to move items around on a player * Minor update to nrequire to display purple message when asked to include a file that dosn't exist. --- gamemode/core/pac/cl_pac.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gamemode/core/pac/cl_pac.lua') diff --git a/gamemode/core/pac/cl_pac.lua b/gamemode/core/pac/cl_pac.lua index 477d65d..69e993a 100644 --- a/gamemode/core/pac/cl_pac.lua +++ b/gamemode/core/pac/cl_pac.lua @@ -1,4 +1,5 @@ +local log = nrequire("log.lua") --As soon as the client connects, request the names of all the pac's on the server --If the player dosen't have PAC3 installed, then overwrite all pac-related network events to display an error. @@ -42,12 +43,12 @@ local function loadpac(ent,name,hash) return end end - if filetext and (tonumber(util.CRC(filetext)) == hash) then + if filetext and tonumber(util.CRC(filetext)) then print("The file on our local system is up to date, applying!") local pactbl = CompileString(string.format("return {%s}",filetext),name)() ent:AttachPACPart(pactbl) else--Cache is old, download the new pac! - print("The file on our local system was out of date! Downloading...") + log.debug(string.format("File out of date (%d vs %d) Re-downloading...", filetext and tonumber(util.CRC(filetext)) or 0 , hash)) net.Start("artery_requestpac") net.WriteString(name) net.SendToServer() @@ -68,7 +69,8 @@ end net.Receive("artery_downloadpac",function() local pac_name = net.ReadString() local pac_txt = net.ReadString() - --local pac_hash = net.ReadUInt(32) + local pac_hash = net.ReadUInt(32) + log.debug(string.format("Received file %s with hash %d", pac_name, pac_hash)) local filepath = string.format(CLIENT_PAC_DIR .. "/%s.txt",pac_name) file.Write(filepath,pac_txt) end) -- cgit v1.2.3-70-g09d2