Fixes compiler errors in the preload_rsc external resource thingy (#34061)

Fixes compiler errors in the preload_rsc external resource thingy
This commit is contained in:
Kyle Spier-Swenson
2018-01-15 07:32:20 -08:00
committed by CitadelStationBot
parent a7b75651f9
commit 32adfdae00
3 changed files with 16 additions and 17 deletions

View File

@@ -13,11 +13,11 @@
//#define VISUALIZE_ACTIVE_TURFS //Highlights atmos active turfs in green
#endif
#define PRELOAD_RSC 1 /*set to:
0 to allow using external resources or on-demand behaviour;
1 to use the default behaviour;
2 for preloading absolutely everything;
*/
#ifndef PRELOAD_RSC //set to:
#define PRELOAD_RSC 0 // 0 to allow using external resources or on-demand behaviour;
#endif // 1 to use the default behaviour;
// 2 for preloading absolutely everything;
#define BACKGROUND_ENABLED 0 // The default value for all uses of set background. Set background can cause gradual lag and is recommended you only turn this on if necessary.
// 1 will enable set background. 0 will disable set background.

View File

@@ -45,13 +45,13 @@ GLOBAL_PROTECT(security_mode)
/world/proc/SetupExternalRSC()
#if (PRELOAD_RSC == 0)
external_rsc_urls = world.file2list("config/external_rsc_urls.txt","\n")
GLOB.external_rsc_urls = world.file2list("config/external_rsc_urls.txt","\n")
var/i=1
while(i<=external_rsc_urls.len)
if(external_rsc_urls[i])
while(i<=GLOB.external_rsc_urls.len)
if(GLOB.external_rsc_urls[i])
i++
else
external_rsc_urls.Cut(i,i+1)
GLOB.external_rsc_urls.Cut(i,i+1)
#endif
/world/proc/CheckSchemaVersion()

View File

@@ -138,7 +138,7 @@
//CONNECT//
///////////
#if (PRELOAD_RSC == 0)
GLOBAL_LIST(external_rsc_urls)
GLOBAL_LIST_EMPTY(external_rsc_urls)
#endif
@@ -150,13 +150,6 @@ GLOBAL_LIST(external_rsc_urls)
if(connection != "seeker" && connection != "web")//Invalid connection type.
return null
#if (PRELOAD_RSC == 0)
var/static/next_external_rsc = 0
if(external_rsc_urls && external_rsc_urls.len)
next_external_rsc = WRAP(next_external_rsc+1, 1, external_rsc_urls.len+1)
preload_rsc = external_rsc_urls[next_external_rsc]
#endif
GLOB.clients += src
GLOB.directory[ckey] = src
@@ -654,6 +647,12 @@ GLOBAL_LIST(external_rsc_urls)
//send resources to the client. It's here in its own proc so we can move it around easiliy if need be
/client/proc/send_resources()
#if (PRELOAD_RSC == 0)
var/static/next_external_rsc = 0
if(GLOB.external_rsc_urls && GLOB.external_rsc_urls.len)
next_external_rsc = WRAP(next_external_rsc+1, 1, GLOB.external_rsc_urls.len+1)
preload_rsc = GLOB.external_rsc_urls[next_external_rsc]
#endif
//get the common files
getFiles(
'html/search.js',