Opened 6 years ago

Closed 5 years ago

#4877 closed defect (fixed)

Incorrect "is not a moderator anymore" message, XmppClient GUI Message should allow more than 2 properties

Reported by: elexis Owned by: elexis
Priority: Must Have Milestone: Alpha 24
Component: Multiplayer lobby Keywords:
Cc: Patch: Phab:D2264,Phab:D2266

Description

As reported today by user1, if someone is unmuted while one is ingame and then returns from a running game to the lobby (or something along those lines), the %(nick)s is not a moderator anymore. string can be seen in the lobby (which is wrong).

Issue described in Phab:rP19514 too.

The reason must be that the XmppClient compares the old user role against the the current user role, not against the new user role at that time of the presence change.

That could be solved easily by adding a third property to the CreateGUIMessage call.

That however runs into the issue that the timestamp is the last argument and currently ommitted. So adding a third argument would make the code uglier.

In #4482 it was attempted to create a custom ScriptInterface for the XmppClient and instead of using a CreateGUIMessage, construct an actual JS::RootedObject where we can set propertis arbitrarily. That just segfaulted, but would be the ideal approach.

Attachments (1)

xmpp struct nuke_v3 (24.9 KB ) - added by elexis 6 years ago.
last WIP that never worked

Download all attachments as: .zip

Change History (10)

by elexis, 6 years ago

Attachment: xmpp struct nuke_v3 added

last WIP that never worked

comment:2 by elexis, 6 years ago

Priority: Nice to HaveMust Have

As reported by user1, from the a23 lobby after Wendy was muted:

(09:15:31 AM) nani: wendy was mod ?
(09:15:32 AM) nani: lol
(09:17:07 AM) TYLER1: u sure wendy was mod?

comment:3 by elexis, 5 years ago

Milestone: BacklogAlpha 24
Patch: Phab:D2264

Phab:D2264 is for arbitrary JSObject support, which will make it very easy to solve the issue, in particular without making things (the struct and functions using it) worse.

It seems the fallacy was to think that it requires a new ScriptInterface, when we can reuse the one from the GUIManager. It would be needed, but only if we want to support non-visual XMPPClients, which will be necessary for the dedicated hosting. So this can be done in a separate step, as the first step will be the same with and without the custom ScriptInterface.

comment:4 by elexis, 5 years ago

In 22855:

Drop lobby presence GUI messages altogether for better performance and less code complexity.

They were only used to determine whether the playerlist should be rebuilt, which can be achieved by a boolean member.
So this patch is removing unnecessary indirection from the original solution in rP16997 and the reduction in rP20040, refs #3386.
In particular the LobbyClearPresenceUpdates call was ugly and one doesnt need hundreds of messages with data on it each if one only wants to know if there was one.
Makes past (rP20070) and future (D2264) patches less complex, refs #4877.

Differential Revision: https://code.wildfiregames.com/D2265
Tested on: gcc 9.1.0, clang 8.0.1, Jenkins

comment:5 by elexis, 5 years ago

In 22856:

Support creating lobby GUI messages with arbitrary arguments instead of forcing every message type into the same struct type, refs #4877 / rP19514 / D339.

Creates the GUI messages directly as JS::Values and removes the intermediary rigid struct.
Implementation similar to ScriptInterface::CreateObject from D2080.

Differential Revision: https://code.wildfiregames.com/D2264
Tested on: clang 8.0.1, Jenkins

comment:6 by elexis, 5 years ago

Patch: Phab:D2264Phab:D2264,Phab:D2266

comment:7 by elexis, 5 years ago

Reproduce:

  1. join lobby with player and mod account
  2. player is muted
  3. player hosts a game
  4. player becomes unmuted during the game
  5. player returns to the lobby

result:

  1. You are not a moderator anymore.
  2. You have been unmuted.

expected result:

  1. You have been muted.
  2. You have been unmuted.

Step 2 and 3 are interchangeable.

comment:8 by elexis, 5 years ago

#4482 also reports that the GUI message data format was insufficient / too rigid struct.

comment:9 by elexis, 5 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 22859:

Fix wrong "player is not a moderator anymore" lobby chat message following initial implementation in rP19514/D339, fixes #4877.

It needs to test against the historic role and not the current role, similar to rP16997, refs #3386.
Implements the third GUI message property using the arbitrary lobby GUI message patch in rP22856/D2264, refs #4482, rP22855/D2265.

Differential Revision: https://code.wildfiregames.com/D2266
Tested on: clang 8.0.1

Note: See TracTickets for help on using tickets.