From 61d746e0096a0636f41b4f66081aeb8157e43d48 Mon Sep 17 00:00:00 2001 From: Alffd Date: Fri, 25 May 2018 15:51:03 -0400 Subject: [PATCH] Tiger changes --- code/_globalvars/configuration.dm | 2 +- code/game/world.dm | 3 +-- code/modules/mob/new_player/new_player.dm | 26 +++++++++++------------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index 035df89b5a7..1e35e150a25 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -2,7 +2,7 @@ var/datum/configuration/config = null var/host = null var/join_motd = null -var/join_tos = null +GLOBAL_VAR(join_tos) var/game_version = "Custom ParaCode" var/changelog_hash = md5('html/changelog.html') //used to check if the CL changed var/game_year = (text2num(time2text(world.realtime, "YYYY")) + 544) diff --git a/code/game/world.dm b/code/game/world.dm index b8577dd73e9..ffb9dfb1ecd 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -362,8 +362,7 @@ var/world_topic_spam_protect_time = world.timeofday /world/proc/load_motd() join_motd = file2text("config/motd.txt") - join_tos = file2text("config/tos.txt") - + GLOB.join_tos = file2text("config/tos.txt") /proc/load_configuration() config = new /datum/configuration() diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 8a2aeb26bae..ccee8332c7c 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -4,7 +4,7 @@ var/spawning = 0 //Referenced when you want to delete the new_player later on in the code. var/totalPlayers = 0 //Player counts for the Lobby tab var/totalPlayersReady = 0 - var/consent = FALSE + var/tos_consent = FALSE universal_speak = 1 invisibility = 101 @@ -20,30 +20,30 @@ /mob/new_player/verb/new_player_panel() set src = usr - if(consent) + if(tos_consent) new_player_panel_proc() else handle_tos_consent() /mob/new_player/proc/handle_tos_consent() - if(!join_tos) + if(!GLOB.join_tos) return establish_db_connection() if(!dbcon.IsConnected()) - consent = 1 + tos_consent = 1 return var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("privacy")] WHERE ckey='[src.ckey]' AND consent=1") query.Execute() while(query.NextRow()) - consent = 1 + tos_consent = 1 - if(!consent) + if(!tos_consent) privacy_consent() /mob/new_player/proc/privacy_consent() src << browse(null, "window=playersetup") - var/output = join_tos + var/output = GLOB.join_tos output += "

I consent" output += "

I DO NOT consent" src << browse(output,"window=privacy_consent;size=500x300") @@ -75,7 +75,7 @@ output += "

Observe

" - if(join_tos) + if(GLOB.join_tos) output += "

Terms of Service

" if(!IsGuestKey(src.key)) @@ -149,10 +149,10 @@ var/DBQuery/query = dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 1)") query.Execute() src << browse(null, "window=privacy_consent") - consent = 1 + tos_consent = 1 new_player_panel_proc() if(href_list["consent_rejected"]) - consent = 0 + tos_consent = 0 to_chat(usr, "You must consent to the terms of service before you can join!") var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") var/DBQuery/query = dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 0)") @@ -163,7 +163,7 @@ return 1 if(href_list["ready"]) - if(!consent) + if(!tos_consent) to_chat(usr, "You must consent to the terms of service before you can join!") return 0 ready = !ready @@ -178,7 +178,7 @@ new_player_panel_proc() if(href_list["observe"]) - if(!consent) + if(!tos_consent) to_chat(usr, "You must consent to the terms of service before you can join!") return 0 @@ -215,7 +215,7 @@ return 0 if(href_list["late_join"]) - if(!consent) + if(!tos_consent) to_chat(usr, "You must consent to the terms of service before you can join!") return 0 if(!ticker || ticker.current_state != GAME_STATE_PLAYING)