mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-17 11:27:05 +01:00
68 lines
2.4 KiB
Plaintext
68 lines
2.4 KiB
Plaintext
/client/proc/security_note(message, tell_user)
|
|
log_access("client security: noting [key_name(src)] | [message]")
|
|
message_admins("client security: noting [key_name(src)] for [message]")
|
|
add_system_note("client-security", message)
|
|
if(tell_user)
|
|
to_chat(src, SPAN_BOLDANNOUNCE("CLIENT-SECURITY: [message]<br>Please correct this."))
|
|
|
|
/client/proc/security_kick(message, tell_user, immediate)
|
|
log_access("client security: kicking [key_name(src)] | [message]")
|
|
message_admins("client security: kicking [key_name(src)] | [message]")
|
|
if(tell_user)
|
|
to_chat(src, SPAN_BOLDANNOUNCE("CLIENT-SECURITY: [message]<br>Please correct this.<br>You will now be disconnected."))
|
|
disconnection_message(message)
|
|
if(!immediate)
|
|
queue_security_kick(5 SECONDS)
|
|
queue_security_kick()
|
|
|
|
/**
|
|
* time is in minutes
|
|
* tell_user is implicit
|
|
*/
|
|
/client/proc/security_ban(message, time = -1)
|
|
var/time_displayed = time == -1? "(forever)" : "for [DisplayTimeText(time MINUTES)]"
|
|
log_access("client security: banning [key_name(src)] [time == -1? "" : "for [time_displayed]"] | [message]")
|
|
message_admins("client security: banning [key_name(src)] [time == -1? "" : "for [time_displayed]"] | [message]")
|
|
add_system_note("client-security", "banned for [time_displayed]: [message]")
|
|
SSbans.t_place_system_ban(
|
|
time == -1 ? BANTYPE_PERMA : BANTYPE_TEMP,
|
|
null,
|
|
time,
|
|
"client-security: [message]",
|
|
banckey = ckey,
|
|
banip = address,
|
|
bancid = computer_id,
|
|
)
|
|
disconnection_message("Client Security - Autoban: [message]")
|
|
qdel(src)
|
|
|
|
/**
|
|
* queues a security kick
|
|
* ensures the client's around for atleast delay or after current proc chain is over
|
|
*/
|
|
/client/proc/queue_security_kick(delay = 0)
|
|
var/left = isnull(queued_security_kick)? null : timeleft(queued_security_kick)
|
|
if(isnull(left) || left < delay)
|
|
deltimer(queued_security_kick)
|
|
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), src), delay, TIMER_STOPPABLE)
|
|
|
|
/**
|
|
* shows a disconnection message that's hopefully resistant to fast-disconnects
|
|
*/
|
|
/client/proc/disconnection_message(msg)
|
|
var/content = {"
|
|
<html>
|
|
<head>
|
|
<title>Disconnection</title>
|
|
</head>
|
|
<body>
|
|
You have been intentionally disconnected by the server.<br><br>
|
|
<center><b>[msg]</b></center>
|
|
<br><hr>
|
|
If you feel this is in error, contact an administrator out of game (e.g. on Discord).
|
|
</body>
|
|
</html>
|
|
"}
|
|
src << browse(content, "window=droppedFromServer;size=480x360;can_close=1")
|
|
window_flash(src)
|