How to implement event part in unity (joining match and etc...)

hi i have question about this part in website documents.

in the connectedOpponents.Remove(self); what is self ? where should i get this to put in this part ? and i use this code after

await socket.CreateMatchAsync(matchName);

is it right ?

and one more question is this right

connectedOpponents.ForEach(x =>
{
Debug.Log(x.Username);
});

thanks

Hi @amirhoseinjfri,

in the connectedOpponents.Remove(self); what is self ? where should i get this to put in this part ?

In the example self is assumed to be a variable that references the player’s own IUserPresence. It can be accessed via the IMatch.Self property.

is it right ?

Ideally you should setup the socket event binding before you create/join the match. This ensures the event will be triggered when the presences are received.

and one more question is this right

That code will log each opponents username to the Unity debug console. If that is what you are trying to do then yes it is correct.