Skip to main content
Version: 3.6

struct PeerID

(Niantic.Lightship.SharedAR.Networking.PeerID)

Overview

Struct that represents the identifiers of other peers in the room. Can be compared with other PeerIDs and used as Keys in Dictionaries.

	struct PeerID: IEquatable< PeerID > {
// fields

static readonly PeerID InvalidID = new(0);

// properties

Guid Identifier;

// methods

PeerID(uint id);
uint ToUint32();
bool Equals(PeerID other);
override int GetHashCode();
override string ToString();
override bool Equals(object obj);
static bool operator == (PeerID left, PeerID right);
static bool operator != (PeerID left, PeerID right);
};

Detailed Documentation

Struct that represents the identifiers of other peers in the room. Can be compared with other PeerIDs and used as Keys in Dictionaries.

Fields

InvalidID

static readonly PeerID InvalidID = new(0)

The Invalid peer ID returned by functions that have errored. This PeerID returns 0 from ToUint32.

Properties

Identifier

Guid Identifier

Guid representation of the PeerID.

Methods

PeerID

PeerID(uint id)

Constructor for the PeerID. PeerIDs should be received from the INetworking API, not manually constructed.

ToUint32

uint ToUint32()

UInt32 representation of the PeerID.

Equals

bool Equals(PeerID other)

Equality implementation for PeerID.

GetHashCode

override int GetHashCode()

Get unique hash for this PeerID. Necessary for Dictionary compatibility.

ToString

override string ToString()

String representation of the PeerID.