diff --git a/SQL/migrate/V006__No_Privacy.sql b/SQL/migrate/V006__No_Privacy.sql new file mode 100644 index 00000000000..87f9b0f0e55 --- /dev/null +++ b/SQL/migrate/V006__No_Privacy.sql @@ -0,0 +1,6 @@ +-- +-- Implemented in PR #2863. +-- Removes unused privacy table. +-- + +DROP TABLE `ss13_privacy`; diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index d1cfe21357e..0ffc22b8b51 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -125,6 +125,8 @@ var/global/list/cloaking_devices = list() var/datum/sprite_accessory/marking/M = new path() body_marking_styles_list[M.name] = M + sortTim(body_marking_styles_list, /proc/cmp_text_asc) + //Surgery Steps - Initialize all /datum/surgery_step into a list paths = subtypesof(/datum/surgery_step) for(var/T in paths) @@ -159,7 +161,13 @@ var/global/list/cloaking_devices = list() S.race_key = rkey //Used in mob icon caching. all_species[S.name] = S - if(!(S.spawn_flags & IS_RESTRICTED)) + sortTim(all_species, /proc/cmp_text_asc) + + // The other lists are generated *after* we sort the main one so they don't need sorting too. + for (var/thing in all_species) + var/datum/species/S = all_species[thing] + + if (!(S.spawn_flags & IS_RESTRICTED)) playable_species += S.name if(S.spawn_flags & IS_WHITELISTED) whitelisted_species += S.name diff --git a/code/controllers/subsystems/icon_smooth.dm b/code/controllers/subsystems/icon_smooth.dm index 6f8ded3b96c..81365632079 100644 --- a/code/controllers/subsystems/icon_smooth.dm +++ b/code/controllers/subsystems/icon_smooth.dm @@ -17,6 +17,9 @@ var/datum/controller/subsystem/icon_smooth/SSicon_smooth /datum/controller/subsystem/icon_smooth/Recover() smooth_queue = SSicon_smooth.smooth_queue +/datum/controller/subsystem/icon_smooth/stat_entry() + ..("Q:[smooth_queue.len]") + /datum/controller/subsystem/icon_smooth/fire() if (explosion_in_progress) return diff --git a/code/controllers/subsystems/lighting.dm b/code/controllers/subsystems/lighting.dm index 48b3b57760c..c8d979989db 100644 --- a/code/controllers/subsystems/lighting.dm +++ b/code/controllers/subsystems/lighting.dm @@ -49,9 +49,13 @@ var/datum/controller/subsystem/lighting/SSlighting /datum/controller/subsystem/lighting/Initialize(timeofday) var/overlaycount = 0 + var/starttime = REALTIMEOFDAY // Generate overlays. + var/turf/T + var/thing for (var/zlevel = 1 to world.maxz) - for (var/turf/T in block(locate(1, 1, zlevel), locate(world.maxx, world.maxy, zlevel))) + for (thing in block(locate(1, 1, zlevel), locate(world.maxx, world.maxy, zlevel))) + T = thing if (!T.dynamic_lighting) continue @@ -64,14 +68,16 @@ var/datum/controller/subsystem/lighting/SSlighting CHECK_TICK - admin_notice(span("danger", "Created [overlaycount] lighting overlays."), R_DEBUG) + admin_notice(span("danger", "Created [overlaycount] lighting overlays in [(REALTIMEOFDAY - starttime)/10] seconds."), R_DEBUG) + starttime = REALTIMEOFDAY // Tick once to clear most lights. fire(FALSE, TRUE) admin_notice(span("danger", "Processed [processed_lights] light sources."), R_DEBUG) admin_notice(span("danger", "Processed [processed_corners] light corners."), R_DEBUG) admin_notice(span("danger", "Processed [processed_overlays] light overlays."), R_DEBUG) + admin_notice(span("danger", "Lighting pre-bake completed in [(REALTIMEOFDAY - starttime)/10] seconds."), R_DEBUG) log_ss("lighting", "NOv:[overlaycount] L:[processed_lights] C:[processed_corners] O:[processed_overlays]") diff --git a/code/game/machinery/station_holomap.dm b/code/game/machinery/station_holomap.dm index 5b3b3ad8d90..25667125db4 100644 --- a/code/game/machinery/station_holomap.dm +++ b/code/game/machinery/station_holomap.dm @@ -34,6 +34,7 @@ return ..() /obj/machinery/station_map/Initialize() + . = ..() holomap_datum = new() original_zLevel = loc.z SSminimap.station_holomaps += src diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index 02ba7e43a0b..1d32d419336 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -39,21 +39,23 @@ D.cure(0) return ..() -/obj/effect/decal/cleanable/blood/Initialize() +/obj/effect/decal/cleanable/blood/Initialize(mapload) . = ..() update_icon() if(istype(src, /obj/effect/decal/cleanable/blood/gibs)) return - if(src.type == /obj/effect/decal/cleanable/blood) - if(src.loc && isturf(src.loc)) + if(type == /obj/effect/decal/cleanable/blood) + if (isturf(loc)) for(var/obj/effect/decal/cleanable/blood/B in src.loc) if(B != src) if (B.blood_DNA) blood_DNA |= B.blood_DNA.Copy() qdel(B) drytime = DRYING_TIME * (amount+1) - if (dries) + if (dries && !mapload) addtimer(CALLBACK(src, /obj/effect/decal/cleanable/blood/.proc/dry), drytime) + else if (dries) + dry() /obj/effect/decal/cleanable/blood/update_icon() if(basecolor == "rainbow") basecolor = "#[get_random_colour(1)]" diff --git a/code/modules/lighting/lighting_area.dm b/code/modules/lighting/lighting_area.dm index a39eb1d975e..0b4ebb820b1 100644 --- a/code/modules/lighting/lighting_area.dm +++ b/code/modules/lighting/lighting_area.dm @@ -9,7 +9,7 @@ luminosity = FALSE /area/proc/set_dynamic_lighting(var/new_dynamic_lighting = TRUE) - L_PROF(src, "area_sdl") + //L_PROF(src, "area_sdl") if (new_dynamic_lighting == dynamic_lighting) return FALSE diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm index 0a3b0efa025..b5aae3c2788 100644 --- a/code/modules/lighting/lighting_atom.dm +++ b/code/modules/lighting/lighting_atom.dm @@ -16,7 +16,7 @@ // The proc you should always use to set the light of this atom. /atom/proc/set_light(var/l_range, var/l_power, var/l_color = NONSENSICAL_VALUE, var/uv = NONSENSICAL_VALUE, var/angle = NONSENSICAL_VALUE, var/no_update = FALSE) - L_PROF(src, "atom_setlight") + //L_PROF(src, "atom_setlight") if(l_range > 0 && l_range < MINIMUM_USEFUL_LIGHT_RANGE) l_range = MINIMUM_USEFUL_LIGHT_RANGE //Brings the range up to 1.4, which is just barely brighter than the soft lighting that surrounds players. @@ -43,7 +43,7 @@ #undef NONSENSICAL_VALUE /atom/proc/set_uv(var/intensity, var/no_update) - L_PROF(src, "atom_setuv") + //L_PROF(src, "atom_setuv") if (intensity < 0 || intensity > 255) intensity = min(max(intensity, 255), 0) @@ -60,7 +60,7 @@ if (QDELING(src)) return - L_PROF(src, "atom_update") + //L_PROF(src, "atom_update") if (!light_power || !light_range) // We won't emit light anyways, destroy the light source. QDEL_NULL(light) @@ -94,7 +94,7 @@ if (new_opacity == opacity) return - L_PROF(src, "atom_setopacity") + //L_PROF(src, "atom_setopacity") opacity = new_opacity var/turf/T = loc diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm index 10533113926..7287da841c4 100644 --- a/code/modules/lighting/lighting_overlay.dm +++ b/code/modules/lighting/lighting_overlay.dm @@ -16,9 +16,7 @@ transform = matrix(WORLD_ICON_SIZE / 32, 0, (WORLD_ICON_SIZE - 32) / 2, 0, WORLD_ICON_SIZE / 32, (WORLD_ICON_SIZE - 32) / 2) #endif -/atom/movable/lighting_overlay/Initialize() - . = ..() - verbs.Cut() +/atom/movable/lighting_overlay/New() SSlighting.lighting_overlays += src var/turf/T = loc // If this runtimes atleast we'll know what's creating overlays in things that aren't turfs. @@ -32,7 +30,7 @@ if (!force) return QDEL_HINT_LETMELIVE // STOP DELETING ME - L_PROF(loc, "overlay_destroy") + //L_PROF(loc, "overlay_destroy") SSlighting.lighting_overlays -= src SSlighting.overlay_queue -= src @@ -147,7 +145,7 @@ // Override here to prevent things accidentally moving around overlays. /atom/movable/lighting_overlay/forceMove(atom/destination, no_tp = FALSE, harderforce = FALSE) if(harderforce) - L_PROF(loc, "overlay_forcemove") + //L_PROF(loc, "overlay_forcemove") . = ..() /atom/movable/lighting_overlay/shuttle_move(turf/loc) diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index d248f670bb3..117adcd8838 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -65,13 +65,13 @@ update() - L_PROF(source_atom, "source_new([type])") + //L_PROF(source_atom, "source_new([type])") return ..() // Kill ourselves. /datum/light_source/Destroy(force) - L_PROF(source_atom, "source_destroy") + //L_PROF(source_atom, "source_destroy") remove_lum() if (source_atom) @@ -115,19 +115,19 @@ top_atom.light_sources += src // Add ourselves to the light sources of our new top atom. - L_PROF(source_atom, "source_update") + //L_PROF(source_atom, "source_update") INTELLIGENT_UPDATE(LIGHTING_CHECK_UPDATE) // Will force an update without checking if it's actually needed. /datum/light_source/proc/force_update() - L_PROF(source_atom, "source_forceupdate") + //L_PROF(source_atom, "source_forceupdate") INTELLIGENT_UPDATE(LIGHTING_FORCE_UPDATE) // Will cause the light source to recalculate turfs that were removed or added to visibility only. /datum/light_source/proc/vis_update() - L_PROF(source_atom, "source_visupdate") + //L_PROF(source_atom, "source_visupdate") INTELLIGENT_UPDATE(LIGHTING_VIS_UPDATE) diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index 1c72595c7a4..8f51ee05d3b 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -11,14 +11,18 @@ // Causes any affecting light sources to be queued for a visibility update, for example a door got opened. /turf/proc/reconsider_lights() - L_PROF(src, "turf_reconsider") - for (var/datum/light_source/L in affecting_lights) + //L_PROF(src, "turf_reconsider") + var/datum/light_source/L + for (var/thing in affecting_lights) + L = thing L.vis_update() // Forces a lighting update. Reconsider lights is preferred when possible. /turf/proc/force_update_lights() - L_PROF(src, "turf_forceupdate") - for (var/datum/light_source/L in affecting_lights) + //L_PROF(src, "turf_forceupdate") + var/datum/light_source/L + for (var/thing in affecting_lights) + L = thing L.force_update() /turf/proc/lighting_clear_overlay() @@ -30,7 +34,7 @@ qdel(lighting_overlay, TRUE) lighting_overlay = null - L_PROF(src, "turf_clear_overlay") + //L_PROF(src, "turf_clear_overlay") for (var/datum/lighting_corner/C in corners) C.update_active() @@ -40,7 +44,7 @@ if (lighting_overlay) return - L_PROF(src, "turf_build_overlay") + //L_PROF(src, "turf_build_overlay") var/area/A = loc if (A.dynamic_lighting && dynamic_lighting) diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index db179a3b3e4..413bf21edd9 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -42,7 +42,6 @@ new_player_panel() spawn(40) if(client) - handle_privacy_poll() client.playtitlemusic() /mob/new_player/proc/show_title() diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index da166ae5ceb..d534ff12e05 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -16,182 +16,157 @@ anchored = 1 // don't get pushed around simulated = FALSE - New() - ..() - dead_mob_list -= src +/mob/new_player/New() + ..() + dead_mob_list -= src - verb/new_player_panel() - set src = usr - new_player_panel_proc() +/mob/new_player/verb/new_player_panel() + set src = usr + new_player_panel_proc() +/mob/new_player/proc/new_player_panel_proc() + var/output = "
New Player Options" + output +="
" + output += "

Setup Character

" - proc/new_player_panel_proc() - var/output = "
New Player Options" - output +="
" - output += "

Setup Character

" - - if(!ROUND_IS_STARTED) - if(ready) - output += "

\[ Ready | Not Ready \]

" - else - output += "

\[ Ready | Not Ready \]

" - + if(!ROUND_IS_STARTED) + if(ready) + output += "

\[ Ready | Not Ready \]

" else - output += "View the Crew Manifest

" - output += "

Join Game!

" + output += "

\[ Ready | Not Ready \]

" - output += "

Observe

" + else + output += "View the Crew Manifest

" + output += "

Join Game!

" - if(!IsGuestKey(src.key)) - establish_db_connection(dbcon) + output += "

Observe

" - if(dbcon.IsConnected()) - var/isadmin = 0 - if(src.client && src.client.holder) - isadmin = 1 - var/DBQuery/query = dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM ss13_poll_vote WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM ss13_poll_textreply WHERE ckey = \"[ckey]\")") - query.Execute() - var/newpoll = 0 - while(query.NextRow()) - newpoll = 1 - break + if(!IsGuestKey(src.key)) + establish_db_connection(dbcon) - if(newpoll) - output += "

Show Player Polls (NEW!)

" - else - output += "

Show Player Polls

" + if(dbcon.IsConnected()) + var/isadmin = 0 + if(src.client && src.client.holder) + isadmin = 1 + var/DBQuery/query = dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM ss13_poll_vote WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM ss13_poll_textreply WHERE ckey = \"[ckey]\")") + query.Execute() + var/newpoll = 0 + while(query.NextRow()) + newpoll = 1 + break - output += "
" - - src << browse(output,"window=playersetup;size=210x280;can_close=0") - return - - Stat() - ..() - - if(statpanel("Lobby")) - stat("Game ID:", game_id) - - if(SSticker.hide_mode) - stat("Game Mode:", "Secret") + if(newpoll) + output += "

Show Player Polls (NEW!)

" else - if(SSticker.hide_mode == 0) - stat("Game Mode:", "[master_mode]") // Old setting for showing the game mode + output += "

Show Player Polls

" - if(SSticker.current_state == GAME_STATE_PREGAME) - if (SSticker.lobby_ready) - stat("Time To Start:", "[SSticker.pregame_timeleft][round_progressing ? "" : " (DELAYED)"]") - else - stat("Time To Start:", "Waiting for Server") - stat("Players: [totalPlayers]", "Players Ready: [totalPlayersReady]") - totalPlayers = 0 - totalPlayersReady = 0 - for(var/mob/new_player/player in player_list) - stat("[player.key]", (player.ready)?("(Playing)"):(null)) - totalPlayers++ - if(player.ready) - totalPlayersReady++ + output += "
" - Topic(href, href_list[]) - if(!client) return 0 + src << browse(output,"window=playersetup;size=210x280;can_close=0") - if(href_list["show_preferences"]) - client.prefs.ShowChoices(src) - return 1 +/mob/new_player/Stat() + ..() - if(href_list["ready"]) - if(SSticker.current_state <= GAME_STATE_PREGAME) // Make sure we don't ready up after the round has started - // Cannot join without a saved character, if we're on SQL saves. - if (config.sql_saves && !client.prefs.current_character) - alert(src, "You have not saved your character yet. Please do so before readying up.") - return + if(statpanel("Lobby")) + stat("Game ID:", game_id) - ready = text2num(href_list["ready"]) + if(SSticker.hide_mode) + stat("Game Mode:", "Secret") + else + if(SSticker.hide_mode == 0) + stat("Game Mode:", "[master_mode]") // Old setting for showing the game mode + + if(SSticker.current_state == GAME_STATE_PREGAME) + if (SSticker.lobby_ready) + stat("Time To Start:", "[SSticker.pregame_timeleft][round_progressing ? "" : " (DELAYED)"]") else - ready = 0 + stat("Time To Start:", "Waiting for Server") + stat("Players: [totalPlayers]", "Players Ready: [totalPlayersReady]") + totalPlayers = 0 + totalPlayersReady = 0 + for(var/mob/new_player/player in player_list) + stat("[player.key]", (player.ready)?("(Playing)"):(null)) + totalPlayers++ + if(player.ready) + totalPlayersReady++ - if(href_list["refresh"]) - src << browse(null, "window=playersetup") //closes the player setup window - new_player_panel_proc() +/mob/new_player/Topic(href, href_list[]) + if(!client) return 0 - if(href_list["observe"]) - if (SSatoms.initialized < INITIALIZATION_INNEW_REGULAR) - // Don't allow players to observe until initialization is more or less complete. - // Letting them join too early breaks things, they can wait. - src << span("alert", "The server is still initializing, try observing again in a minute or so.") - return - - if(alert(src,"Are you sure you wish to observe? You will have to wait 30 minutes before being able to respawn!","Player Setup","Yes","No") == "Yes") - if(!client) return 1 - var/mob/dead/observer/observer = new /mob/dead/observer(src) - spawning = 1 - src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo - - - observer.started_as_observer = 1 - close_spawn_windows() - var/obj/O = locate("landmark*Observer-Start") - if(istype(O)) - src << "Now teleporting." - observer.loc = O.loc - else - src << "Could not locate an observer spawn point. Use the Teleport verb to jump to the station map." - observer.timeofdeath = world.time // Set the time of death so that the respawn timer works correctly. - - announce_ghost_joinleave(src) - var/mob/living/carbon/human/dummy/mannequin = new() - client.prefs.dress_preview_mob(mannequin) - observer.appearance = mannequin - observer.alpha = 127 - observer.layer = initial(observer.layer) - observer.invisibility = initial(observer.invisibility) - qdel(mannequin) - - observer.real_name = client.prefs.real_name - observer.name = observer.real_name - if(!client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed. - observer.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing! - observer.ckey = ckey - observer.initialise_postkey() - qdel(src) - - return 1 - - if(href_list["late_join"]) - - if(SSticker.current_state != GAME_STATE_PLAYING) - usr << "The round is either not ready, or has already finished..." - return + if(href_list["show_preferences"]) + client.prefs.ShowChoices(src) + return 1 + if(href_list["ready"]) + if(SSticker.current_state <= GAME_STATE_PREGAME) // Make sure we don't ready up after the round has started // Cannot join without a saved character, if we're on SQL saves. if (config.sql_saves && !client.prefs.current_character) - alert(src, "You have not saved your character yet. Please do so before attempting to join.") + alert(src, "You have not saved your character yet. Please do so before readying up.") return - if(!check_rights(R_ADMIN, 0)) - var/datum/species/S = all_species[client.prefs.species] - if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist) - src << alert("You are currently not whitelisted to play [client.prefs.species].") - return 0 + ready = text2num(href_list["ready"]) + else + ready = 0 - if(!(S.spawn_flags & CAN_JOIN)) - src << alert("Your current species, [client.prefs.species], is not available for play on the station.") - return 0 + if(href_list["refresh"]) + src << browse(null, "window=playersetup") //closes the player setup window + new_player_panel_proc() - LateChoices() + if(href_list["observe"]) + if (SSatoms.initialized < INITIALIZATION_INNEW_REGULAR) + // Don't allow players to observe until initialization is more or less complete. + // Letting them join too early breaks things, they can wait. + src << span("alert", "The server is still initializing, try observing again in a minute or so.") + return - if(href_list["manifest"]) - ViewManifest() + if(alert(src,"Are you sure you wish to observe? You will have to wait 30 minutes before being able to respawn!","Player Setup","Yes","No") == "Yes") + if(!client) return 1 + var/mob/dead/observer/observer = new /mob/dead/observer(src) + spawning = 1 + src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo - if(href_list["SelectedJob"]) - if(!config.enter_allowed) - usr << "There is an administrative lock on entering the game!" - return - else if(SSticker.mode && SSticker.mode.explosion_in_progress) - usr << "The station is currently exploding. Joining would go poorly." - return + observer.started_as_observer = 1 + close_spawn_windows() + var/obj/O = locate("landmark*Observer-Start") + if(istype(O)) + src << "Now teleporting." + observer.loc = O.loc + else + src << "Could not locate an observer spawn point. Use the Teleport verb to jump to the station map." + observer.timeofdeath = world.time // Set the time of death so that the respawn timer works correctly. + announce_ghost_joinleave(src) + var/mob/living/carbon/human/dummy/mannequin = SSmob.get_mannequin(client.ckey) + client.prefs.dress_preview_mob(mannequin) + observer.appearance = mannequin + observer.alpha = 127 + observer.layer = initial(observer.layer) + observer.invisibility = initial(observer.invisibility) + observer.desc = initial(observer.desc) + + observer.real_name = client.prefs.real_name + observer.name = observer.real_name + if(!client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed. + observer.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing! + observer.ckey = ckey + observer.initialise_postkey() + qdel(src) + + return 1 + + if(href_list["late_join"]) + + if(SSticker.current_state != GAME_STATE_PLAYING) + usr << "The round is either not ready, or has already finished..." + return + + // Cannot join without a saved character, if we're on SQL saves. + if (config.sql_saves && !client.prefs.current_character) + alert(src, "You have not saved your character yet. Please do so before attempting to join.") + return + + if(!check_rights(R_ADMIN, 0)) var/datum/species/S = all_species[client.prefs.species] if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist) src << alert("You are currently not whitelisted to play [client.prefs.species].") @@ -201,312 +176,296 @@ src << alert("Your current species, [client.prefs.species], is not available for play on the station.") return 0 - AttemptLateSpawn(href_list["SelectedJob"],client.prefs.spawnpoint) - return + LateChoices() - if(href_list["privacy_poll"]) - establish_db_connection(dbcon) - if(!dbcon.IsConnected()) - return - var/voted = 0 + if(href_list["manifest"]) + ViewManifest() - //First check if the person has not voted yet. - var/DBQuery/query = dbcon.NewQuery("SELECT * FROM ss13_privacy WHERE ckey='[src.ckey]'") - query.Execute() - while(query.NextRow()) - voted = 1 - break + if(href_list["SelectedJob"]) - //This is a safety switch, so only valid options pass through - var/option = "UNKNOWN" - switch(href_list["privacy_poll"]) - if("signed") - option = "SIGNED" - if("anonymous") - option = "ANONYMOUS" - if("nostats") - option = "NOSTATS" - if("later") - usr << browse(null,"window=privacypoll") - return - if("abstain") - option = "ABSTAIN" - - if(option == "UNKNOWN") - return - - if(!voted) - var/sql = "INSERT INTO ss13_privacy VALUES (null, Now(), '[src.ckey]', '[option]')" - var/DBQuery/query_insert = dbcon.NewQuery(sql) - query_insert.Execute() - usr << "Thank you for your vote!" - usr << browse(null,"window=privacypoll") - - if(!ready && href_list["preference"]) - if(client) - client.prefs.process_link(src, href_list) - else if(!href_list["late_join"]) - new_player_panel() - - if(href_list["showpoll"]) - - handle_player_polling() - return - - if(href_list["pollid"]) - - var/pollid = href_list["pollid"] - if(istext(pollid)) - pollid = text2num(pollid) - if(isnum(pollid)) - src.poll_player(pollid) - return - - if(href_list["votepollid"] && href_list["votetype"]) - var/pollid = text2num(href_list["votepollid"]) - var/votetype = href_list["votetype"] - switch(votetype) - if("OPTION") - var/optionid = text2num(href_list["voteoptionid"]) - vote_on_poll(pollid, optionid) - if("TEXT") - var/replytext = href_list["replytext"] - log_text_poll_reply(pollid, replytext) - if("NUMVAL") - var/id_min = text2num(href_list["minid"]) - var/id_max = text2num(href_list["maxid"]) - - if( (id_max - id_min) > 100 ) //Basic exploit prevention - usr << "The option ID difference is too big. Please contact administration or the database admin." - return - - for(var/optionid = id_min; optionid <= id_max; optionid++) - if(!isnull(href_list["o[optionid]"])) //Test if this optionid was replied to - var/rating - if(href_list["o[optionid]"] == "abstain") - rating = null - else - rating = text2num(href_list["o[optionid]"]) - if(!isnum(rating)) - return - - vote_on_numval_poll(pollid, optionid, rating) - if("MULTICHOICE") - var/id_min = text2num(href_list["minoptionid"]) - var/id_max = text2num(href_list["maxoptionid"]) - - if( (id_max - id_min) > 100 ) //Basic exploit prevention - usr << "The option ID difference is too big. Please contact administration or the database admin." - return - - for(var/optionid = id_min; optionid <= id_max; optionid++) - if(!isnull(href_list["option_[optionid]"])) //Test if this optionid was selected - vote_on_poll(pollid, optionid, 1) - - proc/IsJobAvailable(rank) - var/datum/job/job = SSjobs.GetJob(rank) - if(!job) return 0 - if(!job.is_position_available()) return 0 - if(jobban_isbanned(src,rank)) return 0 - return 1 - - - proc/AttemptLateSpawn(rank,var/spawning_at) - if(src != usr) - return 0 - if(SSticker.current_state != GAME_STATE_PLAYING) - usr << "The round is either not ready, or has already finished..." - return 0 if(!config.enter_allowed) usr << "There is an administrative lock on entering the game!" - return 0 - if(config.sql_saves && !client.prefs.current_character) - alert(src, "You have not saved your character yet. Please do so before attempting to join.") - return 0 - if(!IsJobAvailable(rank)) - src << alert("[rank] is not available. Please try another.") - return 0 - - spawning = 1 - close_spawn_windows() - - SSjobs.AssignRole(src, rank, 1) - - var/mob/living/character = create_character() //creates the human and transfers vars and mind - - character = SSjobs.EquipPersonal(character, rank, 1,spawning_at) //equips the human - - UpdateFactionList(character) - - equip_custom_items(character) - - // AIs don't need a spawnpoint, they must spawn at an empty core - if(character.mind.assigned_role == "AI") - - character = character.AIize(move=0) // AIize the character, but don't move them yet - - // IsJobAvailable for AI checks that there is an empty core available in this list - var/obj/structure/AIcore/deactivated/C = empty_playable_ai_cores[1] - empty_playable_ai_cores -= C - - character.loc = C.loc - - AnnounceCyborg(character, rank, "has been downloaded to the empty core in \the [character.loc.loc]") - SSticker.mode.handle_latejoin(character) - - qdel(C) - qdel(src) + return + else if(SSticker.mode && SSticker.mode.explosion_in_progress) + usr << "The station is currently exploding. Joining would go poorly." return - //Find our spawning point. - var/join_message = SSjobs.LateSpawn(character, rank) + var/datum/species/S = all_species[client.prefs.species] + if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist) + src << alert("You are currently not whitelisted to play [client.prefs.species].") + return 0 - character.lastarea = get_area(loc) - // Moving wheelchair if they have one - if(character.buckled && istype(character.buckled, /obj/structure/bed/chair/wheelchair)) - character.buckled.loc = character.loc - character.buckled.set_dir(character.dir) + if(!(S.spawn_flags & CAN_JOIN)) + src << alert("Your current species, [client.prefs.species], is not available for play on the station.") + return 0 - SSticker.mode.handle_latejoin(character) + AttemptLateSpawn(href_list["SelectedJob"],client.prefs.spawnpoint) + return - if(character.mind.assigned_role != "Cyborg") - data_core.manifest_inject(character) - SSticker.minds += character.mind //Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn + if(!ready && href_list["preference"]) + if(client) + client.prefs.process_link(src, href_list) + else if(!href_list["late_join"]) + new_player_panel() - //Grab some data from the character prefs for use in random news procs. + if(href_list["showpoll"]) - AnnounceArrival(character, rank, join_message) - else - AnnounceCyborg(character, rank, join_message) + handle_player_polling() + return - qdel(src) + if(href_list["pollid"]) - proc/AnnounceCyborg(var/mob/living/character, var/rank, var/join_message) - if (SSticker.current_state == GAME_STATE_PLAYING) - if(character.mind.role_alt_title) - rank = character.mind.role_alt_title - // can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc. - global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") + var/pollid = href_list["pollid"] + if(istext(pollid)) + pollid = text2num(pollid) + if(isnum(pollid)) + src.poll_player(pollid) + return - proc/LateChoices() - var/name = client.prefs.real_name + if(href_list["votepollid"] && href_list["votetype"]) + var/pollid = text2num(href_list["votepollid"]) + var/votetype = href_list["votetype"] + switch(votetype) + if("OPTION") + var/optionid = text2num(href_list["voteoptionid"]) + vote_on_poll(pollid, optionid) + if("TEXT") + var/replytext = href_list["replytext"] + log_text_poll_reply(pollid, replytext) + if("NUMVAL") + var/id_min = text2num(href_list["minid"]) + var/id_max = text2num(href_list["maxid"]) - var/dat = "
" - dat += "Welcome, [name].
" - dat += "Round Duration: [round_duration()]
" + if( (id_max - id_min) > 100 ) //Basic exploit prevention + usr << "The option ID difference is too big. Please contact administration or the database admin." + return - if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles. - if(emergency_shuttle.going_to_centcom()) //Shuttle is going to centcomm, not recalled - dat += "The station has been evacuated.
" - if(emergency_shuttle.online()) - if (emergency_shuttle.evac) // Emergency shuttle is past the point of no recall - dat += "The station is currently undergoing evacuation procedures.
" - else // Crew transfer initiated - dat += "The station is currently undergoing crew transfer procedures.
" + for(var/optionid = id_min; optionid <= id_max; optionid++) + if(!isnull(href_list["o[optionid]"])) //Test if this optionid was replied to + var/rating + if(href_list["o[optionid]"] == "abstain") + rating = null + else + rating = text2num(href_list["o[optionid]"]) + if(!isnum(rating)) + return - dat += "Choose from the following open/valid positions:
" - for(var/datum/job/job in SSjobs.occupations) - if(job && IsJobAvailable(job.title)) - var/active = 0 - // Only players with the job assigned and AFK for less than 10 minutes count as active - for(var/mob/M in player_list) //Added isliving check here, so it won't check ghosts and qualify them as active - if(isliving(M) && M.mind && M.client && M.mind.assigned_role == job.title && M.client.inactivity <= 10 * 60 * 10) - active++ - dat += "[job.title] ([job.current_positions]) (Active: [active])
" + vote_on_numval_poll(pollid, optionid, rating) + if("MULTICHOICE") + var/id_min = text2num(href_list["minoptionid"]) + var/id_max = text2num(href_list["maxoptionid"]) - dat += "
" - src << browse(dat, "window=latechoices;size=300x640;can_close=1") + if( (id_max - id_min) > 100 ) //Basic exploit prevention + usr << "The option ID difference is too big. Please contact administration or the database admin." + return + + for(var/optionid = id_min; optionid <= id_max; optionid++) + if(!isnull(href_list["option_[optionid]"])) //Test if this optionid was selected + vote_on_poll(pollid, optionid, 1) + +/mob/new_player/proc/IsJobAvailable(rank) + var/datum/job/job = SSjobs.GetJob(rank) + if(!job) return 0 + if(!job.is_position_available()) return 0 + if(jobban_isbanned(src,rank)) return 0 + return 1 - proc/create_character() - spawning = 1 - close_spawn_windows() - - var/mob/living/carbon/human/new_character - - var/use_species_name - var/datum/species/chosen_species - if(client.prefs.species) - chosen_species = all_species[client.prefs.species] - use_species_name = chosen_species.get_station_variant() //Only used by pariahs atm. - - if(chosen_species && use_species_name) - // Have to recheck admin due to no usr at roundstart. Latejoins are fine though. - if(is_species_whitelisted(chosen_species) || has_admin_rights()) - new_character = new(newplayer_start, use_species_name) - - if(!new_character) - new_character = new(newplayer_start) - - new_character.lastarea = get_area(loc) - - for(var/lang in client.prefs.alternate_languages) - var/datum/language/chosen_language = all_languages[lang] - if(chosen_language) - if(!config.usealienwhitelist || !(chosen_language.flags & WHITELISTED) || is_alien_whitelisted(src, lang) || has_admin_rights() \ - || (new_character.species && (chosen_language.name in new_character.species.secondary_langs))) - new_character.add_language(lang) - - if(SSticker.random_players) - new_character.gender = pick(MALE, FEMALE) - client.prefs.real_name = random_name(new_character.gender) - client.prefs.randomize_appearance_for(new_character) - else - client.prefs.copy_to(new_character) - - src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo - - if(mind) - mind.active = 0 //we wish to transfer the key manually - if(mind.assigned_role == "Clown") //give them a clownname if they are a clown - new_character.real_name = pick(clown_names) //I hate this being here of all places but unfortunately dna is based on real_name! - new_character.rename_self("clown") - mind.original = new_character - mind.transfer_to(new_character) //won't transfer key since the mind is not active - - new_character.name = real_name - new_character.dna.ready_dna(new_character) - new_character.dna.b_type = client.prefs.b_type - new_character.sync_organ_dna() - if(client.prefs.disabilities) - // Set defer to 1 if you add more crap here so it only recalculates struc_enzymes once. - N3X - new_character.dna.SetSEState(GLASSESBLOCK,1,0) - new_character.disabilities |= NEARSIGHTED - - // And uncomment this, too. - //new_character.dna.UpdateSE() - - // Do the initial caching of the player's body icons. - new_character.force_update_limbs() - new_character.update_eyes() - new_character.regenerate_icons() - - client.prefs.log_character(new_character) - - new_character.key = key //Manually transfer the key to log them in - - return new_character - - proc/ViewManifest() - var/dat = "" - dat += "

Show Crew Manifest

" - dat += data_core.get_manifest(OOC = 1) - - src << browse(dat, "window=manifest;size=370x420;can_close=1") - - Move() +/mob/new_player/proc/AttemptLateSpawn(rank,var/spawning_at) + if(src != usr) + return 0 + if(SSticker.current_state != GAME_STATE_PLAYING) + usr << "The round is either not ready, or has already finished..." + return 0 + if(!config.enter_allowed) + usr << "There is an administrative lock on entering the game!" + return 0 + if(config.sql_saves && !client.prefs.current_character) + alert(src, "You have not saved your character yet. Please do so before attempting to join.") + return 0 + if(!IsJobAvailable(rank)) + src << alert("[rank] is not available. Please try another.") return 0 - proc/close_spawn_windows() - src << browse(null, "window=latechoices") //closes late choices window - src << browse(null, "window=playersetup") //closes the player setup window + spawning = 1 + close_spawn_windows() - proc/has_admin_rights() - return check_rights(R_ADMIN, 0, src) + SSjobs.AssignRole(src, rank, 1) - proc/is_species_whitelisted(datum/species/S) - if(!S) return 1 - return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(S.spawn_flags & IS_WHITELISTED) + var/mob/living/character = create_character() //creates the human and transfers vars and mind + + character = SSjobs.EquipPersonal(character, rank, 1,spawning_at) //equips the human + + UpdateFactionList(character) + + equip_custom_items(character) + + // AIs don't need a spawnpoint, they must spawn at an empty core + if(character.mind.assigned_role == "AI") + + character = character.AIize(move=0) // AIize the character, but don't move them yet + + // IsJobAvailable for AI checks that there is an empty core available in this list + var/obj/structure/AIcore/deactivated/C = empty_playable_ai_cores[1] + empty_playable_ai_cores -= C + + character.loc = C.loc + + AnnounceCyborg(character, rank, "has been downloaded to the empty core in \the [character.loc.loc]") + SSticker.mode.handle_latejoin(character) + + qdel(C) + qdel(src) + + //Find our spawning point. + var/join_message = SSjobs.LateSpawn(character, rank) + + character.lastarea = get_area(loc) + // Moving wheelchair if they have one + if(character.buckled && istype(character.buckled, /obj/structure/bed/chair/wheelchair)) + character.buckled.loc = character.loc + character.buckled.set_dir(character.dir) + + SSticker.mode.handle_latejoin(character) + + if(character.mind.assigned_role != "Cyborg") + data_core.manifest_inject(character) + SSticker.minds += character.mind //Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn + + //Grab some data from the character prefs for use in random news procs. + + AnnounceArrival(character, rank, join_message) + else + AnnounceCyborg(character, rank, join_message) + + qdel(src) + +/mob/new_player/proc/AnnounceCyborg(var/mob/living/character, var/rank, var/join_message) + if (SSticker.current_state == GAME_STATE_PLAYING) + if(character.mind.role_alt_title) + rank = character.mind.role_alt_title + // can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc. + global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") + +/mob/new_player/proc/LateChoices() + var/name = client.prefs.real_name + + var/dat = "
" + dat += "Welcome, [name].
" + dat += "Round Duration: [round_duration()]
" + + if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles. + if(emergency_shuttle.going_to_centcom()) //Shuttle is going to centcomm, not recalled + dat += "The station has been evacuated.
" + if(emergency_shuttle.online()) + if (emergency_shuttle.evac) // Emergency shuttle is past the point of no recall + dat += "The station is currently undergoing evacuation procedures.
" + else // Crew transfer initiated + dat += "The station is currently undergoing crew transfer procedures.
" + + dat += "Choose from the following open/valid positions:
" + for(var/datum/job/job in SSjobs.occupations) + if(job && IsJobAvailable(job.title)) + var/active = 0 + // Only players with the job assigned and AFK for less than 10 minutes count as active + for(var/mob/M in player_list) //Added isliving check here, so it won't check ghosts and qualify them as active + if(isliving(M) && M.mind && M.client && M.mind.assigned_role == job.title && M.client.inactivity <= 10 * 60 * 10) + active++ + dat += "[job.title] ([job.current_positions]) (Active: [active])
" + + dat += "
" + src << browse(dat, "window=latechoices;size=300x640;can_close=1") + + +/mob/new_player/proc/create_character() + spawning = 1 + close_spawn_windows() + + var/mob/living/carbon/human/new_character + + var/use_species_name + var/datum/species/chosen_species + if(client.prefs.species) + chosen_species = all_species[client.prefs.species] + use_species_name = chosen_species.get_station_variant() //Only used by pariahs atm. + + if(chosen_species && use_species_name) + // Have to recheck admin due to no usr at roundstart. Latejoins are fine though. + if(is_species_whitelisted(chosen_species) || has_admin_rights()) + new_character = new(newplayer_start, use_species_name) + + if(!new_character) + new_character = new(newplayer_start) + + new_character.lastarea = get_area(loc) + + for(var/lang in client.prefs.alternate_languages) + var/datum/language/chosen_language = all_languages[lang] + if(chosen_language) + if(!config.usealienwhitelist || !(chosen_language.flags & WHITELISTED) || is_alien_whitelisted(src, lang) || has_admin_rights() \ + || (new_character.species && (chosen_language.name in new_character.species.secondary_langs))) + new_character.add_language(lang) + + if(SSticker.random_players) + new_character.gender = pick(MALE, FEMALE) + client.prefs.real_name = random_name(new_character.gender) + client.prefs.randomize_appearance_for(new_character) + else + client.prefs.copy_to(new_character) + + src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo + + if(mind) + mind.active = 0 //we wish to transfer the key manually + if(mind.assigned_role == "Clown") //give them a clownname if they are a clown + new_character.real_name = pick(clown_names) //I hate this being here of all places but unfortunately dna is based on real_name! + new_character.rename_self("clown") + mind.original = new_character + mind.transfer_to(new_character) //won't transfer key since the mind is not active + + new_character.name = real_name + new_character.dna.ready_dna(new_character) + new_character.dna.b_type = client.prefs.b_type + new_character.sync_organ_dna() + if(client.prefs.disabilities) + // Set defer to 1 if you add more crap here so it only recalculates struc_enzymes once. - N3X + new_character.dna.SetSEState(GLASSESBLOCK,1,0) + new_character.disabilities |= NEARSIGHTED + + // And uncomment this, too. + //new_character.dna.UpdateSE() + + // Do the initial caching of the player's body icons. + new_character.force_update_limbs() + new_character.update_eyes() + new_character.regenerate_icons() + + client.prefs.log_character(new_character) + + new_character.key = key //Manually transfer the key to log them in + + return new_character + +/mob/new_player/proc/ViewManifest() + var/dat = "" + dat += "

Show Crew Manifest

" + dat += data_core.get_manifest(OOC = 1) + + src << browse(dat, "window=manifest;size=370x420;can_close=1") + +/mob/new_player/Move() + return 0 + +/mob/new_player/proc/close_spawn_windows() + src << browse(null, "window=latechoices") //closes late choices window + src << browse(null, "window=playersetup") //closes the player setup window + +/mob/new_player/proc/has_admin_rights() + return check_rights(R_ADMIN, 0, src) + +/mob/new_player/proc/is_species_whitelisted(datum/species/S) + if(!S) return 1 + return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(S.spawn_flags & IS_WHITELISTED) /mob/new_player/get_species(var/reference = 0) var/datum/species/chosen_species @@ -537,5 +496,5 @@ /mob/new_player/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0) return -mob/new_player/MayRespawn() +/mob/new_player/MayRespawn() return 1 diff --git a/code/modules/mob/new_player/poll.dm b/code/modules/mob/new_player/poll.dm index ef5f28c51a9..ad1a75484c8 100644 --- a/code/modules/mob/new_player/poll.dm +++ b/code/modules/mob/new_player/poll.dm @@ -1,47 +1,4 @@ -/mob/new_player/proc/handle_privacy_poll() - establish_db_connection(dbcon) - if(!dbcon.IsConnected()) - return - var/voted = 0 - - var/DBQuery/query = dbcon.NewQuery("SELECT * FROM ss13_privacy WHERE ckey='[src.ckey]'") - query.Execute() - while(query.NextRow()) - voted = 1 - break - - if(!voted) - privacy_poll() - -/mob/new_player/proc/privacy_poll() - var/output = "
Player poll" - output +="
" - output += "We would like to expand our stats gathering." - output += "
This however involves gathering data about player behavior, play styles, unique player numbers, play times, etc. Data like that cannot be gathered fully anonymously, which is why we're asking you how you'd feel if player-specific data was gathered. Prior to any of this actually happening, a privacy policy will be discussed, but before that can begin, we'd preliminarily like to know how you feel about the concept." - output +="
" - output += "How do you feel about the game gathering player-specific statistics? This includes statistics about individual players as well as in-game polling/opinion requests." - - output += "

Signed stats gathering" - output += "
Pick this option if you think usernames should be logged with stats. This allows us to have personalized stats as well as polls." - - output += "

Anonymous stats gathering" - output += "
Pick this option if you think only hashed (indecipherable) usernames should be logged with stats. This doesn't allow us to have personalized stats, as we can't tell who is who (hashed values aren't readable), we can however have ingame polls." - - output += "

No stats gathering" - output += "
Pick this option if you don't want player-specific stats gathered. This does not allow us to have player-specific stats or polls." - - output += "

Ask again later" - output += "
This poll will be brought up again next round." - - output += "

Don't ask again" - output += "
Only pick this if you are fine with whatever option wins." - - output += "

" - - src << browse(output,"window=privacypoll;size=600x500") - return - /datum/polloption var/optionid var/optiontext @@ -523,4 +480,4 @@ insert_query.Execute() usr << "Vote successful." - usr << browse(null,"window=playerpoll") \ No newline at end of file + usr << browse(null,"window=playerpoll") diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 20676e072f9..974f760612c 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -553,7 +553,8 @@ spark(src, 3) status = LIGHT_BROKEN update() - CHECK_TICK // For lights-out events. + if (!skip_sound_and_sparks) + CHECK_TICK // For lights-out events. /obj/machinery/light/proc/fix() if(status == LIGHT_OK) diff --git a/html/changelogs/lohikar-privacypoll.yml b/html/changelogs/lohikar-privacypoll.yml new file mode 100644 index 00000000000..94dac635f12 --- /dev/null +++ b/html/changelogs/lohikar-privacypoll.yml @@ -0,0 +1,4 @@ +author: Lohikar +delete-after: True +changes: + - rscdel: "Removed the privacy poll."