Adds round table to replace tacking some data in feedback table (#27454)

* adds round table to replace tacking some data in feedback table

* removes obsolete code for acolytes_survived

* uses a better query

* corrects var name

* uses actual sql queries

* adds commit column and connected checks before queries
This commit is contained in:
Jordie
2017-05-27 06:17:44 +10:00
committed by AnturK
parent 9c5c82eb6a
commit f042d97448
24 changed files with 151 additions and 82 deletions

View File

@@ -1,3 +1,23 @@
20 May 2017, by Jordie0608
Created table `round` to replace tracking of the datapoints 'round_start', 'round_end', 'server_ip', 'game_mode', 'round_end_results', 'end_error', 'end_proper', 'emergency_shuttle', 'map_name' and 'station_renames' in the `feedback` table.
Once created this table is populated with rows from the `feedback` table.
START TRANSACTION;
CREATE TABLE `feedback`.`round` (`id` INT(11) NOT NULL AUTO_INCREMENT, `start_datetime` DATETIME NOT NULL, `end_datetime` DATETIME NULL, `server_ip` INT(10) UNSIGNED NOT NULL, `server_port` SMALLINT(5) UNSIGNED NOT NULL, `commit_hash` CHAR(40) NULL, `game_mode` VARCHAR(32) NULL, `game_mode_result` VARCHAR(64) NULL, `end_state` VARCHAR(64) NULL, `shuttle_name` VARCHAR(64) NULL, `map_name` VARCHAR(32) NULL, `station_name` VARCHAR(80) NULL, PRIMARY KEY (`id`));
INSERT INTO `feedback`.`round`
(`id`, `start_datetime`, `end_datetime`, `server_ip`, `server_port`, `commit_hash`, `game_mode`, `game_mode_result`, `end_state`, `shuttle_name`, `map_name`, `station_name`)
SELECT DISTINCT ri.round_id, IFNULL(STR_TO_DATE(st.details,'%a %b %e %H:%i:%s %Y'), TIMESTAMP(0)), STR_TO_DATE(et.details,'%a %b %e %H:%i:%s %Y'), IFNULL(INET_ATON(SUBSTRING_INDEX(IF(si.details = '', '0', IF(SUBSTRING_INDEX(si.details, ':', 1) LIKE '%_._%', si.details, '0')), ':', 1)), INET_ATON(0)), IFNULL(IF(si.details LIKE '%:_%', CAST(SUBSTRING_INDEX(si.details, ':', -1) AS UNSIGNED), '0'), '0'), ch.details, gm.details, mr.details, IFNULL(es.details, ep.details), ss.details, mn.details, sn.details
FROM `feedback`.`feedback`AS ri
LEFT JOIN `feedback`.`feedback` AS st ON ri.round_id = st.round_id AND st.var_name = "round_start" LEFT JOIN `feedback`.`feedback` AS et ON ri.round_id = et.round_id AND et.var_name = "round_end" LEFT JOIN `feedback`.`feedback` AS si ON ri.round_id = si.round_id AND si.var_name = "server_ip" LEFT JOIN `feedback`.`feedback` AS ch ON ri.round_id = ch.round_id AND ch.var_name = "revision" LEFT JOIN `feedback`.`feedback` AS gm ON ri.round_id = gm.round_id AND gm.var_name = "game_mode" LEFT JOIN `feedback`.`feedback` AS mr ON ri.round_id = mr.round_id AND mr.var_name = "round_end_result" LEFT JOIN `feedback`.`feedback` AS es ON ri.round_id = es.round_id AND es.var_name = "end_state" LEFT JOIN `feedback`.`feedback` AS ep ON ri.round_id = ep.round_id AND ep.var_name = "end_proper" LEFT JOIN `feedback`.`feedback` AS ss ON ri.round_id = ss.round_id AND ss.var_name = "emergency_shuttle" LEFT JOIN `feedback`.`feedback` AS mn ON ri.round_id = mn.round_id AND mn.var_name = "map_name" LEFT JOIN `feedback`.`feedback` AS sn ON ri.round_id = sn.round_id AND sn.var_name = "station_renames";
COMMIT;
It's not necessary to delete the rows from the `feedback` table but henceforth these datapoints will be in the `round` table.
Remember to add a prefix to the table names if you use them
----------------------------------------------------
21 April 2017, by Jordie0608 21 April 2017, by Jordie0608
Modified table 'player', adding the column 'accountjoindate', removing the column 'id' and making the column 'ckey' the primary key. Modified table 'player', adding the column 'accountjoindate', removing the column 'id' and making the column 'ckey' the primary key.

View File

@@ -362,6 +362,29 @@ CREATE TABLE `poll_vote` (
KEY `idx_pvote_optionid_ckey` (`optionid`,`ckey`) KEY `idx_pvote_optionid_ckey` (`optionid`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `round`
--
DROP TABLE IF EXISTS `round`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `round` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`start_datetime` DATETIME NOT NULL,
`end_datetime` DATETIME NULL,
`server_ip` INT(10) UNSIGNED NOT NULL,
`server_port` SMALLINT(5) UNSIGNED NOT NULL,
`commit_hash` CHAR(40) NULL,
`game_mode` VARCHAR(32) NULL,
`game_mode_result` VARCHAR(64) NULL,
`end_state` VARCHAR(64) NULL,
`shuttle_name` VARCHAR(64) NULL,
`map_name` VARCHAR(32) NULL,
`station_name` VARCHAR(80) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;

View File

@@ -362,6 +362,29 @@ CREATE TABLE `SS13_poll_vote` (
KEY `idx_pvote_optionid_ckey` (`optionid`,`ckey`) KEY `idx_pvote_optionid_ckey` (`optionid`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `SS13_round`
--
DROP TABLE IF EXISTS `SS13_round`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_round` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`start_datetime` DATETIME NOT NULL,
`end_datetime` DATETIME NULL,
`server_ip` INT(10) UNSIGNED NOT NULL,
`server_port` SMALLINT(5) UNSIGNED NOT NULL,
`commit_hash` CHAR(40) NULL,
`game_mode` VARCHAR(32) NULL,
`game_mode_result` VARCHAR(64) NULL,
`end_state` VARCHAR(64) NULL,
`shuttle_name` VARCHAR(64) NULL,
`map_name` VARCHAR(32) NULL,
`station_name` VARCHAR(80) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;

View File

@@ -41,6 +41,7 @@
// Subsystems shutdown in the reverse of the order they initialize in // Subsystems shutdown in the reverse of the order they initialize in
// The numbers just define the ordering, they are meaningless otherwise. // The numbers just define the ordering, they are meaningless otherwise.
#define INIT_ORDER_DBCORE 17
#define INIT_ORDER_SERVER_MAINT 16 #define INIT_ORDER_SERVER_MAINT 16
#define INIT_ORDER_JOBS 15 #define INIT_ORDER_JOBS 15
#define INIT_ORDER_EVENTS 14 #define INIT_ORDER_EVENTS 14

View File

@@ -82,8 +82,6 @@ SUBSYSTEM_DEF(blackbox)
add_details("radio_usage","PDA-[pda_msg_amt]") add_details("radio_usage","PDA-[pda_msg_amt]")
add_details("radio_usage","RC-[rc_msg_amt]") add_details("radio_usage","RC-[rc_msg_amt]")
set_details("round_end","[time2text(world.realtime)]") //This one MUST be the last one that gets set.
if (!SSdbcore.Connect()) if (!SSdbcore.Connect())
return return

View File

@@ -1,7 +1,7 @@
SUBSYSTEM_DEF(dbcore) SUBSYSTEM_DEF(dbcore)
name = "Database" name = "Database"
flags = SS_NO_INIT|SS_NO_FIRE flags = SS_NO_INIT|SS_NO_FIRE
init_order = INIT_ORDER_DBCORE
var/const/FAILED_DB_CONNECTION_CUTOFF = 5 var/const/FAILED_DB_CONNECTION_CUTOFF = 5
var/const/Default_Cursor = 0 var/const/Default_Cursor = 0
@@ -30,6 +30,11 @@ SUBSYSTEM_DEF(dbcore)
_db_con = SSdbcore._db_con _db_con = SSdbcore._db_con
/datum/controller/subsystem/dbcore/Shutdown() /datum/controller/subsystem/dbcore/Shutdown()
//This is as close as we can get to the true round end before Disconnect() without changing where it's called, defeating the reason this is a subsystem
if(SSdbcore.Connect())
var/sql_station_name = sanitizeSQL(station_name())
var/datum/DBQuery/query_round_end = SSdbcore.NewQuery("INSERT INTO [format_table_name("round")] (end_datetime, game_mode_result, end_state, station_name) VALUES (Now(), '[SSticker.mode_result]', '[SSticker.end_state]', '[sql_station_name]') WHERE id = [GLOB.round_id]")
query_round_end.Execute()
if(IsConnected()) if(IsConnected())
Disconnect() Disconnect()

View File

@@ -119,7 +119,9 @@ SUBSYSTEM_DEF(mapping)
INIT_ANNOUNCE("Loading [config.map_name]...") INIT_ANNOUNCE("Loading [config.map_name]...")
TryLoadZ(config.GetFullMapPath(), FailedZs, ZLEVEL_STATION) TryLoadZ(config.GetFullMapPath(), FailedZs, ZLEVEL_STATION)
INIT_ANNOUNCE("Loaded station in [(REALTIMEOFDAY - start_time)/10]s!") INIT_ANNOUNCE("Loaded station in [(REALTIMEOFDAY - start_time)/10]s!")
SSblackbox.add_details("map_name", config.map_name) if(SSdbcore.Connect())
var/datum/DBQuery/query_round_map_name = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET map_name = '[config.map_name]' WHERE id = [GLOB.round_id]")
query_round_map_name.Execute()
if(config.minetype != "lavaland") if(config.minetype != "lavaland")
INIT_ANNOUNCE("WARNING: A map without lavaland set as it's minetype was loaded! This is being ignored! Update the maploader code!") INIT_ANNOUNCE("WARNING: A map without lavaland set as it's minetype was loaded! This is being ignored! Update the maploader code!")

View File

@@ -60,6 +60,8 @@ SUBSYSTEM_DEF(ticker)
var/round_start_time = 0 var/round_start_time = 0
var/list/round_start_events var/list/round_start_events
var/mode_result = "undefined"
var/end_state = "undefined"
/datum/controller/subsystem/ticker/Initialize(timeofday) /datum/controller/subsystem/ticker/Initialize(timeofday)
load_mode() load_mode()
@@ -618,9 +620,9 @@ SUBSYSTEM_DEF(ticker)
sleep(50) sleep(50)
if(mode.station_was_nuked) if(mode.station_was_nuked)
Reboot("Station destroyed by Nuclear Device.", "end_proper", "nuke") Reboot("Station destroyed by Nuclear Device.", "nuke")
else else
Reboot("Round ended.", "end_proper", "proper completion") Reboot("Round ended.", "proper completion")
/datum/controller/subsystem/ticker/proc/send_tip_of_the_round() /datum/controller/subsystem/ticker/proc/send_tip_of_the_round()
var/m var/m
@@ -814,7 +816,7 @@ SUBSYSTEM_DEF(ticker)
C.Export("##action=load_rsc", round_end_sound) C.Export("##action=load_rsc", round_end_sound)
round_end_sound_sent = TRUE round_end_sound_sent = TRUE
/datum/controller/subsystem/ticker/proc/Reboot(reason, feedback_c, feedback_r, delay) /datum/controller/subsystem/ticker/proc/Reboot(reason, end_string, delay)
set waitfor = FALSE set waitfor = FALSE
if(usr && !check_rights(R_SERVER, TRUE)) if(usr && !check_rights(R_SERVER, TRUE))
return return
@@ -835,8 +837,8 @@ SUBSYSTEM_DEF(ticker)
if(delay_end) if(delay_end)
to_chat(world, "<span class='boldannounce'>Reboot was cancelled by an admin.</span>") to_chat(world, "<span class='boldannounce'>Reboot was cancelled by an admin.</span>")
return return
if(end_string)
SSblackbox.set_details("[feedback_c]","[feedback_r]") end_state = end_string
log_game("<span class='boldannounce'>Rebooting World. [reason]</span>") log_game("<span class='boldannounce'>Rebooting World. [reason]</span>")

View File

@@ -130,7 +130,7 @@ SUBSYSTEM_DEF(vote)
active_admins = 1 active_admins = 1
break break
if(!active_admins) if(!active_admins)
SSticker.Reboot("Restart vote successful.", "end_error", "restart vote") SSticker.Reboot("Restart vote successful.", "restart vote")
else else
to_chat(world, "<span style='boldannounce'>Notice:Restart vote will not restart the server automatically because there are active admins on.</span>") to_chat(world, "<span style='boldannounce'>Notice:Restart vote will not restart the server automatically because there are active admins on.</span>")
message_admins("A restart vote has passed, but there are active admins on with +server, so it has been canceled. If you wish, you may restart the server.") message_admins("A restart vote has passed, but there are active admins on with +server, so it has been canceled. If you wish, you may restart the server.")

View File

@@ -20,7 +20,7 @@
if(round_converted) //So badmin blobs later don't step on the dead natural blobs metaphorical toes if(round_converted) //So badmin blobs later don't step on the dead natural blobs metaphorical toes
..() ..()
if(blobwincount <= GLOB.blobs_legit.len) if(blobwincount <= GLOB.blobs_legit.len)
SSblackbox.set_details("round_end_result","win - blob took over") SSticker.mode_result = "win - blob took over"
to_chat(world, "<FONT size = 3><B>The blob has taken over the station!</B></FONT>") to_chat(world, "<FONT size = 3><B>The blob has taken over the station!</B></FONT>")
to_chat(world, "<B>The entire station was eaten by the Blob!</B>") to_chat(world, "<B>The entire station was eaten by the Blob!</B>")
log_game("Blob mode completed with a blob victory.") log_game("Blob mode completed with a blob victory.")
@@ -28,7 +28,7 @@
SSticker.news_report = BLOB_WIN SSticker.news_report = BLOB_WIN
else if(station_was_nuked) else if(station_was_nuked)
SSblackbox.set_details("round_end_result","halfwin - nuke") SSticker.mode_result = "halfwin - nuke"
to_chat(world, "<FONT size = 3><B>Partial Win: The station has been destroyed!</B></FONT>") to_chat(world, "<FONT size = 3><B>Partial Win: The station has been destroyed!</B></FONT>")
to_chat(world, "<B>Directive 7-12 has been successfully carried out, preventing the Blob from spreading.</B>") to_chat(world, "<B>Directive 7-12 has been successfully carried out, preventing the Blob from spreading.</B>")
log_game("Blob mode completed with a tie (station destroyed).") log_game("Blob mode completed with a tie (station destroyed).")
@@ -36,7 +36,7 @@
SSticker.news_report = BLOB_NUKE SSticker.news_report = BLOB_NUKE
else if(!GLOB.blob_cores.len) else if(!GLOB.blob_cores.len)
SSblackbox.set_details("round_end_result","loss - blob eliminated") SSticker.mode_result = "loss - blob eliminated"
to_chat(world, "<FONT size = 3><B>The staff has won!</B></FONT>") to_chat(world, "<FONT size = 3><B>The staff has won!</B></FONT>")
to_chat(world, "<B>The alien organism has been eradicated from the station!</B>") to_chat(world, "<B>The alien organism has been eradicated from the station!</B>")
log_game("Blob mode completed with a crew victory.") log_game("Blob mode completed with a crew victory.")

View File

@@ -191,7 +191,7 @@ Credit where due:
var/datum/game_mode/clockwork_cult/C = SSticker.mode var/datum/game_mode/clockwork_cult/C = SSticker.mode
if(C.check_clockwork_victory()) if(C.check_clockwork_victory())
text += "<span class='large_brass'><b>Ratvar's servants have succeeded in fulfilling His goals!</b></span>" text += "<span class='large_brass'><b>Ratvar's servants have succeeded in fulfilling His goals!</b></span>"
SSblackbox.set_details("round_end_result", "win - servants completed their objective (summon ratvar)") SSticker.mode_result = "win - servants completed their objective (summon ratvar)"
else else
var/half_victory = FALSE var/half_victory = FALSE
var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = locate() in GLOB.all_clockwork_objects var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = locate() in GLOB.all_clockwork_objects
@@ -200,10 +200,10 @@ Credit where due:
if(half_victory) if(half_victory)
text += "<span class='large_brass'><b>The crew escaped before Ratvar could rise, but the gateway \ text += "<span class='large_brass'><b>The crew escaped before Ratvar could rise, but the gateway \
was successfully constructed!</b></span>" was successfully constructed!</b></span>"
SSblackbox.set_details("round_end_result", "halfwin - servants constructed the gateway but their objective was not completed (summon ratvar)") SSticker.mode_result = "halfwin - servants constructed the gateway but their objective was not completed (summon ratvar)"
else else
text += "<span class='userdanger'>Ratvar's servants have failed!</span>" text += "<span class='userdanger'>Ratvar's servants have failed!</span>"
SSblackbox.set_details("round_end_result", "loss - servants failed their objective (summon ratvar)") SSticker.mode_result = "loss - servants failed their objective (summon ratvar)"
text += "<br><b>The servants' objective was:</b> <br>[CLOCKCULT_OBJECTIVE]" text += "<br><b>The servants' objective was:</b> <br>[CLOCKCULT_OBJECTIVE]"
text += "<br>Ratvar's servants had <b>[GLOB.clockwork_caches]</b> Tinkerer's Caches." text += "<br>Ratvar's servants had <b>[GLOB.clockwork_caches]</b> Tinkerer's Caches."
text += "<br><b>Construction Value(CV)</b> was: <b>[GLOB.clockwork_construction_value]</b>" text += "<br><b>Construction Value(CV)</b> was: <b>[GLOB.clockwork_construction_value]</b>"

View File

@@ -208,12 +208,10 @@
/datum/game_mode/cult/declare_completion() /datum/game_mode/cult/declare_completion()
if(!check_cult_victory()) if(!check_cult_victory())
SSblackbox.set_details("round_end_result","win - cult win") SSticker.mode_result = "win - cult win"
SSblackbox.set_val("round_end_result",acolytes_survived)
to_chat(world, "<span class='greentext'>The cult has succeeded! Nar-sie has snuffed out another torch in the void!</span>") to_chat(world, "<span class='greentext'>The cult has succeeded! Nar-sie has snuffed out another torch in the void!</span>")
else else
SSblackbox.set_details("round_end_result","loss - staff stopped the cult") SSticker.mode_result = "loss - staff stopped the cult"
SSblackbox.set_val("round_end_result",acolytes_survived)
to_chat(world, "<span class='redtext'>The staff managed to stop the cult! Dark words and heresy are no match for Nanotrasen's finest!</span>") to_chat(world, "<span class='redtext'>The staff managed to stop the cult! Dark words and heresy are no match for Nanotrasen's finest!</span>")
var/text = "" var/text = ""
@@ -257,22 +255,15 @@
/datum/game_mode/proc/datum_cult_completion() /datum/game_mode/proc/datum_cult_completion()
var/text = "" var/text = ""
var/acolytes_survived = 0
for(var/datum/mind/cult_mind in cult)
if (cult_mind.current && cult_mind.current.stat != DEAD)
if(cult_mind.current.onCentcom() || cult_mind.current.onSyndieBase())
acolytes_survived++
var/cult_fail = 0 var/cult_fail = 0
cult_fail += eldergod cult_fail += eldergod
if(!GLOB.sac_complete) if(!GLOB.sac_complete)
cult_fail++ cult_fail++
if(!cult_fail) if(!cult_fail)
SSblackbox.set_details("round_end_result","win - cult win") SSticker.mode_result = "win - cult win"
SSblackbox.set_val("round_end_result",acolytes_survived)
to_chat(world, "<span class='greentext'>The cult has succeeded! Nar-sie has snuffed out another torch in the void!</span>") to_chat(world, "<span class='greentext'>The cult has succeeded! Nar-sie has snuffed out another torch in the void!</span>")
else else
SSblackbox.set_details("round_end_result","loss - staff stopped the cult") SSticker.mode_result = "loss - staff stopped the cult"
SSblackbox.set_val("round_end_result",acolytes_survived)
to_chat(world, "<span class='redtext'>The staff managed to stop the cult! Dark words and heresy are no match for Nanotrasen's finest!</span>") to_chat(world, "<span class='redtext'>The staff managed to stop the cult! Dark words and heresy are no match for Nanotrasen's finest!</span>")
if(cult_objectives.len) if(cult_objectives.len)
text += "<br><b>The cultists' objectives were:</b>" text += "<br><b>The cultists' objectives were:</b>"

View File

@@ -80,11 +80,17 @@
report = config.intercept report = config.intercept
addtimer(CALLBACK(GLOBAL_PROC, .proc/display_roundstart_logout_report), ROUNDSTART_LOGOUT_REPORT_TIME) addtimer(CALLBACK(GLOBAL_PROC, .proc/display_roundstart_logout_report), ROUNDSTART_LOGOUT_REPORT_TIME)
SSblackbox.set_details("round_start","[time2text(world.realtime)]") if(SSdbcore.Connect())
if(SSticker && SSticker.mode) var/sql
SSblackbox.set_details("game_mode","[SSticker.mode]") if(SSticker && SSticker.mode)
if(GLOB.revdata.commit) sql += "game_mode = '[SSticker.mode]'"
SSblackbox.set_details("revision","[GLOB.revdata.commit]") if(sql)
sql += ", "
if(GLOB.revdata.commit)
sql += "commit_hash = '[GLOB.revdata.commit]'"
if(sql)
var/datum/DBQuery/query_round_game_mode = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET [sql] WHERE id = [GLOB.round_id]")
query_round_game_mode.Execute()
if(report) if(report)
addtimer(CALLBACK(src, .proc/send_intercept, 0), rand(waittime_l, waittime_h)) addtimer(CALLBACK(src, .proc/send_intercept, 0), rand(waittime_l, waittime_h))
generate_station_goals() generate_station_goals()

View File

@@ -288,12 +288,12 @@ GLOBAL_LIST_INIT(gang_outfit_pool, list(/obj/item/clothing/suit/jacket/leather,/
return return
if(!winner) if(!winner)
to_chat(world, "<span class='redtext'>The station was [station_was_nuked ? "destroyed!" : "evacuated before a gang could claim it! The station wins!"]</span><br>") to_chat(world, "<span class='redtext'>The station was [station_was_nuked ? "destroyed!" : "evacuated before a gang could claim it! The station wins!"]</span><br>")
SSblackbox.set_details("round_end_result","loss - gangs failed takeover") SSticker.mode_result = "loss - gangs failed takeover"
SSticker.news_report = GANG_LOSS SSticker.news_report = GANG_LOSS
else else
to_chat(world, "<span class='redtext'>The [winner.name] Gang successfully performed a hostile takeover of the station!</span><br>") to_chat(world, "<span class='redtext'>The [winner.name] Gang successfully performed a hostile takeover of the station!</span><br>")
SSblackbox.set_details("round_end_result","win - gang domination complete") SSticker.mode_result = "win - gang domination complete"
SSticker.news_report = GANG_TAKEOVER SSticker.news_report = GANG_TAKEOVER

View File

@@ -50,8 +50,6 @@
else else
to_chat(world, "<span class='boldnotice'>Nobody survived the meteor storm!</span>") to_chat(world, "<span class='boldnotice'>Nobody survived the meteor storm!</span>")
SSblackbox.set_details("round_end_result","end - evacuation") SSticker.mode_result = "end - evacuation"
SSblackbox.set_val("round_end_result",survivors)
..() ..()
return 1 return 1

View File

@@ -107,10 +107,8 @@
/datum/game_mode/monkey/declare_completion() /datum/game_mode/monkey/declare_completion()
if(check_monkey_victory()) if(check_monkey_victory())
SSblackbox.set_details("round_end_result","win - monkey win") SSticker.mode_result = "win - monkey win"
SSblackbox.set_val("round_end_result",escaped_monkeys)
to_chat(world, "<span class='userdanger'>The monkeys have overthrown their captors! Eeek eeeek!!</span>") to_chat(world, "<span class='userdanger'>The monkeys have overthrown their captors! Eeek eeeek!!</span>")
else else
SSblackbox.set_details("round_end_result","loss - staff stopped the monkeys") SSticker.mode_result = "loss - staff stopped the monkeys"
SSblackbox.set_val("round_end_result",escaped_monkeys)
to_chat(world, "<span class='userdanger'>The staff managed to contain the monkey infestation!</span>") to_chat(world, "<span class='userdanger'>The staff managed to contain the monkey infestation!</span>")

View File

@@ -201,70 +201,70 @@
if(nuke_off_station == NUKE_SYNDICATE_BASE) if(nuke_off_station == NUKE_SYNDICATE_BASE)
SSblackbox.set_details("round_end_result","loss - syndicate nuked - disk secured") SSticker.mode_result = "loss - syndicate nuked - disk secured"
to_chat(world, "<FONT size = 3><B>Humiliating Syndicate Defeat</B></FONT>") to_chat(world, "<FONT size = 3><B>Humiliating Syndicate Defeat</B></FONT>")
to_chat(world, "<B>The crew of [station_name()] gave [syndicate_name()] operatives back their bomb! The syndicate base was destroyed!</B> Next time, don't lose the nuke!") to_chat(world, "<B>The crew of [station_name()] gave [syndicate_name()] operatives back their bomb! The syndicate base was destroyed!</B> Next time, don't lose the nuke!")
SSticker.news_report = NUKE_SYNDICATE_BASE SSticker.news_report = NUKE_SYNDICATE_BASE
else if(!disk_rescued && station_was_nuked && !syndies_didnt_escape) else if(!disk_rescued && station_was_nuked && !syndies_didnt_escape)
SSblackbox.set_details("round_end_result","win - syndicate nuke") SSticker.mode_result = "win - syndicate nuke"
to_chat(world, "<FONT size = 3><B>Syndicate Major Victory!</B></FONT>") to_chat(world, "<FONT size = 3><B>Syndicate Major Victory!</B></FONT>")
to_chat(world, "<B>[syndicate_name()] operatives have destroyed [station_name()]!</B>") to_chat(world, "<B>[syndicate_name()] operatives have destroyed [station_name()]!</B>")
SSticker.news_report = STATION_NUKED SSticker.news_report = STATION_NUKED
else if (!disk_rescued && station_was_nuked && syndies_didnt_escape) else if (!disk_rescued && station_was_nuked && syndies_didnt_escape)
SSblackbox.set_details("round_end_result","halfwin - syndicate nuke - did not evacuate in time") SSticker.mode_result = "halfwin - syndicate nuke - did not evacuate in time"
to_chat(world, "<FONT size = 3><B>Total Annihilation</B></FONT>") to_chat(world, "<FONT size = 3><B>Total Annihilation</B></FONT>")
to_chat(world, "<B>[syndicate_name()] operatives destroyed [station_name()] but did not leave the area in time and got caught in the explosion.</B> Next time, don't lose the disk!") to_chat(world, "<B>[syndicate_name()] operatives destroyed [station_name()] but did not leave the area in time and got caught in the explosion.</B> Next time, don't lose the disk!")
SSticker.news_report = STATION_NUKED SSticker.news_report = STATION_NUKED
else if (!disk_rescued && !station_was_nuked && nuke_off_station && !syndies_didnt_escape) else if (!disk_rescued && !station_was_nuked && nuke_off_station && !syndies_didnt_escape)
SSblackbox.set_details("round_end_result","halfwin - blew wrong station") SSticker.mode_result = "halfwin - blew wrong station"
to_chat(world, "<FONT size = 3><B>Crew Minor Victory</B></FONT>") to_chat(world, "<FONT size = 3><B>Crew Minor Victory</B></FONT>")
to_chat(world, "<B>[syndicate_name()] operatives secured the authentication disk but blew up something that wasn't [station_name()].</B> Next time, don't do that!") to_chat(world, "<B>[syndicate_name()] operatives secured the authentication disk but blew up something that wasn't [station_name()].</B> Next time, don't do that!")
SSticker.news_report = NUKE_MISS SSticker.news_report = NUKE_MISS
else if (!disk_rescued && !station_was_nuked && nuke_off_station && syndies_didnt_escape) else if (!disk_rescued && !station_was_nuked && nuke_off_station && syndies_didnt_escape)
SSblackbox.set_details("round_end_result","halfwin - blew wrong station - did not evacuate in time") SSticker.mode_result = "halfwin - blew wrong station - did not evacuate in time"
to_chat(world, "<FONT size = 3><B>[syndicate_name()] operatives have earned Darwin Award!</B></FONT>") to_chat(world, "<FONT size = 3><B>[syndicate_name()] operatives have earned Darwin Award!</B></FONT>")
to_chat(world, "<B>[syndicate_name()] operatives blew up something that wasn't [station_name()] and got caught in the explosion.</B> Next time, don't do that!") to_chat(world, "<B>[syndicate_name()] operatives blew up something that wasn't [station_name()] and got caught in the explosion.</B> Next time, don't do that!")
SSticker.news_report = NUKE_MISS SSticker.news_report = NUKE_MISS
else if ((disk_rescued || SSshuttle.emergency.mode != SHUTTLE_ENDGAME) && are_operatives_dead()) else if ((disk_rescued || SSshuttle.emergency.mode != SHUTTLE_ENDGAME) && are_operatives_dead())
SSblackbox.set_details("round_end_result","loss - evacuation - disk secured - syndi team dead") SSticker.mode_result = "loss - evacuation - disk secured - syndi team dead"
to_chat(world, "<FONT size = 3><B>Crew Major Victory!</B></FONT>") to_chat(world, "<FONT size = 3><B>Crew Major Victory!</B></FONT>")
to_chat(world, "<B>The Research Staff has saved the disk and killed the [syndicate_name()] Operatives</B>") to_chat(world, "<B>The Research Staff has saved the disk and killed the [syndicate_name()] Operatives</B>")
SSticker.news_report = OPERATIVES_KILLED SSticker.news_report = OPERATIVES_KILLED
else if (disk_rescued) else if (disk_rescued)
SSblackbox.set_details("round_end_result","loss - evacuation - disk secured") SSticker.mode_result = "loss - evacuation - disk secured"
to_chat(world, "<FONT size = 3><B>Crew Major Victory</B></FONT>") to_chat(world, "<FONT size = 3><B>Crew Major Victory</B></FONT>")
to_chat(world, "<B>The Research Staff has saved the disk and stopped the [syndicate_name()] Operatives!</B>") to_chat(world, "<B>The Research Staff has saved the disk and stopped the [syndicate_name()] Operatives!</B>")
SSticker.news_report = OPERATIVES_KILLED SSticker.news_report = OPERATIVES_KILLED
else if (!disk_rescued && are_operatives_dead()) else if (!disk_rescued && are_operatives_dead())
SSblackbox.set_details("round_end_result","halfwin - evacuation - disk not secured") SSticker.mode_result = "halfwin - evacuation - disk not secured"
to_chat(world, "<FONT size = 3><B>Neutral Victory!</B></FONT>") to_chat(world, "<FONT size = 3><B>Neutral Victory!</B></FONT>")
to_chat(world, "<B>The Research Staff failed to secure the authentication disk but did manage to kill most of the [syndicate_name()] Operatives!</B>") to_chat(world, "<B>The Research Staff failed to secure the authentication disk but did manage to kill most of the [syndicate_name()] Operatives!</B>")
SSticker.news_report = OPERATIVE_SKIRMISH SSticker.news_report = OPERATIVE_SKIRMISH
else if (!disk_rescued && crew_evacuated) else if (!disk_rescued && crew_evacuated)
SSblackbox.set_details("round_end_result","halfwin - detonation averted") SSticker.mode_result = "halfwin - detonation averted"
to_chat(world, "<FONT size = 3><B>Syndicate Minor Victory!</B></FONT>") to_chat(world, "<FONT size = 3><B>Syndicate Minor Victory!</B></FONT>")
to_chat(world, "<B>[syndicate_name()] operatives survived the assault but did not achieve the destruction of [station_name()].</B> Next time, don't lose the disk!") to_chat(world, "<B>[syndicate_name()] operatives survived the assault but did not achieve the destruction of [station_name()].</B> Next time, don't lose the disk!")
SSticker.news_report = OPERATIVE_SKIRMISH SSticker.news_report = OPERATIVE_SKIRMISH
else if (!disk_rescued && !crew_evacuated) else if (!disk_rescued && !crew_evacuated)
SSblackbox.set_details("round_end_result","halfwin - interrupted") SSticker.mode_result = "halfwin - interrupted"
to_chat(world, "<FONT size = 3><B>Neutral Victory</B></FONT>") to_chat(world, "<FONT size = 3><B>Neutral Victory</B></FONT>")
to_chat(world, "<B>Round was mysteriously interrupted!</B>") to_chat(world, "<B>Round was mysteriously interrupted!</B>")

View File

@@ -459,7 +459,7 @@
var/datum/game_mode/nuclear/NM = SSticker.mode var/datum/game_mode/nuclear/NM = SSticker.mode
NM.nukes_left -- NM.nukes_left --
if(!SSticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is if(!SSticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is
SSticker.Reboot("Station destroyed by Nuclear Device.", "end_error", "nuke - unhandled ending") SSticker.Reboot("Station destroyed by Nuclear Device.", "nuke - unhandled ending")
/* /*

View File

@@ -345,13 +345,13 @@
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
/datum/game_mode/revolution/declare_completion() /datum/game_mode/revolution/declare_completion()
if(finished == 1) if(finished == 1)
SSblackbox.set_details("round_end_result","win - heads killed") SSticker.mode_result = "win - heads killed"
to_chat(world, "<span class='redtext'>The heads of staff were killed or exiled! The revolutionaries win!</span>") to_chat(world, "<span class='redtext'>The heads of staff were killed or exiled! The revolutionaries win!</span>")
SSticker.news_report = REVS_WIN SSticker.news_report = REVS_WIN
else if(finished == 2) else if(finished == 2)
SSblackbox.set_details("round_end_result","loss - rev heads killed") SSticker.mode_result = "loss - rev heads killed"
to_chat(world, "<span class='redtext'>The heads of staff managed to stop the revolution!</span>") to_chat(world, "<span class='redtext'>The heads of staff managed to stop the revolution!</span>")
SSticker.news_report = REVS_LOSE SSticker.news_report = REVS_LOSE

View File

@@ -133,7 +133,7 @@
/datum/game_mode/wizard/raginmages/declare_completion() /datum/game_mode/wizard/raginmages/declare_completion()
if(finished) if(finished)
SSblackbox.set_details("round_end_result","loss - wizard killed") SSticker.mode_result = "loss - wizard killed"
to_chat(world, "<FONT size=3><B>The crew has managed to hold off the wizard attack! The Space Wizards Federation has been taught a lesson they will not soon forget!</B></FONT>") to_chat(world, "<FONT size=3><B>The crew has managed to hold off the wizard attack! The Space Wizards Federation has been taught a lesson they will not soon forget!</B></FONT>")
..(1) ..(1)

View File

@@ -180,7 +180,7 @@
/datum/game_mode/wizard/declare_completion() /datum/game_mode/wizard/declare_completion()
if(finished) if(finished)
SSblackbox.set_details("round_end_result","loss - wizard killed") SSticker.mode_result = "loss - wizard killed"
to_chat(world, "<span class='userdanger'>The wizard[(wizards.len>1)?"s":""] has been killed by the crew! The Space Wizards Federation has been taught a lesson they will not soon forget!</span>") to_chat(world, "<span class='userdanger'>The wizard[(wizards.len>1)?"s":""] has been killed by the crew! The Space Wizards Federation has been taught a lesson they will not soon forget!</span>")
SSticker.news_report = WIZARD_KILLED SSticker.news_report = WIZARD_KILLED

View File

@@ -428,7 +428,7 @@
SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
switch(result) switch(result)
if("Regular Restart") if("Regular Restart")
SSticker.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "end_error", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10) SSticker.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10)
if("Hard Restart (No Delay, No Feeback Reason)") if("Hard Restart (No Delay, No Feeback Reason)")
world.Reboot() world.Reboot()
if("Hardest Restart (No actions, just reboot)") if("Hardest Restart (No actions, just reboot)")

View File

@@ -297,7 +297,9 @@
setTimer(SSshuttle.emergencyDockTime) setTimer(SSshuttle.emergencyDockTime)
send2irc("Server", "The Emergency Shuttle has docked with the station.") send2irc("Server", "The Emergency Shuttle has docked with the station.")
priority_announce("The Emergency Shuttle has docked with the station. You have [timeLeft(600)] minutes to board the Emergency Shuttle.", null, 'sound/AI/shuttledock.ogg', "Priority") priority_announce("The Emergency Shuttle has docked with the station. You have [timeLeft(600)] minutes to board the Emergency Shuttle.", null, 'sound/AI/shuttledock.ogg', "Priority")
SSblackbox.add_details("emergency_shuttle", src.name) if(SSdbcore.Connect())
var/datum/DBQuery/query_round_shuttle_name = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET shuttle_name = '[name]' WHERE id = [GLOB.round_id]")
query_round_shuttle_name.Execute()
// Gangs only have one attempt left if the shuttle has // Gangs only have one attempt left if the shuttle has
// docked with the station to prevent suffering from // docked with the station to prevent suffering from

View File

@@ -56,12 +56,12 @@
if(config.sql_enabled) if(config.sql_enabled)
if(SSdbcore.Connect()) if(SSdbcore.Connect())
log_world("Database connection established.") log_world("Database connection established.")
var/datum/DBQuery/query_feedback_create_round = SSdbcore.NewQuery("INSERT INTO [format_table_name("feedback")] SELECT null, Now(), IFNULL(MAX(round_id),0)+1, \"server_ip\", 0, \"[world.internet_address]:[world.port]\" FROM [format_table_name("feedback")]") var/datum/DBQuery/query_round_start = SSdbcore.NewQuery("INSERT INTO [format_table_name("round")] (start_datetime, server_ip, server_port) VALUES (Now(), INET_ATON('[world.internet_address]'), '[world.port]')")
query_feedback_create_round.Execute() query_round_start.Execute()
var/datum/DBQuery/query_feedback_max_id = SSdbcore.NewQuery("SELECT MAX(round_id) FROM [format_table_name("feedback")]") var/datum/DBQuery/query_round_last_id = SSdbcore.NewQuery("SELECT LAST_INSERT_ID()")
query_feedback_max_id.Execute() query_round_last_id.Execute()
if(query_feedback_max_id.NextRow()) if(query_round_last_id.NextRow())
GLOB.round_id = query_feedback_max_id.item[1] GLOB.round_id = query_round_last_id.item[1]
else else
log_world("Your server failed to establish a connection with the database.") log_world("Your server failed to establish a connection with the database.")
@@ -224,7 +224,7 @@
else else
to_chat(world, "<span class='boldannounce'>Rebooting world...</span>") to_chat(world, "<span class='boldannounce'>Rebooting world...</span>")
Master.Shutdown() //run SS shutdowns Master.Shutdown() //run SS shutdowns
log_world("World rebooted at [time_stamp()]"); log_world("World rebooted at [time_stamp()]")
..() ..()
/world/proc/load_motd() /world/proc/load_motd()