mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
Terms of service click through.
This commit is contained in:
@@ -359,12 +359,12 @@ DROP TABLE IF EXISTS `privacy`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `privacy` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`datetime` datetime NOT NULL,
|
||||
`ckey` varchar(32) NOT NULL,
|
||||
`option` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=latin1;
|
||||
`datetime` datetime NOT NULL,
|
||||
`consent` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`ckey`),
|
||||
UNIQUE KEY `ckey_UNIQUE` (`ckey`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
||||
@@ -357,13 +357,13 @@ CREATE TABLE `SS13_poll_vote` (
|
||||
DROP TABLE IF EXISTS `SS13_privacy`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `SS13_privacy` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`datetime` datetime NOT NULL,
|
||||
CREATE TABLE `ss13_privacy` (
|
||||
`ckey` varchar(32) NOT NULL,
|
||||
`option` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=latin1;
|
||||
`datetime` datetime NOT NULL,
|
||||
`consent` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`ckey`),
|
||||
UNIQUE KEY `ckey_UNIQUE` (`ckey`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#Updating the SQL from version 2 to version 3. -alffd
|
||||
#Droping privacy table and recreating for terms of service tracking
|
||||
DROP TABLE `privacy`;
|
||||
CREATE TABLE `privacy` (
|
||||
`ckey` varchar(32) NOT NULL,
|
||||
`datetime` datetime NOT NULL,
|
||||
`consent` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`ckey`),
|
||||
UNIQUE KEY `ckey_UNIQUE` (`ckey`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
@@ -345,4 +345,4 @@
|
||||
#define EXPLOSION_BLOCK_PROC -1
|
||||
|
||||
// The SQL version required by this version of the code
|
||||
#define SQL_VERSION 2
|
||||
#define SQL_VERSION 3
|
||||
|
||||
@@ -2,6 +2,7 @@ var/datum/configuration/config = null
|
||||
|
||||
var/host = null
|
||||
var/join_motd = null
|
||||
var/join_tos = null
|
||||
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)
|
||||
|
||||
@@ -362,6 +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")
|
||||
|
||||
|
||||
/proc/load_configuration()
|
||||
|
||||
@@ -4,6 +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
|
||||
universal_speak = 1
|
||||
|
||||
invisibility = 101
|
||||
@@ -19,7 +20,38 @@
|
||||
|
||||
/mob/new_player/verb/new_player_panel()
|
||||
set src = usr
|
||||
new_player_panel_proc()
|
||||
if(consent)
|
||||
new_player_panel_proc()
|
||||
else
|
||||
handle_tos_consent()
|
||||
|
||||
/mob/new_player/proc/handle_tos_consent()
|
||||
if(!join_tos)
|
||||
return
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
consent = 1
|
||||
return
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("privacy")] WHERE ckey='[src.ckey]' AND consent='SIGNED'")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
consent = 1
|
||||
|
||||
if(!consent)
|
||||
privacy_consent()
|
||||
|
||||
|
||||
/mob/new_player/proc/privacy_consent()
|
||||
src << browse(null, "window=playersetup")
|
||||
var/output = join_tos
|
||||
output += "<p><a href='byond://?src=[UID()];consent_signed=SIGNED'>I consent</A>"
|
||||
output += "<p><a href='byond://?src=[UID()];consent_rejected=NOTSIGNED'>I DO NOT consent</A>"
|
||||
src << browse(output,"window=privacy_consent;size=500x300")
|
||||
var/datum/browser/popup = new(src, "privacy_consent", "<div align='center'>Privacy Consent</div>", 500, 400)
|
||||
popup.set_window_options("can_close=0")
|
||||
popup.set_content(output)
|
||||
popup.open(0)
|
||||
return
|
||||
|
||||
|
||||
/mob/new_player/proc/new_player_panel_proc()
|
||||
@@ -43,6 +75,9 @@
|
||||
|
||||
output += "<p><a href='byond://?src=[UID()];observe=1'>Observe</A></p>"
|
||||
|
||||
if(join_tos)
|
||||
output += "<p><a href='byond://?src=[UID()];tos=1'>Terms of Service</A></p>"
|
||||
|
||||
if(!IsGuestKey(src.key))
|
||||
establish_db_connection()
|
||||
|
||||
@@ -109,11 +144,28 @@
|
||||
/mob/new_player/Topic(href, href_list[])
|
||||
if(!client) return 0
|
||||
|
||||
if(href_list["consent_signed"])
|
||||
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]', 'SIGNED')")
|
||||
query.Execute()
|
||||
src << browse(null, "window=privacy_consent")
|
||||
consent = 1
|
||||
new_player_panel_proc()
|
||||
if(href_list["consent_rejected"])
|
||||
consent = 0
|
||||
to_chat(usr, "<span class='warning'>You must consent to the terms of service before you can join!</span>")
|
||||
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]', 'NOTSIGNED')")
|
||||
query.Execute()
|
||||
|
||||
if(href_list["show_preferences"])
|
||||
client.prefs.ShowChoices(src)
|
||||
return 1
|
||||
|
||||
if(href_list["ready"])
|
||||
if(!consent)
|
||||
to_chat(usr, "<span class='warning'>You must consent to the terms of service before you can join!</span>")
|
||||
return 0
|
||||
ready = !ready
|
||||
new_player_panel_proc()
|
||||
|
||||
@@ -126,6 +178,9 @@
|
||||
new_player_panel_proc()
|
||||
|
||||
if(href_list["observe"])
|
||||
if(!consent)
|
||||
to_chat(usr, "<span class='warning'>You must consent to the terms of service before you can join!</span>")
|
||||
return 0
|
||||
|
||||
if(alert(src,"Are you sure you wish to observe? You cannot normally join the round after doing this!","Player Setup","Yes","No") == "Yes")
|
||||
if(!client) return 1
|
||||
@@ -155,8 +210,14 @@
|
||||
respawnable_list += observer
|
||||
qdel(src)
|
||||
return 1
|
||||
if(href_list["tos"])
|
||||
privacy_consent()
|
||||
return 0
|
||||
|
||||
if(href_list["late_join"])
|
||||
if(!consent)
|
||||
to_chat(usr, "<span class='warning'>You must consent to the terms of service before you can join!</span>")
|
||||
return 0
|
||||
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
|
||||
to_chat(usr, "<span class='warning'>The round is either not ready, or has already finished...</span>")
|
||||
return
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<h1>Welcome to Space Station 13!</h1>
|
||||
|
||||
Terms of service goes here.
|
||||
Reference in New Issue
Block a user