Server tools API v3.1
This commit is contained in:
committed by
CitadelStationBot
parent
d25894447e
commit
116041d621
+15
-32
@@ -1,3 +1,6 @@
|
||||
#define PR_ANNOUNCEMENTS_PER_ROUND 5 //The number of unique PR announcements allowed per round
|
||||
//This makes sure that a single person can only spam 3 reopens and 3 closes before being ignored
|
||||
|
||||
GLOBAL_VAR(security_mode)
|
||||
GLOBAL_PROTECT(security_mode)
|
||||
|
||||
@@ -19,8 +22,7 @@ GLOBAL_PROTECT(security_mode)
|
||||
|
||||
SetupLogs()
|
||||
|
||||
if(!RunningService()) //tgs2 support
|
||||
GLOB.revdata.DownloadPRDetails()
|
||||
SERVER_TOOLS_ON_NEW
|
||||
|
||||
load_motd()
|
||||
load_admins()
|
||||
@@ -33,9 +35,12 @@ GLOBAL_PROTECT(security_mode)
|
||||
|
||||
Master.Initialize(10, FALSE)
|
||||
|
||||
<<<<<<< HEAD
|
||||
if(config.irc_announce_new_game)
|
||||
IRCBroadcast("New round starting on [SSmapping.config.map_name]!")
|
||||
|
||||
=======
|
||||
>>>>>>> 62f788f... Server tools API v3.1 (#31000)
|
||||
/world/proc/SetupExternalRSC()
|
||||
#if (PRELOAD_RSC == 0)
|
||||
external_rsc_urls = world.file2list("config/external_rsc_urls.txt","\n")
|
||||
@@ -125,9 +130,16 @@ GLOBAL_PROTECT(security_mode)
|
||||
if(!pinging && !playing && config && config.log_world_topic)
|
||||
WRITE_FILE(GLOB.world_game_log, "TOPIC: \"[T]\", from:[addr], master:[master], key:[key]")
|
||||
|
||||
<<<<<<< HEAD
|
||||
if(input[SERVICE_CMD_PARAM_KEY])
|
||||
return ServiceCommand(input)
|
||||
var/key_valid = (global.comms_allowed && input["key"] == global.comms_key)
|
||||
=======
|
||||
SERVER_TOOLS_ON_TOPIC //redirect to server tools if necessary
|
||||
|
||||
var/comms_key = CONFIG_GET(string/comms_key)
|
||||
var/key_valid = (comms_key && input["key"] == comms_key)
|
||||
>>>>>>> 62f788f... Server tools API v3.1 (#31000)
|
||||
|
||||
if(pinging)
|
||||
var/x = 1
|
||||
@@ -142,17 +154,6 @@ GLOBAL_PROTECT(security_mode)
|
||||
n++
|
||||
return n
|
||||
|
||||
else if("ircstatus" in input) //tgs2 support
|
||||
var/static/last_irc_status = 0
|
||||
if(world.time - last_irc_status < 50)
|
||||
return
|
||||
var/list/adm = get_admin_counts()
|
||||
var/list/allmins = adm["total"]
|
||||
var/status = "Admins: [allmins.len] (Active: [english_list(adm["present"])] AFK: [english_list(adm["afk"])] Stealth: [english_list(adm["stealth"])] Skipped: [english_list(adm["noflags"])]). "
|
||||
status += "Players: [GLOB.clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [SSticker.mode.name]."
|
||||
send2irc("Status", status)
|
||||
last_irc_status = world.time
|
||||
|
||||
else if("status" in input)
|
||||
var/list/s = list()
|
||||
s["version"] = GLOB.game_version
|
||||
@@ -210,24 +211,6 @@ GLOBAL_PROTECT(security_mode)
|
||||
if(input["crossmessage"] == "News_Report")
|
||||
minor_announce(input["message"], "Breaking Update From [input["message_sender"]]")
|
||||
|
||||
else if("adminmsg" in input) //tgs2 support
|
||||
if(!key_valid)
|
||||
return "Bad Key"
|
||||
else
|
||||
return IrcPm(input["adminmsg"],input["msg"],input["sender"])
|
||||
|
||||
else if("namecheck" in input) //tgs2 support
|
||||
if(!key_valid)
|
||||
return "Bad Key"
|
||||
else
|
||||
log_admin("IRC Name Check: [input["sender"]] on [input["namecheck"]]")
|
||||
message_admins("IRC name checking on [input["namecheck"]] from [input["sender"]]")
|
||||
return keywords_lookup(input["namecheck"],1)
|
||||
else if("adminwho" in input) //tgs2 support
|
||||
if(!key_valid)
|
||||
return "Bad Key"
|
||||
else
|
||||
return ircadminwho()
|
||||
else if("server_hop" in input)
|
||||
show_server_hop_transfer_screen(input["server_hop"])
|
||||
|
||||
@@ -246,7 +229,7 @@ GLOBAL_PROTECT(security_mode)
|
||||
C.AnnouncePR(final_composed)
|
||||
|
||||
/world/Reboot(reason = 0, fast_track = FALSE)
|
||||
ServiceReboot() //handles alternative actions if necessary
|
||||
SERVER_TOOLS_ON_REBOOT
|
||||
if (reason || fast_track) //special reboot, do none of the normal stuff
|
||||
if (usr)
|
||||
log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
|
||||
Reference in New Issue
Block a user