Skip to main content
Cold start walks an 18-state machine from splash screen to a live game connection. Four independently-versioned payloads, asset bundles, the C# hot-update assemblies, the Lua bundle, and the data tables, are checked and patched separately, from a single version-check HTTP response.

State machine (cold start, first launch)

In 1.0.370, as in 1.0.364, CheckResVersion clears the cached server IP, port, and connection type on every cold start, so StartConnect never finds a cached server and the GSL (Gate Server List) call always runs (static-analysis-only, Assembly-CSharp.decompiled.cs:9332). Since the 1.0.370 fixes goclient does the same on every reconnect: one GSL lookup with no opt before the Login, unless the run just refreshed its tokens or the address was typed on the command line. It fails open (any error, 211/212 included, keeps the configured address and token), adopts a token the reply carries, saves a rotated refresh token before the Login, and falls back to the configured address or token when the listed server can’t be reached or refuses the handed-back token (static-analysis-only). The cached ip/port/zone short-cut from state 6 to state 9 still exists, but only a mid-session reconnect, such as following a serverInfo redirect, takes it. See Identity, login & session for what the GSL call does with the stored tokens.

Check-version endpoint

In 1.0.370, as in 1.0.364, table_env is table_online and server carries the cached zone (static-analysis-only). goclient now sends the same: table_env=table_online, and the session zone in server on the cross-server path. Earlier versions sent both empty, and the server answered anyway (confirmed live). The empty table_env had one visible cost: the server returns table_version and locale only when the request carries table_env=table_online. Four anonymous check-version GETs on 2026-10-05, Android 1.0.364 and iOS 1.0.344 each with and without table_online, showed both fields (plus an empty x_table_version) only in the table_online variants, with every other field identical (confirmed live). Host list (requests go out to every host in parallel and the first success wins; on total failure the client retries the same list once). About 5% of devices are A/B-bucketed to the ea- hosts by GrayUtils.GetPercentageFromMd5: MD5(deviceId) read as a little-endian uint64, mod 100 + 1 <= 5.
goclient tries the three online hosts one after another, not in parallel. Whichever host answers becomes the base URL for every subsequent call in this bootstrap (getserverlist.php, getnotice.php, probe.php); there is no separate “gate server” discovery step. A response counts as valid when it has a non-empty code (which the client treats as an error), or when updateType is in 0..3 and hotUpdateMsg is non-empty. The 1.0.370 parser (CheckResVersionState, unchanged from 1.0.364) reads these fields: That’s every field the parser handles. A live response carries fewer: the iOS check-version response for 1.0.344 (786), fetched on 2026-10-04, held only client_config, downloadurl, firstLaunchForceUpdateMsg, hotUpdateMsg, lwfile2, resMsg, updateType, and warmup. With table_env=table_online, the 2026-10-05 responses also carried table_version, locale, and an empty x_table_version (confirmed live). updateType meanings (1.0.370 C#, Assembly-CSharp.decompiled.cs:9617-9639): The Login response can carry updateType too; with 2, the client enters its app-update state instead of waiting for init, and a cross-server Login fails with error 9 (1.0.367 C#). On 2026-10-04 the iOS 1.0.344 app got updateType=3 from both check-version and Login, with the Login response naming new_version 1.0.350 (observed live). goclient stops when check-version returns updateType 2 (read as the client’s ToInt, so "2" too, and before code), without asking another host, and exits with code 5. goclient also reads the Login response’s updateType (an SFS Int) and new_version (a UtfString) on every Login, from the same object that holds serverInfo: the response itself, else its p. It logs both at Info with the appVersion the Login claimed. With updateType=2 it closes the connection before init and exits with code 5, as the real client stops there (Assembly-CSharp.decompiled.cs:13666-13669, 71486-71494). A new_version above the claimed build is no warning. The real client uses new_version only to refuse creating a new role when the gap is too large (ShumeiSdkManager.IsForbidCreateRole, static-analysis-only).

resVersion

Login’s resVersion is GetResVersion() in the 1.0.364 C#, unchanged in 1.0.370 (static-analysis-only):
The {GameRes}.{DllRes}_{lwfile2 version}F prefix comes from the versions check-version installs: the GameRes and DllRes manifest versions from hotUpdateMsg, and the first | field of lwfile2. The real iOS app sent 2159.1505_821F_39516.23570 on 2026-10-04, and that day’s check-version response returned GameRes 2159, DllRes 1505, and lwfile2 version 821, matching the prefix. The {table}.{locale} tail is local state, not a field copied from the response (static-analysis-only):
  • {table} is CURRENT_TABLE_VERSION: the APK’s built-in table/version until a newer table archive has been downloaded, then the highest downloaded version.
  • {locale} is LOCALE_VERSION: the APK’s built-in locale/version until a downloaded locale/<ver>/ exists, then the highest such version.
After a successful update, those equal check-version’s table_version and locale, which the server returns only for table_env=table_online (confirmed live). On 2026-10-05 a table_online request returned table version 39516 and locale 23570, exactly the iOS app’s tail. Every part of the 1.0.364 APK’s own baseline is in the APK: 2342.1501_825F_39432.23557 (gameres.version, dllres.version, LWScripts.txt, table/version, locale/version). goclient derives resVersion from the check-version reply for the build that login claims: the iOS build under -cs-ios, otherwise Android. It sends "0" when that reply lacks a part. "0" is what it sent for months, and the server accepted that.

Hot-update transport & patch format

Four independently-versioned payloads, compared via the fields above and patched separately:
  • Asset bundles: UnityFS bundles in the XAssetPro container, tracked by the gameres manifest (see The XAssetPro asset container below).
  • C# assemblies: the APK ships 118 loose, XOR’d .mdl files in assets/Assemblies/, not bundles, plus noUpdateAssemblies.json = [{"name":"SmartFox2X"}], which pins the SFS2X library to the APK copy. The dllres manifest (v1501 in the APK) lists 117 remote-only <asm>.encrypt.bytes bundles plus its own copy of that JSON; mscorlib has no entry, so it can’t be hot-updated. Updated assemblies are written to persistentDataPath/Assemblies/<asm>.mdl, which FM_Mono searches before the APK (static-analysis-only).
  • Lua bundle: one flat LWLF file, not wrapped in an AssetBundle at all.
  • Data tables: the plain-ZIP table_*.data archive.
Downloaded patches/replacements may be wrapped in a lightweight on-disk XOR obfuscation (not real confidentiality, key material is hardcoded client-side) built on a reduced-round ChaCha stream cipher: 8 rounds (4 double-rounds) instead of standard ChaCha20, IETF layout, detected by a short (3–6 byte) magic-prefix swap: The offsets come from the 1.0.364 EncryptUtils in BaseUtils (static-analysis-only). Key/nonce are derived once from hardcoded dummy constants via two self-referential ChaCha8 passes (reproduced independently in Python and confirmed reproducible):

The XAssetPro asset container

The gameres asset bundles aren’t plain Unity AssetBundles on disk. XAssetPro (VEngine, API 6.1.5) packs them, and the APK’s install-time asset pack holds one container. Except for the dated HEAD requests, everything in this section is static-analysis-only, checked against the shipped files:
  • assets/AssetBundles/BundleFragment0.bytes (539 MB) is 8,059 UnityFS bundles laid end to end, with no gaps or padding. Their headers have the engine version stripped (5.x.x / 0.0.0; the real engine is 2019.4.41f1), and their blocks are LZ4HC.
  • BundleOffsetTable.bytes and AliasOffsetTable.bytes map a bundle’s name, or its alias, to (fragment index << 32) | offset. Both hold the same 8,059 offsets. The client opens a bundle with AssetBundle.LoadFromFile(fragment, 0, offset).
  • Manifests are text, with [Version], [Directories], [Paths], [Bundles], and [Groups] sections. A bundle line is id,name,crc32,size,pathIds,depIds,downloadModes,alias. The alias is sha256(name without extension) plus the extension, and the 32-hex suffix of a bundle’s name is the MD5 of its bytes. Each manifest has a .version stamp, version,size,crc32, which is where hotUpdateMsg’s fields land.
  • The pack holds exactly the bundles whose downloadModes include 0 (Base): 8,059 of the 36,745 in the gameres manifest (v2342), 539 MB of 3.04 GB. Everything else downloads on demand, by download-mode group.
  • Downloads use <CDN>/hotupdate/com.fun.lastwar.gp/Android/<file>. A manifest is fetched as the ZIP <name>_small_v<version> and CRC-checked against its .version. Bundles are fetched by plain name; the alias is only the on-device file name. On 2026-10-04, HEAD requests returned 200 for a manifest ZIP and for a bundle by name, and 404 for the same bundle by alias.
TLS certificate validation is disabled on the XAssetPro bundle download path, its HttpWebRequest downloader (static-analysis-only). Integrity there rests on the manifest’s CRC-32 alone.

CDN

The client rotates through the fallback bases on retry. The Lua bundle sits at a predictable path under each base (NetworkURLConfig.GetDownloadURL, LWLuaFileUtil):
<app id> is the bundle identifier: com.fun.lastwar.gp for Android, com.lastwar.ios for iOS. The .bz2 is plain bzip2, not ChaCha-wrapped; if a download ever is wrapped (PRB), the client unwraps it first. On disk, the client re-encrypts the bundle as LWLF file version 2, which never affects the CDN payload. Old versions stay hosted: every version probed between 780 and 826 returned HTTP 200 on 2026-10-04. Lua bundle versions seen on 2026-10-04: At the command-catalog level, both live bundles match the 1.0.364 APK. Their differences are debug-only UI modules, a removed diagnostic, and a handful of changed chunks outside Net/. Every request schema goclient uses is identical across all four versions, see Command reference.