aboutsummaryrefslogtreecommitdiff
path: root/gamemode/nrequire.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/nrequire.lua')
-rw-r--r--gamemode/nrequire.lua32
1 files changed, 18 insertions, 14 deletions
diff --git a/gamemode/nrequire.lua b/gamemode/nrequire.lua
index 7be9772..1b6be2f 100644
--- a/gamemode/nrequire.lua
+++ b/gamemode/nrequire.lua
@@ -14,6 +14,24 @@ local searchpaths = {
{"data/artery/global","GAME"},
}
+if SERVER then
+ --Network messages
+ util.AddNetworkString("artery_downloadfile")
+ util.AddNetworkString("art_downloadfiles")
+ util.AddNetworkString("art_requestfile")
+ util.AddNetworkString("art_respondfile")
+ util.AddNetworkString("artery_request_client_download")
+ --[[Server tells the client to load a file]]
+ util.AddNetworkString("artery_loadfile")
+ --[[Client tells server we don't have that file]]
+ util.AddNetworkString("artery_requestcsfile")
+ --[[Server gives client the contents of a file]]
+ util.AddNetworkString("artery_respondfile")
+ util.AddNetworkString("art_requestclientreload")
+ util.AddNetworkString("art_refresh")
+ util.AddNetworkString("art_manualrefresh")
+end
+
--dir is a table of {string_path, string_directory}
local function TraverseFolder(dir,func)
local find_path = table.concat({dir[1],"/*"},"")
@@ -184,12 +202,6 @@ function nrequire(req,...)
end
if SERVER then
- --[[Server tells the client to load a file]]
- util.AddNetworkString("artery_loadfile")
- --[[Client tells server we don't have that file]]
- util.AddNetworkString("artery_requestcsfile")
- --[[Server gives client the contents of a file]]
- util.AddNetworkString("artery_respondfile")
net.Receive("artery_requestcsfile",function(ln,ply)
local which = net.ReadString()
local path = net.ReadString()
@@ -331,11 +343,6 @@ if SERVER then
end
local runclient = nil
if SERVER then
- util.AddNetworkString("artery_downloadfile")
- util.AddNetworkString("art_downloadfiles")
- util.AddNetworkString("art_requestfile")
- util.AddNetworkString("art_respondfile")
- util.AddNetworkString("artery_request_client_download")
local function downloadclient(who)
print("Loading client",who)
net.Start("art_downloadfiles")
@@ -461,7 +468,6 @@ if SERVER then
end
if SERVER then
- util.AddNetworkString("art_requestclientreload")
net.Receive("art_requestclientreload",function(ln,pl)
loadclient(pl)
end)
@@ -485,7 +491,6 @@ else
end
if SERVER then
- util.AddNetworkString("art_refresh")
concommand.Add("art_refresh",function(ply,cmd,args)
print("Doing soft refresh")
doincludes()
@@ -497,7 +502,6 @@ else
end
if SERVER then
- util.AddNetworkString("art_manualrefresh")
concommand.Add("art_manualrefresh",function(ply,cmd,args)
if not ply:IsAdmin() then return end
reqtbl = {}