Zemanzo / web-marbles

Aims to recreate Marble Racing from the ground up, as a fully web based game
https://playmarbl.es/
GNU General Public License v3.0
23 stars 12 forks source link

Chat commands falsely trigger for partial matches #293

Open Qaomen opened 3 years ago

Qaomen commented 3 years ago

Expected behavior The chat commands (e.g. !marble) only works when a user's message matches the command exactly. When additional attributes are added in the message, they are separated with whitespace from each other and the command itself.

Actual behavior As long as the start of the message matches the command (e.g. !marblemarbleandevenmoremarble), the command is triggered.

Reproduction steps

  1. Go to the client page
  2. Type any valid chat command
  3. Add any text to the command without adding whitespace
  4. The command is triggered despite not fully matching

Additional context It's not a feature-breaking bug at the moment, although it does muddy up attribute checks for marbles and might cause conflicts with similarly named commands in the future.