mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
Merge pull request #16914 from MrStonedOne/clientversionconfig
Adds a config for client versions
This commit is contained in:
@@ -197,6 +197,11 @@
|
||||
// The object used for the clickable stat() button.
|
||||
var/obj/effect/statclick/statclick
|
||||
|
||||
var/client_warn_version = 0
|
||||
var/client_warn_message = "Your version of byond may have issues or be blocked from accessing this server in the future."
|
||||
var/client_error_version = 0
|
||||
var/client_error_message = "Your version of byond is too old, may have issues, and is blocked from accessing this server."
|
||||
|
||||
|
||||
/datum/configuration/New()
|
||||
var/list/L = subtypesof(/datum/game_mode)
|
||||
@@ -401,6 +406,15 @@
|
||||
protected_config.autoadmin_rank = ckeyEx(value)
|
||||
if("generate_minimaps")
|
||||
config.generate_minimaps = 1
|
||||
if("client_warn_version")
|
||||
config.client_warn_version = text2num(value)
|
||||
if("client_warn_message")
|
||||
config.client_warn_message = value
|
||||
if("client_error_version")
|
||||
config.client_error_version = text2num(value)
|
||||
if("client_error_message")
|
||||
config.client_error_message = value
|
||||
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
//SECURITY//
|
||||
////////////
|
||||
#define UPLOAD_LIMIT 1048576 //Restricts client uploads to the server to 1MB //Could probably do with being lower.
|
||||
#define MIN_CLIENT_VERSION 0 //Just an ambiguously low version for now, I don't want to suddenly stop people playing.
|
||||
//I would just like the code ready should it ever need to be used.
|
||||
|
||||
/*
|
||||
When somebody clicks a link in game, this Topic is called first.
|
||||
It does the stuff in this proc and then is redirected to the Topic() proc for the src=[0xWhatever]
|
||||
@@ -103,8 +102,6 @@ var/next_external_rsc = 0
|
||||
|
||||
if(connection != "seeker" && connection != "web")//Invalid connection type.
|
||||
return null
|
||||
if(byond_version < MIN_CLIENT_VERSION) //Out of date client.
|
||||
return null
|
||||
|
||||
#if (PRELOAD_RSC == 0)
|
||||
if(external_rsc_urls && external_rsc_urls.len)
|
||||
@@ -143,6 +140,24 @@ var/next_external_rsc = 0
|
||||
|
||||
. = ..() //calls mob.Login()
|
||||
|
||||
if (byond_version < config.client_error_version) //Out of date client.
|
||||
src << "<span class='danger'><b>Your version of byond is too old:</b></span>"
|
||||
src << config.client_error_message
|
||||
src << "Your version: [byond_version]"
|
||||
src << "Required version: [config.client_error_version] or later"
|
||||
src << "Visit http://www.byond.com/download/ to get the latest version of byond."
|
||||
if (holder)
|
||||
src << "Because you are an admin, you are being allowed to walk past this limitation, But it is still STRONGLY suggested you upgrade"
|
||||
else
|
||||
del(src)
|
||||
return 0
|
||||
else if (byond_version < config.client_warn_version) //We have words for this client.
|
||||
src << "<span class='danger'><b>Your version of byond may be getting out of date:</b></span>"
|
||||
src << config.client_warn_message
|
||||
src << "Your version: [byond_version]"
|
||||
src << "Required version to remove this message: [config.client_warn_version] or later"
|
||||
src << "Visit http://www.byond.com/download/ to get the latest version of byond."
|
||||
|
||||
if (connection == "web")
|
||||
if (!config.allowwebclient)
|
||||
src << "Web client is disabled"
|
||||
|
||||
+10
-1
@@ -235,4 +235,13 @@ ANNOUNCE_ADMIN_LOGOUT
|
||||
|
||||
## GENERATE_MINIMAPS
|
||||
## Generating minimaps(For crew monitor) is slow and bogs down testing, so its disabled by default and must be enabled by uncommenting this config if you are running a production server.
|
||||
#GENERATE_MINIMAPS
|
||||
#GENERATE_MINIMAPS
|
||||
|
||||
## CLIENT VERSION CONTROL
|
||||
## This allows you to configure the minimum required client version, as well as a warning version, and message for both.
|
||||
## These trigger for any version below (non-inclusive) the given version, so 510 triggers on 509 or lower.
|
||||
## These messages will be followed by one stating the clients current version and the required version for clarity.
|
||||
#CLIENT_WARN_VERSION 510
|
||||
#CLIENT_WARN_MESSAGE Byond is really close to releasing 510 beta as the stable release, please take this time to try it out. Reports are that the client preforms better then the version you are using, and also handles network lag better. Shortly after it's release we will end up using 510 client features and you will be forced to update.
|
||||
#CLIENT_ERROR_VERSION 509
|
||||
#CLIENT_ERROR_MESSAGE Your version of byond is not supported. Please upgrade.
|
||||
Reference in New Issue
Block a user