Data storage problem on unity client side

problem 1
basically the issue is that when i join the gameplay again from lobby(main menu) list of players is not reset .

public List Players { get; private set; }
Players = new List();

In Players we have previous stored data either we cleared it or not , on Game scene from
GamePlay —> lobby —> GamePlay

Problem 2

we have two players p1 and p2
ofcourse p1 send first req of matchmatking then p2

but match join req send first by p2 then p1

its effects the list of connected opponents or match join presence, we use that list for assigned their positin on gameplay , we make a game of 4-5 players in a room
and turn should be shift clockwise

Please keep forum post scope narrow next time, one issue per post ideally. If you have more than one problem create one post for each.

Problem 1: I’m not sure what this list of players is, I assume it’s something you’ve created. If it’s your own data structure then you are responsible for its use - including clearing it when the player leaves the match and joins another one.

Problem 2: If I understand correctly you’re talking about the order of connected opponents in the list of presences. This is not guaranteed and if you rely on a particular order you should guarantee it yourself. For example you can sort the list by user ID so each client sees the same order, or you can send data messages between match participants to agree the order.