Skip to main content
Every command is dispatched off one flat string; there’s no numeric opcode layer above SFS2X’s own framing. In 1.0.364 the Lua catalog (MsgDefines) defines 3,115 commands, of which MsgMap gives a handler to 3,097; 54 more exist only in C#; and the chat subsystem’s own table defines 133 wire names. The 1.0.351 figures were 3,065 / 3,047 for the Lua catalog and 131 for the chat table, 3,178 in all. This page summarizes how they’re organized; the full row-level catalog is described below rather than reproduced as a giant static table.

The 1.0.364 catalog at a glance

All counts are static-analysis-only, from a script that parsed every Net/Msgs Message class and every SFSNetwork.SendMessage call site:
  • 54 C#-only commands never appear in MsgDefines, including the login plumbing (login.ext, check.device.change, change.user.parseid), the world-map viewport pulls, and the march and kick pushes. C# handles 71 wire names in all; for the 18 that are also in the Lua catalog, C# wins. See Lua architecture.
  • The chat table has 133 wire names: 87 travel on the chat WebSocket, 45 on the game socket, and 1 has no handler. Five of them share a wire name with a MsgDefines command.
  • About 23% of the Lua catalog (731 of 3,115) is server pushes.

By functional domain

Two independent axes describe every command: which gameplay system it belongs to, and whether it’s a client request or a server-initiated push (roughly a fifth of all commands are pushes, 22% in 1.0.351 by the push.* naming convention). The domain breakdown below was built against the 1.0.351 catalog and hasn’t been redone for 1.0.364. Trade trucks (train.*) and the alliance train (alliance.train.*) are the Net/Msgs/Railway module (60 commands in 1.0.364), not Season; the alliance train runs under activity type 203. This 1.0.351 split has no row for them. These rows sum to 3,057, not the 3,047 mechanically-extracted main-table figure quoted above (and not the 3,178 grand total, which also includes the 131 chat-table commands this per-domain breakdown doesn’t cover) — a handful of commands land ambiguously between two domains and were counted in each, so this table is a categorization aid, not an exact partition.

Changes in 1.0.364

An exact diff of the 1.0.351 catalog (LWLF 793, recovered from the CDN) against the 1.0.364 APK’s (LWLF 825) gives:
  • MsgDefines keys: 3,065 → 3,115. Handled commands (MsgMap): 3,047 → 3,097.
  • 50 added, 0 removed, 0 renamed (same key, different wire string), and no handler moved.
  • The live Android (826) and iOS (821) bundles match 1.0.364 at the catalog level.
  • Every request schema goclient sends is unchanged. Some responses gained fields; for example, the push.chat.get.system.mails list push gained delActivityIds.
The chat table grew from 131 to 133 wire names but wasn’t diffed entry by entry; the domain table above still describes 1.0.351. All of this is static-analysis-only. Other 1.0.364 changes that touch protocol behavior: ProductLineBuilds gained the Crystal Factory (see City & building), MailEnum gained CrystalBoss=58, and the Lua LoginErrorCode table gained 55-58 (see Identity, login & session). A few commands the real client sends never appear in MsgDefines, because C# sends them directly: change.user.parseid, check.device.change, and login.ext. See Identity, login & session. They’re three of the 54 C#-only commands above.

Claim requests

The 1.0.364 coverage pass catalogued 558 claim-like requests, those whose names contain claim, collect, receive, reward, free, daily, sign, gift, or similar, each with its request params and the guard around its first send site; 55 carry a hand-traced eligibility rule. About 260 look like free claims; the rest are read-only fetches whose names merely contain “reward”, spends, PvP actions, or purchases. Few are documented on these pages: of the 245 claim wires reachable from one partition of the UI, 231 appear nowhere in the docs. The conventions below are shared across them (static-analysis-only unless marked).

Claim-all sentinels

Several claims take a sentinel instead of an id, to claim everything pending in one request:

Other conventions

  • Claim state. TaskState 1 (CanReceive) means claimable and 2 means claimed; other claim-state enums are in the Entity ID reference.
  • “Already claimed.” The generic error is 120289 (confirmed live for the VIP dailies, see Live validation against production).
  • Daily gates use the server day. “Already claimed today” checks compare timestamps with the server day, which starts at 02:00 UTC live, see Identity, login & session.
  • activityId types differ. Almost every activity reward request takes activityId as an Int, but the generic activity detail read, hero.event.info.get, takes it as a UTF string.
  • The detail read sends the entry’s activityid. An init activity entry may carry an activityid besides its id, and the client sends that one (ActivityInfoData.lua:126-128, 160-161). The Alliance Duel is {id: 55000, activityid: "70000"}: asked for "55000", the server answers a bare {success=true} (confirmed live). See Alliance Duel.
  • Free and paid variants can share a wire name. A lottery with useFree: 0 spends tickets or diamonds, useGold/gold flags spend diamonds, and free.building.up.new with gold: 2 pays with diamonds.
  • Speed-ups. build.ccd.m.new, queue.ccd.m.new, and building.camp.accel take either an item string (itemIDs, or itemId for the camp, as "tmpl;n|tmpl;n") or a useGold amount. The UI’s isGold flag never reaches the wire (QueueCcdMNewMessage.lua:3-17). queue.ccd.m.new with an empty itemIDs is the client’s own diamond instant finish (ArmyManager.lua:204-210); on a running research inside the free research time (init effect 30100) the same bytes are its free finish (UIScienceView.lua:648-654). goclient sends neither. The items-only build.ccd.m.new reply lists the items spent in itemCostArr and the diamond balance in remainGold (confirmed live), see Alliance Duel.

Reward payload

Claim responses carry a reward array plus, often, a sibling resource object (1.0.364 RewardManager; static-analysis-only):
  • type is a RewardType id; the full id-to-name table is in the Entity ID reference.
  • For plain resources and currencies (METAL for iron, WOOD (31) for coins, FOOD, GOLD for diamonds, PETROLEUM for oil, stamina, and so on), value is the amount gained and total the new balance.
  • For goods (type 7), value is {itemId, count, rewardAdd}: count is the new owned count and rewardAdd the amount gained. Resource items (27) use {id, num}, heroes (25) {heroId, rewardAdd, uuid}, and soldiers (23) {itemId, count}. Common equipment (38) nests under value.changes[] as {equipUid, cfgId, num, changeNum}: num is the new owned count, changeNum the gain.
  • resource holds absolute balances, applied before the reward entries. On the wire, food is money, coins are wood, and iron is metal.
  • Some responses also carry a top-level gold, and a few counters arrive as their own top-level fields rather than as reward entries.

Search the full catalog

Two row-level catalogs exist:
  • The 1.0.364 coverage catalog (commands.tsv): all 3,115 MsgDefines commands, one row each, with the wire name, direction, runtime handler, request params with their SFS2X types (name:Int, nested arrays expanded, [name:Type] for conditional puts), the response fields the handler reads, the DataCenter managers it calls, the send-site count and first send sites, the C# handler where C# shadows Lua, duplicate-wire notes, and a relevance label. Companion indexes list every one of the 4,561 send sites with its enclosing function and nearest if guards (command_send_sites.tsv), the 558 claim-like requests (claim_commands.tsv), the 133-name chat table (chat_commands.tsv), and the 159 game systems (systems.tsv). These live with the coverage-analysis artifacts, outside this repo, and are regenerable with the method in Findings & further work.
  • The 1.0.351 dossier catalog (cmd-data), described below: 3,178 commands total, 3,047 from the main dispatch table (Net.Msgs.*, over the primary SFS socket) plus 131 from the dedicated chat subsystem’s own table (Chat.WebMessage.* / Chat.NetMessage.*, split across the chat WebSocket and the primary socket, see the WS / SFS tags).
The source dossier this page is derived from ships the full catalog as an interactive, client-side search tool (a search box filtering on key/wire-cmd/handler-class, plus a channel dropdown for All channels / SFS socket / Chat WebSocket, rendering up to the first 300 matches at a time). That live widget isn’t reproduced here; hand-transcribing ~3,178 rows into a static Markdown table would be both unwieldy and error-prone. The underlying data is not lost, though: it’s the same cmd-data JSON data island (one row per command, [key, wire cmd, handler class, channel]) backing the dossier’s search tool, and it is regenerable directly from the client’s own dispatch tables using the same mechanical extraction that produced it in the first place.
Each row in the 1.0.351 cmd-data catalog carries four fields: Commands whose Key is prefixed Push (wire cmd prefixed push.*) are server-initiated pushes rather than client requests; this is the 22% figure cited above. The full 3,178-row dataset (extracted from MsgDefines/MsgMap for the main table, and the chat subsystem’s parallel table for the 131 Chat.WebMessage.*/Chat.NetMessage.* entries) is available in the extracted reports produced alongside this dossier, and can be regenerated from the client using the extraction methodology described in Extraction methodology. Field-level request/response schemas for the structurally central commands in each domain are documented in the gameplay-domain pages, not here; reading a command’s own OnCreate/HandleMessage pair in the decompiled Lua is the authoritative source for anything not covered there. (See City & building, Military, hero & battle, Alliance, chat & mail, Shop, trading & real-money IAP, and World map.)