diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm
index 6a05464cf73..f7d8dc3d8c7 100644
--- a/code/controllers/voting.dm
+++ b/code/controllers/voting.dm
@@ -167,12 +167,7 @@ datum/controller/vote
if(restart)
- world << "World restarting due to vote..."
- feedback_set_details("end_error","restart vote")
- if(blackbox) blackbox.save_all_data_to_sql()
- sleep(50)
- log_game("Rebooting due to restart vote")
- world.Reboot()
+ world.Reboot("Restart vote successful.", "end_error", "restart vote")
return .
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index 56798e7ca3d..e5badecac9b 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -404,26 +404,9 @@ var/global/datum/controller/gameticker/ticker
callHook("roundend")
if (mode.station_was_nuked)
- feedback_set_details("end_proper","nuke")
- if(!delay_end)
- world << "\blue Rebooting due to destruction of station in [restart_timeout/10] seconds"
+ world.Reboot("Station destroyed by Nuclear Device.", "end_proper", "nuke")
else
- feedback_set_details("end_proper","proper completion")
- if(!delay_end)
- world << "\blue Restarting in [restart_timeout/10] seconds"
-
-
- if(blackbox)
- blackbox.save_all_data_to_sql()
-
- if(!delay_end)
- sleep(restart_timeout)
- if(!delay_end)
- world.Reboot()
- else
- world << "\blue An admin has delayed the round end"
- else
- world << "\blue An admin has delayed the round end"
+ world.Reboot("Round ended.", "end_proper", "proper completion")
else if (mode_finished)
post_game = 1
diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm
index e3fb3809c39..7aef1ae06a7 100644
--- a/code/game/gamemodes/malfunction/malfunction.dm
+++ b/code/game/gamemodes/malfunction/malfunction.dm
@@ -62,15 +62,7 @@
/datum/game_mode/malfunction/post_setup()
for(var/datum/mind/AI_mind in malf_ai)
if(malf_ai.len < 1)
- world << {"Uh oh, its malfunction and there is no AI! Please report this.
- Rebooting world in 5 seconds."}
-
- feedback_set_details("end_error","malf - no AI")
-
- if(blackbox)
- blackbox.save_all_data_to_sql()
- sleep(50)
- world.Reboot()
+ world.Reboot("No AI during Malfunction.", "end_error", "malf - no AI", 50)
return
AI_mind.current.verbs += /mob/living/silicon/ai/proc/choose_modules
AI_mind.current:laws = new /datum/ai_laws/malfunction
@@ -83,11 +75,6 @@
AI_mind.current.verbs += /datum/game_mode/malfunction/proc/takeover
-/* AI_mind.current.icon_state = "ai-malf"
- spawn(10)
- if(alert(AI_mind.current,"Do you want to use an alternative sprite for your real core?",,"Yes","No")=="Yes")
- AI_mind.current.icon_state = "ai-malf2"
-*/
if(emergency_shuttle)
emergency_shuttle.auto_recall = 1
spawn (rand(waittime_l, waittime_h))
diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm
index 0850f6ad46b..2e032973286 100644
--- a/code/game/gamemodes/nuclear/nuclearbomb.dm
+++ b/code/game/gamemodes/nuclear/nuclearbomb.dm
@@ -380,15 +380,7 @@ var/bomb_set
//kinda shit but I couldn't get permission to do what I wanted to do.
if(!ticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is
- world << "Resetting in 30 seconds!"
-
- feedback_set_details("end_error","nuke - unhandled ending")
-
- if(blackbox)
- blackbox.save_all_data_to_sql()
- sleep(300)
- log_game("Rebooting due to nuclear detonation.")
- world.Reboot()
+ world.Reboot("Station destroyed by Nuclear Device.", "end_error", "nuke - unhandled ending")
return
return
diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm
index 6f843bc148b..e6d258b3386 100644
--- a/code/modules/admin/IsBanned.dm
+++ b/code/modules/admin/IsBanned.dm
@@ -1,5 +1,8 @@
//Blocks an attempt to connect before even creating our client datum thing.
world/IsBanned(key,address,computer_id)
+ if (!key || !address || !computer_id)
+ log_access("Failed Login (invalid data): [key] [address]-[computer_id]")
+ return list("reason"="invalid login data", "desc"="Your computer provided invalid or blank information to the server on connection (byond username, IP, and Computer ID.) Provided information for reference: Username:'[key]' IP:'[address]' Computer ID:'[computer_id]' If you continue to get this error, please restart byond or contact byond support.")
if(ckey(key) in admin_datums)
return ..()
@@ -38,17 +41,12 @@ world/IsBanned(key,address,computer_id)
diary << "Ban database connection failure. Key [ckeytext] not checked"
return
- var/failedcid = 1
- var/failedip = 1
-
var/ipquery = ""
var/cidquery = ""
if(address)
- failedip = 0
ipquery = " OR ip = '[address]' "
if(computer_id)
- failedcid = 0
cidquery = " OR computerid = '[computer_id]' "
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
@@ -79,8 +77,4 @@ world/IsBanned(key,address,computer_id)
return list("reason"="[bantype]", "desc"="[desc]")
- if (failedcid)
- message_admins("[key] has logged in with a blank computer id in the ban check.")
- if (failedip)
- message_admins("[key] has logged in with a blank ip in the ban check.")
return ..() //default pager ban stuff
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index df5db483430..9961cd2720e 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -66,11 +66,12 @@ var/global/nologevent = 0
body += "Jobban | "
body += "Appearance Ban | "
body += "Notes | "
- if(M.client.check_watchlist(M.client.ckey))
- body += "Remove from Watchlist | "
- body += "Edit Watchlist Reason "
- else
- body += "Add to Watchlist "
+ if(M.client)
+ if(M.client.check_watchlist(M.client.ckey))
+ body += "Remove from Watchlist | "
+ body += "Edit Watchlist Reason "
+ else
+ body += "Add to Watchlist "
if(M.client)
body += "| Prison | "
@@ -596,31 +597,32 @@ var/global/nologevent = 0
/datum/admins/proc/restart()
set category = "Server"
set name = "Restart"
- set desc="Restarts the world"
- if (!usr.client.holder)
- return
+ set desc="Restarts the world immediately"
+
+ if(!check_rights(R_ADMIN)) return
+
var/confirm = alert("Restart the game world?", "Restart", "Yes", "Cancel")
if(confirm == "Cancel")
return
if(confirm == "Yes")
- world << "\red Restarting world! \blue Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!"
- log_admin("[key_name(usr)] initiated a reboot.")
-
- feedback_set_details("end_error","admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]")
+ var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num
+ if(!delay)
+ delay = 50
+ else
+ delay = delay * 10
+ message_admins("[key_name_admin(usr)] has initiated a server restart with a delay of [delay/10] seconds")
+ log_admin("[key_name(usr)] has initiated a server restart with a delay of [delay/10] seconds")
+ ticker.delay_end = 0
feedback_add_details("admin_verb","R") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-
- if(blackbox)
- blackbox.save_all_data_to_sql()
-
- sleep(50)
- world.Reboot()
+ world.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "end_error", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay)
/datum/admins/proc/announce()
set category = "Special Verbs"
set name = "Announce"
set desc="Announce your desires to the world"
- if(!check_rights(0)) return
+
+ if(!check_rights(R_ADMIN)) return
var/message = input("Global message to send:", "Admin Announce", null, null) as message
if(message)
@@ -759,24 +761,6 @@ var/global/nologevent = 0
log_admin("[key_name(usr)] removed the delay.")
feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-/datum/admins/proc/immreboot()
- set category = "Server"
- set desc="Reboots the server post haste"
- set name="Immediate Reboot"
- if(!usr.client.holder) return
- if( alert("Reboot server?",,"Yes","No") == "No")
- return
- world << "\red Rebooting world! \blue Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!"
- log_admin("[key_name(usr)] initiated an immediate reboot.")
-
- feedback_set_details("end_error","immediate admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]")
- feedback_add_details("admin_verb","IR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-
- if(blackbox)
- blackbox.save_all_data_to_sql()
-
- world.Reboot()
-
/datum/admins/proc/unprison(var/mob/M in mob_list)
set category = "Admin"
set name = "Unprison"
@@ -997,6 +981,21 @@ proc/formatLocation(var/location)
proc/formatPlayerPanel(var/mob/U,var/text="PP")
return "[text]"
+//Kicks all the clients currently in the lobby. The second parameter (kick_only_afk) determins if an is_afk() check is ran, or if all clients are kicked
+//defaults to kicking everyone (afk + non afk clients in the lobby)
+//returns a list of ckeys of the kicked clients
+/proc/kick_clients_in_lobby(message, kick_only_afk = 0)
+ var/list/kicked_client_names = list()
+ for(var/client/C in clients)
+ if(istype(C.mob, /mob/new_player))
+ if(kick_only_afk && !C.is_afk()) //Ignore clients who are not afk
+ continue
+ if(message)
+ C << message
+ kicked_client_names.Add("[C.ckey]")
+ del(C)
+ return kicked_client_names
+
//returns 1 to let the dragdrop code know we are trapping this event
//returns 0 if we don't plan to trap the event
/datum/admins/proc/cmd_ghost_drag(var/mob/dead/observer/frommob, var/mob/living/tomob)
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index b41dece52d7..571f5c0463b 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -118,7 +118,6 @@ var/list/admin_verbs_server = list(
/datum/admins/proc/delay,
/datum/admins/proc/toggleaban,
/client/proc/toggle_log_hrefs,
- /datum/admins/proc/immreboot,
/client/proc/everyone_random,
/datum/admins/proc/toggleAI,
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm
index 8873f385d90..a345f9df321 100644
--- a/code/modules/admin/player_panel.dm
+++ b/code/modules/admin/player_panel.dm
@@ -197,7 +197,7 @@