aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/pac/cl_pac.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-07-21 19:08:34 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2018-07-21 19:08:34 -0400
commit81d3d4eb333e226432a591461b84ed12f5ac9a3f (patch)
treed802983c3caf6683f1fd8eb881c7df65afa0d27b /gamemode/core/pac/cl_pac.lua
parentbfdf805676684a838dde5d4cdeb3d8c972d5003d (diff)
downloadartery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.tar.gz
artery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.tar.bz2
artery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.zip
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.
Diffstat (limited to 'gamemode/core/pac/cl_pac.lua')
-rw-r--r--gamemode/core/pac/cl_pac.lua8
1 files changed, 5 insertions, 3 deletions
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)