Server Greeting Refactor (#1034)

Refactors the Server Greeting datum to do majority of the processing clientside. No longer will we be holding massive spans of text in memory, and looking over them for shits and giggles.
This commit is contained in:
skull132
2016-11-06 13:59:22 +02:00
committed by GitHub
parent dae995ba04
commit 0b6120c1ac
7 changed files with 167 additions and 113 deletions
+11 -10
View File
@@ -55,8 +55,6 @@
cmd_admin_discord_pm(href_list["discord_msg"])
return
//Logs all hrefs
if(config && config.log_hrefs && href_logfile)
href_logfile << "<small>[time2text(world.timeofday,"hh:mm")] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>"
@@ -178,6 +176,10 @@
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_stats_ie (ckey, IsIE, IsEdge, EdgeHtmlVersion, TrueVersion, ActingVersion, CompatibilityMode, DateUpdated) VALUES (_ckey, _IsIE, _IsEdge, _EdgeHtmlVersion, _TrueVersion, _ActingVersion, _CompatibilityMode, NOW()) ON DUPLICATE KEY UPDATE IsIE = VALUES(IsIe), IsEdge = VALUES(IsEdge), EdgeHtmlVersion = VALUES(EdgeHtmlVersion), TrueVersion = VALUES(TrueVersion), ActingVersion = VALUES(ActingVersion), CompatibilityMode = VALUES(CompatibilityMode), DateUpdated = NOW()")
query.Execute(data)
if ("greeting")
if (server_greeting)
server_greeting.handle_call(href_list, src)
return
// Antag contest shit
@@ -294,10 +296,9 @@
send_resources()
nanomanager.send_resources(src)
var/outdated_greeting_info = server_greeting.find_outdated_info(src)
if (outdated_greeting_info)
server_greeting.display_to_client(src, outdated_greeting_info)
// Server greeting shenanigans.
if (server_greeting.find_outdated_info(src, 1))
server_greeting.display_to_client(src)
// Check code/modules/admin/verbs/antag-ooc.dm for definition
add_aooc_if_necessary()
@@ -421,10 +422,7 @@
'html/images/talisman.png',
'html/bootstrap/css/bootstrap.min.css',
'html/bootstrap/js/bootstrap.min.js',
'html/bootstrap/js/html5shiv.min.js',
'html/bootstrap/js/respond.min.js',
'html/jquery/jquery-2.0.0.min.js',
'html/iestats/json2.min.js',
'html/iestats/ie-truth.min.js',
'icons/pda_icons/pda_atmos.png',
'icons/pda_icons/pda_back.png',
@@ -586,4 +584,7 @@
set name = "Open Greeting"
set category = "OOC"
server_greeting.display_to_client(src, server_greeting.find_outdated_info(src))
// Update the information just in case.
server_greeting.find_outdated_info(src, 1)
server_greeting.display_to_client(src)
@@ -61,13 +61,13 @@
* Returns the HTML required to display this alert.
*/
/datum/client_notification/proc/get_html()
var/html = "<div class=\"row\">[note_wrapper[1]]\n"
var/html = "<div class=\"row\">[note_wrapper[1]]"
if (!persistent)
html += "<a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>\n"
html += "<a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>"
html += note_text
html += "\n[note_wrapper[2]]</div>"
html += "[note_wrapper[2]]</div>"
return html