-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
You should AFK yourself... NOW -- Ports soft-ping fixes from TG, AKF …
…players kicked from lobby, SSD indicators (#2049) * tgui-panel: Soft ping (#66299) * tgui-panel: Soft ping * ports sex code * why are you like this linters * GOD DAMMIT SKYRAT, STOP MAKING ME BEND OVER * brings up up-to-date with ERP code * le fix * missed this one Skyrat-SS13/Skyrat-tg#1678 --------- Co-authored-by: Aleksej Komarov <[email protected]> Co-authored-by: Kirie Saito <[email protected]>
- Loading branch information
1 parent
5c09317
commit 95742ef
Showing
19 changed files
with
188 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
GLOBAL_VAR_INIT(ssd_indicator_overlay, mutable_appearance('ModularTegustation/ssd_indicator/icons/ssd_indicator.dmi', "default0", FLY_LAYER)) | ||
|
||
/mob/living | ||
var/ssd_indicator = FALSE | ||
var/lastclienttime = 0 | ||
|
||
/mob/living/proc/set_ssd_indicator(state) | ||
if(state == ssd_indicator) | ||
return | ||
ssd_indicator = state | ||
if(ssd_indicator) | ||
add_overlay(GLOB.ssd_indicator_overlay) | ||
log_message("<font color='green'>has went SSD and got their indicator!</font>", INDIVIDUAL_ATTACK_LOG) | ||
else | ||
cut_overlay(GLOB.ssd_indicator_overlay) | ||
log_message("<font color='green'>is no longer SSD and lost their indicator!</font>", INDIVIDUAL_ATTACK_LOG) | ||
|
||
/mob/living/Login() | ||
. = ..() | ||
set_ssd_indicator(FALSE) | ||
|
||
/mob/living/Logout() | ||
lastclienttime = world.time | ||
set_ssd_indicator(TRUE) | ||
. = ..() | ||
|
||
/mob/living/ghostize(can_reenter_corpse = TRUE) | ||
. = ..() | ||
set_ssd_indicator(FALSE) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Title: SSD indicator | ||
|
||
MODULE ID: SSD_INDICATOR | ||
|
||
### Description: | ||
|
||
Shows a green "ZZZ" on people that are SSD, records when they went SSD and shows that as time on examine. Also uses that variable for cryosleep threshold | ||
|
||
### TG Proc Changes: | ||
|
||
./code/modules/mob/living/carbon/human/examine.dm > /mob/living/carbon/human/examine() | ||
./code/modules/mob/living/death.dm > /mob/living/proc/death(gibbed) | ||
|
||
### Defines: | ||
|
||
- N/A | ||
|
||
### Master file additions | ||
|
||
- N/A | ||
|
||
### Included files that are not contained in this module: | ||
|
||
- N/A | ||
|
||
### Credits: | ||
Azarak - original code & porting | ||
Gboster - Porting it into LC13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*! | ||
* Copyright (c) 2022 Aleksej Komarov | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
SUBSYSTEM_DEF(ping) | ||
name = "Ping" | ||
priority = FIRE_PRIORITY_PING | ||
wait = 4 SECONDS | ||
flags = SS_NO_INIT | ||
runlevels = RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME | ||
|
||
var/list/currentrun = list() | ||
|
||
/datum/controller/subsystem/ping/stat_entry() | ||
..("P:[GLOB.clients.len]") | ||
|
||
/datum/controller/subsystem/ping/fire(resumed = FALSE) | ||
// Prepare the new batch of clients | ||
if (!resumed) | ||
src.currentrun = GLOB.clients.Copy() | ||
|
||
// De-reference the list for sanic speeds | ||
var/list/currentrun = src.currentrun | ||
|
||
while (currentrun.len) | ||
var/client/client = currentrun[currentrun.len] | ||
currentrun.len-- | ||
|
||
if (client?.tgui_panel?.is_ready()) | ||
// Send a soft ping | ||
client.tgui_panel.window.send_message("ping/soft", list( | ||
// Slightly less than the subsystem timer (somewhat arbitrary) | ||
// to prevent incoming pings from resetting the afk state | ||
"afk" = client.is_afk(3.5 SECONDS), | ||
)) | ||
|
||
if (MC_TICK_CHECK) | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
* @license MIT | ||
*/ | ||
|
||
export const CONNECTION_LOST_AFTER = 15000; | ||
export const CONNECTION_LOST_AFTER = 20000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.