Remove privacy poll & other tweaks/fixes (#2863)

changes:

Removed the privacy poll as it is unused.
Observing no longer creates a new mannequin, instead fetching one from SSmobs.
Observer ghosts now have a description again.
Converted new_player.dm to absolute pathing.
Fixed a bad init on holomaps.
Removed a sleep from light fixture Initialize().
Added a queue length stat to the MC panel for Icon Smoothing.
Halved time taken to create lighting overlay objects.
Species & body marking lists are now sorted alphabetically.
Commented out calls to lighting profiler to remove overhead of string interpolation in some procs.
Blood dries instantly if present during mapload instead of setting a timer.
This commit is contained in:
Lohikar
2017-07-01 13:53:39 -05:00
committed by skull132
parent de2efd09ac
commit 42f91d8117
16 changed files with 451 additions and 503 deletions

View File

@@ -0,0 +1,6 @@
--
-- Implemented in PR #2863.
-- Removes unused privacy table.
--
DROP TABLE `ss13_privacy`;

View File

@@ -125,6 +125,8 @@ var/global/list/cloaking_devices = list()
var/datum/sprite_accessory/marking/M = new path() var/datum/sprite_accessory/marking/M = new path()
body_marking_styles_list[M.name] = M 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 //Surgery Steps - Initialize all /datum/surgery_step into a list
paths = subtypesof(/datum/surgery_step) paths = subtypesof(/datum/surgery_step)
for(var/T in paths) for(var/T in paths)
@@ -159,7 +161,13 @@ var/global/list/cloaking_devices = list()
S.race_key = rkey //Used in mob icon caching. S.race_key = rkey //Used in mob icon caching.
all_species[S.name] = S 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 playable_species += S.name
if(S.spawn_flags & IS_WHITELISTED) if(S.spawn_flags & IS_WHITELISTED)
whitelisted_species += S.name whitelisted_species += S.name

View File

@@ -17,6 +17,9 @@ var/datum/controller/subsystem/icon_smooth/SSicon_smooth
/datum/controller/subsystem/icon_smooth/Recover() /datum/controller/subsystem/icon_smooth/Recover()
smooth_queue = SSicon_smooth.smooth_queue smooth_queue = SSicon_smooth.smooth_queue
/datum/controller/subsystem/icon_smooth/stat_entry()
..("Q:[smooth_queue.len]")
/datum/controller/subsystem/icon_smooth/fire() /datum/controller/subsystem/icon_smooth/fire()
if (explosion_in_progress) if (explosion_in_progress)
return return

View File

@@ -49,9 +49,13 @@ var/datum/controller/subsystem/lighting/SSlighting
/datum/controller/subsystem/lighting/Initialize(timeofday) /datum/controller/subsystem/lighting/Initialize(timeofday)
var/overlaycount = 0 var/overlaycount = 0
var/starttime = REALTIMEOFDAY
// Generate overlays. // Generate overlays.
var/turf/T
var/thing
for (var/zlevel = 1 to world.maxz) 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) if (!T.dynamic_lighting)
continue continue
@@ -64,14 +68,16 @@ var/datum/controller/subsystem/lighting/SSlighting
CHECK_TICK 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. // Tick once to clear most lights.
fire(FALSE, TRUE) fire(FALSE, TRUE)
admin_notice(span("danger", "Processed [processed_lights] light sources."), R_DEBUG) 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_corners] light corners."), R_DEBUG)
admin_notice(span("danger", "Processed [processed_overlays] light overlays."), 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]") log_ss("lighting", "NOv:[overlaycount] L:[processed_lights] C:[processed_corners] O:[processed_overlays]")

View File

@@ -34,6 +34,7 @@
return ..() return ..()
/obj/machinery/station_map/Initialize() /obj/machinery/station_map/Initialize()
. = ..()
holomap_datum = new() holomap_datum = new()
original_zLevel = loc.z original_zLevel = loc.z
SSminimap.station_holomaps += src SSminimap.station_holomaps += src

View File

@@ -39,21 +39,23 @@
D.cure(0) D.cure(0)
return ..() return ..()
/obj/effect/decal/cleanable/blood/Initialize() /obj/effect/decal/cleanable/blood/Initialize(mapload)
. = ..() . = ..()
update_icon() update_icon()
if(istype(src, /obj/effect/decal/cleanable/blood/gibs)) if(istype(src, /obj/effect/decal/cleanable/blood/gibs))
return return
if(src.type == /obj/effect/decal/cleanable/blood) if(type == /obj/effect/decal/cleanable/blood)
if(src.loc && isturf(src.loc)) if (isturf(loc))
for(var/obj/effect/decal/cleanable/blood/B in src.loc) for(var/obj/effect/decal/cleanable/blood/B in src.loc)
if(B != src) if(B != src)
if (B.blood_DNA) if (B.blood_DNA)
blood_DNA |= B.blood_DNA.Copy() blood_DNA |= B.blood_DNA.Copy()
qdel(B) qdel(B)
drytime = DRYING_TIME * (amount+1) drytime = DRYING_TIME * (amount+1)
if (dries) if (dries && !mapload)
addtimer(CALLBACK(src, /obj/effect/decal/cleanable/blood/.proc/dry), drytime) addtimer(CALLBACK(src, /obj/effect/decal/cleanable/blood/.proc/dry), drytime)
else if (dries)
dry()
/obj/effect/decal/cleanable/blood/update_icon() /obj/effect/decal/cleanable/blood/update_icon()
if(basecolor == "rainbow") basecolor = "#[get_random_colour(1)]" if(basecolor == "rainbow") basecolor = "#[get_random_colour(1)]"

View File

@@ -9,7 +9,7 @@
luminosity = FALSE luminosity = FALSE
/area/proc/set_dynamic_lighting(var/new_dynamic_lighting = TRUE) /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) if (new_dynamic_lighting == dynamic_lighting)
return FALSE return FALSE

View File

@@ -16,7 +16,7 @@
// The proc you should always use to set the light of this atom. // 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) /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) 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. 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 #undef NONSENSICAL_VALUE
/atom/proc/set_uv(var/intensity, var/no_update) /atom/proc/set_uv(var/intensity, var/no_update)
L_PROF(src, "atom_setuv") //L_PROF(src, "atom_setuv")
if (intensity < 0 || intensity > 255) if (intensity < 0 || intensity > 255)
intensity = min(max(intensity, 255), 0) intensity = min(max(intensity, 255), 0)
@@ -60,7 +60,7 @@
if (QDELING(src)) if (QDELING(src))
return 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. if (!light_power || !light_range) // We won't emit light anyways, destroy the light source.
QDEL_NULL(light) QDEL_NULL(light)
@@ -94,7 +94,7 @@
if (new_opacity == opacity) if (new_opacity == opacity)
return return
L_PROF(src, "atom_setopacity") //L_PROF(src, "atom_setopacity")
opacity = new_opacity opacity = new_opacity
var/turf/T = loc var/turf/T = loc

View File

@@ -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) transform = matrix(WORLD_ICON_SIZE / 32, 0, (WORLD_ICON_SIZE - 32) / 2, 0, WORLD_ICON_SIZE / 32, (WORLD_ICON_SIZE - 32) / 2)
#endif #endif
/atom/movable/lighting_overlay/Initialize() /atom/movable/lighting_overlay/New()
. = ..()
verbs.Cut()
SSlighting.lighting_overlays += src 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. 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) if (!force)
return QDEL_HINT_LETMELIVE // STOP DELETING ME return QDEL_HINT_LETMELIVE // STOP DELETING ME
L_PROF(loc, "overlay_destroy") //L_PROF(loc, "overlay_destroy")
SSlighting.lighting_overlays -= src SSlighting.lighting_overlays -= src
SSlighting.overlay_queue -= src SSlighting.overlay_queue -= src
@@ -147,7 +145,7 @@
// Override here to prevent things accidentally moving around overlays. // Override here to prevent things accidentally moving around overlays.
/atom/movable/lighting_overlay/forceMove(atom/destination, no_tp = FALSE, harderforce = FALSE) /atom/movable/lighting_overlay/forceMove(atom/destination, no_tp = FALSE, harderforce = FALSE)
if(harderforce) if(harderforce)
L_PROF(loc, "overlay_forcemove") //L_PROF(loc, "overlay_forcemove")
. = ..() . = ..()
/atom/movable/lighting_overlay/shuttle_move(turf/loc) /atom/movable/lighting_overlay/shuttle_move(turf/loc)

View File

@@ -65,13 +65,13 @@
update() update()
L_PROF(source_atom, "source_new([type])") //L_PROF(source_atom, "source_new([type])")
return ..() return ..()
// Kill ourselves. // Kill ourselves.
/datum/light_source/Destroy(force) /datum/light_source/Destroy(force)
L_PROF(source_atom, "source_destroy") //L_PROF(source_atom, "source_destroy")
remove_lum() remove_lum()
if (source_atom) if (source_atom)
@@ -115,19 +115,19 @@
top_atom.light_sources += src // Add ourselves to the light sources of our new top atom. 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) INTELLIGENT_UPDATE(LIGHTING_CHECK_UPDATE)
// Will force an update without checking if it's actually needed. // Will force an update without checking if it's actually needed.
/datum/light_source/proc/force_update() /datum/light_source/proc/force_update()
L_PROF(source_atom, "source_forceupdate") //L_PROF(source_atom, "source_forceupdate")
INTELLIGENT_UPDATE(LIGHTING_FORCE_UPDATE) INTELLIGENT_UPDATE(LIGHTING_FORCE_UPDATE)
// Will cause the light source to recalculate turfs that were removed or added to visibility only. // Will cause the light source to recalculate turfs that were removed or added to visibility only.
/datum/light_source/proc/vis_update() /datum/light_source/proc/vis_update()
L_PROF(source_atom, "source_visupdate") //L_PROF(source_atom, "source_visupdate")
INTELLIGENT_UPDATE(LIGHTING_VIS_UPDATE) INTELLIGENT_UPDATE(LIGHTING_VIS_UPDATE)

View File

@@ -11,14 +11,18 @@
// Causes any affecting light sources to be queued for a visibility update, for example a door got opened. // Causes any affecting light sources to be queued for a visibility update, for example a door got opened.
/turf/proc/reconsider_lights() /turf/proc/reconsider_lights()
L_PROF(src, "turf_reconsider") //L_PROF(src, "turf_reconsider")
for (var/datum/light_source/L in affecting_lights) var/datum/light_source/L
for (var/thing in affecting_lights)
L = thing
L.vis_update() L.vis_update()
// Forces a lighting update. Reconsider lights is preferred when possible. // Forces a lighting update. Reconsider lights is preferred when possible.
/turf/proc/force_update_lights() /turf/proc/force_update_lights()
L_PROF(src, "turf_forceupdate") //L_PROF(src, "turf_forceupdate")
for (var/datum/light_source/L in affecting_lights) var/datum/light_source/L
for (var/thing in affecting_lights)
L = thing
L.force_update() L.force_update()
/turf/proc/lighting_clear_overlay() /turf/proc/lighting_clear_overlay()
@@ -30,7 +34,7 @@
qdel(lighting_overlay, TRUE) qdel(lighting_overlay, TRUE)
lighting_overlay = null lighting_overlay = null
L_PROF(src, "turf_clear_overlay") //L_PROF(src, "turf_clear_overlay")
for (var/datum/lighting_corner/C in corners) for (var/datum/lighting_corner/C in corners)
C.update_active() C.update_active()
@@ -40,7 +44,7 @@
if (lighting_overlay) if (lighting_overlay)
return return
L_PROF(src, "turf_build_overlay") //L_PROF(src, "turf_build_overlay")
var/area/A = loc var/area/A = loc
if (A.dynamic_lighting && dynamic_lighting) if (A.dynamic_lighting && dynamic_lighting)

View File

@@ -42,7 +42,6 @@
new_player_panel() new_player_panel()
spawn(40) spawn(40)
if(client) if(client)
handle_privacy_poll()
client.playtitlemusic() client.playtitlemusic()
/mob/new_player/proc/show_title() /mob/new_player/proc/show_title()

View File

@@ -16,182 +16,157 @@
anchored = 1 // don't get pushed around anchored = 1 // don't get pushed around
simulated = FALSE simulated = FALSE
New() /mob/new_player/New()
..() ..()
dead_mob_list -= src dead_mob_list -= src
verb/new_player_panel() /mob/new_player/verb/new_player_panel()
set src = usr set src = usr
new_player_panel_proc() new_player_panel_proc()
/mob/new_player/proc/new_player_panel_proc()
var/output = "<div align='center'><B>New Player Options</B>"
output +="<hr>"
output += "<p><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A></p>"
proc/new_player_panel_proc() if(!ROUND_IS_STARTED)
var/output = "<div align='center'><B>New Player Options</B>" if(ready)
output +="<hr>" output += "<p>\[ <b>Ready</b> | <a href='byond://?src=\ref[src];ready=0'>Not Ready</a> \]</p>"
output += "<p><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A></p>"
if(!ROUND_IS_STARTED)
if(ready)
output += "<p>\[ <b>Ready</b> | <a href='byond://?src=\ref[src];ready=0'>Not Ready</a> \]</p>"
else
output += "<p>\[ <a href='byond://?src=\ref[src];ready=1'>Ready</a> | <b>Not Ready</b> \]</p>"
else else
output += "<a href='byond://?src=\ref[src];manifest=1'>View the Crew Manifest</A><br><br>" output += "<p>\[ <a href='byond://?src=\ref[src];ready=1'>Ready</a> | <b>Not Ready</b> \]</p>"
output += "<p><a href='byond://?src=\ref[src];late_join=1'>Join Game!</A></p>"
output += "<p><a href='byond://?src=\ref[src];observe=1'>Observe</A></p>" else
output += "<a href='byond://?src=\ref[src];manifest=1'>View the Crew Manifest</A><br><br>"
output += "<p><a href='byond://?src=\ref[src];late_join=1'>Join Game!</A></p>"
if(!IsGuestKey(src.key)) output += "<p><a href='byond://?src=\ref[src];observe=1'>Observe</A></p>"
establish_db_connection(dbcon)
if(dbcon.IsConnected()) if(!IsGuestKey(src.key))
var/isadmin = 0 establish_db_connection(dbcon)
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(newpoll) if(dbcon.IsConnected())
output += "<p><b><a href='byond://?src=\ref[src];showpoll=1'>Show Player Polls</A> (NEW!)</b></p>" var/isadmin = 0
else if(src.client && src.client.holder)
output += "<p><a href='byond://?src=\ref[src];showpoll=1'>Show Player Polls</A></p>" 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 += "</div>" if(newpoll)
output += "<p><b><a href='byond://?src=\ref[src];showpoll=1'>Show Player Polls</A> (NEW!)</b></p>"
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")
else else
if(SSticker.hide_mode == 0) output += "<p><a href='byond://?src=\ref[src];showpoll=1'>Show Player Polls</A></p>"
stat("Game Mode:", "[master_mode]") // Old setting for showing the game mode
if(SSticker.current_state == GAME_STATE_PREGAME) output += "</div>"
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++
Topic(href, href_list[]) src << browse(output,"window=playersetup;size=210x280;can_close=0")
if(!client) return 0
if(href_list["show_preferences"]) /mob/new_player/Stat()
client.prefs.ShowChoices(src) ..()
return 1
if(href_list["ready"]) if(statpanel("Lobby"))
if(SSticker.current_state <= GAME_STATE_PREGAME) // Make sure we don't ready up after the round has started stat("Game ID:", game_id)
// 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
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 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"]) /mob/new_player/Topic(href, href_list[])
src << browse(null, "window=playersetup") //closes the player setup window if(!client) return 0
new_player_panel_proc()
if(href_list["observe"]) if(href_list["show_preferences"])
if (SSatoms.initialized < INITIALIZATION_INNEW_REGULAR) client.prefs.ShowChoices(src)
// Don't allow players to observe until initialization is more or less complete. return 1
// 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 << "<span class='notice'>Now teleporting.</span>"
observer.loc = O.loc
else
src << "<span class='danger'>Could not locate an observer spawn point. Use the Teleport verb to jump to the station map.</span>"
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 << "<span class='warning'>The round is either not ready, or has already finished...</span>"
return
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. // Cannot join without a saved character, if we're on SQL saves.
if (config.sql_saves && !client.prefs.current_character) 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 return
if(!check_rights(R_ADMIN, 0)) ready = text2num(href_list["ready"])
var/datum/species/S = all_species[client.prefs.species] else
if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist) ready = 0
src << alert("You are currently not whitelisted to play [client.prefs.species].")
return 0
if(!(S.spawn_flags & CAN_JOIN)) if(href_list["refresh"])
src << alert("Your current species, [client.prefs.species], is not available for play on the station.") src << browse(null, "window=playersetup") //closes the player setup window
return 0 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"]) 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")
ViewManifest() 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) observer.started_as_observer = 1
usr << "<span class='notice'>There is an administrative lock on entering the game!</span>" close_spawn_windows()
return var/obj/O = locate("landmark*Observer-Start")
else if(SSticker.mode && SSticker.mode.explosion_in_progress) if(istype(O))
usr << "<span class='danger'>The station is currently exploding. Joining would go poorly.</span>" src << "<span class='notice'>Now teleporting.</span>"
return observer.loc = O.loc
else
src << "<span class='danger'>Could not locate an observer spawn point. Use the Teleport verb to jump to the station map.</span>"
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 << "<span class='warning'>The round is either not ready, or has already finished...</span>"
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] var/datum/species/S = all_species[client.prefs.species]
if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist) 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].") 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.") src << alert("Your current species, [client.prefs.species], is not available for play on the station.")
return 0 return 0
AttemptLateSpawn(href_list["SelectedJob"],client.prefs.spawnpoint) LateChoices()
return
if(href_list["privacy_poll"]) if(href_list["manifest"])
establish_db_connection(dbcon) ViewManifest()
if(!dbcon.IsConnected())
return
var/voted = 0
//First check if the person has not voted yet. if(href_list["SelectedJob"])
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM ss13_privacy WHERE ckey='[src.ckey]'")
query.Execute()
while(query.NextRow())
voted = 1
break
//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 << "<b>Thank you for your vote!</b>"
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 << "<span class='warning'>The round is either not ready, or has already finished...</span>"
return 0
if(!config.enter_allowed) if(!config.enter_allowed)
usr << "<span class='notice'>There is an administrative lock on entering the game!</span>" usr << "<span class='notice'>There is an administrative lock on entering the game!</span>"
return 0 return
if(config.sql_saves && !client.prefs.current_character) else if(SSticker.mode && SSticker.mode.explosion_in_progress)
alert(src, "You have not saved your character yet. Please do so before attempting to join.") usr << "<span class='danger'>The station is currently exploding. Joining would go poorly.</span>"
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 return
//Find our spawning point. var/datum/species/S = all_species[client.prefs.species]
var/join_message = SSjobs.LateSpawn(character, rank) 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) if(!(S.spawn_flags & CAN_JOIN))
// Moving wheelchair if they have one src << alert("Your current species, [client.prefs.species], is not available for play on the station.")
if(character.buckled && istype(character.buckled, /obj/structure/bed/chair/wheelchair)) return 0
character.buckled.loc = character.loc
character.buckled.set_dir(character.dir)
SSticker.mode.handle_latejoin(character) AttemptLateSpawn(href_list["SelectedJob"],client.prefs.spawnpoint)
return
if(character.mind.assigned_role != "Cyborg") if(!ready && href_list["preference"])
data_core.manifest_inject(character) if(client)
SSticker.minds += character.mind //Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn 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) handle_player_polling()
else return
AnnounceCyborg(character, rank, join_message)
qdel(src) if(href_list["pollid"])
proc/AnnounceCyborg(var/mob/living/character, var/rank, var/join_message) var/pollid = href_list["pollid"]
if (SSticker.current_state == GAME_STATE_PLAYING) if(istext(pollid))
if(character.mind.role_alt_title) pollid = text2num(pollid)
rank = character.mind.role_alt_title if(isnum(pollid))
// 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. src.poll_player(pollid)
global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") return
proc/LateChoices() if(href_list["votepollid"] && href_list["votetype"])
var/name = client.prefs.real_name 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 = "<html><body><center>" if( (id_max - id_min) > 100 ) //Basic exploit prevention
dat += "<b>Welcome, [name].<br></b>" usr << "The option ID difference is too big. Please contact administration or the database admin."
dat += "Round Duration: [round_duration()]<br>" return
if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles. for(var/optionid = id_min; optionid <= id_max; optionid++)
if(emergency_shuttle.going_to_centcom()) //Shuttle is going to centcomm, not recalled if(!isnull(href_list["o[optionid]"])) //Test if this optionid was replied to
dat += "<font color='red'><b>The station has been evacuated.</b></font><br>" var/rating
if(emergency_shuttle.online()) if(href_list["o[optionid]"] == "abstain")
if (emergency_shuttle.evac) // Emergency shuttle is past the point of no recall rating = null
dat += "<font color='red'>The station is currently undergoing evacuation procedures.</font><br>" else
else // Crew transfer initiated rating = text2num(href_list["o[optionid]"])
dat += "<font color='red'>The station is currently undergoing crew transfer procedures.</font><br>" if(!isnum(rating))
return
dat += "Choose from the following open/valid positions:<br>" vote_on_numval_poll(pollid, optionid, rating)
for(var/datum/job/job in SSjobs.occupations) if("MULTICHOICE")
if(job && IsJobAvailable(job.title)) var/id_min = text2num(href_list["minoptionid"])
var/active = 0 var/id_max = text2num(href_list["maxoptionid"])
// 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 += "<a href='byond://?src=\ref[src];SelectedJob=[job.title]'>[job.title] ([job.current_positions]) (Active: [active])</a><br>"
dat += "</center>" if( (id_max - id_min) > 100 ) //Basic exploit prevention
src << browse(dat, "window=latechoices;size=300x640;can_close=1") 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() /mob/new_player/proc/AttemptLateSpawn(rank,var/spawning_at)
spawning = 1 if(src != usr)
close_spawn_windows() return 0
if(SSticker.current_state != GAME_STATE_PLAYING)
var/mob/living/carbon/human/new_character usr << "<span class='warning'>The round is either not ready, or has already finished...</span>"
return 0
var/use_species_name if(!config.enter_allowed)
var/datum/species/chosen_species usr << "<span class='notice'>There is an administrative lock on entering the game!</span>"
if(client.prefs.species) return 0
chosen_species = all_species[client.prefs.species] if(config.sql_saves && !client.prefs.current_character)
use_species_name = chosen_species.get_station_variant() //Only used by pariahs atm. alert(src, "You have not saved your character yet. Please do so before attempting to join.")
return 0
if(chosen_species && use_species_name) if(!IsJobAvailable(rank))
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though. src << alert("[rank] is not available. Please try another.")
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 = "<html><body>"
dat += "<h4>Show Crew Manifest</h4>"
dat += data_core.get_manifest(OOC = 1)
src << browse(dat, "window=manifest;size=370x420;can_close=1")
Move()
return 0 return 0
proc/close_spawn_windows() spawning = 1
src << browse(null, "window=latechoices") //closes late choices window close_spawn_windows()
src << browse(null, "window=playersetup") //closes the player setup window
proc/has_admin_rights() SSjobs.AssignRole(src, rank, 1)
return check_rights(R_ADMIN, 0, src)
proc/is_species_whitelisted(datum/species/S) var/mob/living/character = create_character() //creates the human and transfers vars and mind
if(!S) return 1
return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(S.spawn_flags & IS_WHITELISTED) 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 = "<html><body><center>"
dat += "<b>Welcome, [name].<br></b>"
dat += "Round Duration: [round_duration()]<br>"
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 += "<font color='red'><b>The station has been evacuated.</b></font><br>"
if(emergency_shuttle.online())
if (emergency_shuttle.evac) // Emergency shuttle is past the point of no recall
dat += "<font color='red'>The station is currently undergoing evacuation procedures.</font><br>"
else // Crew transfer initiated
dat += "<font color='red'>The station is currently undergoing crew transfer procedures.</font><br>"
dat += "Choose from the following open/valid positions:<br>"
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 += "<a href='byond://?src=\ref[src];SelectedJob=[job.title]'>[job.title] ([job.current_positions]) (Active: [active])</a><br>"
dat += "</center>"
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 = "<html><body>"
dat += "<h4>Show Crew Manifest</h4>"
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) /mob/new_player/get_species(var/reference = 0)
var/datum/species/chosen_species 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) /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 return
mob/new_player/MayRespawn() /mob/new_player/MayRespawn()
return 1 return 1

View File

@@ -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 = "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>We would like to expand our stats gathering.</b>"
output += "<br>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 +="<hr>"
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 += "<p><a href='byond://?src=\ref[src];privacy_poll=signed'>Signed stats gathering</A>"
output += "<br>Pick this option if you think usernames should be logged with stats. This allows us to have personalized stats as well as polls."
output += "<p><a href='byond://?src=\ref[src];privacy_poll=anonymous'>Anonymous stats gathering</A>"
output += "<br>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 += "<p><a href='byond://?src=\ref[src];privacy_poll=nostats'>No stats gathering</A>"
output += "<br>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 += "<p><a href='byond://?src=\ref[src];privacy_poll=later'>Ask again later</A>"
output += "<br>This poll will be brought up again next round."
output += "<p><a href='byond://?src=\ref[src];privacy_poll=abstain'>Don't ask again</A>"
output += "<br>Only pick this if you are fine with whatever option wins."
output += "</div>"
src << browse(output,"window=privacypoll;size=600x500")
return
/datum/polloption /datum/polloption
var/optionid var/optionid
var/optiontext var/optiontext
@@ -523,4 +480,4 @@
insert_query.Execute() insert_query.Execute()
usr << "<span class='notice'>Vote successful.</span>" usr << "<span class='notice'>Vote successful.</span>"
usr << browse(null,"window=playerpoll") usr << browse(null,"window=playerpoll")

View File

@@ -553,7 +553,8 @@
spark(src, 3) spark(src, 3)
status = LIGHT_BROKEN status = LIGHT_BROKEN
update() update()
CHECK_TICK // For lights-out events. if (!skip_sound_and_sparks)
CHECK_TICK // For lights-out events.
/obj/machinery/light/proc/fix() /obj/machinery/light/proc/fix()
if(status == LIGHT_OK) if(status == LIGHT_OK)

View File

@@ -0,0 +1,4 @@
author: Lohikar
delete-after: True
changes:
- rscdel: "Removed the privacy poll."