Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConnectionRefusal

A simple data class describing a connection refusal by Union Server.

Hierarchy

  • ConnectionRefusal

Index

Constructors

constructor

Properties

Readonly banDuration

banDuration: number = NaN

When the refusal-reason code for this ConnectionRefusal object is ConnectionRefusalReason.BANNED, banDuration indicates the length of the ban on this client's address, in milliseconds.

Readonly banReason

banReason: string = ""

When the refusal-reason code for this ConnectionRefusal object is ConnectionRefusalReason.BANNED, banReason indicates the cause of the ban on this client's address, as an arbitrary string. For example: "You were banned for inappropriate use of language".

Readonly bannedAt

bannedAt: number = NaN

When the refusal-reason code for this ConnectionRefusal object is ConnectionRefusalReason.BANNED, bannedAt indicates the time at which this client's address was banned by Union Server. The time is specified in milliseconds-from-1970 format UTC time, according to the server's clock.

Readonly description

description: string

Returns an arbitrary string providing information about the condition that led to the connection refusal by Union Server.

Readonly reason

reason: string

Returns the reason for a connection refusal by Union Server. The refusal-reason string is either one of the constants defined by the ConnectionRefusalReason class or an arbitrary refusal-reason-code generated by a custom server-side module.

When reason is ConnectionRefusalReason.BANNED, the time, duration, and cause of the ban will be available via the bannedAt, banDuration, and banReason variables.