diff --git a/code/_compile_options.dm b/code/_compile_options.dm index adebd47b98c..6b6ce01d996 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -5,6 +5,11 @@ //By using the testing("message") proc you can create debug-feedback for people with this //uncommented, but not visible in the release version) +#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; + */ //SYSTEM TOGGLES - these allow you to compile the game without some of the laggier systems if your server cannot cope with demand diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 3ef743c60b8..3c1dd2ccb6f 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -37,3 +37,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 = PRELOAD_RSC diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index adef2c387cc..6009a644d7a 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -46,6 +46,12 @@ ..() //redirect to hsrc.Topic() +/client/proc/is_content_unlocked() + if(!prefs.unlock_content) + src << "Become a BYOND member to access member-perks and features, as well as support the engine that makes this game possible. Click Here to find out more." + return 0 + return 1 + /client/proc/handle_spam_prevention(var/message, var/mute_type) if(config.automute_on && !holder && src.last_message == message) src.last_message_count++ @@ -79,6 +85,11 @@ /////////// //CONNECT// /////////// +#if (PRELOAD_RSC == 0) +var/list/external_rsc_urls +var/next_external_rsc = 0 +#endif + /client/New(TopicData) TopicData = null //Prevent calls to client.Topic from connect @@ -87,6 +98,12 @@ if(byond_version < MIN_CLIENT_VERSION) //Out of date client. return null +#if (PRELOAD_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 + clients += src directory[ckey] = src @@ -267,10 +284,4 @@ 'icons/stamp_icons/large_stamp-cap.png', 'icons/stamp_icons/large_stamp-qm.png', 'icons/stamp_icons/large_stamp-law.png' - ) - -/client/proc/is_content_unlocked() - if(!prefs.unlock_content) - src << "Become a BYOND member to access member-perks and features, as well as support the engine that makes this game possible. Click Here to find out more." - return 0 - return 1 \ No newline at end of file + ) \ No newline at end of file diff --git a/code/world.dm b/code/world.dm index c7fa563a996..02cdc3315cb 100644 --- a/code/world.dm +++ b/code/world.dm @@ -8,6 +8,15 @@ #define RECOMMENDED_VERSION 495 /world/New() +#if (PRELOAD_RSC == 0) + external_rsc_urls = file2list("config/external_rsc_urls.txt","\n") + var/i=1 + while(i<=external_rsc_urls.len) + if(external_rsc_urls[i]) + i++ + else + external_rsc_urls.Cut(i,i+1) +#endif //logs var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") // if(revdata && istext(revdata.revision) && length(revdata.revision)>7) diff --git a/config/external_rsc_urls.txt b/config/external_rsc_urls.txt new file mode 100644 index 00000000000..e69de29bb2d