Parties
packets18 packets
Parties: Animal Jam's own, on a schedule, and the ones players host. Layouts are read from Party/PartyXtCommManager.as, Party/PartyManager.as and Party/PartyPopup.as in the decompiled client (deploy 1829). A party that is joined answers with room.join-result; these packets carry only the failures.
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 |
|---|---|---|---|
PartyListRequest | sl | game → server | The player asks which parties are on. |
PartyList | sl | server → game | The server lists Animal Jam’s parties. |
PartyJoinRequest | sj | game → server | The player asks to join a party. |
PartyJoinResult | sj | server → game | The server says a party could not be joined. |
PartyJoinBarred | sj | server → game | The server says the party does not take the player’s animal or pet. |
CustomPartyListRequest | slp | game → server | The player asks which parties players are hosting. |
CustomPartyList | slp | server → game | The server lists the parties players are hosting. |
CustomPartyJoinRequest | sjp | game → server | The player asks to join a party a player hosts. |
CustomPartyJoinResult | sjp | server → game | The server says whether a hosted party could be joined. |
CustomPartyNodeRequest | spn | game → server | The player asks which server a hosted party is on. |
CustomPartyHostRequest | scp | game → server | The player asks to host a party of their own. |
CustomPartyHostingRequest | sphp | game → server | The player asks whether someone is hosting a party. |
CustomPartyHosting | sphp | server → game | The server says how long someone has left hosting a party. |
PartyMasterpiecesRequest | sm | game → server | The player asks for the bulletin board’s masterpieces. |
PartyMasterpieces | sm | server → game | The server gives the bulletin board’s masterpieces. |
CustomPartyHostResult | scp | server → game | The server says whether the player may host a party. |
CustomPartyKilled | spk | server → game | The server ends the player’s hosted party from outside the client. |
CustomPartyNode | spn | server → game | The server says which server a hosted party is on. |
PartyListRequest
Asks for Animal Jam's parties (PartyXtCommManager.sendPartyListRequest).
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.PartyListRequest, (packet) => {
console.log('party.list-request');
});PartyList
Animal Jam's parties (PartyPopup.partyListResponse). The client does not read the first argument; it starts at the count.
Fields
| Field | Type | |
|---|---|---|
unread | string | The first argument, which the client does not read; kept as it came. |
parties | ScheduledParty[] | Animal Jam's parties, 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.PartyList, (packet) => {
console.log(packet.unread, packet.parties);
});PartyJoinRequest
Joins one of Animal Jam's parties by its def (PartyXtCommManager.sendJoinPartyRequest).
Fields
| Field | Type | |
|---|---|---|
defId | number | The party to join, by its def id. |
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.PartyJoinRequest, (packet) => {
console.log(packet.defId);
});PartyJoinResult
A party join that failed (PartyManager.roomSoireeResponse): the client reads the rest only when the first argument is 0. reason is NM (members only), NA or NP (the party does not allow the player's avatar or pet; a barrier id follows in extra).
Fields
| Field | Type | |
|---|---|---|
joined | boolean | The first argument is not 0; the client reads nothing more then. |
reason | string | null | Why the join failed: NM, NA or NP (see above). Null when joined or missing. |
extra | string[] | Whatever follows, as it came: a barrier id after NA or NP. |
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.PartyJoinResult, (packet) => {
console.log(packet.joined, packet.reason, packet.extra);
});PartyJoinBarred
A party join refused for the player's animal or pet, with the party it is about, whose barrier popup the client opens (GuiManager.showBarrierPopup). A variant of party.join-result, which reads every sj:
%xt%sj%<room>%0%<NA|NP>%<defId>%
Fields
| Field | Type | |
|---|---|---|
reason | "NA" | "NP" | NA for the player's animal, NP for their pet. |
defId | number | The party the barrier is about, by its def id. |
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.PartyJoinBarred, (packet) => {
console.log(packet.reason, packet.defId);
});CustomPartyListRequest
Asks for the parties players host (PartyXtCommManager.sendCustomPartyListRequest). Its one caller, PartyPopup, asks with 0 and 200: where the page starts and how long it is.
Fields
| Field | Type | |
|---|---|---|
start | number | Where the page starts, 0 for the first party. PartyPopup sends 0. |
limit | number | How many parties the page holds. PartyPopup sends 200. |
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.CustomPartyListRequest, (packet) => {
console.log(packet.start, packet.limit);
});CustomPartyList
The parties players host (PartyPopup.customPartyListResponse).
Fields
| Field | Type | |
|---|---|---|
unread | boolean | A flag the client does not read. |
total | number | The client reads the page only when this is above 0. |
skipped | readonly [number, number] | null | Two numbers before the page's parties that the client skips, or null when total is 0. |
parties | CustomParty[] | The page's parties, after their count; empty when total is 0. |
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.CustomPartyList, (packet) => {
console.log(packet.unread, packet.total, packet.skipped);
});CustomPartyJoinRequest
Joins a party a player hosts, on this server node (PartyXtCommManager.sendCustomPartyJoinRequest). PartyManager.sendCustomPartyJoin switches node first when the party is elsewhere.
Fields
| Field | Type | |
|---|---|---|
creatorUuid | string | The host's uuid, as party.custom-list gives it. |
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.CustomPartyJoinRequest, (packet) => {
console.log(packet.creatorUuid);
});CustomPartyJoinResult
The answer to joining a hosted party (PartyManager.customPartyJoinResponse): joined is set for 1, and a failure names its reason (NPP, BLK, DIS).
Fields
| Field | Type | |
|---|---|---|
joined | boolean | The party was joined: the first argument is 1. |
reason | string | null | Why the join failed: NPP, BLK or DIS. Null when joined or missing. |
extra | string[] | Whatever follows, as it came. |
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.CustomPartyJoinResult, (packet) => {
console.log(packet.joined, packet.reason, packet.extra);
});CustomPartyNodeRequest
Asks which server node a hosted party is on (PartyXtCommManager.sendCustomPartyNodeId).
Fields
| Field | Type | |
|---|---|---|
creatorUuid | string | The host's uuid, as party.custom-list gives it. |
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.CustomPartyNodeRequest, (packet) => {
console.log(packet.creatorUuid);
});CustomPartyHostRequest
Hosts a party of the player's own (PartyXtCommManager.sendCustomPartyHostRequest), as CustomPartyCreatePopup sends it: the party's def, its name as three localisation ids (one from each of the popup's three name wheels, _partyNameChosenIds), and the den item whose music plays.
Fields
| Field | Type | |
|---|---|---|
defId | number | The kind of party to host, by its party def id (_currPartyDef.id). |
nameStrIds | readonly [number, number, number] | The three localisation ids the party's name is built from, in order. |
audioDefId | number | The den item whose music plays in the party (_currAudioDef.id). |
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.CustomPartyHostRequest, (packet) => {
console.log(packet.defId, packet.nameStrIds, packet.audioDefId);
});CustomPartyHostingRequest
Asks how long a player has left hosting their party (PartyXtCommManager.sendCustomPartyIsHosting), as a buddy card does before it shows the party button. The client sends nothing for an empty uuid.
Fields
| Field | Type | |
|---|---|---|
creatorUuid | string | The host's uuid (UserInfo.uuid). |
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.CustomPartyHostingRequest, (packet) => {
console.log(packet.creatorUuid);
});CustomPartyHosting
How long a player has left hosting their party (PartyManager.customPartyIsHostingResponse), which the client writes onto that player's UserInfo.timeLeftHostingCustomParty. The answer does not name the player: the client remembers who it asked about.
Fields
| Field | Type | |
|---|---|---|
secondsLeft | number | Seconds left hosting; 0 when they host nothing. |
extra | string[] | Whatever follows, as it came. |
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.CustomPartyHosting, (packet) => {
console.log(packet.secondsLeft, packet.extra);
});PartyMasterpiecesRequest
Asks for the masterpieces the party bulletin board shows (PartyXtCommManager.sendPartyMasterpiece), which BulletinBoard asks once and keeps.
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.PartyMasterpiecesRequest, (packet) => {
console.log('party.masterpieces-request');
});PartyMasterpieces
The bulletin board's masterpieces (PartyXtCommManager.handleXtReply, passed to BulletinBoard.onMasterpiecesLoaded): one argument of JSON holding a pool of masterpieces, or an empty string when there are none. The board shows the first.
Fields
| Field | Type | |
|---|---|---|
json | string | The JSON as it came, which the client parses; empty when there are none. |
pool | PoolMasterpiece[] | The masterpieces in the pool, in the server's order; empty when there are none. |
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.PartyMasterpieces, (packet) => {
console.log(packet.json, packet.pool);
});CustomPartyHostResult
Whether hosting a party was allowed, and for how long (PartyManager.customPartyCreateResponse):
%xt%scp%<room>%1%1%<secondsLeft>% %xt%scp%<room>%0%<reason>%
A hosting of 1 with a second 1 is the client's own case for "still hosting"; the client reads nothing when that second flag is 0, which is not seen in play. reason is ND (no diamond), EXISTS (already hosting one) or NM (not a member); anything else (INV, NR, DIS) shows the same generic refusal.
Fields
| Field | Type | |
|---|---|---|
secondsLeft | number | null | The seconds the player has left hosting it, when hosting is true; null otherwise. |
hosting | boolean | Whether the player may host the party. |
reason | string | null | Why hosting was refused (ND, EXISTS, NM, or the client's generic refusal for INV, NR and DIS), when hosting is false; null otherwise. |
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.CustomPartyHostResult, (packet) => {
console.log(packet.secondsLeft, packet.hosting, packet.reason);
});CustomPartyKilled
The player's hosted party was ended from outside the client, such as by staff or the schedule (PartyManager.customPartyKillResponse): the client refunds the diamond it cost, and closes any open party popup. Nothing in the client sends a request this answers; it only ever arrives unprompted.
Fields
| Field | Type | |
|---|---|---|
diamondsRefunded | number | The diamonds refunded for the party, as the client adds them back. |
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.CustomPartyKilled, (packet) => {
console.log(packet.diamondsRefunded);
});CustomPartyNode
Where a hosted party is (PartyManager.onGetPartyNodeId): when found, the host's uuid and the node, which the client passes back to sendCustomPartyJoin.
Fields
| Field | Type | |
|---|---|---|
found | boolean | The party was found: the first argument is 1. |
party | { creatorUuid: string; node: string; } | null | The host and the node, or null when the party was not found. |
extra | string[] | Whatever follows, as it came. |
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.CustomPartyNode, (packet) => {
console.log(packet.found, packet.party, packet.extra);
});