mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 08:03:43 +01:00
73e861b7c0
* dev team chat initial * oops * refactor who code * allow discord relay * yeet some un-needed stuff * tweak the role colour * Update code/__DEFINES/admin_defines.dm Co-authored-by: ROdenFL <ROdenFL@yandex.ru> Signed-off-by: Sean <12197162+S34NW@users.noreply.github.com> * .Add to += * Update config/example/config.toml Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: Sean <12197162+S34NW@users.noreply.github.com> --------- Signed-off-by: Sean <12197162+S34NW@users.noreply.github.com> Co-authored-by: ROdenFL <ROdenFL@yandex.ru> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
65 lines
1.7 KiB
Plaintext
65 lines
1.7 KiB
Plaintext
/**
|
|
* Delegates the speech to the proper channel.
|
|
*
|
|
* Arguments:
|
|
* entry - the text to broadcast
|
|
* channel - the channel to broadcast in
|
|
* Returns:
|
|
* boolean - on success or failure
|
|
*/
|
|
/datum/tgui_say/proc/delegate_speech(entry, channel)
|
|
switch(channel)
|
|
if(SAY_CHANNEL)
|
|
client.mob.say_verb(entry)
|
|
return TRUE
|
|
if(RADIO_CHANNEL)
|
|
client.mob.say_verb((isliving(client.mob) ? ";" : "") + entry)
|
|
return TRUE
|
|
if(WHISPER_CHANNEL)
|
|
client.mob.whisper(entry)
|
|
return TRUE
|
|
if(ME_CHANNEL)
|
|
client.mob.me_verb(entry)
|
|
return TRUE
|
|
if(OOC_CHANNEL)
|
|
client.ooc(entry)
|
|
return TRUE
|
|
if(LOOC_CHANNEL)
|
|
client.looc(entry)
|
|
return TRUE
|
|
if(ADMIN_CHANNEL)
|
|
client.cmd_admin_say(entry)
|
|
return TRUE
|
|
if(MENTOR_CHANNEL)
|
|
client.cmd_mentor_say(entry)
|
|
return TRUE
|
|
if(DSAY_CHANNEL)
|
|
client.dsay(entry)
|
|
return TRUE
|
|
if(DEV_CHANNEL)
|
|
client.cmd_dev_say(entry)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/**
|
|
* Handles text entry and forced speech.
|
|
*
|
|
* Arguments:
|
|
* payload - a string list containing entry & channel
|
|
* Returns:
|
|
* boolean - success or failure
|
|
*/
|
|
/datum/tgui_say/proc/handle_entry(payload)
|
|
if(!payload?["channel"] || !payload["entry"])
|
|
var/hacker_man_ckey = usr.client.ckey
|
|
qdel(usr.client)
|
|
message_admins("[hacker_man_ckey] was kicked for attemping to send a null message to TGUI-say.")
|
|
CRASH("[hacker_man_ckey] entered in a null payload to the chat window.")
|
|
if(length_char(payload["entry"]) > MAX_MESSAGE_LEN)
|
|
var/hacker_man_ckey = usr.client.ckey
|
|
qdel(usr.client)
|
|
message_admins("[hacker_man_ckey] was kicked for attemping to bypass TGUI-say character limits.")
|
|
CRASH("[hacker_man_ckey] has entered more characters than allowed into a TGUI-Say.")
|
|
delegate_speech(payload["entry"], payload["channel"])
|
|
return TRUE
|