AbstractNode

Session of a node. It's executed in a dedicated thread.

abstract
class AbstractNode : Handler!serverbound {}

Constructors

this
this(HubServer server, JSONValue* additionalJson)
Undocumented in source.

Members

Functions

addNode
void addNode(AbstractNode node)

Notifies the node that another node has connected to the hub.

addPlayer
void addPlayer(PlayerSession player, ubyte reason, ubyte[] transferMessage)

Adds a player to the node.

exchageInfo
void exchageInfo(HncomStream stream)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePlayerGamePacket
void handlePlayerGamePacket(Player.GamePacket packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePlayerKick
void handlePlayerKick(Player.Kick packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePlayerOrderedGamePacket
void handlePlayerOrderedGamePacket(Player.OrderedGamePacket packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePlayerSerializedGamePacket
void handlePlayerSerializedGamePacket(Player.SerializedGamePacket packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePlayerTransfer
void handlePlayerTransfer(Player.Transfer packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePlayerUpdateDisplayName
void handlePlayerUpdateDisplayName(Player.UpdateDisplayName packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePlayerUpdatePermissionLevel
void handlePlayerUpdatePermissionLevel(Player.UpdatePermissionLevel packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handlePlayerUpdateWorld
void handlePlayerUpdateWorld(Player.UpdateWorld packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStatusAddWorld
void handleStatusAddWorld(Status.AddWorld packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStatusLatency
void handleStatusLatency(Status.Latency packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStatusLog
void handleStatusLog(Status.Log packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStatusRemoveWorld
void handleStatusRemoveWorld(Status.RemoveWorld packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStatusSendMessage
void handleStatusSendMessage(Status.SendMessage packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStatusUpdateLanguageFiles
void handleStatusUpdateLanguageFiles(Status.UpdateLanguageFiles packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStatusUpdateMaxPlayers
void handleStatusUpdateMaxPlayers(Status.UpdateMaxPlayers packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStatusUpdateUsage
void handleStatusUpdateUsage(Status.UpdateUsage packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleUtilCompressed
void handleUtilCompressed(Util.Compressed packet)
Undocumented in source. Be warned that the author may not have intended to support it.
handleUtilUncompressed
void handleUtilUncompressed(Util.Uncompressed packet)
Undocumented in source. Be warned that the author may not have intended to support it.
loop
void loop(HncomStream stream)
Undocumented in source.
onClosed
void onClosed(bool transfer)

Called when the client closes the connection. Tries to transfer every connected player to the main node.

onPlayerGone
void onPlayerGone(PlayerSession player, ubyte reason)

Generic function that removes a player from the node's list and sends a PlayerDisconnected packet to notify the node of the disconnection.

onPlayerKicked
void onPlayerKicked(PlayerSession player)

Called when a player is kicked (not by the node).

onPlayerLeft
void onPlayerLeft(PlayerSession player)

Called when a player lefts the server using the disconnect button or closing the socket.

onPlayerTimedOut
void onPlayerTimedOut(PlayerSession player)

Called when a player times out.

onPlayerTransferred
void onPlayerTransferred(PlayerSession player)

Called when a player is transferred by the hub (not by the node) to another node.

receiveNodeInfo
Login.NodeInfo receiveNodeInfo(HncomStream stream)
Undocumented in source.
remoteCommand
void remoteCommand(string command, ubyte origin, Address address, int commandId)

Executes a remote command.

removeNode
void removeNode(AbstractNode node)

Notifies the node that another node has been disconnected from the hub.

send
void send(ubyte[] buffer)
Undocumented in source.
send
void send(ubyte[] buffer)
Undocumented in source. Be warned that the author may not have intended to support it.
sendDisplayNameUpdate
void sendDisplayNameUpdate(PlayerSession player, string displayName)
Undocumented in source. Be warned that the author may not have intended to support it.
sendHubInfo
void sendHubInfo(HncomStream stream, Login.HubInfo packet)
Undocumented in source.
sendLanguageUpdate
void sendLanguageUpdate(PlayerSession player, string language)
Undocumented in source. Be warned that the author may not have intended to support it.
sendLatencyUpdate
void sendLatencyUpdate(PlayerSession player)

Updates a player's latency (usually sent every 30 seconds).

sendMessage
void sendMessage(uint sender, bool broadcasted, ubyte[] payload)

Sends a message to the node.

sendPacketLossUpdate
void sendPacketLossUpdate(PlayerSession player)

Updates a player's packet loss (usually sent every 30 seconds).

sendPermissionLevelUpdate
void sendPermissionLevelUpdate(PlayerSession player, ubyte permissionLevel)
Undocumented in source. Be warned that the author may not have intended to support it.
sendTo
void sendTo(PlayerSession player, ubyte[] data)

Sends data to the node received from a player.

sendViewDistanceUpdate
void sendViewDistanceUpdate(PlayerSession player, uint viewDistance)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source.
updatePlayers
void updatePlayers(uint online, uint max)

Sends the number of online players and maximum number of players to the node.

Properties

accepts
bool accepts(ubyte game, uint protocol)
Undocumented in source. Be warned that the author may not have intended to support it.
addPacket
Status.AddNode addPacket [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
cpu
float cpu [@property getter]

Gets the node's usage, updated with the ResourcesUsage packet.

full
bool full [@property getter]

Indicates whether the node is full.

latency
uint latency [@property getter]

Gets the node's latency (it may not be precise).

main
bool main [@property getter]

Indicates whether or not this is a main node. A main node is able to receive players without the use of the transfer function. Every hub should have at least one main node, otherwise every player that tries to connect will be disconnected with the 'end of stream' message.

max
uint max [@property getter]

Gets the highest number of players that can connect to the node.

name
string name [@property getter]

Gets the name of the node. The name is different for every node connected to hub and it should be used other nodes with the transfer function.

online
uint online [@property getter]

Gets the number of players connected to the node.

ram
ulong ram [@property getter]

Gets the node's usage, updated with the ResourcesUsage packet.

tps
float tps [@property getter]

Gets the node's usage, updated with the ResourcesUsage packet.

worlds
shared(WorldSession)[] worlds [@property getter]

Gets the list of worlds loaded on the node.

Variables

id
uint id;
Undocumented in source.
plugins
Login.NodeInfo.Plugin[] plugins;
Undocumented in source.
stream
HncomStream stream;
Undocumented in source.

Meta