/// <summary> /// Constructs an instance for a non-default universe. /// </summary> /// <param name="domain">Unresolved domain name (i.e. auth.activeworlds.com).</param> /// <param name="port">Port number of the universe server.</param> /// <exception cref="InstanceCreationFailedException">Thrown when the instance failed to be created.</exception> public Instance(string domain, int port) { IntPtr tempInstance; int rc = NativeMethods.aw_create(domain, port, out tempInstance); SDKWrapperException<InstanceCreationFailedException>.Assert(rc); _instance = tempInstance; Attributes = new AttributeProvider(this); }
/// <summary> /// Constructs an instance for a non-default universe. /// </summary> /// <param name="address">IP address of the universe server represented as a 32-bit unsigned integer. The IP address is stored according to Network Byte Order.</param> /// <param name="port">Port number of the universe server.</param> /// <exception cref="InstanceCreationFailedException">Thrown when the instance failed to be created.</exception> public Instance(int address, int port) { IntPtr tempInstance; int rc = NativeMethods.aw_create_resolved(address, port, out tempInstance); SDKWrapperException<InstanceCreationFailedException>.Assert(rc); _instance = tempInstance; Attributes = new AttributeProvider(this); }