The player wall
packets11 packets
The player wall's game messages (playerWall.PlayerWallXtCommManager). The wall itself (its posts, and deleting, hiding and clearing them) lives on a web service of its own that the client speaks to over HTTP (sendServiceRequest), with a token it asks the game server for here (wt). What goes through the game server besides is the wall's settings: who may post on it, how it looks, and counting a visit.
The client keeps one callback for each request, so an answer belongs to the last request of its kind.
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 |
|---|---|---|---|
WallTokenRequest | wt | game → server | The client asks for the token a player wall’s service wants. |
WallToken | wt | server → game | The server hands over a player wall’s token, or refuses it. |
WallTokenRefused | wt | server → game | The server refuses a player wall’s token, naming the wall. |
WallSettingsSetRequest | wss | game → server | The player sets who may post on their wall. |
WallSettingsSetResult | wss | server → game | The server says whether it kept who may post on the player’s wall. |
WallSettingsRequest | wsg | game → server | The player asks who may post on someone’s wall. |
WallSettings | wsg | server → game | The server says who may post on a wall. |
WallParametersRequest | wps | game → server | The player changes how their wall looks. |
WallParametersResult | wps | server → game | The server says whether it kept how the player’s wall looks. |
WallVisitRequest | wci | game → server | The player counts a visit to someone’s wall. |
WallVisitResult | wci | server → game | The server says whether a visit to a wall was counted. |
WallTokenRequest
Asks for the token the wall service wants for someone's wall (PlayerWallXtCommManager.sendWallTokenRequest(userName, ...)), which the client asks for the first time it touches a wall and again when the service turns one down:
%xt%o%wt%<room>%<userName>%
Fields
| Field | Type | |
|---|---|---|
userName | string | Whose wall, by account name. |
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.WallTokenRequest, (packet) => {
console.log(packet.userName);
});WallToken
The token for a wall, and what it lets the player do there (PlayerWallManager.handleTokenResponse, which keeps it in tokenMap by the lowercased name):
%xt%wt%<room>%1%<token>%<read>%<write>%<userName>% %xt%wt%<room>%<result>%
A result other than 1 is a refusal, and carries nothing more: -1 and -2 each have a popup of their own (strings 22623 and 22624), anything else the general one (22625). read and write are 1 when allowed; PlayerWallGui lets the player post only where write is.
Fields
| Field | Type | |
|---|---|---|
result | string | 1 when the token was given; -1, -2 or another value for a refusal. |
token | string | null | The token the wall service wants with every request for that wall. Null for a refusal. |
read | boolean | Whether the player may read that wall: 1. False for a refusal. |
write | boolean | Whether the player may post on that wall: 1. False for a refusal. |
userName | string | null | Whose wall the token is for, by account name. Null for a refusal. |
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.WallToken, (packet) => {
console.log(packet.result, packet.token, packet.read);
});WallTokenRefused
A refused token as Animal Jam's server writes it, the four fields of a token after the result for all that it refuses: an empty token, 0 for reading, 1 for posting, and the name asked for. PlayerWallManager.handleTokenResponse reads nothing past a refusal's result, so the popup is the result's alone; the rest is written as the real server writes it. A variant of player-wall.token, which reads every wt:
%xt%wt%<room>%<result>%%0%1%<userName>%
Fields
| Field | Type | |
|---|---|---|
result | string | Why: -1 and -2 each have a popup of their own, anything else the general one. |
token | string | The token, empty: there is none. |
read | boolean | Whether the player may read the wall: 0. |
write | boolean | Whether the player may post on it, as the real server writes a refusal: 1. |
userName | string | Whose wall was asked for, by account name, as it was asked for. |
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.WallTokenRefused, (packet) => {
console.log(packet.result, packet.token, packet.read);
});WallSettingsSetRequest
Sets who may post on the player's own wall (PlayerWallXtCommManager.sendSetWallSettingsRequest, from the wall's settings popup), by the setting's number: 0 nobody, 1 buddies, 2 anybody (SbiConstants.PLAYER_WALL_*):
%xt%o%wss%<room>%<setting>%
Fields
| Field | Type | |
|---|---|---|
setting | number | Who may post: 0 nobody, 1 buddies, 2 anybody. |
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.WallSettingsSetRequest, (packet) => {
console.log(packet.setting);
});WallSettingsSetResult
Whether the setting was kept (PlayerWallManager.onPrivacyResponse, which then stores the setting it asked for in userInfo.playerWallSettings; the answer does not repeat it):
%xt%wss%<room>%<ok>%
Fields
| Field | Type | |
|---|---|---|
ok | boolean | Whether the setting was kept: 1. |
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.WallSettingsSetResult, (packet) => {
console.log(packet.ok, packet.extra);
});WallSettingsRequest
Asks who may post on someone's wall (PlayerWallXtCommManager.sendGetWallSettingsRequest, from a buddy card, which greys its wall button out when the player may not):
%xt%o%wsg%<room>%<userName>%
Fields
| Field | Type | |
|---|---|---|
userName | string | Whose wall, by account name. |
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.WallSettingsRequest, (packet) => {
console.log(packet.userName);
});WallSettings
Who may post on the wall asked about (PlayerWallXtCommManager.handleXtReply, which hands the number to BuddyCard.onPlayerWallPrivacyGet):
%xt%wsg%<room>%<setting>%
Fields
| Field | Type | |
|---|---|---|
setting | number | Who may post: 0 nobody, 1 buddies, 2 anybody. |
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.WallSettings, (packet) => {
console.log(packet.setting, packet.extra);
});WallParametersRequest
Changes how the player's own wall looks: its decor, its photo booth picture, its status (PlayerWallXtCommManager.sendSetWallParametersRequest). The client keeps its whole settings and sends only what changed (PlayerWallGui.checkForWallParameterChanges), as JSON:
%xt%o%wps%<room>%<changes as JSON>%
Fields
| Field | Type | |
|---|---|---|
changes | string | What changed, as JSON: the wall's own settings object, with only the changed keys. |
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.WallParametersRequest, (packet) => {
console.log(packet.changes);
});WallParametersResult
Whether the change was kept (PlayerWallXtCommManager.setParametersResponse, then PlayerWallManager.onParametersResponse, which keeps the whole settings it sent as myWallParameters):
%xt%wps%<room>%<ok>%
Fields
| Field | Type | |
|---|---|---|
ok | boolean | Whether the change was kept: 1. |
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.WallParametersResult, (packet) => {
console.log(packet.ok, packet.extra);
});WallVisitRequest
Counts a visit to someone's wall (PlayerWallXtCommManager.sendSetWallCounterIncrementRequest), which PlayerWallGui.setupViews sends the first time in a session the player opens a wall that is not their own:
%xt%o%wci%<room>%<userName>%
Fields
| Field | Type | |
|---|---|---|
userName | string | Whose wall, by account name. |
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.WallVisitRequest, (packet) => {
console.log(packet.userName);
});WallVisitResult
Whether the visit was counted (PlayerWallManager.onWallCountIncrementResponse, which then marks the wall in myViewedWalls so it is not counted again this session):
%xt%wci%<room>%<ok>%
Fields
| Field | Type | |
|---|---|---|
ok | boolean | Whether the visit was counted: 1. |
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.WallVisitResult, (packet) => {
console.log(packet.ok, packet.extra);
});