diff --git a/SQL/paradise_schema.sql b/SQL/paradise_schema.sql index f9ede329474..826e47878c6 100644 --- a/SQL/paradise_schema.sql +++ b/SQL/paradise_schema.sql @@ -264,6 +264,7 @@ CREATE TABLE `player` ( `windowflashing` smallint(4) DEFAULT '1', `ghost_anonsay` tinyint(1) NOT NULL DEFAULT '0', `exp` mediumtext, + `clientfps` smallint(4) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `ckey` (`ckey`) ) ENGINE=InnoDB AUTO_INCREMENT=32446 DEFAULT CHARSET=latin1; diff --git a/SQL/paradise_schema_prefixed.sql b/SQL/paradise_schema_prefixed.sql index 8de204cfe3e..e0056474db3 100644 --- a/SQL/paradise_schema_prefixed.sql +++ b/SQL/paradise_schema_prefixed.sql @@ -263,6 +263,7 @@ CREATE TABLE `SS13_player` ( `windowflashing` smallint(4) DEFAULT '1', `ghost_anonsay` tinyint(1) NOT NULL DEFAULT '0', `exp` mediumtext, + `clientfps` smallint(4) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `ckey` (`ckey`) ) ENGINE=InnoDB AUTO_INCREMENT=32446 DEFAULT CHARSET=latin1; diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 2720f8086d0..9e731953ce5 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -418,6 +418,8 @@ preferences_datums[ckey] = prefs prefs.last_ip = address //these are gonna be used for banning prefs.last_id = computer_id //these are gonna be used for banning + if(world.byond_version >= 511 && byond_version >= 511 && prefs.clientfps) + fps = prefs.clientfps spawn() // Goonchat does some non-instant checks in start() chatOutput.start() diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index a351d3f5032..7d9603566d9 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -68,6 +68,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts #define TAB_GEAR 2 /datum/preferences + var/client/parent //doohickeys for savefiles // var/path var/default_slot = 1 //Holder so it doesn't default to slot 1, rather the last one used @@ -94,6 +95,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/UI_style_color = "#ffffff" var/UI_style_alpha = 255 var/windowflashing = TRUE + var/clientfps = 0 //ghostly preferences var/ghost_anonsay = 0 @@ -203,6 +205,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/gear_tab = "General" /datum/preferences/New(client/C) + parent = C b_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") max_gear_slots = config.max_loadout_points @@ -448,7 +451,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "Ghost sight: [(toggles & CHAT_GHOSTSIGHT) ? "Nearest Creatures" : "All Emotes"]
" dat += "Ghost radio: [(toggles & CHAT_GHOSTRADIO) ? "Nearest Speakers" : "All Chatter"]
" dat += "Deadchat anonymity: [ghost_anonsay ? "Anonymous" : "Not Anonymous"]
" - + dat += "FPS: [clientfps]
" dat += "" dat += "

Special Role Settings

" if(jobban_isbanned(user, "Syndicate")) @@ -1887,6 +1890,18 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("Mechanical") organ_data[organ] = "mechanical" + if("clientfps") + var/version_message + if(user.client && user.client.byond_version < 511) + version_message = "\nYou need to be using byond version 511 or later to take advantage of this feature, your version of [user.client.byond_version] is too low" + if(world.byond_version < 511) + version_message += "\nThis server does not currently support client side fps. You can set now for when it does." + var/desiredfps = input(user, "Choose your desired fps.[version_message]\n(0 = synced with server tick rate (currently:[world.fps]))", "Character Preference", clientfps) as null|num + if(!isnull(desiredfps)) + clientfps = desiredfps + if(world.byond_version >= 511 && user.client && user.client.byond_version >= 511) + parent.fps = clientfps + /* if("skin_style") var/skin_style_name = input(user, "Select a new skin style") as null|anything in list("default1", "default2", "default3") @@ -1932,7 +1947,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("hear_adminhelps") sound ^= SOUND_ADMINHELP - if("ui") switch(UI_style) if("Midnight") diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm index 5581d0a1844..7c6e14a7a49 100644 --- a/code/modules/client/preference/preferences_mysql.dm +++ b/code/modules/client/preference/preferences_mysql.dm @@ -16,7 +16,8 @@ lastchangelog, windowflashing, ghost_anonsay, - exp + exp, + clientfps FROM [format_table_name("player")] WHERE ckey='[C.ckey]'"} ) @@ -46,6 +47,7 @@ windowflashing = text2num(query.item[14]) ghost_anonsay = text2num(query.item[15]) exp = query.item[16] + clientfps = query.item[17] //Sanitize ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor)) @@ -63,6 +65,7 @@ windowflashing = sanitize_integer(windowflashing, 0, 1, initial(windowflashing)) ghost_anonsay = sanitize_integer(ghost_anonsay, 0, 1, initial(ghost_anonsay)) exp = sanitize_text(exp, initial(exp)) + clientfps = sanitize_integer(clientfps, 0, 1000, initial(clientfps)) return 1 /datum/preferences/proc/save_preferences(client/C) @@ -89,7 +92,8 @@ show_ghostitem_attack='[show_ghostitem_attack]', lastchangelog='[lastchangelog]', windowflashing='[windowflashing]', - ghost_anonsay='[ghost_anonsay]' + ghost_anonsay='[ghost_anonsay]', + clientfps='[clientfps]' WHERE ckey='[C.ckey]'"} )