NetworkGamer.Id Property

Gets a unique identifier that can be used to refer to this gamer in network packets.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Syntax

public byte Id { get; }

Property Value

A unique identifier that can be used to refer to this gamer in network packets.

Remarks

This value is synchronized across all the machines in the session, so it can be used in situations where gamer A wants to send a packet to B, and the contents of this packet must refer to gamer C. Using the identifier is preferable to sending the index of the gamer within the session, because indices could change if gamers join or leave in mid session, but this id will always remain constant. To look up a gamer once you know their id, use FindGamerById.

See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP