Merge branch 'master' into upstream-merge-32161

This commit is contained in:
LetterJay
2017-11-11 23:02:13 -06:00
committed by GitHub
625 changed files with 27981 additions and 20284 deletions

View File

@@ -6,8 +6,10 @@
#define STICKYBAN_MAX_EXISTING_USER_MATCHES 5 //ie, users who were connected before the ban triggered
#define STICKYBAN_MAX_ADMIN_MATCHES 2
/world/IsBanned(key,address,computer_id)
/world/IsBanned(key,address,computer_id,type,real_bans_only=FALSE)
if (!key || !address || !computer_id)
if(real_bans_only)
return FALSE
log_access("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.)")
@@ -31,7 +33,7 @@
return list("reason"="whitelist", "desc" = "\nReason: You are not on the white list for this server")
//Guest Checking
if(IsGuestKey(key))
if(!real_bans_only && IsGuestKey(key))
if (CONFIG_GET(flag/guest_ban))
log_access("Failed Login: [key] - Guests not allowed")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
@@ -41,7 +43,7 @@
//Population Cap Checking
var/extreme_popcap = CONFIG_GET(number/extreme_popcap)
if(extreme_popcap && living_player_count() >= extreme_popcap && !admin)
if(!real_bans_only && extreme_popcap && living_player_count() >= extreme_popcap && !admin)
log_access("Failed Login: [key] - Population cap reached")
return list("reason"="popcap", "desc"= "\nReason: [CONFIG_GET(string/extreme_popcap_message)]")
@@ -160,8 +162,8 @@
world.SetConfig("ban", bannedckey, null)
log_game("Stickyban on [bannedckey] detected as rogue, reverting to it's roundstart state")
message_admins("Stickyban on [bannedckey] detected as rogue, reverting to it's roundstart state")
log_game("Stickyban on [bannedckey] detected as rogue, reverting to its roundstart state")
message_admins("Stickyban on [bannedckey] detected as rogue, reverting to its roundstart state")
//do not convert to timer.
spawn (5)
world.SetConfig("ban", bannedckey, null)

View File

@@ -0,0 +1,149 @@
#define SOUND_EMITTER_LOCAL "local" //Plays the sound like a normal heard sound
#define SOUND_EMITTER_DIRECT "direct" //Plays the sound directly to hearers regardless of pressure/proximity/et cetera
#define SOUND_EMITTER_RADIUS "radius" //Plays the sound to everyone in a radius
#define SOUND_EMITTER_ZLEVEL "zlevel" //Plays the sound to everyone on the z-level
#define SOUND_EMITTER_GLOBAL "global" //Plays the sound to everyone in the game world
//Admin sound emitters with highly customizable functions!
/obj/effect/sound_emitter
name = "sound emitter"
desc = "Emits sounds, presumably."
icon = 'icons/effects/effects.dmi'
icon_state = "shield2"
invisibility = INVISIBILITY_OBSERVER
anchored = TRUE
density = FALSE
opacity = FALSE
alpha = 175
var/sound_file //The sound file the emitter plays
var/sound_volume = 50 //The volume the sound file is played at
var/play_radius = 3 //Any mobs within this many tiles will hear the sounds played if it's using the appropriate mode
var/motus_operandi = SOUND_EMITTER_LOCAL //The mode this sound emitter is using
var/emitter_range = SOUND_EMITTER_ZLEVEL //The range this emitter's sound is heard at; this isn't a number, but a string (see the defines above)
/obj/effect/sound_emitter/Destroy(force)
if(!force)
return QDEL_HINT_LETMELIVE
. = ..()
/obj/effect/sound_emitter/singularity_act()
return
/obj/effect/sound_emitter/examine(mob/user)
..()
if(!isobserver(user))
return
to_chat(user, "<span class='boldnotice'>Sound File:</span> [sound_file ? sound_file : "None chosen"]")
to_chat(user, "<span class='boldnotice'>Mode:</span> [motus_operandi]</span>")
to_chat(user, "<span class='boldnotice'>Range:</span> [emitter_range]</span>")
to_chat(user, "<b>Sound is playing at [sound_volume]% volume.</b>")
if(user.client.holder)
to_chat(user, "<b>Alt-click it to quickly activate it!</b>")
/obj/effect/sound_emitter/attack_ghost(mob/user)
if(!check_rights_for(user.client, R_SOUNDS))
examine(user)
return
edit_emitter(user)
/obj/effect/sound_emitter/AltClick(mob/user)
if(check_rights_for(user.client, R_SOUNDS))
activate(user)
to_chat(user, "<span class='notice'>Sound emitter activated.</span>")
/obj/effect/sound_emitter/proc/edit_emitter(mob/user)
var/dat = ""
dat += "<b>Label:</b> <a href='?src=\ref[src];edit_label=1'>[maptext ? maptext : "No label set!"]</a><br>"
dat += "<br>"
dat += "<b>Sound File:</b> <a href='?src=\ref[src];edit_sound_file=1'>[sound_file ? sound_file : "No file chosen!"]</a><br>"
dat += "<b>Volume:</b> <a href='?src=\ref[src];edit_volume=1'>[sound_volume]%</a><br>"
dat += "<br>"
dat += "<b>Mode:</b> <a href='?src=\ref[src];edit_mode=1'>[motus_operandi]</a><br>"
if(motus_operandi != SOUND_EMITTER_LOCAL)
dat += "<b>Range:</b> <a href='?src=\ref[src];edit_range=1'>[emitter_range]</a>[emitter_range == SOUND_EMITTER_RADIUS ? "<a href='?src=\ref[src];edit_radius=1'>[play_radius]-tile radius</a>" : ""]<br>"
dat += "<br>"
dat += "<a href='?src=\ref[src];play=1'>Play Sound</a> (interrupts other sound emitter sounds)"
var/datum/browser/popup = new(user, "emitter", "", 500, 600)
popup.set_content(dat)
popup.open()
/obj/effect/sound_emitter/Topic(href, href_list)
..()
if(!ismob(usr) || !usr.client || !check_rights_for(usr.client, R_SOUNDS))
return
var/mob/user = usr
if(href_list["edit_label"])
var/new_label = stripped_input(user, "Choose a new label.", "Sound Emitter")
if(!new_label)
return
maptext = new_label
to_chat(user, "<span class='notice'>Label set to [maptext].</span>")
if(href_list["edit_sound_file"])
var/new_file = input(user, "Choose a sound file.", "Sound Emitter") as null|sound
if(!new_file)
return
sound_file = new_file
to_chat(user, "<span class='notice'>New sound file set to [sound_file].</span>")
if(href_list["edit_volume"])
var/new_volume = input(user, "Choose a volume.", "Sound Emitter", sound_volume) as null|num
if(isnull(new_volume))
return
new_volume = Clamp(new_volume, 0, 100)
sound_volume = new_volume
to_chat(user, "<span class='notice'>Volume set to [sound_volume]%.</span>")
if(href_list["edit_mode"])
var/new_mode
var/mode_list = list("Local (normal sound)" = SOUND_EMITTER_LOCAL, "Direct (not affected by environment/location)" = SOUND_EMITTER_DIRECT)
new_mode = input(user, "Choose a new mode.", "Sound Emitter") as null|anything in mode_list
if(!new_mode)
return
motus_operandi = mode_list[new_mode]
to_chat(user, "<span class='notice'>Mode set to [motus_operandi].</span>")
if(href_list["edit_range"])
var/new_range
var/range_list = list("Radius (all mobs within a radius)" = SOUND_EMITTER_RADIUS, "Z-Level (all mobs on the same z)" = SOUND_EMITTER_ZLEVEL, "Global (all players)" = SOUND_EMITTER_GLOBAL)
new_range = input(user, "Choose a new range.", "Sound Emitter") as null|anything in range_list
if(!new_range)
return
emitter_range = range_list[new_range]
to_chat(user, "<span class='notice'>Range set to [emitter_range].</span>")
if(href_list["edit_radius"])
var/new_radius = input(user, "Choose a radius.", "Sound Emitter", sound_volume) as null|num
if(isnull(new_radius))
return
new_radius = Clamp(new_radius, 0, 127)
play_radius = new_radius
to_chat(user, "<span class='notice'>Audible radius set to [play_radius].</span>")
if(href_list["play"])
activate(user)
edit_emitter(user) //Refresh the UI to see our changes
/obj/effect/sound_emitter/proc/activate(mob/user)
var/list/hearing_mobs = list()
if(motus_operandi == SOUND_EMITTER_LOCAL)
playsound(src, sound_file, sound_volume, FALSE)
return
switch(emitter_range)
if(SOUND_EMITTER_RADIUS)
for(var/mob/M in GLOB.player_list)
if(get_dist(src, M) <= play_radius)
hearing_mobs += M
if(SOUND_EMITTER_ZLEVEL)
for(var/mob/M in GLOB.player_list)
if(M.z == z)
hearing_mobs += M
if(SOUND_EMITTER_GLOBAL)
hearing_mobs = GLOB.player_list.Copy()
for(var/mob/M in hearing_mobs)
if(M.client.prefs.toggles & SOUND_MIDI)
M.playsound_local(M, sound_file, sound_volume, FALSE, channel = CHANNEL_ADMIN, pressure_affected = FALSE)
if(user)
log_admin("[ADMIN_LOOKUPFLW(user)] activated a sound emitter with file \"[sound_file]\" at [COORD(src)]")
flick("shield1", src)
#undef SOUND_EMITTER_LOCAL
#undef SOUND_EMITTER_DIRECT
#undef SOUND_EMITTER_RADIUS
#undef SOUND_EMITTER_ZLEVEL
#undef SOUND_EMITTER_GLOBAL

View File

@@ -142,8 +142,8 @@
to_chat(usr, "<span class='adminnotice'>Error: No cached sticky ban for [ckey] found!</span>")
world.SetConfig("ban",ckey,null)
log_admin_private("[key_name(usr)] has reverted [ckey]'s sticky ban to it's state at round start.")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has reverted [ckey]'s sticky ban to it's state at round start.</span>")
log_admin_private("[key_name(usr)] has reverted [ckey]'s sticky ban to its state at round start.")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has reverted [ckey]'s sticky ban to its state at round start.</span>")
//revert is mostly used when shit goes rouge, so we have to set it to null
// and wait a byond tick before assigning it to ensure byond clears its shit.
sleep(world.tick_lag)

View File

@@ -3,9 +3,11 @@
/proc/_abs(A)
return abs(A)
/*/proc/_animate(atom/A, set_vars, time = 10, loop = 1, easing = LINEAR_EASING, flags_1 = null)
animate(A, set_vars, time, loop, easing, flags_1)
Borked. If anyone wants to fix this be my guest.*/
/proc/_animate(atom/A, set_vars, time = 10, loop = 1, easing = LINEAR_EASING, flags = null)
var/mutable_appearance/MA = new()
for(var/v in set_vars)
MA.vars[v] = set_vars[v]
animate(A, appearance = MA, time, loop, easing, flags)
/proc/_acrccos(A)
return arccos(A)

View File

@@ -614,8 +614,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/proc/send2irc(msg,msg2)
if(SERVER_TOOLS_PRESENT)
SERVER_TOOLS_RELAY_BROADCAST("[msg] | [msg2]")
msg = replacetext(replacetext(msg, "\proper", ""), "\improper", "")
msg2 = replacetext(replacetext(msg2, "\proper", ""), "\improper", "")
SERVER_TOOLS_RELAY_BROADCAST("[msg] | [msg2]")
/proc/send2otherserver(source,msg,type = "Ahelp")
var/comms_key = CONFIG_GET(string/comms_key)

View File

@@ -780,7 +780,7 @@ GLOBAL_PROTECT(LastAdminCalledProc)
/client/proc/cmd_display_init_log()
set category = "Debug"
set name = "Display Initialzie() Log"
set name = "Display Initialize() Log"
set desc = "Displays a list of things that didn't handle Initialize() properly"
usr << browse(replacetext(SSatoms.InitLog(), "\n", "<br>"), "window=initlog")
@@ -873,3 +873,42 @@ GLOBAL_PROTECT(LastAdminCalledProc)
message_admins("<span class='adminnotice'>[key_name_admin(src)] pumped a random event.</span>")
SSblackbox.add_details("admin_verb","Pump Random Event")
log_admin("[key_name(src)] pumped a random event.")
/client/proc/start_line_profiling()
set category = "Profile"
set name = "Start Line Profiling"
set desc = "Starts tracking line by line profiling for code lines that support it"
PROFILE_START
message_admins("<span class='adminnotice'>[key_name_admin(src)] started line by line profiling.</span>")
SSblackbox.add_details("admin_verb","Start Line Profiling")
log_admin("[key_name(src)] started line by line profiling.")
/client/proc/stop_line_profiling()
set category = "Profile"
set name = "Stops Line Profiling"
set desc = "Stops tracking line by line profiling for code lines that support it"
PROFILE_STOP
message_admins("<span class='adminnotice'>[key_name_admin(src)] stopped line by line profiling.</span>")
SSblackbox.add_details("admin_verb","stop Line Profiling")
log_admin("[key_name(src)] stopped line by line profiling.")
/client/proc/show_line_profiling()
set category = "Profile"
set name = "Show Line Profiling"
set desc = "Shows tracked profiling info from code lines that support it"
var/sortlist = list(
"Avg time" = /proc/cmp_profile_avg_time_dsc,
"Total Time" = /proc/cmp_profile_time_dsc,
"Call Count" = /proc/cmp_profile_count_dsc
)
var/sort = input(src, "Sort type?", "Sort Type", "Avg time") as null|anything in sortlist
if (!sort)
return
sort = sortlist[sort]
profile_show(src, sort)

View File

@@ -42,7 +42,10 @@ GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list(
/client/proc/print_pointers,
/client/proc/cmd_show_at_list,
/client/proc/cmd_show_at_markers,
/client/proc/manipulate_organs
/client/proc/manipulate_organs,
/client/proc/start_line_profiling,
/client/proc/stop_line_profiling,
/client/proc/show_line_profiling
))
/obj/effect/debugging/mapfix_marker

View File

@@ -416,7 +416,7 @@ GLOBAL_PROTECT(VVpixelmovement)
if (index == null)
return
var/assoc = 0
var/prompt = alert(src, "Do you want to edit the key or it's assigned value?", "Associated List", "Key", "Assigned Value", "Cancel")
var/prompt = alert(src, "Do you want to edit the key or its assigned value?", "Associated List", "Key", "Assigned Value", "Cancel")
if (prompt == "Cancel")
return
if (prompt == "Assigned Value")
@@ -610,8 +610,8 @@ GLOBAL_PROTECT(VVpixelmovement)
if (O.vv_edit_var(variable, var_new) == FALSE)
to_chat(src, "Your edit was rejected by the object.")
return
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]"
log_world("### VarEdit by [key_name(src)]: [O.type] [variable]=[var_value] => [var_new]")
log_admin("[key_name(src)] modified [original_name]'s [variable] to from [html_encode("[var_value]")] to [html_encode("[var_new]")]")
var/msg = "[key_name_admin(src)] modified [original_name]'s [variable] from [var_value] to [var_new]"
message_admins(msg)
admin_ticket_log(O, msg)

View File

@@ -213,7 +213,6 @@
/datum/admins/proc/makeNukeTeam()
var/datum/game_mode/nuclear/temp = new
var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you wish to be considered for a nuke team being sent in?", "operative", temp)
var/list/mob/dead/observer/chosen = list()
@@ -246,24 +245,18 @@
nuke.r_code = nuke_code
//Let's find the spawn locations
var/list/turf/synd_spawn = list()
for(var/obj/effect/landmark/A in GLOB.landmarks_list)
if(A.name == "Syndicate-Spawn")
synd_spawn += get_turf(A)
continue
var/leader_chosen
var/leader_chosen = FALSE
var/spawnpos = 1 //Decides where they'll spawn. 1=leader.
for(var/mob/c in chosen)
if(spawnpos > synd_spawn.len)
spawnpos = 2 //Ran out of spawns. Let's loop back to the first non-leader position
if(spawnpos > GLOB.nukeop_start.len)
spawnpos = 1 //Ran out of spawns. Let's loop back to the first non-leader position
var/mob/living/carbon/human/new_character=makeBody(c)
if(!leader_chosen)
leader_chosen = 1
new_character.mind.make_Nuke(synd_spawn[spawnpos],nuke_code,1)
leader_chosen = TRUE
new_character.mind.make_Nuke(pick(GLOB.nukeop_leader_start), nuke_code, TRUE)
else
new_character.mind.make_Nuke(synd_spawn[spawnpos],nuke_code)
new_character.mind.make_Nuke(GLOB.nukeop_start[spawnpos], nuke_code)
spawnpos++
return 1
else

View File

@@ -399,7 +399,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
else//They may also be a cyborg or AI.
switch(new_character.mind.assigned_role)
if("Cyborg")//More rigging to make em' work and check if they're traitor.
new_character = new_character.Robotize()
new_character = new_character.Robotize(TRUE)
if("AI")
new_character = new_character.AIize()
else