mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
wew
This commit is contained in:
@@ -114,6 +114,6 @@ SUBSYSTEM_DEF(input)
|
|||||||
|
|
||||||
/datum/controller/subsystem/input/fire()
|
/datum/controller/subsystem/input/fire()
|
||||||
var/list/clients = GLOB.clients // Let's sing the list cache song
|
var/list/clients = GLOB.clients // Let's sing the list cache song
|
||||||
for(var/i in 1 to clients.len)
|
for(var/i in 1 to length(clients))
|
||||||
var/client/C = clients[i]
|
var/client/C = clients[i]
|
||||||
C.keyLoop()
|
C.keyLoop()
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ SUBSYSTEM_DEF(mapping)
|
|||||||
var/datum/space_level/empty_space
|
var/datum/space_level/empty_space
|
||||||
var/num_of_res_levels = 1
|
var/num_of_res_levels = 1
|
||||||
|
|
||||||
|
var/stat_map_name = "Loading..."
|
||||||
|
|
||||||
//dlete dis once #39770 is resolved
|
//dlete dis once #39770 is resolved
|
||||||
/datum/controller/subsystem/mapping/proc/HACK_LoadMapConfig()
|
/datum/controller/subsystem/mapping/proc/HACK_LoadMapConfig()
|
||||||
if(!config)
|
if(!config)
|
||||||
@@ -45,6 +47,7 @@ SUBSYSTEM_DEF(mapping)
|
|||||||
#else
|
#else
|
||||||
config = load_map_config(error_if_missing = FALSE)
|
config = load_map_config(error_if_missing = FALSE)
|
||||||
#endif
|
#endif
|
||||||
|
stat_map_name = config.map_name
|
||||||
|
|
||||||
/datum/controller/subsystem/mapping/Initialize(timeofday)
|
/datum/controller/subsystem/mapping/Initialize(timeofday)
|
||||||
HACK_LoadMapConfig()
|
HACK_LoadMapConfig()
|
||||||
@@ -330,7 +333,10 @@ GLOBAL_LIST_EMPTY(the_station_areas)
|
|||||||
return
|
return
|
||||||
|
|
||||||
next_map_config = VM
|
next_map_config = VM
|
||||||
return TRUE
|
|
||||||
|
. = TRUE
|
||||||
|
|
||||||
|
stat_map_name = "[config.map_name] (Next: [next_map_config.map_name])"
|
||||||
|
|
||||||
/datum/controller/subsystem/mapping/proc/preloadTemplates(path = "_maps/templates/") //see master controller setup
|
/datum/controller/subsystem/mapping/proc/preloadTemplates(path = "_maps/templates/") //see master controller setup
|
||||||
var/list/filelist = flist(path)
|
var/list/filelist = flist(path)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ SUBSYSTEM_DEF(nightshift)
|
|||||||
if(!emergency)
|
if(!emergency)
|
||||||
announce("Restoring night lighting configuration to normal operation.")
|
announce("Restoring night lighting configuration to normal operation.")
|
||||||
else
|
else
|
||||||
announce("Disabling night lighting: Station is in a state of emergency.")
|
announce("Disabling night lighting: Station is in a state of emergency.")
|
||||||
if(emergency)
|
if(emergency)
|
||||||
night_time = FALSE
|
night_time = FALSE
|
||||||
if(nightshift_active != night_time)
|
if(nightshift_active != night_time)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ SUBSYSTEM_DEF(shuttle)
|
|||||||
var/list/hostileEnvironments = list() //Things blocking escape shuttle from leaving
|
var/list/hostileEnvironments = list() //Things blocking escape shuttle from leaving
|
||||||
var/list/tradeBlockade = list() //Things blocking cargo from leaving.
|
var/list/tradeBlockade = list() //Things blocking cargo from leaving.
|
||||||
var/supplyBlocked = FALSE
|
var/supplyBlocked = FALSE
|
||||||
|
var/emergency_shuttle_stat_text
|
||||||
|
|
||||||
//supply shuttle stuff
|
//supply shuttle stuff
|
||||||
var/obj/docking_port/mobile/supply/supply
|
var/obj/docking_port/mobile/supply/supply
|
||||||
@@ -118,6 +119,9 @@ SUBSYSTEM_DEF(shuttle)
|
|||||||
points += point_gain
|
points += point_gain
|
||||||
//Cargo stuff end
|
//Cargo stuff end
|
||||||
|
|
||||||
|
var/esETA = emergency?.getModeStr()
|
||||||
|
emergency_shuttle_stat_text = "[esETA? "[esETA] [emergency.getTimerStr()]" : ""]"
|
||||||
|
|
||||||
if(!SSmapping.clearing_reserved_turfs)
|
if(!SSmapping.clearing_reserved_turfs)
|
||||||
while(transit_requesters.len)
|
while(transit_requesters.len)
|
||||||
var/requester = popleft(transit_requesters)
|
var/requester = popleft(transit_requesters)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
SUBSYSTEM_DEF(time_track)
|
SUBSYSTEM_DEF(time_track)
|
||||||
name = "Time Tracking"
|
name = "Time Tracking"
|
||||||
wait = 600
|
wait = 1 SECONDS
|
||||||
flags = SS_NO_INIT|SS_NO_TICK_CHECK
|
flags = SS_NO_INIT|SS_NO_TICK_CHECK
|
||||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||||
|
|
||||||
@@ -16,23 +16,33 @@ SUBSYSTEM_DEF(time_track)
|
|||||||
var/last_tick_byond_time = 0
|
var/last_tick_byond_time = 0
|
||||||
var/last_tick_tickcount = 0
|
var/last_tick_tickcount = 0
|
||||||
|
|
||||||
|
var/last_measurement = 0
|
||||||
|
var/measurement_delay = 60
|
||||||
|
|
||||||
|
var/stat_time_text
|
||||||
|
var/time_dilation_text
|
||||||
|
|
||||||
/datum/controller/subsystem/time_track/fire()
|
/datum/controller/subsystem/time_track/fire()
|
||||||
|
stat_time_text = "TIME: Server [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")] Round [WORLDTIME2TEXT("hh:mm:ss")] Station [STATION_TIME_TIMESTAMP("hh:mm:ss")]\n[time_dilation_text]"
|
||||||
|
|
||||||
var/current_realtime = REALTIMEOFDAY
|
if(++last_measurement == measurement_delay)
|
||||||
var/current_byondtime = world.time
|
last_measurement = 0
|
||||||
var/current_tickcount = world.time/world.tick_lag
|
var/current_realtime = REALTIMEOFDAY
|
||||||
|
var/current_byondtime = world.time
|
||||||
|
var/current_tickcount = world.time/world.tick_lag
|
||||||
|
|
||||||
if (!first_run)
|
if (!first_run)
|
||||||
var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag))
|
var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag))
|
||||||
|
|
||||||
time_dilation_current = tick_drift / (current_tickcount - last_tick_tickcount) * 100
|
time_dilation_current = tick_drift / (current_tickcount - last_tick_tickcount) * 100
|
||||||
|
|
||||||
time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current)
|
time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current)
|
||||||
time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast)
|
time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast)
|
||||||
time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg)
|
time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg)
|
||||||
else
|
else
|
||||||
first_run = FALSE
|
first_run = FALSE
|
||||||
last_tick_realtime = current_realtime
|
last_tick_realtime = current_realtime
|
||||||
last_tick_byond_time = current_byondtime
|
last_tick_byond_time = current_byondtime
|
||||||
last_tick_tickcount = current_tickcount
|
last_tick_tickcount = current_tickcount
|
||||||
SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[SQLtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]")))
|
SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[SQLtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]")))
|
||||||
|
time_dilation_text = "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dalilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)"
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
/client/verb/display_ping(time as num)
|
/client/verb/display_ping(time as num)
|
||||||
set instant = TRUE
|
set instant = TRUE
|
||||||
set name = ".display_ping"
|
set name = ".display_ping"
|
||||||
to_chat(src, "<span class='notice'>Round trip ping took [round(pingfromtime(time),1)]ms</span>")
|
to_chat(src, "<span class='notice'>Round trip ping took [round(pingfromtime(time),1)]ms (Avg: [round(avgping, 1)]ms])</span>")
|
||||||
|
|
||||||
/client/verb/ping()
|
/client/verb/ping()
|
||||||
set name = "Ping"
|
set name = "Ping"
|
||||||
set category = "OOC"
|
set category = "OOC"
|
||||||
winset(src, null, "command=.display_ping+[world.time+world.tick_lag*TICK_USAGE_REAL/100]")
|
winset(src, null, "command=.display_ping+[world.time+world.tick_lag*TICK_USAGE_REAL/100]")
|
||||||
|
|||||||
@@ -15,4 +15,4 @@
|
|||||||
movement_dir &= ~(NORTH|SOUTH)
|
movement_dir &= ~(NORTH|SOUTH)
|
||||||
if((movement_dir & EAST) && (movement_dir & WEST))
|
if((movement_dir & EAST) && (movement_dir & WEST))
|
||||||
movement_dir &= ~(EAST|WEST)
|
movement_dir &= ~(EAST|WEST)
|
||||||
user.Move(get_step(src, movement_dir), movement_dir)
|
user.Move(get_step(src, movement_dir), movement_dir)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
set hidden = TRUE
|
set hidden = TRUE
|
||||||
|
|
||||||
client_keysend_amount += 1
|
client_keysend_amount += 1
|
||||||
|
|
||||||
var/cache = client_keysend_amount
|
var/cache = client_keysend_amount
|
||||||
|
|
||||||
if(keysend_tripped && next_keysend_trip_reset <= world.time)
|
if(keysend_tripped && next_keysend_trip_reset <= world.time)
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
//don't want to kick people if a lag spike results in a huge flood of commands being sent
|
//don't want to kick people if a lag spike results in a huge flood of commands being sent
|
||||||
if(cache >= MAX_KEYPRESS_AUTOKICK)
|
if(cache >= MAX_KEYPRESS_AUTOKICK)
|
||||||
if(!keysend_tripped)
|
if(!keysend_tripped)
|
||||||
keysend_tripped = TRUE
|
keysend_tripped = TRUE
|
||||||
next_keysend_trip_reset = world.time + (2 SECONDS)
|
next_keysend_trip_reset = world.time + (2 SECONDS)
|
||||||
else
|
else
|
||||||
log_admin("Client [ckey] was just autokicked for flooding keysends; likely abuse but potentially lagspike.")
|
log_admin("Client [ckey] was just autokicked for flooding keysends; likely abuse but potentially lagspike.")
|
||||||
@@ -35,11 +35,7 @@
|
|||||||
message_admins("Client [ckey] just attempted to send an invalid keypress. Keymessage was over [MAX_KEYPRESS_COMMANDLENGTH] characters, autokicking due to likely abuse.")
|
message_admins("Client [ckey] just attempted to send an invalid keypress. Keymessage was over [MAX_KEYPRESS_COMMANDLENGTH] characters, autokicking due to likely abuse.")
|
||||||
QDEL_IN(src, 1)
|
QDEL_IN(src, 1)
|
||||||
return
|
return
|
||||||
//offset by 1 because the buffer address is 0 indexed because the math was simpler
|
keys_held[_key] = TRUE
|
||||||
keys_held[current_key_address + 1] = _key
|
|
||||||
//the time a key was pressed isn't actually used anywhere (as of 2019-9-10) but this allows easier access usage/checking
|
|
||||||
keys_held[_key] = world.time
|
|
||||||
current_key_address = ((current_key_address + 1) % HELD_KEY_BUFFER_LENGTH)
|
|
||||||
var/movement = SSinput.movement_keys[_key]
|
var/movement = SSinput.movement_keys[_key]
|
||||||
if(!(next_move_dir_sub & movement) && !keys_held["Ctrl"])
|
if(!(next_move_dir_sub & movement) && !keys_held["Ctrl"])
|
||||||
next_move_dir_add |= movement
|
next_move_dir_add |= movement
|
||||||
@@ -70,11 +66,7 @@
|
|||||||
set instant = TRUE
|
set instant = TRUE
|
||||||
set hidden = TRUE
|
set hidden = TRUE
|
||||||
|
|
||||||
//Can't just do a remove because it would alter the length of the rolling buffer, instead search for the key then null it out if it exists
|
keys_held -= _key
|
||||||
for(var/i in 1 to HELD_KEY_BUFFER_LENGTH)
|
|
||||||
if(keys_held[i] == _key)
|
|
||||||
keys_held[i] = null
|
|
||||||
break
|
|
||||||
var/movement = SSinput.movement_keys[_key]
|
var/movement = SSinput.movement_keys[_key]
|
||||||
if(!(next_move_dir_add & movement))
|
if(!(next_move_dir_add & movement))
|
||||||
next_move_dir_sub |= movement
|
next_move_dir_sub |= movement
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/client
|
/client
|
||||||
/// A rolling buffer of any keys held currently
|
/// Keys currently held
|
||||||
var/list/keys_held = list()
|
var/list/keys_held = list()
|
||||||
///used to keep track of the current rolling buffer position
|
|
||||||
var/current_key_address = 0
|
|
||||||
/// These next two vars are to apply movement for keypresses and releases made while move delayed.
|
/// These next two vars are to apply movement for keypresses and releases made while move delayed.
|
||||||
/// Because discarding that input makes the game less responsive.
|
/// Because discarding that input makes the game less responsive.
|
||||||
/// On next move, add this dir to the move that would otherwise be done
|
/// On next move, add this dir to the move that would otherwise be done
|
||||||
|
|||||||
@@ -565,29 +565,23 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
|
|||||||
M.show_inv(user)
|
M.show_inv(user)
|
||||||
|
|
||||||
/mob/proc/is_muzzled()
|
/mob/proc/is_muzzled()
|
||||||
return 0
|
return FALSE
|
||||||
|
|
||||||
/mob/Stat()
|
/mob/Stat()
|
||||||
..()
|
..()
|
||||||
|
|
||||||
if(statpanel("Status"))
|
//This is only called from client/Stat(), let's assume client exists.
|
||||||
if (client)
|
|
||||||
stat(null, "Ping: [round(client.lastping, 1)]ms (Average: [round(client.avgping, 1)]ms)")
|
|
||||||
stat(null, "Map: [SSmapping.config?.map_name || "Loading..."]")
|
|
||||||
var/datum/map_config/cached = SSmapping.next_map_config
|
|
||||||
if(cached)
|
|
||||||
stat(null, "Next Map: [cached.map_name]")
|
|
||||||
stat(null, "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]")
|
|
||||||
stat(null, "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]")
|
|
||||||
stat(null, "Round Time: [WORLDTIME2TEXT("hh:mm:ss")]")
|
|
||||||
stat(null, "Station Time: [STATION_TIME_TIMESTAMP("hh:mm:ss")]")
|
|
||||||
stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
|
|
||||||
if(SSshuttle.emergency)
|
|
||||||
var/ETA = SSshuttle.emergency.getModeStr()
|
|
||||||
if(ETA)
|
|
||||||
stat(null, "[ETA] [SSshuttle.emergency.getTimerStr()]")
|
|
||||||
|
|
||||||
if(client && client.holder)
|
if(statpanel("Status"))
|
||||||
|
var/list/L = list()
|
||||||
|
L += "Ping: [round(client.lastping,1)]ms (Avg: [round(client.avgping,1)]ms)"
|
||||||
|
L += SSmapping.stat_map_name
|
||||||
|
L += "Round ID: [GLOB.round_id || "NULL"]")
|
||||||
|
L += SStime_track.stat_time_text
|
||||||
|
L += SSshuttle.emergency_shuttle_stat_text
|
||||||
|
stat(null, "[L.Join("\n")]")
|
||||||
|
|
||||||
|
if(client.holder)
|
||||||
if(statpanel("MC"))
|
if(statpanel("MC"))
|
||||||
var/turf/T = get_turf(client.eye)
|
var/turf/T = get_turf(client.eye)
|
||||||
stat("Location:", COORD(T))
|
stat("Location:", COORD(T))
|
||||||
@@ -637,8 +631,6 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
|
|||||||
if(A.IsObscured())
|
if(A.IsObscured())
|
||||||
continue
|
continue
|
||||||
statpanel(listed_turf.name, null, A)
|
statpanel(listed_turf.name, null, A)
|
||||||
|
|
||||||
|
|
||||||
if(mind)
|
if(mind)
|
||||||
add_spells_to_statpanel(mind.spell_list)
|
add_spells_to_statpanel(mind.spell_list)
|
||||||
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
|
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
|
||||||
|
|||||||
@@ -34,20 +34,19 @@
|
|||||||
#define MOVEMENT_DELAY_BUFFER 0.75
|
#define MOVEMENT_DELAY_BUFFER 0.75
|
||||||
#define MOVEMENT_DELAY_BUFFER_DELTA 1.25
|
#define MOVEMENT_DELAY_BUFFER_DELTA 1.25
|
||||||
|
|
||||||
/client/Move(n, direct)
|
/client/Move(n, direction)
|
||||||
if(world.time < move_delay) //do not move anything ahead of this check please
|
if(world.time < move_delay) //do not move anything ahead of this check please
|
||||||
return FALSE
|
return FALSE
|
||||||
else
|
else
|
||||||
next_move_dir_add = 0
|
next_move_dir_add = next_move_dir_sub = NONE
|
||||||
next_move_dir_sub = 0
|
|
||||||
var/old_move_delay = move_delay
|
var/old_move_delay = move_delay
|
||||||
move_delay = world.time + world.tick_lag //this is here because Move() can now be called mutiple times per tick
|
move_delay = world.time + world.tick_lag //this is here because Move() can now be called mutiple times per tick
|
||||||
if(!mob || !mob.loc)
|
if(!n || !direction || !mob?.loc)
|
||||||
return FALSE
|
|
||||||
if(!n || !direct)
|
|
||||||
return FALSE
|
return FALSE
|
||||||
|
//GET RID OF THIS SOON AS MOBILITY FLAGS IS DONE
|
||||||
if(mob.notransform)
|
if(mob.notransform)
|
||||||
return FALSE //This is sota the goto stop mobs from moving var
|
return FALSE
|
||||||
|
|
||||||
if(mob.control_object)
|
if(mob.control_object)
|
||||||
return Move_object(direct)
|
return Move_object(direct)
|
||||||
if(!isliving(mob))
|
if(!isliving(mob))
|
||||||
|
|||||||
Reference in New Issue
Block a user