Page MenuHomeWildfire Games

Muting player messages (spectator messages) (ingame)
Needs RevisionPublic

Authored by ffffffff on Nov 23 2017, 2:13 AM.

Details

Reviewers
elexis
Trac Tickets
#4750
Summary

New commands /mute /unmute /mutespecs/unmutespecs

Locally un/muting ingame player or spectators.

Often its very annoying having specators speaking in public chat in game and not keeping into observer chat. (especially in 1v1 f.e.). So quick local muting command for a player or spectators as whole is very helpful (maybe this must/can be saved also in user config for remembered option).

Maybe must be spread also to lobby and gamesetup chat and btw maybe it must also be unify "g_ChatCommands" from lobby.js and "g_NetworkCommands" from network.js to one global chatcommands string with help description. maybe therefore migrate the "big" g_ChatCommands from lobby.js to "g_NetworkCommands" from network.js.

maybe this needs also a hotkey (not sure which :().

please discuss

Test Plan

discuss

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

ffffffff created this revision.Nov 23 2017, 2:13 AM
ffffffff edited the summary of this revision. (Show Details)Nov 23 2017, 2:15 AM
ffffffff edited the summary of this revision. (Show Details)

Agreed about the usefulness.

binaries/data/mods/public/gui/common/network.js
56

have

83–94

Could save a couple lines with

if (mute && index == -1)
{
  add message
  push
}
else if (!mute && index != -1)
{
  add message
  splice
}

Maybe in the first one also check that name != our name, so that we don't mute ourselves on accident?

Code looks surprisingly good:

  • Broadening the meaning of network.js to also encompass player assignment code seems ok. Might move some more player assignments code over there too later.
  • Saving the muted players in a separate global instead of g_PlayerAssignments is reasonable in order to persist the data and because the latter is replaced altogether by the NetClient data iirc and the GUIDs change on each rejoin.

Future Extension:

  • Each chat command should be available through buttons eventually, which can be done in #3787.
  • Players might want to see what the muted player talked when non-muted players responded to the muted player. So eventually a checkbox could be added to the chat history that toggles mutes in the chat history.

About the revision description:

  • Storing muted usernames (antibuddy) in the userconfig is reasonable, but should be done outside of this diff. It should likely be two separate commands then (temp mute, perma mute)
  • Unification of lobby chat commands and network.js chat commands seems implausible, because the prior ones are commands for the xmpp chat and the latter for the gamesetup/session chat that do completely different things.
  • Hotkey at most to unmute everyone because muting needs the player argument, so meh
binaries/data/mods/public/gui/common/network.js
56

Observers for global consitency (/mutespecs still ok for me as /muteobs sounds a bit weird)

83

Better move it above the big objects

binaries/data/mods/public/gui/session/messages.js
1087

The same change is missing in the gamesetup I suppose
unneeded parentheses https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence
1 tab 4 spaces

ffffffff updated this revision to Diff 4335.Nov 23 2017, 3:46 PM

/unmuteall

ffffffff updated this revision to Diff 4336.Nov 23 2017, 3:48 PM
elexis requested changes to this revision.Jan 14 2018, 4:18 PM

See #4750 comment:9

This revision now requires changes to proceed.Jan 14 2018, 4:18 PM