mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-25 20:35:10 -06:00
OOPS! packet limit crash fixed
This commit is contained in:
parent
4a99da4fca
commit
1aec252579
1 changed files with 6 additions and 3 deletions
|
|
@ -38,13 +38,16 @@ class GlobalChat : Commands {
|
|||
"%u" to "<u>",
|
||||
"%<gt><gt>" to "<img=2>"
|
||||
)
|
||||
private val COMMON_SHORTCUT_PATTERN = Regex(
|
||||
"%ironman|%chat|%hcim|%uim|%/trans|%trans(?![=])|%/shad|%shad(?![=])|%/str|%str(?![=])|%/u|%u(?![=])|%<gt><gt>"
|
||||
)
|
||||
private val COMMON_SHORTCUT_PATTERN = Regex("%ironman|%chat|%hcim|%uim|%/trans|%trans(?![=])|%/shad|%shad(?![=])|%/str|%str(?![=])|%/u|%u(?![=])|%<gt><gt>")
|
||||
private const val MAX_ENCODED_MESSAGE_LENGTH = 255
|
||||
|
||||
fun process(sender: String, message: String, chatIcon: Int) {
|
||||
val msgSD = prepare(sender, message, false, chatIcon)
|
||||
val msgHD = prepare(sender, message, true, chatIcon)
|
||||
if (msgSD.length > MAX_ENCODED_MESSAGE_LENGTH || msgHD.length > MAX_ENCODED_MESSAGE_LENGTH) {
|
||||
return
|
||||
}
|
||||
|
||||
for (player in Repository.players.filter { !getAttribute(it, ATTR_GLOBAL_MUTE, false) }) {
|
||||
if (player.interfaceManager.isResizable)
|
||||
sendMessage(player, msgHD)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue