| 123456789101112131415161718192021222324252627 |
- using System;
- using System.Net;
- namespace Base
- {
- internal struct UAddress
- {
- private readonly uint ip;
- private readonly ushort port;
- public UAddress(string host, int port)
- {
- IPAddress address = IPAddress.Parse(host);
- this.ip = BitConverter.ToUInt32(address.GetAddressBytes(), 0);
- this.port = (ushort) port;
- }
- public ENetAddress Struct
- {
- get
- {
- ENetAddress address = new ENetAddress { Host = this.ip, Port = this.port };
- return address;
- }
- }
- }
- }
|