Packets
Animal Jam Classic talks to its server in short messages. Phantom reads 375 of them as named, typed packets: packets in a script, and the same definitions from @phantomclient/plugin/sdk in a plugin with the packets permission. Each page lists a group with every field, generated from @phantom/protocol's catalogue.
Hearing, changing and sending
TypeScript
// After the fact: what the server sent the game. Costs the traffic nothing.
const stop = phantom.packets.server.watch(packets.AvatarMove, (move) => console.log(move.room, move.points));
// Before it arrives, able to change it (return new fields) or drop it (message.drop()).
phantom.packets.client.on(packets.PublicChat, (chat, message) => {
if (chat.text.includes('secret')) message.drop();
});
// Sending one yourself, past every hook.
await phantom.packets.server.send('%xt%o%rj%-1%jamaa_township.room_main%0%0%%');The SDK reference covers phantom.packets call by call.
Every group
Signing inConnecting and signing in: SmartFox's own handshake (
SmartFoxClient and handlers/SysHandler in the client), then Animal Jam's login reply.12 packetsRoomsRooms: joining one, and what the server says about it.9 packetsAvatarsA point in a room, in the room's world coordinates.31 packetsChatHow a chat message was made.24 packetsBuddiesBuddies.16 packetsJam-a-gramsJam-a-grams (ecard.ECardXtCommManager): cards players send each other, which may carry a gift.17 packetsRefer a friendRefer a friend (buddy.ReferAFriendXtCommManager): the player's own referral code, the players who joined with it, and, for a new account, naming the player who referred them.8 packetsTradesTrading (trade.TradeXtCommManager, answered in gui.TradeManager).6 packetsItemsClothing: the inventory, wearing and taking off, buying and recycling (item.ItemXtCommManager).11 packetsShopsWhat a shop is offering (GenericListXtCommManager, item.ItemXtCommManager.shopListResponse).8 packetsGems and diamondsThe player's currencies, and the codes and prizes that add to them.8 packetsPetsPets: the player's list, bringing one out or putting it away, adopting, buying, dressing and freeing one, and the kinds the account has unlocked (pet.PetXtCommManager and pet.PetManager in the client).16 packetsAdopt a PetAdopt a Pet: the checklist of cards whose codes come printed on real-world toys (adoptAPet.AdoptAPetXtCommManager and AdoptAPetManager in the client).5 packetsDensDens: joining one, their privacy, the player's den rooms and who is visiting.34 packetsThe worldThe world around the rooms: how full each room is, the shards (the worlds the server selector lists) and the server nodes they live on.6 packetsPartiesParties: Animal Jam's own, on a schedule, and the ones players host.18 packetsAdventures101 packetsMinigamesMinigames, as game.MinigameXtCommManager sends and handles them.22 packetsAchievementsAchievements and user variables ("stats"), as achievement.AchievementXtCommManager sends and handles them.6 packetsLikesLikes (resourceArray.ResourceArrayXtCommManager): the heart under a masterpiece in its preview (gui.MasterpiecePreview) and the one on a player's wall (playerWall.PlayerWallGui).4 packetsThe player wallThe player wall's game messages (playerWall.PlayerWallXtCommManager).11 packetsWorld itemsWorld items (WorldItems.WorldItemsXtCommManager and WorldItemsManager): the gift objects placed around Jamaa's rooms, each clicked once, ever, for what it holds.2 packets