From 4e0c68b88a0c6170258d7e09d224459c3b1ddcc9 Mon Sep 17 00:00:00 2001 From: cib Date: Tue, 11 Jun 2013 20:07:47 +0200 Subject: [PATCH 1/2] Added a configuration option that allows putting the .rsc on external servers. --- code/controllers/configuration.dm | 4 ++++ code/modules/client/client defines.dm | 2 ++ code/modules/client/client procs.dm | 6 +++++- config/config.txt | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 02f8c521aa6..58dc3affe2a 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -40,6 +40,7 @@ var/Ticklag = 0.9 var/Tickcomp = 0 var/socket_talk = 0 // use socket_talk to communicate with other processes + var/list/resource_urls = null var/list/mode_names = list() var/list/modes = list() // allowed modes @@ -164,6 +165,9 @@ if(type == "config") switch (name) + if ("resource_urls") + config.resource_urls = stringsplit(value, " ") + if ("admin_legacy_system") config.admin_legacy_system = 1 diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index d93dbd6f595..c85ee0159c6 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -39,3 +39,5 @@ var/player_age = "Requires database" //So admins know why it isn't working - Used to determine how old the account is - in days. var/related_accounts_ip = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this ip var/related_accounts_cid = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this computer id + + preload_rsc = 0 // This is 0 so we can set it to an URL once the player logs in and have them download the resources from a different server. diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 16b0fbea6cb..d665fab4e5a 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -103,6 +103,10 @@ del(src) return + // Change the way they should download resources. + if(config.resource_urls) src.preload_rsc = pick(config.resource_urls) + else src.preload_rsc = 1 // If config.resource_urls is not set, preload like normal. + clients += src directory[ckey] = src @@ -278,4 +282,4 @@ 'icons/xenoarch_icons/chart2.jpg', 'icons/xenoarch_icons/chart3.jpg', 'icons/xenoarch_icons/chart4.jpg' - ) \ No newline at end of file + ) diff --git a/config/config.txt b/config/config.txt index a98daab8423..e5bccd964c5 100644 --- a/config/config.txt +++ b/config/config.txt @@ -213,3 +213,7 @@ ALIEN_PLAYER_RATIO 0.2 ##Remove the # to let ghosts spin chairs #GHOST_INTERACTION + +## Uncomment this to enable external .rsc downloads. URLs must be separated by no more than one space. +## The linked .zip file should contain the required .rsc +#resource_urls http://firstserver.org/myresource.zip http://secondserver.org/myresource.zip http://10.22.11.1/myresource.zip From 13b16bcd699b312d2131679429400762242a4362 Mon Sep 17 00:00:00 2001 From: cib Date: Tue, 11 Jun 2013 20:53:29 +0200 Subject: [PATCH 2/2] Added extra message when downloading external resources. --- code/modules/client/client procs.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index d665fab4e5a..b74355c2713 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -104,8 +104,12 @@ return // Change the way they should download resources. - if(config.resource_urls) src.preload_rsc = pick(config.resource_urls) + if(config.resource_urls) + src.preload_rsc = pick(config.resource_urls) else src.preload_rsc = 1 // If config.resource_urls is not set, preload like normal. + + src << "\red If the title screen is black, resources are still downloading. Please be patient until the title screen appears." + clients += src directory[ckey] = src