From 9631eef2aa03f60e0889ff3028b83a1f8765c40d Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Mon, 18 Mar 2019 14:53:41 +0100 Subject: [PATCH] Fixed the middle mouse exploit --- code/_onclick/click.dm | 4 ++++ code/controllers/configuration.dm | 5 +++++ code/modules/client/client procs.dm | 4 ++++ config/example/config.txt | 3 +++ 4 files changed, 16 insertions(+) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 7b700ad4c6d..24e58b502ad 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -70,6 +70,10 @@ changeNext_click(1) var/list/modifiers = params2list(params) + var/dragged = modifiers["drag"] + if(dragged && !modifiers[dragged]) + return + if(modifiers["middle"] && modifiers["shift"] && modifiers["ctrl"]) MiddleShiftControlClickOn(A) return diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index b26ac90921e..3a2ff120af3 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -2,6 +2,8 @@ var/server_name = null // server name (for world name / status) var/server_suffix = 0 // generate numeric suffix based on server port + var/minimum_client_build = 1421 // Build 1421 due to the middle mouse button exploit + var/nudge_script_path = "nudge.py" // where the nudge.py script is located var/log_ooc = 0 // log OOC channel @@ -382,6 +384,9 @@ if("serversuffix") config.server_suffix = 1 + if("minimum_client_build") + config.minimum_client_build = text2num(value) + if("nudge_script_path") config.nudge_script_path = value diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 7360de3b2ed..ac9a88aaa08 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -290,6 +290,10 @@ return null if(byond_version < MIN_CLIENT_VERSION) // Too out of date to play at all. Unfortunately, we can't send them a message here. return null + if(byond_build < config.minimum_client_build) + alert(src, "You are using a byond build which is not supported by this server. Please use a build version of atleast [config.minimum_client_build].", "Incorrect build", "OK") + del(src) + return 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. ") diff --git a/config/example/config.txt b/config/example/config.txt index ae6f9fefaa7..40d9d870cf4 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -7,6 +7,9 @@ ADMIN_LEGACY_SYSTEM ## Add a # infront of this if you want to use the SQL based banning system. The legacy systems use the files in the data folder. You need to set up your database to use the SQL based system. BAN_LEGACY_SYSTEM +## Add a # infront of this to unlimit the builds used to play. Advised is to keep it atleast 1421 due to the middle mouse button locking exploit +MINIMUM_CLIENT_BUILD 1421 + ## Add a # here if you wish to use the setup where jobs have more access. This is intended for servers with low populations - where there are not enough players to fill all roles, so players need to do more than just one job. Also for servers where they don't want people to hide in their own departments. JOBS_HAVE_MINIMAL_ACCESS