[user] injects [M] with the syringe with [src]!")
-
else
to_chat(user, "You inject yourself with [src].")
+ add_attack_logs(user, M, attack_log, FALSE)
+ if(!iscarbon(user))
+ M.LAssailant = null
+ else
+ M.LAssailant = user
+
inject(M, user)
used = 1
icon_state = "dnainjector0"
diff --git a/code/game/objects/items/weapons/dnascrambler.dm b/code/game/objects/items/weapons/dnascrambler.dm
index 53ceac58fdd..cd1d79ae683 100644
--- a/code/game/objects/items/weapons/dnascrambler.dm
+++ b/code/game/objects/items/weapons/dnascrambler.dm
@@ -51,9 +51,7 @@
H.dna.ResetUIFrom(H)
target.update_icons()
- log_attack("[key_name(user)] injected [key_name(target)] with the [name]")
- log_game("[key_name_admin(user)] injected [key_name_admin(target)] with the [name]")
-
+ add_attack_logs(user, target, "injected with [src]")
used = 1
update_icon()
name = "used " + name
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index d1e47f34bca..56f49853b10 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -89,7 +89,7 @@
/obj/item/grenade/plastic/suicide_act(mob/user)
message_admins("[key_name_admin(user)](?) (FLW) suicided with [src.name] at ([user.x],[user.y],[user.z] - JMP)",0,1)
- message_admins("[key_name(user)] suicided with [name] at ([user.x],[user.y],[user.z])")
+ log_game("[key_name(user)] suicided with [name] at ([user.x],[user.y],[user.z])")
user.visible_message("[user] activates the [name] and holds it above \his head! It looks like \he's going out with a bang!")
var/message_say = "FOR NO RAISIN!"
if(user.mind)
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index d27bce20313..9a872257e3f 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -65,7 +65,7 @@
var/turf/target_turf = get_turf(target)
if(target_turf)
var/turflist = getline(user, target_turf)
- add_logs(user, target, "flamethrowered", addition="at [target.x],[target.y],[target.z]")
+ add_attack_logs(user, target, "Flamethrowered at [target.x],[target.y],[target.z]")
flame_turf(turflist)
/obj/item/flamethrower/attackby(obj/item/W as obj, mob/user as mob, params)
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index 5a099274915..070e058b2d0 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -46,7 +46,7 @@
else
feedback_add_details("handcuffs","H")
- add_logs(user, C, "handcuffed", src)
+ add_attack_logs(user, C, "Handcuffed ([src])")
else
to_chat(user, "You fail to handcuff [C].")
@@ -183,7 +183,7 @@
C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C)
C.update_handcuffed()
to_chat(user, "You handcuff [C].")
- add_logs(user, C, "ziptie-cuffed")
+ add_attack_logs(user, C, "Handcuffed (ziptie-cuffed)")
else
to_chat(user, "You fail to handcuff [C].")
diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm
index 94d476b6470..9a7c3f0e27c 100644
--- a/code/game/objects/items/weapons/implants/implant.dm
+++ b/code/game/objects/items/weapons/implants/implant.dm
@@ -54,7 +54,7 @@
H.sec_hud_set_implants()
if(user)
- add_logs(user, source, "implanted", object="[name]")
+ add_attack_logs(user, source, "Implanted with [src]")
return 1
diff --git a/code/game/objects/items/weapons/implants/implant_traitor.dm b/code/game/objects/items/weapons/implants/implant_traitor.dm
index fa7192f4f56..68ef65664c7 100644
--- a/code/game/objects/items/weapons/implants/implant_traitor.dm
+++ b/code/game/objects/items/weapons/implants/implant_traitor.dm
@@ -74,7 +74,7 @@
slaved.add_serv_hud(user.mind, "master") //handles master servent icons
slaved.add_serv_hud(H.mind, "mindslave")
- log_admin("[ckey(user.key)] has mind-slaved [ckey(H.key)].")
+ log_admin("[key_name(user)] has mind-slaved [key_name(H)].")
activated = 1
if(jobban_isbanned(M, ROLE_SYNDICATE))
ticker.mode.replace_jobbanned_player(M, ROLE_SYNDICATE)
diff --git a/code/game/objects/items/weapons/pneumaticCannon.dm b/code/game/objects/items/weapons/pneumaticCannon.dm
index 55515dc0947..84b8d55a915 100644
--- a/code/game/objects/items/weapons/pneumaticCannon.dm
+++ b/code/game/objects/items/weapons/pneumaticCannon.dm
@@ -114,7 +114,7 @@
if(!discharge)
user.visible_message("[user] fires \the [src]!", \
"You fire \the [src]!")
- add_logs(user, target, "fired at", src)
+ add_attack_logs(user, target, "Fired [src]")
playsound(src.loc, 'sound/weapons/sonic_jackhammer.ogg', 50, 1)
for(var/obj/item/ITD in loadedItems) //Item To Discharge
spawn(0)
diff --git a/code/game/objects/items/weapons/powerfist.dm b/code/game/objects/items/weapons/powerfist.dm
index 0af3018268c..7b6dfeb3a75 100644
--- a/code/game/objects/items/weapons/powerfist.dm
+++ b/code/game/objects/items/weapons/powerfist.dm
@@ -93,6 +93,6 @@
target.throw_at(throw_target, 5 * fisto_setting, 0.2)
- add_logs(user, target, "power fisted", src)
+ add_attack_logs(user, target, "POWER FISTED with [src]")
user.changeNext_move(CLICK_CD_MELEE * click_delay)
diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm
index deb1fc489c2..4d56e2a22ad 100644
--- a/code/game/objects/items/weapons/storage/bible.dm
+++ b/code/game/objects/items/weapons/storage/bible.dm
@@ -38,16 +38,11 @@
return
/obj/item/storage/bible/attack(mob/living/M as mob, mob/living/user as mob)
-
var/chaplain = 0
if(user.mind && (user.mind.assigned_role == "Chaplain"))
chaplain = 1
-
- M.create_attack_log("Has been attacked with [src.name] by [user.name] ([user.ckey])")
- user.create_attack_log("Used the [src.name] to attack [M.name] ([M.ckey])")
- log_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])")
-
+ add_attack_logs(user, M, "Hit with [src]")
if(!iscarbon(user))
M.LAssailant = null
else
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index ce8ed6ad167..95598a0ed23 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -160,7 +160,7 @@
var/mob/living/carbon/human/H = L
H.forcesay(hit_appends)
- add_logs(user, L, "stunned", object="stunbaton")
+ add_attack_logs(user, L, "Stunned with [src]")
/obj/item/melee/baton/emp_act(severity)
if(bcell)
diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm
index 55fa8177e15..3fc4b4b7717 100644
--- a/code/game/objects/items/weapons/swords_axes_etc.dm
+++ b/code/game/objects/items/weapons/swords_axes_etc.dm
@@ -55,8 +55,8 @@
return 0
playsound(get_turf(src), 'sound/effects/woodhit.ogg', 75, 1, -1)
target.Weaken(3)
- add_logs(user, target, "stunned", object="[src]")
- src.add_fingerprint(user)
+ add_attack_logs(user, target, "Stunned with [src]")
+ add_fingerprint(user)
target.visible_message("[user] has knocked down [target] with \the [src]!", \
"[user] has knocked down [target] with \the [src]!")
if(!iscarbon(user))
diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm
index 6f773d329ca..64a5c95f5c0 100644
--- a/code/game/objects/items/weapons/tanks/watertank.dm
+++ b/code/game/objects/items/weapons/tanks/watertank.dm
@@ -286,7 +286,7 @@
nanofrost_cooldown = 1
R.remove_any(50)
var/obj/effect/nanofrost_container/A = new /obj/effect/nanofrost_container(get_turf(src))
- log_game("[user.ckey] ([user.name]) used Nanofrost at [get_area(user)] ([user.x], [user.y], [user.z]).")
+ log_game("[key_name(user)] used Nanofrost at [get_area(user)] ([user.x], [user.y], [user.z]).")
playsound(src,'sound/items/syringeproj.ogg',40,1)
for(var/a=0, a<5, a++)
step_towards(A, target)
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index 49235504200..3e5d3386e0a 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -368,9 +368,7 @@
if(M.stat!=2)
M.emote("scream")
if(istype(user))
- M.create_attack_log("Has been cremated by [user.name] ([user.ckey])")
- user.create_attack_log("Cremated [M.name] ([M.ckey])")
- log_attack("[user.name] ([user.ckey]) cremated [M.name] ([M.ckey])")
+ add_attack_logs(user, M, "Cremated")
M.death(1)
if(QDELETED(M))
continue // Re-check for mobs that delete themselves on death
diff --git a/code/game/objects/structures/spirit_board.dm b/code/game/objects/structures/spirit_board.dm
index 253f93dc7ae..b6f66350f1f 100644
--- a/code/game/objects/structures/spirit_board.dm
+++ b/code/game/objects/structures/spirit_board.dm
@@ -33,7 +33,7 @@
notify_ghosts("Someone has begun playing with a [src.name] in [get_area(src)]!", source = src)
planchette = input("Choose the letter.", "Seance!") in list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
- add_logs(M, src, "picked a letter on", addition="which was \"[planchette]\".")
+ add_attack_logs(M, src, "Picked a letter on [src] which was \"[planchette]\".")
cooldown = world.time
lastuser = M.ckey
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index 9737b6fe0da..002bbb566d6 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -190,7 +190,7 @@
G.affecting.Weaken(2)
G.affecting.visible_message("[G.assailant] pushes [G.affecting] onto [src].", \
"[G.assailant] pushes [G.affecting] onto [src].")
- add_logs(G.assailant, G.affecting, "pushed onto a table")
+ add_attack_logs(G.assailant, G.affecting, "Pushed onto a table")
qdel(I)
return 1
qdel(I)
diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm
index cd68b0ec3b0..29d5e41b716 100644
--- a/code/game/verbs/ooc.dm
+++ b/code/game/verbs/ooc.dm
@@ -40,7 +40,7 @@ var/global/admin_ooc_colour = "#b82e00"
message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]")
return
- log_ooc("[mob.name]/[key] : [msg]")
+ log_ooc(msg, src)
var/display_colour = normal_ooc_colour
if(holder && !holder.fakekey)
@@ -187,7 +187,7 @@ var/global/admin_ooc_colour = "#b82e00"
message_admins("[key_name_admin(src)] has attempted to advertise in LOOC: [msg]")
return
- log_ooc("(LOCAL) [mob.name]/[key] : [msg]")
+ log_looc(msg, src)
var/mob/source = mob.get_looc_source()
var/list/heard = get_mobs_in_view(7, source)
diff --git a/code/game/world.dm b/code/game/world.dm
new file mode 100644
index 00000000000..f7cf1a758b7
--- /dev/null
+++ b/code/game/world.dm
@@ -0,0 +1,494 @@
+#define RECOMMENDED_VERSION 510
+
+var/global/list/map_transition_config = MAP_TRANSITION_CONFIG
+
+/world/New()
+ SetupLogs()
+ log_world("World loaded at [time_stamp()]")
+ log_world("[GLOB.vars.len - GLOB.gvars_datum_in_built_vars.len] global variables")
+
+ if(byond_version < RECOMMENDED_VERSION)
+ log_world("Your server's byond version does not meet the recommended requirements for this code. Please update BYOND")
+
+ if(config && config.server_name != null && config.server_suffix && world.port > 0)
+ // dumb and hardcoded but I don't care~
+ config.server_name += " #[(world.port % 1000) / 100]"
+
+ GLOB.timezoneOffset = text2num(time2text(0, "hh")) * 36000
+
+ callHook("startup")
+
+ src.update_status()
+
+ . = ..()
+
+ // Create robolimbs for chargen.
+ populate_robolimb_list()
+
+ space_manager.initialize() //Before the MC starts up
+
+ Master.Initialize(10, FALSE)
+
+ processScheduler = new
+ master_controller = new /datum/controller/game_controller()
+ spawn(1)
+ processScheduler.deferSetupFor(/datum/controller/process/ticker)
+ processScheduler.setup()
+
+ master_controller.setup()
+
+ if(using_map && using_map.name)
+ map_name = "[using_map.name]"
+ else
+ map_name = "Unknown"
+
+
+ if(config && config.server_name)
+ name = "[config.server_name]: [station_name()]"
+ else
+ name = station_name()
+
+
+#undef RECOMMENDED_VERSION
+
+ return
+
+//world/Topic(href, href_list[])
+// to_chat(world, "Received a Topic() call!")
+// to_chat(world, "[href]")
+// for(var/a in href_list)
+// to_chat(world, "[a]")
+// if(href_list["hello"])
+// to_chat(world, "Hello world!")
+// return "Hello world!"
+// to_chat(world, "End of Topic() call.")
+// ..()
+
+var/world_topic_spam_protect_ip = "0.0.0.0"
+var/world_topic_spam_protect_time = world.timeofday
+
+/world/Topic(T, addr, master, key)
+ log_debug("WORLD/TOPIC: \"[T]\", from:[addr], master:[master], key:[key]")
+
+ var/list/input = params2list(T)
+ var/key_valid = (config.comms_password && input["key"] == config.comms_password) //no password means no comms, not any password
+
+ if("ping" in input)
+ var/x = 1
+ for(var/client/C)
+ x++
+ return x
+
+ else if("players" in input)
+ var/n = 0
+ for(var/mob/M in player_list)
+ if(M.client)
+ n++
+ return n
+
+ else if("status" in input)
+ var/list/s = list()
+ var/list/admins = list()
+ s["version"] = game_version
+ s["mode"] = master_mode
+ s["respawn"] = config ? abandon_allowed : 0
+ s["enter"] = enter_allowed
+ s["vote"] = config.allow_vote_mode
+ s["ai"] = config.allow_ai
+ s["host"] = host ? host : null
+ s["players"] = list()
+ s["roundtime"] = worldtime2text()
+ s["stationtime"] = station_time_timestamp()
+ s["oldstationtime"] = classic_worldtime2text() // more "consistent" indication of the round's running time
+ s["listed"] = "Public"
+ if(!hub_password)
+ s["listed"] = "Invisible"
+ var/player_count = 0
+ var/admin_count = 0
+
+ for(var/client/C in clients)
+ if(C.holder)
+ if(C.holder.fakekey)
+ continue //so stealthmins aren't revealed by the hub
+ admin_count++
+ admins += list(list(C.key, C.holder.rank))
+ s["player[player_count]"] = C.key
+ player_count++
+ s["players"] = player_count
+ s["admins"] = admin_count
+ s["map_name"] = map_name ? map_name : "Unknown"
+
+ if(key_valid)
+ if(ticker && ticker.mode)
+ s["real_mode"] = ticker.mode.name
+
+ s["security_level"] = get_security_level()
+ s["ticker_state"] = ticker.current_state
+
+ if(shuttle_master && shuttle_master.emergency)
+ // Shuttle status, see /__DEFINES/stat.dm
+ s["shuttle_mode"] = shuttle_master.emergency.mode
+ // Shuttle timer, in seconds
+ s["shuttle_timer"] = shuttle_master.emergency.timeLeft()
+
+ for(var/i in 1 to admins.len)
+ var/list/A = admins[i]
+ s["admin[i - 1]"] = A[1]
+ s["adminrank[i - 1]"] = A[2]
+
+ return list2params(s)
+
+ else if("manifest" in input)
+ var/list/positions = list()
+ var/list/set_names = list(
+ "heads" = command_positions,
+ "sec" = security_positions,
+ "eng" = engineering_positions,
+ "med" = medical_positions,
+ "sci" = science_positions,
+ "car" = supply_positions,
+ "srv" = service_positions,
+ "civ" = civilian_positions,
+ "bot" = nonhuman_positions
+ )
+
+ for(var/datum/data/record/t in data_core.general)
+ var/name = t.fields["name"]
+ var/rank = t.fields["rank"]
+ var/real_rank = t.fields["real_rank"]
+
+ var/department = 0
+ for(var/k in set_names)
+ if(real_rank in set_names[k])
+ if(!positions[k])
+ positions[k] = list()
+ positions[k][name] = rank
+ department = 1
+ if(!department)
+ if(!positions["misc"])
+ positions["misc"] = list()
+ positions["misc"][name] = rank
+
+ return json_encode(positions)
+
+ else if("adminmsg" in input)
+ /*
+ We got an adminmsg from IRC bot lets split the input then validate the input.
+ expected output:
+ 1. adminmsg = ckey of person the message is to
+ 2. msg = contents of message, parems2list requires
+ 3. validatationkey = the key the bot has, it should match the gameservers commspassword in it's configuration.
+ 4. sender = the ircnick that send the message.
+ */
+ if(!key_valid)
+ return keySpamProtect(addr)
+
+ var/client/C
+
+ for(var/client/K in clients)
+ if(K.ckey == input["adminmsg"])
+ C = K
+ break
+ if(!C)
+ return "No client with that name on server"
+
+ var/message = "IRC-Admin PM from [C.holder ? "IRC-" + input["sender"] : "Administrator"]: [input["msg"]]"
+ var/amessage = "IRC-Admin PM from IRC-[input["sender"]] to [key_name(C)] : [input["msg"]]"
+
+ C.received_irc_pm = world.time
+ C.irc_admin = input["sender"]
+
+ C << 'sound/effects/adminhelp.ogg'
+ to_chat(C, message)
+
+ for(var/client/A in admins)
+ if(A != C)
+ to_chat(A, amessage)
+
+ return "Message Successful"
+
+ else if("notes" in input)
+ /*
+ We got a request for notes from the IRC Bot
+ expected output:
+ 1. notes = ckey of person the notes lookup is for
+ 2. validationkey = the key the bot has, it should match the gameservers commspassword in it's configuration.
+ */
+ if(!key_valid)
+ return keySpamProtect(addr)
+
+ return show_player_info_irc(input["notes"])
+
+ else if("announce" in input)
+ if(config.comms_password)
+ if(input["key"] != config.comms_password)
+ return "Bad Key"
+ else
+ for(var/client/C in clients)
+ to_chat(C, "PR: [input["announce"]]")
+
+ else if("kick" in input)
+ /*
+ We have a kick request over coms.
+ Only needed portion is the ckey
+ */
+ if(!key_valid)
+ return keySpamProtect(addr)
+
+ var/client/C
+
+ for(var/client/K in clients)
+ if(K.ckey == input["kick"])
+ C = K
+ break
+ if(!C)
+ return "No client with that name on server"
+
+ del(C)
+
+ return "Kick Successful"
+
+ else if("setlog" in input)
+ if(!key_valid)
+ return keySpamProtect(addr)
+
+ SetupLogs()
+
+ return "Logs set to current date"
+
+ else if("setlist" in input)
+ if(!key_valid)
+ return keySpamProtect(addr)
+ if(input["req"] == "public")
+ hub_password = hub_password_base
+ update_status()
+ return "Set listed status to public."
+ else
+ hub_password = ""
+ update_status()
+ return "Set listed status to invisible."
+
+/proc/keySpamProtect(var/addr)
+ if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50)
+ spawn(50)
+ world_topic_spam_protect_time = world.time
+ return "Bad Key (Throttled)"
+
+ world_topic_spam_protect_time = world.time
+ world_topic_spam_protect_ip = addr
+ return "Bad Key"
+
+/world/Reboot(var/reason, var/feedback_c, var/feedback_r, var/time)
+ if(reason == 1) //special reboot, do none of the normal stuff
+ if(usr)
+ message_admins("[key_name_admin(usr)] has requested an immediate world restart via client side debugging tools")
+ log_admin("[key_name(usr)] has requested an immediate world restart via client side debugging tools")
+ spawn(0)
+ to_chat(world, "Rebooting world immediately due to host request")
+ shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
+ if(config && config.shutdown_on_reboot)
+ sleep(0)
+ if(shutdown_shell_command)
+ shell(shutdown_shell_command)
+ del(world)
+ return
+ else
+ return ..(1)
+
+ var/delay
+ if(!isnull(time))
+ delay = max(0,time)
+ else
+ delay = ticker.restart_timeout
+ if(ticker.delay_end)
+ to_chat(world, "An admin has delayed the round end.")
+ return
+ to_chat(world, "Rebooting world in [delay/10] [delay > 10 ? "seconds" : "second"]. [reason]")
+
+ var/round_end_sound = pick(round_end_sounds)
+ var/sound_length = round_end_sounds[round_end_sound]
+ if(delay > sound_length) // If there's time, play the round-end sound before rebooting
+ spawn(delay - sound_length)
+ if(!ticker.delay_end)
+ world << round_end_sound
+ sleep(delay)
+ if(blackbox)
+ blackbox.save_all_data_to_sql()
+ if(ticker.delay_end)
+ to_chat(world, "Reboot was cancelled by an admin.")
+ return
+ feedback_set_details("[feedback_c]","[feedback_r]")
+ log_game("Rebooting world. [reason]")
+ //kick_clients_in_lobby("The round came to an end with you in the lobby.", 1)
+
+ processScheduler.stop()
+ shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
+
+ if(config && config.shutdown_on_reboot)
+ sleep(0)
+ if(shutdown_shell_command)
+ shell(shutdown_shell_command)
+ del(world)
+ return
+ else
+ for(var/client/C in clients)
+ if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
+ C << link("byond://[config.server]")
+ ..(0)
+
+
+/hook/startup/proc/loadMode()
+ world.load_mode()
+ return 1
+
+/world/proc/load_mode()
+ var/list/Lines = file2list("data/mode.txt")
+ if(Lines.len)
+ if(Lines[1])
+ master_mode = Lines[1]
+ log_game("Saved mode is '[master_mode]'")
+
+/world/proc/save_mode(var/the_mode)
+ var/F = file("data/mode.txt")
+ fdel(F)
+ F << the_mode
+
+/hook/startup/proc/loadMOTD()
+ world.load_motd()
+ return 1
+
+/world/proc/load_motd()
+ join_motd = file2text("config/motd.txt")
+
+
+/proc/load_configuration()
+ config = new /datum/configuration()
+ config.load("config/config.txt")
+ config.load("config/game_options.txt","game_options")
+ config.loadsql("config/dbconfig.txt")
+ config.loadoverflowwhitelist("config/ofwhitelist.txt")
+ // apply some settings from config..
+
+/world/proc/update_status()
+ var/s = ""
+
+ if(config && config.server_name)
+ s += "[config.server_name] — "
+
+ s += "[station_name()]";
+ s += " ("
+ s += "" //Change this to wherever you want the hub to link to.
+ s += "[game_version]"
+ s += ""
+ s += ")"
+ s += "
The Perfect Mix of RP & Action
"
+
+
+
+
+ var/list/features = list()
+
+ if(ticker)
+ if(master_mode)
+ features += master_mode
+ else
+ features += "STARTING"
+
+ if(!enter_allowed)
+ features += "closed"
+
+ features += abandon_allowed ? "respawn" : "no respawn"
+
+ if(config && config.allow_vote_mode)
+ features += "vote"
+
+ if(config && config.allow_ai)
+ features += "AI allowed"
+
+ var/n = 0
+ for(var/mob/M in player_list)
+ if(M.client)
+ n++
+
+ if(n > 1)
+ features += "~[n] players"
+ else if(n > 0)
+ features += "~[n] player"
+
+ /*
+ is there a reason for this? the byond site shows 'hosted by X' when there is a proper host already.
+ if(host)
+ features += "hosted by [host]"
+ */
+
+// if(!host && config && config.hostedby)
+// features += "hosted by [config.hostedby]"
+
+ if(features)
+ s += ": [jointext(features, ", ")]"
+
+ /* does this help? I do not know */
+ if(src.status != s)
+ src.status = s
+
+#define FAILED_DB_CONNECTION_CUTOFF 5
+var/failed_db_connections = 0
+var/failed_old_db_connections = 0
+
+/world/proc/SetupLogs()
+ GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")]"
+ GLOB.world_game_log = "[GLOB.log_directory]/game.log"
+ GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
+ GLOB.world_runtime_log = "[GLOB.log_directory]/runtime.log"
+ start_log(GLOB.world_game_log)
+ start_log(GLOB.world_href_log)
+ start_log(GLOB.world_runtime_log)
+
+ if(fexists(GLOB.config_error_log))
+ fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log")
+ fdel(GLOB.config_error_log)
+
+
+/hook/startup/proc/connectDB()
+ if(!setup_database_connection())
+ log_world("Your server failed to establish a connection with the feedback database.")
+ else
+ log_world("Feedback database connection established.")
+ return 1
+
+/proc/setup_database_connection()
+
+ if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore.
+ return 0
+
+ if(!dbcon)
+ dbcon = new()
+
+ var/user = sqlfdbklogin
+ var/pass = sqlfdbkpass
+ var/db = sqlfdbkdb
+ var/address = sqladdress
+ var/port = sqlport
+
+ dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
+ . = dbcon.IsConnected()
+ if( . )
+ failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter.
+ else
+ failed_db_connections++ //If it failed, increase the failed connections counter.
+ log_world(dbcon.ErrorMsg())
+
+ return .
+
+//This proc ensures that the connection to the feedback database (global variable dbcon) is established
+proc/establish_db_connection()
+ if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF)
+ return 0
+
+ if(!dbcon || !dbcon.IsConnected())
+ return setup_database_connection()
+ else
+ return 1
+
+#undef FAILED_DB_CONNECTION_CUTOFF
+
diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm
index 4015c2fda1c..b97993d5327 100644
--- a/code/modules/admin/IsBanned.dm
+++ b/code/modules/admin/IsBanned.dm
@@ -1,11 +1,11 @@
//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]")
+ log_adminwarn("Failed Login (invalid data): [key] [address]-[computer_id]")
return list("reason"="invalid login data", "desc"="Error: Could not check ban status, please try again. Error message: 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(text2num(computer_id) == 2147483647) //this cid causes stickybans to go haywire
- log_access("Failed Login (invalid cid): [key] [address]-[computer_id]")
+ log_adminwarn("Failed Login (invalid cid): [key] [address]-[computer_id]")
return list("reason"="invalid login data", "desc"="Error: Could not check ban status, Please try again. Error message: Your computer provided an invalid Computer ID.")
var/admin = 0
var/ckey = ckey(key)
@@ -16,13 +16,13 @@ world/IsBanned(key,address,computer_id)
//Guest Checking
if(!guests_allowed && IsGuestKey(key))
- log_access("Failed Login: [key] [computer_id] [address] - Guests not allowed")
+ log_adminwarn("Failed Login: [key] [computer_id] [address] - Guests not allowed")
// message_admins("Failed Login: [key] - Guests not allowed")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a BYOND account.")
//check if the IP address is a known Tor node
if(config.ToRban && ToRban_isbanned(address))
- log_access("Failed Login: [key] [computer_id] [address] - Banned: Tor")
+ log_adminwarn("Failed Login: [key] [computer_id] [address] - Banned: Tor")
message_admins("Failed Login: [key] - Banned: Tor")
//ban their computer_id and ckey for posterity
AddBan(ckey(key), computer_id, "Use of Tor", "Automated Ban", 0, 0)
@@ -41,14 +41,13 @@ world/IsBanned(key,address,computer_id)
message_admins("The admin [key] has been allowed to bypass a matching ban on [.["key"]]")
addclientmessage(ckey,"You have been allowed to bypass a matching ban on [.["key"]].")
else
- log_access("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]")
+ log_adminwarn("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]")
return .
else
var/ckeytext = ckey(key)
if(!establish_db_connection())
- log_to_dd("Ban database connection failure. Key [ckeytext] not checked")
- diary << "Ban database connection failure. Key [ckeytext] not checked"
+ log_world("Ban database connection failure. Key [ckeytext] not checked")
return
var/ipquery = ""
@@ -100,7 +99,7 @@ world/IsBanned(key,address,computer_id)
. = list("reason"="[bantype]", "desc"="[desc]")
- log_access("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]")
+ log_adminwarn("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]")
return .
. = ..() //default pager ban stuff
@@ -114,6 +113,6 @@ world/IsBanned(key,address,computer_id)
addclientmessage(ckey,"You have been allowed to bypass a matching host/sticky ban.")
return null
else
- log_access("Failed Login: [key] [computer_id] [address] - Banned [.["message"]]")
+ log_adminwarn("Failed Login: [key] [computer_id] [address] - Banned [.["message"]]")
return .
diff --git a/code/modules/admin/ToRban.dm b/code/modules/admin/ToRban.dm
index 77e49877259..05af7c15cf5 100644
--- a/code/modules/admin/ToRban.dm
+++ b/code/modules/admin/ToRban.dm
@@ -22,7 +22,7 @@
/proc/ToRban_update()
spawn(0)
- diary << "Downloading updated ToR data..."
+ log_world("Downloading updated ToR data...")
var/http[] = world.Export("http://exitlist.torproject.org/exit-addresses")
var/list/rawlist = file2list(http["CONTENT"])
@@ -36,11 +36,11 @@
if(!cleaned) continue
F[cleaned] << 1
to_chat(F["last_update"], world.realtime)
- diary << "ToR data updated!"
+ log_world("ToR data updated!")
if(usr)
to_chat(usr, "ToRban updated.")
return 1
- diary << "ToR data update aborted: no data."
+ log_world("ToR data update aborted: no data.")
return 0
/client/proc/ToRban(task in list("update","toggle","show","remove","remove all","find"))
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index ce5ac02b85a..b155ddc13dd 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -4,14 +4,12 @@ var/global/nologevent = 0
////////////////////////////////
/proc/message_admins(var/msg)
msg = "ADMIN LOG: [msg]"
- log_adminwarn(msg)
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights)
if(C.prefs && !(C.prefs.toggles & CHAT_NO_ADMINLOGS))
to_chat(C, msg)
/proc/msg_admin_attack(var/text) //Toggleable Attack Messages
- log_attack(text)
if(!nologevent)
var/rendered = "ATTACK: [text]"
for(var/client/C in admins)
@@ -866,13 +864,13 @@ var/global/nologevent = 0
for(var/mob/living/silicon/S in mob_list)
ai_number++
if(isAI(S))
- to_chat(usr, "AI [key_name(S, usr)]'s laws:")
+ to_chat(usr, "AI [key_name(S, TRUE)]'s laws:")
else if(isrobot(S))
var/mob/living/silicon/robot/R = S
- to_chat(usr, "CYBORG [key_name(S, usr)]'s [R.connected_ai?"(Slaved to: [R.connected_ai])":"(Independent)"] laws:")
+ to_chat(usr, "CYBORG [key_name(S, TRUE)]'s [R.connected_ai?"(Slaved to: [R.connected_ai])":"(Independent)"] laws:")
else if(ispAI(S))
var/mob/living/silicon/pai/P = S
- to_chat(usr, "pAI [key_name(S, usr)]'s laws:")
+ to_chat(usr, "pAI [key_name(S, TRUE)]'s laws:")
to_chat(usr, "[P.pai_law0]")
if(P.pai_laws)
to_chat(usr, "[P.pai_laws]")
diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm
index 3eb12b11e68..4623a46d7d1 100644
--- a/code/modules/admin/admin_investigate.dm
+++ b/code/modules/admin/admin_investigate.dm
@@ -40,8 +40,8 @@
if("hrefs") //persistant logs and stuff
if(config && config.log_hrefs)
- if(href_logfile)
- src << browse(href_logfile,"window=investigate[subject];size=800x300")
+ if(GLOB.world_href_log)
+ src << browse(file(GLOB.world_href_log), "window=investigate[subject];size=800x300")
else
to_chat(src, "Error: admin_investigate: No href logfile found.")
return
diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm
index 7b5c4073293..45e85a847fe 100644
--- a/code/modules/admin/admin_ranks.dm
+++ b/code/modules/admin/admin_ranks.dm
@@ -104,8 +104,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
establish_db_connection()
if(!dbcon.IsConnected())
- log_to_dd("Failed to connect to database in load_admins(). Reverting to legacy system.")
- diary << "Failed to connect to database in load_admins(). Reverting to legacy system."
+ log_world("Failed to connect to database in load_admins(). Reverting to legacy system.")
config.admin_legacy_system = 1
load_admins()
return
@@ -124,8 +123,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(directory[ckey])
if(!admin_datums)
- log_to_dd("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
- diary << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system."
+ log_world("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
config.admin_legacy_system = 1
load_admins()
return
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index e3889ebf1bd..43652f0784d 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -19,17 +19,13 @@ var/list/admin_verbs_admin = list(
/client/proc/resetcolorooc, /*allows us to set a reset our ooc color*/
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
/client/proc/toggle_view_range, /*changes how far we can see*/
- /datum/admins/proc/view_txt_log, /*shows the server log (diary) for today*/
- /datum/admins/proc/view_atk_log, /*shows the server combat-log, doesn't do anything presently*/
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/
/client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/
- /client/proc/giveruntimelog, /*allows us to give access to runtime logs to somebody*/
- /client/proc/getruntimelog, /*allows us to access runtime logs to somebody*/
- /client/proc/getserverlog, /*allows us to fetch server logs (diary) for other days*/
+ /client/proc/getserverlogs, /*allows us to fetch server logs (diary) for other days*/
/client/proc/jumptocoord, /*we ghost and jump to a coordinate*/
/client/proc/Getmob, /*teleports a mob to our location*/
/client/proc/Getkey, /*teleports a mob with a certain ckey to our location*/
diff --git a/code/modules/admin/banappearance.dm b/code/modules/admin/banappearance.dm
index 06deaa1c461..ff461c0f333 100644
--- a/code/modules/admin/banappearance.dm
+++ b/code/modules/admin/banappearance.dm
@@ -52,8 +52,7 @@ DEBUG
log_admin("appearance_keylist was empty")
else
if(!establish_db_connection())
- log_to_dd("Database connection failed. Reverting to the legacy ban system.")
- diary << "Database connection failed. Reverting to the legacy ban system."
+ log_world("Database connection failed. Reverting to the legacy ban system.")
config.ban_legacy_system = 1
appearance_loadbanfile()
return
diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm
index 6dd7930b120..920bb933f32 100644
--- a/code/modules/admin/banjob.dm
+++ b/code/modules/admin/banjob.dm
@@ -78,8 +78,7 @@ DEBUG
log_runtime(EXCEPTION("Skipping malformed job ban: [s]"))
else
if(!establish_db_connection())
- log_to_dd("Database connection failed. Reverting to the legacy ban system.")
- diary << "Database connection failed. Reverting to the legacy ban system."
+ log_world("Database connection failed. Reverting to the legacy ban system.")
config.ban_legacy_system = 1
jobban_loadbanfile()
return
diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm
index 9c0564a6bf1..c38b42ad9b5 100644
--- a/code/modules/admin/verbs/adminhelp.dm
+++ b/code/modules/admin/verbs/adminhelp.dm
@@ -109,7 +109,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
switch(selected_type)
if("Mentorhelp")
- msg = "[selected_type]: [key_name(src, 1, 1, selected_type)] (?) (PP) (VV) (SM) ([admin_jump_link(mob)]) (CA) (REJT) [ai_found ? " (CL)" : ""] (TAKE) : [msg]"
+ msg = "[selected_type]: [key_name(src, TRUE, selected_type)] (?) (PP) (VV) (SM) ([admin_jump_link(mob)]) (CA) (REJT) [ai_found ? " (CL)" : ""] (TAKE) : [msg]"
for(var/client/X in mentorholders + modholders + adminholders)
if(X.prefs.sound & SOUND_ADMINHELP)
X << 'sound/effects/adminhelp.ogg'
@@ -123,7 +123,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
T.addResponse(usr.client, msg)
else
ticketNum = globAdminTicketHolder.getTicketCounter() // ticketNum is the ticket ready to be assigned.
- msg = "[selected_type]: [key_name(src, 1, 1, selected_type)] (?) (PP) (VV) (SM) ([admin_jump_link(mob)]) (CA) (TICKET) [ai_found ? " (CL)" : ""](TAKE) : [msg]"
+ msg = "[selected_type]: [key_name(src, TRUE, selected_type)] (?) (PP) (VV) (SM) ([admin_jump_link(mob)]) (CA) (TICKET) [ai_found ? " (CL)" : ""](TAKE) : [msg]"
//Open a new adminticket and inform the user.
globAdminTicketHolder.newTicket(src, prunedmsg, msg)
for(var/client/X in modholders + adminholders)
diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm
index 4c045e193c8..474b9795b59 100644
--- a/code/modules/admin/verbs/adminpm.dm
+++ b/code/modules/admin/verbs/adminpm.dm
@@ -88,7 +88,7 @@
//get message text, limit it's length.and clean/escape html
if(!msg)
- msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as text|null
+ msg = input(src,"Message:", "Private message to [key_name(C, 0)]") as text|null
if(!msg)
return
@@ -152,9 +152,9 @@
var/emoji_msg = "[msg]"
- recieve_message = "[type] from-[recieve_pm_type][key_name(src, C, C.holder ? 1 : 0, type)]: [emoji_msg]"
+ recieve_message = "[type] from-[recieve_pm_type][key_name(src, TRUE, type)]: [emoji_msg]"
to_chat(C, recieve_message)
- to_chat(src, "[send_pm_type][type] to-[key_name(C, src, holder ? 1 : 0, type)]: [emoji_msg]")
+ to_chat(src, "[send_pm_type][type] to-[key_name(C, TRUE, type)]: [emoji_msg]")
/*if(holder && !C.holder)
C.last_pm_recieved = world.time
@@ -175,13 +175,13 @@
switch(type)
if("Mentorhelp")
if(check_rights(R_ADMIN|R_MOD|R_MENTOR, 0, X.mob))
- to_chat(X, "[type]: [key_name(src, X, 0, type)]->[key_name(C, X, 0, type)]: [emoji_msg]")
+ to_chat(X, "[type]: [key_name(src, TRUE, type)]->[key_name(C, TRUE, type)]: [emoji_msg]")
if("Adminhelp")
if(check_rights(R_ADMIN|R_MOD, 0, X.mob))
- to_chat(X, "[type]: [key_name(src, X, 0, type)]->[key_name(C, X, 0, type)]: [emoji_msg]")
+ to_chat(X, "[type]: [key_name(src, TRUE, type)]->[key_name(C, TRUE, type)]: [emoji_msg]")
else
if(check_rights(R_ADMIN|R_MOD, 0, X.mob))
- to_chat(X, "[type]: [key_name(src, X, 0, type)]->[key_name(C, X, 0, type)]: [emoji_msg]")
+ to_chat(X, "[type]: [key_name(src, TRUE, type)]->[key_name(C, TRUE, type)]: [emoji_msg]")
//Check if the mob being PM'd has any open admin tickets.
var/tickets = list()
@@ -226,4 +226,4 @@
if(X == src)
continue
if(check_rights(R_ADMIN|R_MOD|R_MENTOR, 0, X.mob))
- to_chat(X, "PM: [key_name(src, X, 0)]->IRC-Admins: [msg]")
+ to_chat(X, "PM: [key_name(src, TRUE, 0)]->IRC-Admins: [msg]")
diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm
index cbcacc43006..f091e49f60e 100644
--- a/code/modules/admin/verbs/adminsay.dm
+++ b/code/modules/admin/verbs/adminsay.dm
@@ -7,7 +7,7 @@
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
if(!msg) return
- log_admin("[key_name(src)] : [msg]")
+ log_adminsay(msg, src)
if(check_rights(R_ADMIN,0))
for(var/client/C in admins)
@@ -25,7 +25,7 @@
return
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
- log_admin("MENTOR: [key_name(src)] : [msg]")
+ log_mentorsay(msg, src)
if(!msg)
return
diff --git a/code/modules/admin/verbs/antag-ooc.dm b/code/modules/admin/verbs/antag-ooc.dm
index cc33f7948f4..2e0c044c424 100644
--- a/code/modules/admin/verbs/antag-ooc.dm
+++ b/code/modules/admin/verbs/antag-ooc.dm
@@ -17,4 +17,4 @@
to_chat(M, "AOOC: [display_name]: [msg]")
- log_ooc("(ANTAG) [key] : [msg]")
+ log_aooc(msg, src)
diff --git a/code/modules/admin/verbs/freeze.dm b/code/modules/admin/verbs/freeze.dm
index 523fe5cb302..9439c63e861 100644
--- a/code/modules/admin/verbs/freeze.dm
+++ b/code/modules/admin/verbs/freeze.dm
@@ -118,7 +118,7 @@ var/global/list/frozen_mob_list = list()
M.addVerb(/obj/mecha/verb/eject)
to_chat(M.occupant, "You have been unfrozen by [key]")
message_admins("[key_name_admin(usr)] unfroze [key_name(M.occupant)] in a [M.name]")
- log_admin("[key_name(usr)] unfroze [M.occupant.name]/[M.occupant.ckey] in a [M.name]")
+ log_admin("[key_name(usr)] unfroze [key_name(M.occupant)] in a [M.name]")
else
message_admins("[key_name_admin(usr)] unfroze an empty [M.name]")
log_admin("[key_name(usr)] unfroze an empty [M.name]")
diff --git a/code/modules/admin/verbs/getlogs.dm b/code/modules/admin/verbs/getlogs.dm
index 48507a55352..22c6d778733 100644
--- a/code/modules/admin/verbs/getlogs.dm
+++ b/code/modules/admin/verbs/getlogs.dm
@@ -14,56 +14,11 @@
*/
-//This proc allows Game Masters to grant a client access to the .getruntimelog verb
-//Permissions expire at the end of each round.
-//Runtimes can be used to meta or spot game-crashing exploits so it's advised to only grant coders that
-//you trust access. Also, it may be wise to ensure that they are not going to play in the current round.
-/client/proc/giveruntimelog()
- set name = ".giveruntimelog"
- set desc = "Give somebody access to any session logfiles saved to the /log/runtime/ folder."
- set category = null
-
- if(!src.holder)
- to_chat(src, "Only Admins may use this command.")
- return
-
- var/client/target = input(src,"Choose somebody to grant access to the server's runtime logs (permissions expire at the end of each round):","Grant Permissions",null) as null|anything in clients
- if(!istype(target,/client))
- to_chat(src, "Error: giveruntimelog(): Client not found.")
- return
-
- target.verbs |= /client/proc/getruntimelog
- to_chat(target, "You have been granted access to runtime logs. Please use them responsibly or risk being banned.")
- return
-
-
-//This proc allows download of runtime logs saved within the data/logs/ folder by dreamdeamon.
-//It works similarly to show-server-log.
-/client/proc/getruntimelog()
- set name = ".getruntimelog"
- set desc = "Retrieve any session logfiles saved by dreamdeamon."
- set category = null
-
- var/path = browse_files("data/logs/runtime/")
- if(!path)
- return
-
- if(file_spam_check())
- return
-
- message_admins("[key_name_admin(src)] accessed file: [path]")
- src << ftp(file(path))
-
- to_chat(src, "Attempting to send file, this may take a fair few minutes if the file is very large.")
- return
-
-
//This proc allows download of past server logs saved within the data/logs/ folder.
-//It works similarly to show-server-log.
-/client/proc/getserverlog()
- set name = ".getserverlog"
- set desc = "Fetch logfiles from data/logs"
- set category = null
+/client/proc/getserverlogs()
+ set name = "Get Server Logs"
+ set desc = "View/retrieve logfiles."
+ set category = "Admin"
var/path = browse_files("data/logs/")
if(!path)
@@ -73,44 +28,14 @@
return
message_admins("[key_name_admin(src)] accessed file: [path]")
- src << ftp(file(path))
-
- to_chat(src, "Attempting to send file, this may take a fair few minutes if the file is very large.")
- return
-
-
-//Other log stuff put here for the sake of organisation
-
-//Shows today's server log
-/datum/admins/proc/view_txt_log()
- set category = "Admin"
- set name = "Show Server Log"
- set desc = "Shows today's server log."
-
- var/path = "data/logs/[time2text(world.realtime,"YYYY/MM-Month/DD-Day")].log"
- if( fexists(path) )
- src << ftp(file(path))
-
- else
- to_chat(src, "Error: view_txt_log(): File not found/Invalid path([path]).")
- return
- feedback_add_details("admin_verb","VTL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- return
-
-//Shows today's attack log
-/datum/admins/proc/view_atk_log()
- set category = "Admin"
- set name = "Show Server Attack Log"
- set desc = "Shows today's server attack log."
-
- var/path = "data/logs/[time2text(world.realtime,"YYYY/MM-Month/DD-Day")] Attack.log"
- if( fexists(path) )
- src << ftp(file(path))
-
- else
- to_chat(src, "Error: view_atk_log(): File not found/Invalid path([path]).")
- return
- usr << run(file(path))
-
- feedback_add_details("admin_verb","SSAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- return
+ switch(alert("View (in game), Open (in your system's text editor), or Download?", path, "View", "Open", "Download"))
+ if ("View")
+ src << browse("[html_encode(file2text(file(path)))]
", list2params(list("window" = "viewfile.[path]")))
+ if ("Open")
+ src << run(file(path))
+ if ("Download")
+ src << ftp(file(path))
+ else
+ return
+ to_chat(src, "Attempting to send [path], this may take a fair few minutes if the file is very large.")
+ return
\ No newline at end of file
diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm
index 084057498bb..b26a27b3aa6 100644
--- a/code/modules/admin/verbs/massmodvar.dm
+++ b/code/modules/admin/verbs/massmodvar.dm
@@ -201,7 +201,7 @@
if(rejected)
to_chat(src, "[rejected] out of [count] objects rejected your edit")
- log_to_dd("### MassVarEdit by [src]: [O.type] (A/R [accepted]/[rejected]) [variable]=[html_encode("[O.vars[variable]]")]([list2params(value)])")
+ log_world("### MassVarEdit by [src]: [O.type] (A/R [accepted]/[rejected]) [variable]=[html_encode("[O.vars[variable]]")]([list2params(value)])")
log_admin("[key_name(src)] mass modified [original_name]'s [variable] to [O.vars[variable]] ([accepted] objects modified)")
message_admins("[key_name_admin(src)] mass modified [original_name]'s [variable] to [O.vars[variable]] ([accepted] objects modified)")
diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm
index 55ce03d8988..dfca07426c5 100644
--- a/code/modules/admin/verbs/modifyvariables.dm
+++ b/code/modules/admin/verbs/modifyvariables.dm
@@ -342,7 +342,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
if(!O.vv_edit_var(objectvar, L))
to_chat(src, "Your edit was rejected by the object.")
return
- log_to_dd("### ListVarEdit by [src]: [(O ? O.type : "/list")] [objectvar]: ADDED=[var_value]")
+ log_world("### ListVarEdit by [src]: [(O ? O.type : "/list")] [objectvar]: ADDED=[var_value]")
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: ADDED=[var_value]")
message_admins("[key_name_admin(src)] modified [original_name]'s [objectvar]: ADDED=[var_value]")
@@ -385,7 +385,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
if(!O.vv_edit_var(objectvar, L))
to_chat(src, "Your edit was rejected by the object.")
return
- log_to_dd("### ListVarEdit by [src]: [O.type] [objectvar]: CLEAR NULLS")
+ log_world("### ListVarEdit by [src]: [O.type] [objectvar]: CLEAR NULLS")
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: CLEAR NULLS")
message_admins("[key_name_admin(src)] modified [original_name]'s list [objectvar]: CLEAR NULLS")
return
@@ -395,7 +395,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
if(!O.vv_edit_var(objectvar, L))
to_chat(src, "Your edit was rejected by the object.")
return
- log_to_dd("### ListVarEdit by [src]: [O.type] [objectvar]: CLEAR DUPES")
+ log_world("### ListVarEdit by [src]: [O.type] [objectvar]: CLEAR DUPES")
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: CLEAR DUPES")
message_admins("[key_name_admin(src)] modified [original_name]'s list [objectvar]: CLEAR DUPES")
return
@@ -405,7 +405,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
if(!O.vv_edit_var(objectvar, L))
to_chat(src, "Your edit was rejected by the object.")
return
- log_to_dd("### ListVarEdit by [src]: [O.type] [objectvar]: SHUFFLE")
+ log_world("### ListVarEdit by [src]: [O.type] [objectvar]: SHUFFLE")
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: SHUFFLE")
message_admins("[key_name_admin(src)] modified [original_name]'s list [objectvar]: SHUFFLE")
return
@@ -482,7 +482,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
if(!O.vv_edit_var(objectvar, L))
to_chat(src, "Your edit was rejected by the object.")
return
- log_to_dd("### ListVarEdit by [src]: [O.type] [objectvar]: REMOVED=[html_encode("[original_var]")]")
+ log_world("### ListVarEdit by [src]: [O.type] [objectvar]: REMOVED=[html_encode("[original_var]")]")
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: REMOVED=[original_var]")
message_admins("[key_name_admin(src)] modified [original_name]'s [objectvar]: REMOVED=[original_var]")
return
@@ -501,7 +501,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
if(!O.vv_edit_var(objectvar, L))
to_chat(src, "Your edit was rejected by the object.")
return
- log_to_dd("### ListVarEdit by [src]: [(O ? O.type : "/list")] [objectvar]: [original_var]=[new_var]")
+ log_world("### ListVarEdit by [src]: [(O ? O.type : "/list")] [objectvar]: [original_var]=[new_var]")
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: [original_var]=[new_var]")
message_admins("[key_name_admin(src)] modified [original_name]'s varlist [objectvar]: [original_var]=[new_var]")
@@ -612,7 +612,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height",
if(!O.vv_edit_var(variable, var_new))
to_chat(src, "Your edit was rejected by the object.")
return
- log_to_dd("### VarEdit by [src]: [O.type] [variable]=[html_encode("[var_new]")]")
+ log_world("### VarEdit by [src]: [O.type] [variable]=[html_encode("[var_new]")]")
log_admin("[key_name(src)] modified [original_name]'s [variable] to [var_new]")
var/msg = "[key_name_admin(src)] modified [original_name]'s [variable] to [var_new]"
message_admins(msg)
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index 3f52862536d..9b230e6e742 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -47,6 +47,7 @@
status = 1
bombers += "[key_name(user)] welded a single tank bomb. Temperature: [bombtank.air_contents.temperature-T0C]"
msg_admin_attack("[key_name_admin(user)] welded a single tank bomb. Temperature: [bombtank.air_contents.temperature-T0C]")
+ log_game("[key_name(user)] welded a single tank bomb. Temperature: [bombtank.air_contents.temperature - T0C]")
to_chat(user, "A pressure hole has been bored to [bombtank] valve. \The [bombtank] can now be ignited.")
else
status = 0
diff --git a/code/modules/awaymissions/maploader/swapmaps.dm b/code/modules/awaymissions/maploader/swapmaps.dm
index bff9df153ef..bdb15581b61 100644
--- a/code/modules/awaymissions/maploader/swapmaps.dm
+++ b/code/modules/awaymissions/maploader/swapmaps.dm
@@ -584,7 +584,7 @@ proc/SwapMaps_CreateFromTemplate(template_id)
else if(swapmaps_mode!=SWAPMAPS_TEXT && fexists("map_[template_id].txt"))
text=1
else
- log_to_dd("SwapMaps error in SwapMaps_CreateFromTemplate(): map_[template_id] file not found.")
+ log_world("SwapMaps error in SwapMaps_CreateFromTemplate(): map_[template_id] file not found.")
return
if(text)
S=new
@@ -611,7 +611,7 @@ proc/SwapMaps_LoadChunk(chunk_id,turf/locorner)
else if(swapmaps_mode!=SWAPMAPS_TEXT && fexists("map_[chunk_id].txt"))
text=1
else
- log_to_dd("SwapMaps error in SwapMaps_LoadChunk(): map_[chunk_id] file not found.")
+ log_world("SwapMaps error in SwapMaps_LoadChunk(): map_[chunk_id] file not found.")
return
if(text)
S=new
@@ -629,9 +629,9 @@ proc/SwapMaps_LoadChunk(chunk_id,turf/locorner)
proc/SwapMaps_SaveChunk(chunk_id,turf/corner1,turf/corner2)
if(!corner1 || !corner2)
- log_to_dd("SwapMaps error in SwapMaps_SaveChunk():")
- if(!corner1) log_to_dd(" corner1 turf is null")
- if(!corner2) log_to_dd(" corner2 turf is null")
+ log_world("SwapMaps error in SwapMaps_SaveChunk():")
+ if(!corner1) log_world(" corner1 turf is null")
+ if(!corner2) log_world(" corner2 turf is null")
return
var/swapmap/M=new
M.id=chunk_id
@@ -658,7 +658,7 @@ proc/SwapMaps_GetSize(id)
else if(swapmaps_mode!=SWAPMAPS_TEXT && fexists("map_[id].txt"))
text=1
else
- log_to_dd("SwapMaps error in SwapMaps_GetSize(): map_[id] file not found.")
+ log_world("SwapMaps error in SwapMaps_GetSize(): map_[id] file not found.")
return
if(text)
S=new
diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm
index f946c63e76c..65220b0b754 100644
--- a/code/modules/awaymissions/zlevel.dm
+++ b/code/modules/awaymissions/zlevel.dm
@@ -57,7 +57,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
maploader.load_map(file, z_offset = zlev)
late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
space_manager.remove_dirt(zlev)
- log_to_dd(" Away mission loaded: [map]")
+ log_world(" Away mission loaded: [map]")
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name != "awaystart")
@@ -88,7 +88,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
maploader.load_map(file, z_offset = zlev)
late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
space_manager.remove_dirt(zlev)
- log_to_dd(" Away mission loaded: [map]")
+ log_world(" Away mission loaded: [map]")
//map_transition_config.Add(AWAY_MISSION_LIST)
@@ -168,7 +168,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
if(!valid)
continue
- log_to_dd(" Ruin \"[ruin.name]\" loaded in [stop_watch(watch)]s at ([T.x], [T.y], [T.z]).")
+ log_world(" Ruin \"[ruin.name]\" loaded in [stop_watch(watch)]s at ([T.x], [T.y], [T.z]).")
var/obj/effect/ruin_loader/R = new /obj/effect/ruin_loader(T)
R.Load(ruins,ruin)
@@ -179,7 +179,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
if(initialbudget == budget) //Kill me
- log_to_dd(" No ruins loaded.")
+ log_world(" No ruins loaded.")
/obj/effect/ruin_loader
diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm
index 9b30cc9e599..838670221ad 100644
--- a/code/modules/client/client procs.dm
+++ b/code/modules/client/client procs.dm
@@ -65,7 +65,7 @@
//search the href for script injection
if( findtext(href,"