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
reasonDisconnectReasonmessagestring
Disconnection(DisconnectReason, string, ApprovalRejection)
Creates a disconnection record that carries the server's approval rejection.
public Disconnection(DisconnectReason reason, string message, ApprovalRejection rejection)
Parameters
reasonDisconnectReasonWhy it happened.
messagestringDetail for the player or the log.
rejectionApprovalRejectionWhy connection approval refused the client (with Rejected); None otherwise.
Fields
None
No disconnect.
public static readonly Disconnection None
Field Value
Properties
Message
Detail for the player or the log (for example the approval rejection text). Never null.
public string Message { get; }
Property Value
Reason
Why it happened.
public DisconnectReason Reason { get; }
Property Value
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
Methods
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
otherDisconnectionAn object to compare with this object.
Returns
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.