diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm
index 2934a830c8d..052b64f035f 100644
--- a/code/controllers/configuration/entries/general.dm
+++ b/code/controllers/configuration/entries/general.dm
@@ -413,6 +413,10 @@
config_entry_value = null
min_val = 500
+/datum/config_entry/number/client_warn_build
+ default = null
+ min_val = 0
+
/datum/config_entry/string/client_warn_message
config_entry_value = "Your version of byond may have issues or be blocked from accessing this server in the future."
@@ -429,6 +433,10 @@
config_entry_value = null
min_val = 0
+/datum/config_entry/number/client_max_build
+ config_entry_value = null
+ min_val = 0
+
/datum/config_entry/number/minute_topic_limit
config_entry_value = null
min_val = 0
diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm
index 8091627245b..62c19659dec 100644
--- a/code/modules/client/client_procs.dm
+++ b/code/modules/client/client_procs.dm
@@ -4,7 +4,6 @@
#define UPLOAD_LIMIT 10485760 //Restricts client uploads to the server to 1MB //Could probably do with being lower.
-#define MAX_RECOMMENDED_CLIENT 1589
GLOBAL_LIST_INIT(blacklisted_builds, list(
"1407" = "bug preventing client display overrides from working leads to clients being able to see things/mobs they shouldn't be able to see",
@@ -264,28 +263,44 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
log_access("Login: [key_name(src)] from [address ? address : "localhost"]-[computer_id] || BYOND v[full_version]")
var/alert_mob_dupe_login = FALSE
+ var/alert_admin_multikey = FALSE
if(CONFIG_GET(flag/log_access))
- for(var/I in GLOB.clients)
- if(!I || I == src)
+ var/list/joined_players = list()
+ for(var/player_ckey in GLOB.joined_player_list)
+ joined_players[player_ckey] = 1
+
+ for(var/joined_player_ckey in (GLOB.directory | joined_players))
+ if (!joined_player_ckey || joined_player_ckey == ckey)
continue
- var/client/C = I
- if(C.key && (C.key != key) )
- var/matches
- if( (C.address == address) )
- matches += "IP ([address])"
- if( (C.computer_id == computer_id) )
- if(matches)
- matches += " and "
- matches += "ID ([computer_id])"
- alert_mob_dupe_login = TRUE
- if(matches)
- if(C)
- message_admins("Notice: [key_name_admin(src)] has the same [matches] as [key_name_admin(C)].")
- log_access("Notice: [key_name(src)] has the same [matches] as [key_name(C)].")
- else
- message_admins("Notice: [key_name_admin(src)] has the same [matches] as [key_name_admin(C)] (no longer logged in). ")
- log_access("Notice: [key_name(src)] has the same [matches] as [key_name(C)] (no longer logged in).")
+ var/datum/preferences/joined_player_preferences = GLOB.preferences_datums[joined_player_ckey]
+ if(!joined_player_preferences)
+ continue //this shouldn't happen.
+
+ var/client/C = GLOB.directory[joined_player_ckey]
+ var/in_round = ""
+ if (joined_players[joined_player_ckey])
+ in_round = " who has played in the current round"
+ var/message_type = "Notice"
+
+ var/matches
+ if(joined_player_preferences.last_ip == address)
+ matches += "IP ([address])"
+ if(joined_player_preferences.last_id == computer_id)
+ if(matches)
+ matches = "BOTH [matches] and "
+ alert_admin_multikey = TRUE
+ message_type = "MULTIKEY"
+ matches += "Computer ID ([computer_id])"
+ alert_mob_dupe_login = TRUE
+
+ if(matches)
+ if(C)
+ message_admins("[message_type]: Connecting player [key_name_admin(src)] has the same [matches] as [key_name_admin(C)][in_round].")
+ log_admin_private("[message_type]: Connecting player [key_name(src)] has the same [matches] as [key_name(C)][in_round].")
+ else
+ message_admins("[message_type]: Connecting player [key_name_admin(src)] has the same [matches] as [joined_player_ckey](no longer logged in)[in_round]. ")
+ log_admin_private("[message_type]: Connecting player [key_name(src)] has the same [matches] as [joined_player_ckey](no longer logged in)[in_round].")
if(GLOB.player_details[ckey])
player_details = GLOB.player_details[ckey]
player_details.byond_version = full_version
@@ -310,12 +325,14 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
to_chat_immediate(src, "Byond build [byond_build] ([byond_version].[byond_build]) has been blacklisted for the following reason: [GLOB.blacklisted_builds[num2text(byond_build)]].")
to_chat_immediate(src, "Please download a new version of byond. If [byond_build] is the latest, you can go to BYOND's website to download other versions.")
if(connecting_admin)
- to_chat(src, "As an admin, you are being allowed to continue using this version, but please consider changing byond versions")
+ to_chat_immediate(src, "As an admin, you are being allowed to continue using this version, but please consider changing byond versions")
else
qdel(src)
return
- if(byond_build > MAX_RECOMMENDED_CLIENT)
- to_chat(src, "Your version of byond is over the maximum recommended version for clients (build [MAX_RECOMMENDED_CLIENT]) and may be unstable.")
+
+ var/max_recommended_client = CONFIG_GET(number/client_max_build)
+ if(byond_build > max_recommended_client)
+ to_chat(src, "Your version of byond is over the maximum recommended version for clients (build [max_recommended_client]) and may be unstable.")
to_chat(src, "Please download an older version of byond. You can go to BYOND's website to download other versions.")
if(SSinput.initialized)
set_macros()
@@ -323,41 +340,50 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
// Initialize tgui panel
tgui_panel.Initialize()
- if(alert_mob_dupe_login)
- spawn()
- alert(mob, "You have logged in already with another key this round, please log out of this one NOW or risk being banned!")
+ if(alert_mob_dupe_login && !holder)
+ var/dupe_login_message = "Your ComputerID has already logged in with another key this round, please log out of this one NOW or risk being banned!"
+ if (alert_admin_multikey)
+ dupe_login_message += "\nAdmins have been informed."
+ message_admins("MULTIKEYING: [key_name_admin(src)] has a matching CID+IP with another player and is clearly multikeying. They have been warned to leave the server or risk getting banned.")
+ log_admin_private("MULTIKEYING: [key_name(src)] has a matching CID+IP with another player and is clearly multikeying. They have been warned to leave the server or risk getting banned.")
+ spawn(0.5 SECONDS) //needs to run during world init, do not convert to add timer
+ alert(mob, dupe_login_message) //players get banned if they don't see this message, do not convert to tgui_alert (or even tg_alert) please.
+ to_chat_immediate(mob, "[dupe_login_message]")
+
connection_time = world.time
connection_realtime = world.realtime
connection_timeofday = world.timeofday
winset(src, null, "command=\".configure graphics-hwmode on\"")
- var/cev = CONFIG_GET(number/client_error_version)
- var/ceb = CONFIG_GET(number/client_error_build)
- var/cwv = CONFIG_GET(number/client_warn_version)
- if (byond_version < cev || byond_build < ceb) //Out of date client.
+ var/breaking_version = CONFIG_GET(number/client_error_version)
+ var/breaking_build = CONFIG_GET(number/client_error_build)
+ var/warn_version = CONFIG_GET(number/client_warn_version)
+ var/warn_build = CONFIG_GET(number/client_warn_build)
+
+ if (byond_version < breaking_version || (byond_version == breaking_version && byond_build < breaking_build)) //Out of date client.
to_chat_immediate(src, "Your version of BYOND is too old:")
to_chat_immediate(src, CONFIG_GET(string/client_error_message))
to_chat_immediate(src, "Your version: [byond_version].[byond_build]")
- to_chat_immediate(src, "Required version: [cev].[ceb] or later")
+ to_chat_immediate(src, "Required version: [breaking_version].[breaking_build] or later")
to_chat_immediate(src, "Visit BYOND's website to get the latest version of BYOND.")
if (connecting_admin)
- to_chat(src, "Because you are an admin, you are being allowed to walk past this limitation, But it is still STRONGLY suggested you upgrade")
+ to_chat_immediate(src, "Because you are an admin, you are being allowed to walk past this limitation, But it is still STRONGLY suggested you upgrade")
else
qdel(src)
- return 0
- else if (byond_version < cwv) //We have words for this client.
+ return
+ else if (byond_version < warn_version || (byond_version == warn_version && byond_build < warn_build)) //We have words for this client.
if(CONFIG_GET(flag/client_warn_popup))
var/msg = "Your version of byond may be getting out of date:
"
msg += CONFIG_GET(string/client_warn_message) + "
"
- msg += "Your version: [byond_version]
"
- msg += "Required version to remove this message: [cwv] or later
"
+ msg += "Your version: [byond_version].[byond_build]
"
+ msg += "Required version to remove this message: [warn_version].[warn_build] or later
"
msg += "Visit BYOND's website to get the latest version of BYOND.
"
src << browse(msg, "window=warning_popup")
else
to_chat(src, "Your version of byond may be getting out of date:")
to_chat(src, CONFIG_GET(string/client_warn_message))
- to_chat(src, "Your version: [byond_version]")
- to_chat(src, "Required version to remove this message: [cwv] or later")
+ to_chat(src, "Your version: [byond_version].[byond_build]")
+ to_chat(src, "Required version to remove this message: [warn_version].[warn_build] or later")
to_chat(src, "Visit BYOND's website to get the latest version of BYOND.")
if (connection == "web" && !connecting_admin)
@@ -831,7 +857,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
var/url = winget(src, null, "url")
//special javascript to make them reconnect under a new window.
src << browse({"byond://[url]?token=[token]"}, "border=0;titlebar=0;size=1x1;window=redirect")
- to_chat(src, {"You will be automatically taken to the game, if not, click here to be taken manually"})
+ to_chat_immediate(src, {"You will be automatically taken to the game, if not, click here to be taken manually"})
/client/proc/note_randomizer_user()
add_system_note("CID-Error", "Detected as using a cid randomizer.")
diff --git a/config/config.txt b/config/config.txt
index 8c02e315f2d..bcd3e56e5c5 100644
--- a/config/config.txt
+++ b/config/config.txt
@@ -456,18 +456,16 @@ AUTOADMIN_RANK Admin
## 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.
## If CLIENT_WARN_POPUP is uncommented a popup window with the message will be displayed instead
-
-#Warn, Allows connection but warns about possibile instability.
-CLIENT_WARN_POPUP
-CLIENT_WARN_VERSION 0
-#Wish we had a build check for this
-CLIENT_WARN_MESSAGE Currently Unused! If you see this message yell at Francinum!
-
-#Error, Blocks non-admin connection.
+#CLIENT_WARN_VERSION 513
+#CLIENT_WARN_BUILD 1421
+#CLIENT_WARN_POPUP
+#CLIENT_WARN_MESSAGE 512 is no longer being directly supported as version 513 is set to become the new stable version soon. We've made a number of changes to take advantage of the improvements made in 513 which should make for a smoother experience. We will be removing support for 512 when this new version replaces it as stable, so it's recommended that you upgrade now. (You can update to the BETA via the website or directly in the BYOND client)
CLIENT_ERROR_VERSION 514
CLIENT_ERROR_MESSAGE Your version of byond is not supported. Please upgrade.
## The minimum build needed for joining the server, if using 513, a good minimum build would be 1526.
-CLIENT_ERROR_BUILD 1583
+CLIENT_ERROR_BUILD 1589
+## The maximum build recommended for clients
+CLIENT_MAX_BUILD 1614
## TOPIC RATE LIMITING
## This allows you to limit how many topic calls (clicking on an interface window) the client can do in any given game second and/or game minute.