party service: check joins are for the current party
The server can resume party membership on handshake to parties other than the current client party (eg. if the client is restarted or for any other reason the current party changes). This desyncs otherwise if the joins aren't checked to be in the current party.
This commit is contained in:
@@ -34,5 +34,6 @@ import net.runelite.http.api.ws.WebsocketMessage;
|
||||
public class UserJoin extends WebsocketMessage
|
||||
{
|
||||
private final UUID memberId;
|
||||
private final UUID partyId;
|
||||
private final String name;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,13 @@ public class PartyService
|
||||
@Subscribe
|
||||
public void onUserJoin(final UserJoin message)
|
||||
{
|
||||
if (!partyId.equals(message.getPartyId()))
|
||||
{
|
||||
// This can happen when a session is resumed server side after the client party
|
||||
// changes when disconnected.
|
||||
return;
|
||||
}
|
||||
|
||||
final PartyMember partyMember = new PartyMember(message.getMemberId(), message.getName());
|
||||
members.add(partyMember);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user