Photon Fusion
2.1.1
Represents a network connection map. More...
Classes | |
| struct | Iterator |
| Iterator for traversing the connections in a NetConnectionMap. More... | |
Public Types | |
| enum | EntryState |
| Represents the state of an entry in the NetConnectionMap. More... | |
Public Member Functions | |
| NetConnection * | Find (NetAddress address) |
| Finds a connection by its address in the network peer group. | |
| NetConnection * | Find (NetConnectionId id) |
| Finds a connection by its ID in the network peer group. | |
| NetConnection * | FindByIndex (int index) |
| Gets a connection by its index in the network peer group. | |
| NetConnection * | Insert (NetAddress address, byte[] uniqueId) |
| Inserts a new connection into the network peer group using the specified address and unique ID. | |
| NetConnection * | Remap (NetAddress oldAddress, NetAddress newAddress) |
| Remaps a connection from an old address to a new address. | |
| bool | Remove (NetAddress address) |
| Removes a connection from the network peer group by its address. | |
| bool | TryFindByIndex (int index, out NetConnection *connection) |
| Tries to get a connection by its index in the network peer group. | |
Static Public Member Functions | |
| static NetConnectionMap * | Allocate (int capacity, short groupIndex, in NetConfig *config) |
| Allocates and initializes a new NetConnectionMap with the specified capacity and group index. | |
| static void | Dispose (ref NetConnectionMap *map, INetPeerGroupCallbacks callbacks) |
| Disposes of the specified NetConnectionMap and its associated resources. | |
Properties | |
| readonly NetConnection * | ConnectionsBuffer [get] |
| Gets the buffer of connections. | |
| readonly int | Count [get] |
| Gets the count of used connections minus the free connections. | |
| readonly int | CountUsed [get] |
| Gets the count of used connections. | |
| readonly bool | Full [get] |
| Gets a value indicating whether the connection map is full. | |
Represents a network connection map.
| enum EntryState |
Represents the state of an entry in the NetConnectionMap.
| Enumerator | |
|---|---|
| None | The entry is not in use. |
| Free | The entry is free and available for use. |
| Used | The entry is currently in use. |
|
static |
Allocates and initializes a new NetConnectionMap with the specified capacity and group index.
| capacity | The number of connections the map can hold. |
| groupIndex | The group index associated with the connections. |
| config | The configuration settings for the network connections. |
|
static |
Disposes of the specified NetConnectionMap and its associated resources.
| map | A pointer to the NetConnectionMap to dispose. |
| callbacks | The callbacks to invoke during disposal. |
| NetConnection * Find | ( | NetAddress | address | ) |
Finds a connection by its address in the network peer group.
| address | The address of the connection to find. |
| NetConnection * Find | ( | NetConnectionId | id | ) |
Finds a connection by its ID in the network peer group.
| id | The ID of the connection to find. |
| NetConnection * FindByIndex | ( | int | index | ) |
Gets a connection by its index in the network peer group.
| index | The index of the connection to retrieve. |
| IndexOutOfRangeException | Thrown when the index is out of the usable capacity range. |
| NetConnection * Insert | ( | NetAddress | address, |
| byte[] | uniqueId ) |
Inserts a new connection into the network peer group using the specified address and unique ID.
| address | The address of the connection to insert. |
| uniqueId | The unique ID of the connection to insert. |
| NetConnection * Remap | ( | NetAddress | oldAddress, |
| NetAddress | newAddress ) |
Remaps a connection from an old address to a new address.
| oldAddress | The old address of the connection. |
| newAddress | The new address of the connection. |
| bool Remove | ( | NetAddress | address | ) |
Removes a connection from the network peer group by its address.
| address | The address of the connection to remove. |
| bool TryFindByIndex | ( | int | index, |
| out NetConnection * | connection ) |
Tries to get a connection by its index in the network peer group.
| index | The index of the connection to retrieve. |
| connection | Output parameter that will point to the connection if found. |