Struct Disconnection

Namespace
Unity.Multiplayer.Core

A disconnect reason plus an optional human-readable message and, for a refused connection, the typed approval reason the server sent.

public readonly struct Disconnection : IEquatable<Disconnection>
Implements
Inherited Members

Constructors

Disconnection(DisconnectReason, string)

Creates a disconnection record.

public Disconnection(DisconnectReason reason, string message)

Parameters

reason DisconnectReason
message string

Disconnection(DisconnectReason, string, ApprovalRejection)

Creates a disconnection record that carries the server's approval rejection.

public Disconnection(DisconnectReason reason, string message, ApprovalRejection rejection)

Parameters

reason DisconnectReason

Why it happened.

message string

Detail for the player or the log.

rejection ApprovalRejection

Why connection approval refused the client (with Rejected); None otherwise.

Fields

None

No disconnect.

public static readonly Disconnection None

Field Value

Disconnection

Properties

Message

Detail for the player or the log (for example the approval rejection text). Never null.

public string Message { get; }

Property Value

string

Reason

Why it happened.

public DisconnectReason Reason { get; }

Property Value

DisconnectReason

Rejection

When Reason is Rejected and the server said why in the MindAttic wire format: version, protocol, password, full, banned or bad payload. Otherwise None.

public ApprovalRejection Rejection { get; }

Property Value

ApprovalRejection

Methods

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(Disconnection)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Disconnection other)

Parameters

other Disconnection

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.