mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-26 01:52:29 +00:00
@@ -286,7 +286,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
dat += "<body>"
|
||||
|
||||
var/p_age = "unknown"
|
||||
for(var/client/C in clients)
|
||||
for(var/client/C in GLOB.clients)
|
||||
if(C.ckey == key)
|
||||
p_age = C.player_age
|
||||
break
|
||||
@@ -727,28 +727,28 @@ proc/admin_notice(var/message, var/rights)
|
||||
//Split on pipe or \n
|
||||
decomposed = splittext(message,regex("\\||$","m"))
|
||||
decomposed += "0" //Tack on a final 0 sleep to make 3-per-message evenly
|
||||
|
||||
|
||||
//Time to find how they screwed up.
|
||||
//Wasn't the right length
|
||||
if((decomposed.len) % 3) //+1 to accomidate the lack of a wait time for the last message
|
||||
to_chat(usr,"<span class='warning'>You passed [decomposed.len] segments (senders+messages+pauses). You must pass a multiple of 3, minus 1 (no pause after the last message). That means a sender and message on every other line (starting on the first), separated by a pipe character (|), and a number every other line that is a pause in seconds.</span>")
|
||||
return
|
||||
|
||||
|
||||
//Too long a conversation
|
||||
if((decomposed.len / 3) > 20)
|
||||
to_chat(usr,"<span class='warning'>This conversation is too long! 20 messages maximum, please.</span>")
|
||||
return
|
||||
|
||||
|
||||
//Missed some sleeps, or sanitized to nothing.
|
||||
for(var/i = 1; i < decomposed.len; i++)
|
||||
|
||||
|
||||
//Sanitize sender
|
||||
var/clean_sender = sanitize(decomposed[i])
|
||||
if(!clean_sender)
|
||||
to_chat(usr,"<span class='warning'>One part of your conversation was not able to be sanitized. It was the sender of the [(i+2)/3]\th message.</span>")
|
||||
return
|
||||
decomposed[i] = clean_sender
|
||||
|
||||
|
||||
//Sanitize message
|
||||
var/clean_message = sanitize(decomposed[++i])
|
||||
if(!clean_message)
|
||||
|
||||
Reference in New Issue
Block a user