From c60ee477e816923ff7a4bc21cade3a8c3fba3826 Mon Sep 17 00:00:00 2001 From: Kyep Date: Wed, 29 Jun 2016 23:49:30 -0700 Subject: [PATCH] Adds warning when client BYOND version is old Adds a chat text warning when a client connects to the server with a version of BYOND which is at least one major version behind what is current. E.g we've declared the standard to be 510, and they connect with 509. This warning does not actually stop them doing anything. It just tells them to go update their BYOND. This does not support minor versions (e.g: 510.1347) because the client's "byond_version" var only reports the major version number. Still, should help remind people who return to the game after an absence to update their client before playing. --- code/modules/client/client procs.dm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index d7b41fe2c59..1905176db74 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -8,6 +8,8 @@ #define UPLOAD_LIMIT 10485760 //Restricts client uploads to the server to 10MB //Boosted this thing. What's the worst that can happen? #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. +#define SUGGESTED_CLIENT_VERSION 510 // only integers (e.g: 510, 511) useful here. Does not properly handle minor versions (e.g: 510.58, 511.848) + /* 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] @@ -258,8 +260,11 @@ if(connection != "seeker") //Invalid connection type. return null - if(byond_version < MIN_CLIENT_VERSION) //Out of date client. + if(byond_version < MIN_CLIENT_VERSION) // Too out of date to play at all, force update. + to_chat(src,"Your BYOND client (v: [byond_version]) is too far out of date to to play. Get the latest client from http://www.byond.com/") return null + if(byond_version < SUGGESTED_CLIENT_VERSION) // Update is suggested, but not required. + to_chat(src,"Your BYOND client (v: [byond_version]) is out of date. This can cause glitches. We highly suggest you download the latest client from http://www.byond.com/ before playing. ") if(IsGuestKey(key)) alert(src,"This server doesn't allow guest accounts to play. Please go to http://www.byond.com/ and register for a key.","Guest","OK")