mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-27 21:48:25 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
40
Brutal.RakNet/Manual/APIPartials/AddressOrGuid.cs
Normal file
40
Brutal.RakNet/Manual/APIPartials/AddressOrGuid.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
namespace Brutal.RakNetApi;
|
||||
|
||||
public partial struct AddressOrGUID
|
||||
{
|
||||
public static AddressOrGUID UnassignedGuid => new(RakNetGUID.UNASSIGNED_RAKNET_GUID);
|
||||
|
||||
public static AddressOrGUID From(RakNetGUID guid) => new(guid);
|
||||
|
||||
public static AddressOrGUID From(SystemAddress address) => new(address);
|
||||
|
||||
public AddressOrGUID(RakNetGUID guid)
|
||||
{
|
||||
RakNetGuid = guid;
|
||||
SystemAddress = SystemAddress.UNASSIGNED_SYSTEM_ADDRESS;
|
||||
}
|
||||
|
||||
public AddressOrGUID(SystemAddress systemAddress)
|
||||
{
|
||||
SystemAddress = systemAddress;
|
||||
RakNetGuid = RakNetGUID.UNASSIGNED_RAKNET_GUID;
|
||||
}
|
||||
|
||||
public string ToString(bool appendPort = false, char delimiter = ':')
|
||||
{
|
||||
return RakNetGuid != RakNetGUID.UNASSIGNED_RAKNET_GUID
|
||||
? RakNetGuid.ToString()
|
||||
: SystemAddress.ToString(appendPort, delimiter);
|
||||
}
|
||||
}
|
||||
|
||||
/*public readonly unsafe partial struct RakPeerInstance : IDisposable
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
if (impl != 0)
|
||||
{
|
||||
RakNetLibrary.DestroyInstance(this);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
Loading…
Reference in a new issue