Skip to content

Chat Box allows sending of chat messages with negative range #623

Description

@dogboy21

Describe

When using the sendMessage (and similar) functions of the Chat Box, a range can be set with a parameter. During the creation of tests for #562 I noticed two issues with this:

  • When a chatBoxMaxRange is set in the config, one can simply pass -1 as a range to thesendMessage function and thus bypass the max range set in the config
  • When chatBoxMaxRange is set to -1 (default), passing a negative integer smaller than -1 as a range to thesendMessage function results in no message sent

Steps to reproduce

  1. Place a Computer and a Chat Box side by side
  2. In the Lua console of the computer, execute the following script peripheral.find("chatBox").sendMessage("Message with short range", "GameTest", "<>", "&a", -1) (or peripheral.find("chatBox").sendMessage("Message with short range", "GameTest", "<>", "&a", -2))

Multiplayer?

No

Version

Own compiled build.

Minecraft, Forge and maybe other related mods versions

Forge 43.3.13 Minecraft 1.19.2

Screenshots or Videos

No response

Crashlog/log

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions