diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 1c423657..8871475e 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -7,7 +7,7 @@ //Returns the world time in english proc/worldtime2text(time = world.time) //return "[round(time / 36000)+12]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]" - return time2text(time + world_timeofday_at_start, "hh:mm:ss") + return time2text(time + world_timeofday_at_start, "hh:mm") proc/time_stamp() return time2text(world.timeofday, "hh:mm:ss") diff --git a/code/game/objects/items/devices/magnetic_lock.dm b/code/game/objects/items/devices/magnetic_lock.dm index 9b261401..c3376454 100644 --- a/code/game/objects/items/devices/magnetic_lock.dm +++ b/code/game/objects/items/devices/magnetic_lock.dm @@ -115,7 +115,11 @@ return if (istype(I, /obj/item/weapon/crowbar)) user << "You remove \the [powercell] from \the [src]." - powercell.loc = loc + if (ismob(loc)) + var/mob/M = loc + M.put_in_hands(powercell) + else + powercell.loc = loc powercell = null return if (istype(I, /obj/item/weapon/weldingtool)) @@ -149,6 +153,20 @@ visible_message("[src] beeps loudly and falls off \the [target]; its powercell having run out of power.") setstatus(STATUS_INACTIVE) +/obj/item/device/magnetic_lock/update_icon() + if (constructionstate && status != STATUS_BROKEN) + icon_state = "deconstruct_[constructionstate]" + return + else + switch (status) + if (STATUS_INACTIVE) + icon_state = "inactive" + if (STATUS_ACTIVE) + icon_state = "active" + if (STATUS_BROKEN) + icon_state = "broken" + return + /obj/item/device/magnetic_lock/proc/attachto(var/obj/machinery/door/airlock/newtarget, var/mob/user as mob) if (status == STATUS_BROKEN) user << "[src] is damaged beyond repair! It cannot be used!" @@ -191,7 +209,6 @@ return detach() - icon_state = "inactive" status = newstatus if (STATUS_ACTIVE) @@ -201,7 +218,6 @@ return attach(newtarget) - icon_state = "active" status = newstatus if (STATUS_BROKEN) @@ -214,22 +230,19 @@ detach(playflick) - icon_state = "broken" status = newstatus + update_icon() + /obj/item/device/magnetic_lock/proc/setconstructionstate(var/newstate) constructionstate = newstate - if (newstate == 0) - if (status == STATUS_ACTIVE) - icon_state = "active" - else - icon_state = "inactive" - else if (newstate == 2) + if (newstate == 2) flick("deconstruct_2_anim", src) - else if (newstate == 4) + + if (newstate == 4) setstatus(STATUS_BROKEN) - else - icon_state = "deconstruct_[constructionstate]" + + update_icon() /obj/item/device/magnetic_lock/proc/detach(var/playflick = 1) if (target) @@ -241,6 +254,7 @@ layer = LAYER_NORMAL target.bracer = null + target = null processing_objects.Remove(src) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 694f5b09..8a21f4b3 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -114,6 +114,10 @@ assembly.head = src move_into_robot(user,assembly) +/obj/item/robot_parts/head/New() + ..() + + law_computer = new() /obj/item/robot_parts/robot_suit name = "robot endoskeleton" diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index af695044..f14d71ec 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -31,12 +31,7 @@ var/global/normal_ooc_colour = "#002eb8" if(prefs.muted & MUTE_OOC) src << "\red You cannot use OOC (muted)." return - if(handle_spam_prevention(msg,MUTE_OOC)) - return - if(findtext(msg, "byond://")) - src << "Advertising other servers is not allowed." - log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]") - message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]") + if(handle_spam_prevention(msg,MUTE_OOC,0)) return if(holder) @@ -148,12 +143,7 @@ var/global/normal_ooc_colour = "#002eb8" if(prefs.muted & MUTE_OOC) src << "\red You cannot use OOC (muted)." return - if(handle_spam_prevention(msg,MUTE_OOC)) - return - if(findtext(msg, "byond://")) - src << "Advertising other servers is not allowed." - log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]") - message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]") + if(handle_spam_prevention(msg,MUTE_OOC,0)) return if(holder) @@ -206,4 +196,4 @@ var/global/normal_ooc_colour = "#002eb8" var/prefix = "(R)LOOC" if (C.mob in heard) prefix = "LOOC" - C << "[stealth][prefix]: [src.key]: [msg]" \ No newline at end of file + C << "[stealth][prefix]: [src.key]: [msg]" diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 41ff2003..01a83cc9 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -15,7 +15,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," if(prefs.muted & MUTE_ADMINHELP) src << "Error: Admin-PM: You cannot send adminhelps (Muted)." return - if(src.handle_spam_prevention(msg,MUTE_ADMINHELP)) + if(src.handle_spam_prevention(msg,MUTE_ADMINHELP,0)) return adminhelped = 2 //Determines if they get the message to reply by clicking the name. diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 8fb8c70f..fd49a3c9 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -56,7 +56,7 @@ else adminhelp(msg) //admin we are replying to has vanished, adminhelp instead return - if (src.handle_spam_prevention(msg,MUTE_ADMINHELP)) + if (src.handle_spam_prevention(msg,MUTE_ADMINHELP,0)) return //clean the message if it's not sent by a high-rank admin @@ -161,4 +161,3 @@ continue if(X.holder.rights & (R_ADMIN|R_MOD)) X << "PM: [key_name(src, X, 0)]->IRC-Admins: \blue [msg]" - diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 33e78ef4..0993a9a0 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -15,9 +15,6 @@ src << "\red You have deadchat muted." return - if (src.handle_spam_prevention(msg,MUTE_DEADCHAT)) - return - var/stafftype = null if (src.holder.rights & R_MOD) diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index 776c5355..bc1c8789 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -13,7 +13,7 @@ if(usr.client.prefs.muted & MUTE_PRAY) usr << "\red You cannot pray (muted)." return - if(src.client.handle_spam_prevention(msg,MUTE_PRAY)) + if(src.client.handle_spam_prevention(msg,MUTE_PRAY,0)) return var/image/cross = image('icons/obj/storage.dmi',"bible") @@ -58,4 +58,4 @@ msg = "\blue SYNDICATE:[key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]" for(var/client/C in admins) if(C.holder.rights & (R_ADMIN|R_MOD|R_FUN)) - C << msg \ No newline at end of file + C << msg diff --git a/code/modules/admin/verbs/warning.dm b/code/modules/admin/verbs/warning.dm index d222bb5e..932ca4e6 100644 --- a/code/modules/admin/verbs/warning.dm +++ b/code/modules/admin/verbs/warning.dm @@ -42,7 +42,7 @@ feedback_inc("ban_warn",1) else if(C) - C << "You have been formally warned by an administrator.
Further warnings will result in an autoban.
" + C << "You have been warned by an administrator.
Further warnings will result in an autoban.
" message_admins("[key_name_admin(src)] has warned [key_name_admin(C)]. They have [MAX_WARNS-D.warns] strikes remaining.") message_mods("[key_name_admin(src)] has warned [key_name_admin(C)]. They have [MAX_WARNS-D.warns] strikes remaining.") else @@ -122,7 +122,7 @@ feedback_add_details("admin_verb","WARN-DB") if(C) - C << "You have been formally warned by an administrator.
Click here to review and acknowledge them!
" + C << "You have been warned by an administrator.
Click here to review and acknowledge them!
" message_admins("[key_name_admin(src)] has warned [warned_ckey] for: [reason].") message_mods("[key_name_admin(src)] has warned [warned_ckey].") diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 334b7fb8..2052558e 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -95,7 +95,9 @@ prefs.process_link(src, href_list) ..() //redirect to hsrc.Topic() -/client/proc/handle_spam_prevention(var/message, var/mute_type) +/client/proc/handle_spam_prevention(var/message, var/mute_type, var/pass = 1) + if (pass) + return 0 if(config.automute_on && !holder) if(src.last_message_time > world.time - SPAM_TIMER * 10) if(src.last_message_timer > SPAM_TRIGGER_AUTOMUTE) diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index 6e64df73..1e004769 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -11,9 +11,6 @@ src << "\red You cannot talk in deadchat (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_DEADCHAT)) - return - . = src.say_dead(message) @@ -33,9 +30,6 @@ src << "\red You cannot emote in deadchat (muted)." return - if(src.client.handle_spam_prevention(message, MUTE_DEADCHAT)) - return - . = src.emote_dead(message) /* diff --git a/code/modules/mob/living/carbon/alien/emote.dm b/code/modules/mob/living/carbon/alien/emote.dm index 0efcae7c..7c8eafb8 100644 --- a/code/modules/mob/living/carbon/alien/emote.dm +++ b/code/modules/mob/living/carbon/alien/emote.dm @@ -18,8 +18,6 @@ if (client.prefs.muted & MUTE_IC) src << "\red You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -124,4 +122,4 @@ for(var/mob/O in hearers(src, null)) O.show_message(message, m_type) //Foreach goto(746) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm index d0038f08..df135038 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm @@ -18,8 +18,6 @@ if (client.prefs.muted & MUTE_IC) src << "\red You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -132,4 +130,4 @@ for(var/mob/O in hearers(src, null)) O.show_message(message, m_type) //Foreach goto(746) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/carbon/alien/larva/emote.dm b/code/modules/mob/living/carbon/alien/larva/emote.dm index da325c04..f2fe2a58 100644 --- a/code/modules/mob/living/carbon/alien/larva/emote.dm +++ b/code/modules/mob/living/carbon/alien/larva/emote.dm @@ -18,8 +18,6 @@ if (client.prefs.muted & MUTE_IC) src << "\red You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -124,4 +122,4 @@ for(var/mob/O in hearers(src, null)) O.show_message(message, m_type) //Foreach goto(746) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/carbon/brain/emote.dm b/code/modules/mob/living/carbon/brain/emote.dm index 2cf1cb37..ee41e3c0 100644 --- a/code/modules/mob/living/carbon/brain/emote.dm +++ b/code/modules/mob/living/carbon/brain/emote.dm @@ -19,8 +19,6 @@ if (client.prefs.muted & MUTE_IC) src << "\red You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -79,4 +77,4 @@ O.show_message(message, m_type) else if (m_type & 2) for (var/mob/O in hearers(src.loc, null)) - O.show_message(message, m_type) \ No newline at end of file + O.show_message(message, m_type) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 799a89fc..c056d2a5 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -74,8 +74,6 @@ if (client.prefs.muted & MUTE_IC) src << "\red You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -618,4 +616,4 @@ HTML += "
" HTML +="\[Done\]" HTML += "" - src << browse(HTML, "window=flavor_changes;size=430x300") \ No newline at end of file + src << browse(HTML, "window=flavor_changes;size=430x300") diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 6ecfd8f7..c1a918fe 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -12,8 +12,7 @@ if (src.client.prefs.muted & MUTE_IC) src << "\red You cannot whisper (muted)." return - - if (src.client.handle_spam_prevention(message,MUTE_IC)) + if (client.handle_spam_prevention(message, MUTE_IC, 0)) return if (src.stat == 2) @@ -78,12 +77,12 @@ temp_message[H] = ninjaspeak(temp_message[H]) pick_list -= H message = list2text(temp_message, " ") - message = replacetext(message, "o", "¤") - message = replacetext(message, "p", "þ") - message = replacetext(message, "l", "£") - message = replacetext(message, "s", "§") - message = replacetext(message, "u", "µ") - message = replacetext(message, "b", "ß") + message = replacetext(message, "o", "�") + message = replacetext(message, "p", "�") + message = replacetext(message, "l", "�") + message = replacetext(message, "s", "�") + message = replacetext(message, "u", "�") + message = replacetext(message, "b", "�") //TODO: handle_speech_problems if (src.stuttering) diff --git a/code/modules/mob/living/carbon/metroid/emote.dm b/code/modules/mob/living/carbon/metroid/emote.dm index 123bcbce..b315eb9c 100644 --- a/code/modules/mob/living/carbon/metroid/emote.dm +++ b/code/modules/mob/living/carbon/metroid/emote.dm @@ -17,8 +17,6 @@ if (client.prefs.muted & MUTE_IC) src << "\red You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -73,4 +71,4 @@ for(var/mob/O in hearers(src, null)) O.show_message(message, m_type) //Foreach goto(746) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/carbon/monkey/emote.dm b/code/modules/mob/living/carbon/monkey/emote.dm index 21057a0b..56ecf9dd 100644 --- a/code/modules/mob/living/carbon/monkey/emote.dm +++ b/code/modules/mob/living/carbon/monkey/emote.dm @@ -19,8 +19,6 @@ if (client.prefs.muted & MUTE_IC) src << "\red You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -137,4 +135,4 @@ for(var/mob/O in hearers(src, null)) O.show_message(message, m_type) //Foreach goto(746) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/silicon/pai/emote.dm b/code/modules/mob/living/silicon/pai/emote.dm index b9658454..7cecb30b 100644 --- a/code/modules/mob/living/silicon/pai/emote.dm +++ b/code/modules/mob/living/silicon/pai/emote.dm @@ -13,8 +13,6 @@ if(client.prefs.muted & MUTE_IC) src << "You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -99,4 +97,4 @@ else for(var/mob/O in hearers(src, null)) O.show_message(message, m_type) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm index 1c55bed0..bec57287 100644 --- a/code/modules/mob/living/silicon/robot/emote.dm +++ b/code/modules/mob/living/silicon/robot/emote.dm @@ -14,8 +14,6 @@ if(client.prefs.muted & MUTE_IC) src << "You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (stat) return if(!(message)) @@ -217,4 +215,4 @@ else for(var/mob/O in hearers(src, null)) O.show_message(message, m_type) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 8aa23f99..470837e6 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -31,8 +31,6 @@ if(client.prefs.muted & MUTE_IC) src << "You cannot send IC messages (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) diff --git a/code/modules/mob/living/simple_animal/borer.dm b/code/modules/mob/living/simple_animal/borer.dm index bf47c80a..22d79e70 100644 --- a/code/modules/mob/living/simple_animal/borer.dm +++ b/code/modules/mob/living/simple_animal/borer.dm @@ -11,8 +11,6 @@ if(client.prefs.muted & MUTE_IC) src << "\red You cannot speak in IC (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if(istype(src.loc,/mob/living/simple_animal/borer)) @@ -135,8 +133,6 @@ if(client.prefs.muted & MUTE_IC) src << "\red You cannot speak in IC (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (copytext(message, 1, 2) == "*") return emote(copytext(message, 2)) diff --git a/code/modules/mob/living/simple_animal/borer/borer_captive.dm b/code/modules/mob/living/simple_animal/borer/borer_captive.dm index 936c810d..524cf493 100644 --- a/code/modules/mob/living/simple_animal/borer/borer_captive.dm +++ b/code/modules/mob/living/simple_animal/borer/borer_captive.dm @@ -9,8 +9,6 @@ if(client.prefs.muted & MUTE_IC) src << "\red You cannot speak in IC (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if(istype(src.loc,/mob/living/simple_animal/borer)) diff --git a/code/modules/mob/living/simple_animal/borer/say.dm b/code/modules/mob/living/simple_animal/borer/say.dm index c0bfb071..156fce5e 100644 --- a/code/modules/mob/living/simple_animal/borer/say.dm +++ b/code/modules/mob/living/simple_animal/borer/say.dm @@ -16,8 +16,6 @@ if(client.prefs.muted & MUTE_IC) src << "\red You cannot speak in IC (muted)." return - if (src.client.handle_spam_prevention(message,MUTE_IC)) - return if (copytext(message, 1, 2) == "*") return emote(copytext(message, 2)) @@ -39,4 +37,4 @@ if (istype(M, /mob/new_player)) continue else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS) - M << "[src.truename] whispers to [host], \"[message]\"" \ No newline at end of file + M << "[src.truename] whispers to [host], \"[message]\"" diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 454c962f..b5291cf8 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -12,6 +12,15 @@ if(say_disabled) //This is here to try to identify lag problems usr << "\red Speech is currently admin-disabled." return + + if (client) + if (istype(src, /mob/dead/observer)) + if (client.handle_spam_prevention(message, MUTE_DEADCHAT, 0)) + return + else + if (client.handle_spam_prevention(message, MUTE_IC, 0)) + return + //Let's try to make users fix their errors - we try to detect single, out-of-place letters and 'unintended' words /* var/first_letter = copytext(message,1,2) @@ -37,6 +46,14 @@ usr << "\red Speech is currently admin-disabled." return + if (client) + if (istype(src, /mob/dead/observer)) + if (client.handle_spam_prevention(message, MUTE_DEADCHAT, 0)) + return + else + if (client.handle_spam_prevention(message, MUTE_IC, 0)) + return + message = strip_html_properly(message) //We do not have typing indicator code yet - Waiting for the okay from Skull before considering adding - Jamini // set_typing_indicator(0) diff --git a/code/world.dm b/code/world.dm index 7046c23a..f4db2e53 100644 --- a/code/world.dm +++ b/code/world.dm @@ -22,7 +22,6 @@ world.log << "Your server's byond version does not meet the recommended requirements for this server. Please update BYOND" load_configuration() - load_visibility() if(config && config.server_name != null && config.server_suffix && world.port > 0) // dumb and hardcoded but I don't care~ @@ -254,24 +253,28 @@ var/master_server_password fdel(F) F << the_mode -/world/proc/load_visibility() - var/list/Lines = file2list("data/hubsetting.txt") - if (Lines.len) - if (Lines[1] && Lines[2]) - log_misc("Saved visibility is: [Lines[1]]; saved override is: [Lines[2]].") - if (text2num(Lines[2]) == 1) - visibility = text2num(Lines[1]) - else - if (time2text(realtime, "Day") == ("Saturday" || "Sunday")) - visibility = 0 - else - visibility = 1 - save_visibility(visibility, 0) +/hook/startup/proc/loadVisibility() + world.load_visibility() + return 1 -/world/proc/save_visibility(var/the_visibility, var/override = 0) +/world/proc/load_visibility() + var/list/saved_settings = file2list("data/hubsetting.txt") + var/list/invisible_days = list("Saturday", "Sunday") + if (saved_settings.len == 2) + log_misc("Saved visibility is: [saved_settings[1]]; saved override is: [saved_settings[2]].") + if (text2num(saved_settings[2]) == 1) + world.visibility = text2num(saved_settings[1]) + else + if (time2text(realtime, "Day") in invisible_days) + world.visibility = 0 + else + world.visibility = 1 + save_visibility(world.visibility, 0) + +/world/proc/save_visibility(var/visibility, var/override = 0) var/F = file("data/hubsetting.txt") fdel(F) - F << the_visibility + F << visibility F << override /hook/startup/proc/loadMOTD() @@ -442,4 +445,4 @@ var/world_timeofday_at_start hook/startup/proc/store_timeofday_at_start() world_timeofday_at_start = world.timeofday - return 1 \ No newline at end of file + return 1