The world
packets6 packets
The world around the rooms: how full each room is, the shards (the worlds the server selector lists) and the server nodes they live on. Layouts are read from room/RoomXtCommManager.as, gamePlayFlow/GamePlay.as, gui/VolumeSelector.as and nodeHop/NodeHopXtCommManager.as in the decompiled client (deploy 1829).
Hearing and sending packets
What the game sends is heard on phantom.packets.client, and what the server sends on phantom.packets.server. watch hears a packet after it has gone through; on hears it first and may change or drop it; send sends one to that end. See Packets.
Overview
| Packet | Command | Way | What it is |
|---|---|---|---|
RoomCountRequest | rc | game → server | The player asks how many of their buddies are in each land. |
RoomCounts | rc | server → game | The server says how many of the player’s buddies are in each land. |
ShardListRequest | rm | game → server | The player asks for the list of shards. |
ShardList | rm | server → game | The server lists the shards on each server node. |
NodeHopRequest | nd | game → server | The player asks to move off a server that is shutting down. |
NodeHop | nd | server → game | The server names the server to move to. |
RoomCountRequest
Asks how many of the player's buddies are in each land (RoomXtCommManager.sendRoomCountRequest), from the world map: when it opens and every 15 seconds while it is, and only while the player has a buddy online (VolumeSelector.updateRoomCount).
Fields
| Field | Type | |
|---|---|---|
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.RoomCountRequest, (packet) => {
console.log('world.room-count-request');
});RoomCounts
How many of the player's buddies are in each land (VolumeSelector.handleRoomCountResponse), which the world map shows on the land's button. The map keeps the last count it reads for a land, so a server sends each land once.
Fields
| Field | Type | |
|---|---|---|
rooms | RoomCount[] | Each room and how many buddies are in its land, after their count. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.RoomCounts, (packet) => {
console.log(packet.rooms);
});ShardListRequest
Asks for every shard (RoomXtCommManager.sendMoreShardRequest, from ServerSelector). The client shows the answer in the server selector, and only when that popup is open does it hold together.
Fields
| Field | Type | |
|---|---|---|
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.ShardListRequest, (packet) => {
console.log('world.shard-list-request');
});ShardList
Every shard, by node (GamePlay.showServerSelectorMore). The layout has no counts: each node's host is followed by its shards, four numbers each, until the next value that is not a number, which is the next host. The client tells them apart the same way, with isNaN(Number(value)).
Fields
| Field | Type | |
|---|---|---|
status | number | null | Set when the server answers with a number instead of a list: 0 or below means there are no shards to show (RoomXtCommManager.roomMoreResponse). Null for a list. |
nodes | ShardNode[] | Each server node and its shards, in the order sent. Empty when status is set. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.ShardList, (packet) => {
console.log(packet.status, packet.nodes);
});NodeHopRequest
Asks for a server node to move to while this one drains, when the player accepts the drain popup (NodeHopXtCommManager.sendNodeHopForDrainRequest).
Fields
| Field | Type | |
|---|---|---|
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.NodeHopRequest, (packet) => {
console.log('world.node-hop-request');
});NodeHop
The node to move to (NodeHopXtCommManager.handleNodeHopDrainResponse), which the client hands to its page to reload with (Utility.reloadSWFOrGetIp).
Fields
| Field | Type | |
|---|---|---|
host | string | The server node to reconnect to, which the client passes to Utility.reloadSWFOrGetIp. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.NodeHop, (packet) => {
console.log(packet.host);
});