diff --git a/docs/api/monster_index/mount-monster-detail.md b/docs/api/monster_index/mount-monster-detail.md new file mode 100644 index 0000000..7e6faae --- /dev/null +++ b/docs/api/monster_index/mount-monster-detail.md @@ -0,0 +1,148 @@ +# Endpoint: `POST /api/monster-index/mount-monster-detail` + +* **Status:** 🟡 Mock / Skeleton +* **Category:** Monsters (Monster Index, Mount Monster Detail) +* **Related Game Classes (Cpp2IL):** `Ammo.MonsterIndexMountMonsterDetailApi`, `Ammo.MonsterIndexMountMonsterDetailRequest`, `Ammo.MonsterIndexMountMonsterDetailResponse`, `Ammo.MountMonsterModel`, `Ammo.MonsterModel`, `Ammo.MonsterDictionaryMountMonsterDetailScene`, `Ammo.MonsterDictionaryMonsterDetailSceneBase<,>`, `Ammo.MonsterDictionarySceneController`, `Ammo.MountMonsterBuildParam`, `Ammo.CharacterBuilder` (`SimpleMountMonster`) + +--- + +## 📋 Overview +Called when an entry of the mount monster list is opened. The response contains the master data, descriptions, strong and weak stats, default skills, parent monsters for breeding and drop quests. The client builds the detail view, including the 3D model, from it (`MonsterDictionarySceneController.Setup(MountMonsterModel, isSilhouette)`). + +The HTTP method: the API constructor sets a method field of `2`, which I read as POST based on the pattern across all 220 `*Api` classes. The constructor also sets a flag byte of `1`; its meaning is unknown. + +--- + +## 📥 Request (Client ➔ Server) + +### Headers (if special) +```http +Accept: application/msgpack +Accept-Encoding: gzip +Authorization: Bearer +``` + +### Payload Structure +```json +{ "mountMonsterId": 1000001 } +``` + +| Field | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| `mountMonsterId` | `long` | Yes | `mountMonsterId` from the list response | + +--- + +## 📤 Response (Server ➔ Client) + +### Response Headers +```http +Content-Type: application/msgpack +``` + +### Expected Structure (MessagePack map, shown as JSON) +```json +{ + "commonResource": { "subNotifications": [], "badges": [] }, + "mountMonster": { + "mountMonsterId": 1000001, "name": "Test", "indexNo": 1, "monsterId": 1000001, + "iconId": 1000001, "rarity": 1, "mountType": 1, "isDefault": false, "grade": 1, + "sequenceId": 1000001, "longTapSkillId": 0, + "baseHp": 0, "baseSp": 0, "baseAttack": 0, "basePhysicalDefense": 0, "baseMagicalDefense": 0, + "elementalType": 1, "baseElementalPoint": 0, + "hpLevelCoefficient": 1.0, "spLevelCoefficient": 1.0, "attackLevelCoefficient": 1.0, + "physicalDefenseLevelCoefficient": 1.0, "magicalDefenseLevelCoefficient": 1.0, + "elementalPointLevelCoefficient": 1.0, + "hpExpCoefficient": 1.0, "spExpCoefficient": 1.0, "attackExpCoefficient": 1.0, + "physicalDefenseExpCoefficient": 1.0, "magicalDefenseExpCoefficient": 1.0, + "elementalPointExpCoefficient": 1.0, + "minTrainedHpLimit": 0, "maxTrainedHpLimit": 0, + "minTrainedSpLimit": 0, "maxTrainedSpLimit": 0, + "minTrainedAttackLimit": 0, "maxTrainedAttackLimit": 0, + "minTrainedPhysicalDefenseLimit": 0, "maxTrainedPhysicalDefenseLimit": 0, + "minTrainedMagicalDefenseLimit": 0, "maxTrainedMagicalDefenseLimit": 0, + "minTrainedElementalPointLimit": 0, "maxTrainedElementalPointLimit": 0, + "price": 0, "hateId": 0, "playerSkill1Id": 0 + }, + "monster": { + "monsterId": 1000001, "name": "Test", "evolutionStep": 1, "blowRate": 0, + "category": 0, "species": 1, "voiceCategory": 0, + "modelId": 1000001, "motionId": 1000001, "sequenceId": 1000001 + }, + "dropQuests": [], + "descriptions": [ { "text": "Test", "iconType": 1, "isLocked": false } ], + "strongStatusTypes": [2], + "weakStatusTypes": [3], + "defaultPlayerSkills": [], + "rareDefaultPlayerSkills": [], + "defaultPassiveSkills": [], + "parentMountMonsterThumbnails1": [], + "parentMountMonsterThumbnails2": [], + "hasOtherBreedingRecipe": false +} +``` + +| Field | Type | Description / Expected Values | +| :--- | :--- | :--- | +| `mountMonster` | object | `MountMonsterModel`, fields below | +| `monster` | object | `MonsterModel`, fields below. `monsterId` should match `mountMonster.monsterId` | +| `dropQuests` | array | `ModifiedQuestModel[]` (`name`, `type`, `quest`). Deeply nested; `[]` is enough for a mock | +| `descriptions` | array | `MonsterDescriptionModel[]`: `text` (string), `iconType` (int: 1–8 or 100 = `ReserveTempLocked`), `isLocked` (bool) | +| `strongStatusTypes` | array | `MonsterTrainedStatusType[]` as int: 0 None, 1 Random, 2 HP, 3 Attack, 4 PhysicalDefense, 6 MagicalDefense, 7 Element, 8 SP (5 does not exist) | +| `weakStatusTypes` | array | same as `strongStatusTypes` | +| `defaultPlayerSkills` | array | `PlayerSkillModel[]`, very large; `[]` is enough for a mock | +| `rareDefaultPlayerSkills` | array | `PlayerSkillModel[]`; `[]` is enough for a mock | +| `defaultPassiveSkills` | array | `PassiveSkillModel[]`; `[]` is enough for a mock | +| `parentMountMonsterThumbnails1` | array | `MountMonsterThumbnailModel[]`, same structure as in the list endpoint (`mount-monster`): `indexNo` (int), `mountMonsterId` (long), `rarity`, `elementalType`, `mountType`, `grade` (int), `monsterThumbnail` (object with `monsterId`, `name`, `iconId`, `monsterIndexStatus`, `monsterModelId`) | +| `parentMountMonsterThumbnails2` | array | `MountMonsterThumbnailModel[]` | +| `hasOtherBreedingRecipe` | `bool` | Whether further breeding recipes exist | + +**`MountMonsterModel`** + +| Field | Type | Description | +| :--- | :--- | :--- | +| `mountMonsterId` | `long` | ID | +| `name` | `string` | Display name | +| `indexNo` | `int` | Index number | +| `monsterId` | `int` | Reference to `monster.monsterId` | +| `iconId` | `int` | Icon asset `ui/monster/icon/m_{id:D7}` | +| `rarity` | `int` | 0–8 | +| `mountType` | `int` | 0–5 | +| `isDefault` | `bool` | Unknown purpose | +| `grade` | `int` | Grade | +| `sequenceId` | `int` | In initial tests this was equal to the iconId and modelId | +| `longTapSkillId` | `int` | Associated Skill ID | +| `baseHp`, `baseSp`, `baseAttack`, `basePhysicalDefense`, `baseMagicalDefense`, `baseElementalPoint` | `int` | Base values | +| `elementalType` | `int` | 0–6 | +| `hpLevelCoefficient`, `spLevelCoefficient`, `attackLevelCoefficient`, `physicalDefenseLevelCoefficient`, `magicalDefenseLevelCoefficient`, `elementalPointLevelCoefficient` | `float` | Level coefficients | +| `hpExpCoefficient`, `spExpCoefficient`, `attackExpCoefficient`, `physicalDefenseExpCoefficient`, `magicalDefenseExpCoefficient`, `elementalPointExpCoefficient` | `float` | Experience coefficients | +| `minTrainedHpLimit`, `minTrainedSpLimit`, `minTrainedAttackLimit`, `minTrainedPhysicalDefenseLimit`, `minTrainedMagicalDefenseLimit`, `minTrainedElementalPointLimit` | `int` | Lower limits for training | +| `maxTrainedHpLimit`, `maxTrainedSpLimit`, `maxTrainedAttackLimit`, `maxTrainedPhysicalDefenseLimit`, `maxTrainedMagicalDefenseLimit`, `maxTrainedElementalPointLimit` | `int` | Upper limits for training | +| `price`, `hateId`, `playerSkill1Id` | `int` | ❓ | + +**`MonsterModel`** + +| Field | Type | Description | +| :--- | :--- | :--- | +| `monsterId` | `int` | Monster ID | +| `name` | `string` | Display name | +| `evolutionStep` | `int` | Evolution step | +| `blowRate` | `int` | ❓ | +| `category` | `int` | 0 Normal, 1 Rare | +| `species` | `int` | 0 None, 1 Punin, 2 Goblin, 3 Huwamimi, 4 Volk, 5 Mushru, 6 Golem, 7 Pix, 8 Ele, 9 Mananium, 10 Chate, 11 Flolo, 12 Guruda, 13 TheFanatic, 14 Wyrm, 15 Bugreus, 16 Taimai, 17 Gnome, 18 Zeele, 19 Kicklle | +| `voiceCategory` | `int` | `MonsterVoiceCategory` 0–25 (0 None, 1 SmallDragon, 2 Dragon, 3 BigDragon, 4 Cute, 5 Carrac, 6 Bird, 7 Bird2, 8 EvilInsect, 9 Insect, 10 Beast, 11 EvilBeast, 12 Frog, 13 Machine, 14 Golem, 15 Lion, 16 Flower1, 17 Flower2, 18 Sheep, 19 Sea, 20 Fox, 21 Mystery1, 22 Mystery2, 23 Mystery3, 24 Dog, 25 Rat) | +| `modelId` | `int` | Model bundle `character/monster/model/m_{id:D7}` | +| `motionId` | `int` | Animation bundle (see notes) | +| `sequenceId` | `int` | Sequence bundle (see notes) | + +--- + +## 🧠 Reverse Engineering & Implementation Notes +* **Current Mock Behavior:** All fields filled, lists with complex types left empty. The detail view loads. In the test, `mountMonster.iconId`, `monster.modelId`, `motionId` and `sequenceId` were all set to `1000001`. +* **Client Dependencies / Edge Cases:** + * The view loads model, motion and sequence bundles. If one is missing, `Player.log` shows `Unable to open archive file …/StreamingAssets/1/w///` and the game reports "Failed to load". + * Send float fields as real floats and avoid `0` for the coefficients (in case the UI divides by them when it calculates stats). + * For how asset names are resolved, and why missing bundles show up as numeric paths, see `option-monster-detail`. + * HTTP `404` shows a connection-error dialog and the game keeps running; HTTP `200` with an empty or invalid body freezes the game without a crash. + * Invalid or non resolveable asset Ids force a "failed to load asset" error and failback to the main menu. +* **Database Requirements:** Master data per mount monster (stats, skills, parents) and drop quests per monster. \ No newline at end of file diff --git a/docs/api/monster_index/mount-monster.md b/docs/api/monster_index/mount-monster.md new file mode 100644 index 0000000..b0d3976 --- /dev/null +++ b/docs/api/monster_index/mount-monster.md @@ -0,0 +1,90 @@ +# Endpoint: `POST /api/monster-index/mount-monster` + +* **Status:** 🟡 Mock / Skeleton +* **Category:** Monsters (Monster Index, Mount Monsters) +* **Related Game Classes (Cpp2IL):** `Ammo.MonsterIndexMountMonsterApi`, `Ammo.MonsterIndexMountMonsterRequest`, `Ammo.MonsterIndexMountMonsterResponse`, `Ammo.MountMonsterThumbnailModel`, `Ammo.MonsterThumbnailModel`, `Ammo.MonsterDictionaryTopScene` (`d__10`), `Ammo.MonsterDictionaryMonsterSelectSceneBase`, `Ammo.MonsterDictionaryMonsterSelectViewModel` + +--- + +## 📋 Overview +Called when the player opens the "Mount Monster" section of the monster index. The response lists all index entries as thumbnails. The client paginates locally (24 entries per page, `ElementsPerPage = 24`) and sorts and filters on its own. The models implement `IHasRarity`, `IHasElementalType`, `IHasMountType`, `IHasGrade` and `IHasMonsterIndexStatus` for this. + +The HTTP method: the API constructor sets a method field of `2`, which I read as POST based on the pattern across all 220 `*Api` classes. The constructor also sets two flag bytes (`257`); their meaning is unknown. + +--- + +## 📥 Request (Client ➔ Server) + +### Headers (if special) +```http +Accept: application/msgpack +Accept-Encoding: gzip +Authorization: Bearer +``` + +### Payload Structure +No body. `MonsterIndexMountMonsterRequest` has no fields. + +| Field | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| – | – | – | – | + +--- + +## 📤 Response (Server ➔ Client) + +### Response Headers +```http +Content-Type: application/msgpack +``` + +### Expected Structure (MessagePack map, shown as JSON) +```json +{ + "commonResource": { "subNotifications": [], "badges": [] }, + "thumbnails": [ + { + "indexNo": 1, + "mountMonsterId": 1000001, + "rarity": 1, + "elementalType": 1, + "mountType": 1, + "grade": 1, + "monsterThumbnail": { + "monsterId": 1000001, + "name": "Test", + "iconId": 1000001, + "monsterIndexStatus": 4, + "monsterModelId": 1000001 + } + } + ] +} +``` + +| Field | Type | Description / Expected Values | +| :--- | :--- | :--- | +| `thumbnails` | array | `MountMonsterThumbnailModel[]`, one entry per index slot | +| `thumbnails[].indexNo` | `int` | Index number, shown as text (`Int32.ToString`) | +| `thumbnails[].mountMonsterId` | `long` | ID used later for `mount-monster-detail` | +| `thumbnails[].rarity` | `int` | `Rarity` 0–8 (`Star0` … `Star8`) | +| `thumbnails[].elementalType` | `int` | 0 None, 1 Fire, 2 Wind, 3 Thunder, 4 Water, 5 Light, 6 Dark | +| `thumbnails[].mountType` | `int` | 0 None, 1 Strike, 2 Power, 3 Wide, 4 HeavyMagic, 5 RapidMagic | +| `thumbnails[].grade` | `int` | Grade | +| `thumbnails[].monsterThumbnail` | object | `MonsterThumbnailModel` | +| `…monsterThumbnail.monsterId` | `int` | Monster ID | +| `…monsterThumbnail.name` | `string` | Display name | +| `…monsterThumbnail.iconId` | `int` | Icon asset `ui/monster/icon/m_{iconId:D7}` (the bundle must exist locally) | +| `…monsterThumbnail.monsterIndexStatus` | `int` | 0 Unidentified, 1 NewIdentified, 2 Identified, 3 NewObtained, 4 Obtained. `Unidentified` is probalbly shown as a silhouette | +| `…monsterThumbnail.monsterModelId` | `int` | Model ID) | + +--- + +## 🧠 Reverse Engineering & Implementation Notes +* **Current Mock Behavior:** Returns one entry with `iconId: 1000001` (the list loads). +* **Client Dependencies / Edge Cases:** + * An `iconId` without a local bundle leads to "Failed to load. Return to title screen" and, in `Player.log`, to `Unable to open archive file …/StreamingAssets/1/w/…` (observed; `1000001` works). + * The response and `MountMonsterThumbnailModel` both have `UpdateDatabase()`, so entries end up in the client database. `mountMonsterId` should be unique. + * An entry that is not in `thumbnails` does not appear in the game. I did not test how the client copes with very large lists. + * HTTP `404` shows a connection-error dialog and the game keeps running; HTTP `200` with an empty or incomplete body freezes the game without a crash. +* **Database Requirements:** A master table of mount monsters (ordered by `indexNo`) and, per player, the index status (`monsterIndexStatus`). This is a recommendation. \ No newline at end of file diff --git a/docs/api/monster_index/option-monster-detail.md b/docs/api/monster_index/option-monster-detail.md new file mode 100644 index 0000000..6f7df13 --- /dev/null +++ b/docs/api/monster_index/option-monster-detail.md @@ -0,0 +1,141 @@ +# Endpoint: `POST /api/monster-index/option-monster-detail` + +* **Status:** 🟡 Mock / Skeleton (the detail view does not load yet, see notes) +* **Category:** Monsters (Monster Index, Option Monster Detail) +* **Related Game Classes (Cpp2IL):** `Ammo.MonsterIndexOptionMonsterDetailApi`, `Ammo.MonsterIndexOptionMonsterDetailRequest`, `Ammo.MonsterIndexOptionMonsterDetailResponse`, `Ammo.OptionMonsterModel` (getter `Monster`), `Ammo.MonsterModel`, `Ammo.OptionMonsterSkillModel`, `Ammo.MonsterDictionaryOptionMonsterDetailScene`, `Ammo.MonsterDictionarySceneController`, `Ammo.OptionMonsterBuildParam`, `Ammo.MonsterBuildParam`, `Ammo.CharacterBuilder` (`SimpleMonster`), `Ammo.CharacterBuildAssetExtensions` (`MonsterPrefab`, `MonsterCommonSequence`) + +--- + +## 📋 Overview +Called when an entry of the option monster list is opened. The response contains the option monster's master data, the matching `MonsterModel`, drop quests, a description and the option skill. The client builds the 3D model from it (`MonsterDictionarySceneController.Setup(OptionMonsterModel, isSilhouette)`). + +The HTTP method: the API constructor sets a method field of `2`, which I read as POST based on the pattern across all 220 `*Api` classes. The constructor also sets a flag byte of `1`; its meaning is unknown. + +--- + +## 📥 Request (Client ➔ Server) + +### Headers (if special) +```http +Accept: application/msgpack +Accept-Encoding: gzip +Authorization: Bearer +``` + +### Payload Structure +```json +{ "optionMonsterId": 101001610 } +``` + +| Field | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| `optionMonsterId` | `long` | Yes | `optionMonsterId` from the list response | + +--- + +## 📤 Response (Server ➔ Client) + +### Response Headers +```http +Content-Type: application/msgpack +``` + +### Expected Structure (MessagePack map, shown as JSON) +```json +{ + "commonResource": { "subNotifications": [], "badges": [] }, + "optionMonster": { + "optionMonsterId": 101001610, "name": "Test", "indexNo": 1, + "monsterId": 101001610, "iconId": 101001610, "rarity": 1, + "radius": 1.0, "scaleFactor": 1.0, "role": 1, + "price": 0, "baseAttack": 0, "elementalType": 1, "baseElementalPoint": 0, + "baseEvaluation": 0, "optionMonsterSkillId": 1, "hateId": 0, + "optionMonsterAi": { + "optionMonsterAiId": 1, "aiId": 0, "battleRange": 0, + "searchRange": 0, "personalSpace": 0, "fieldOfView": 0 + } + }, + "monster": { + "monsterId": 101001610, "name": "Test", "evolutionStep": 1, "blowRate": 0, + "category": 0, "species": 1, "voiceCategory": 0, + "modelId": 101001610, "motionId": 202000110, "sequenceId": 202000110 + }, + "dropQuests": [], + "description": { "text": "Test", "iconType": 1, "isLocked": false }, + "optionMonsterSkill": { + "optionMonsterSkillId": 1, "name": "Test", "description": "Test", + "attackType": 1, "range": 0, "statuses": [], + "wincePoint": 0, "elementalType1": 1, "elementalType2": 0, "elementalType3": 0, + "attackId": 0, "attackActionIds": [], "additionalEffectIds": [], + "bulletIds": [], "noVanishmentAttackIds": [], + "baseMaxCharge": 0, "baseBreakPoint": 0, "baseAttackPower": 0, + "baseElementalPower1": 0, "baseElementalPower2": 0, "baseElementalPower3": 0, + "baseCoolTime": 0, "additionalEffectBaseValues": [], "additionalEffectBaseDurations": [], + "baseVanishWaitTime": 0.0 + } +} +``` +`202000110` for `motionId` / `sequenceId` is only an **untested** placeholder. All three of its bundles (`seq_list`, `motion_list`, `transition_list`) exist in the asset manifest (see notes). + +| Field | Type | Description / Expected Values | +| :--- | :--- | :--- | +| `optionMonster` | object | `OptionMonsterModel`, fields below | +| `monster` | object | `MonsterModel` (same fields as in `mount-monster-detail`). The client finds it through `optionMonster.monsterId` in its database (see notes) | +| `dropQuests` | array | `ModifiedQuestModel[]`; `[]` is enough for a mock | +| `description` | object | **A single** `MonsterDescriptionModel` (`text`, `iconType`, `isLocked`), not an array | +| `optionMonsterSkill` | object | `OptionMonsterSkillModel`, fields below | + +**`OptionMonsterModel`** + +| Field | Type | Description | +| :--- | :--- | :--- | +| `optionMonsterId` | `long` | ID | +| `name` | `string` | Display name | +| `indexNo` | `int` | Index number | +| `monsterId` | `int` | Key for the `MonsterModel` lookup (not `0`, unique, identical to `monster.monsterId`) | +| `iconId` | `int` | Icon asset | +| `rarity` | `int` | 0–8 | +| `radius`, `scaleFactor` | `float` | Size and scale (`0` makes the model invisible, and triggers a background client error) | +| `role` | `int` | 1 Attacker, 2 Tanker, 3 Healer, 4 Buffer, 5 Debuffer | +| `price`, `baseAttack`, `baseElementalPoint`, `baseEvaluation`, `hateId` | `int` | Values | +| `elementalType` | `int` | 0–6 | +| `optionMonsterSkillId` | `long` | Reference to `optionMonsterSkill.optionMonsterSkillId` | +| `optionMonsterAi` | object | `OptionMonsterAiModel`: `optionMonsterAiId` (long), `aiId`, `battleRange`, `searchRange`, `personalSpace`, `fieldOfView` (all int) | + +**`OptionMonsterSkillModel`** + +| Field | Type | Description | +| :--- | :--- | :--- | +| `optionMonsterSkillId` | `long` | ID | +| `name`, `description` | `string` | Display texts | +| `attackType` | `int` | 0 None, 1 PhysicalAttack, 2 MagicalAttack | +| `range` | `int` | Range | +| `statuses` | array | `OptionMonsterSkillStatusModel[]`. Per entry: `skillId` (long), `limitBreakStep` (int), `additionalEffectValues` (int[]), `maxCharge`, `coolTime`, `attackPower`, `elementalPower1`, `elementalPower2`, `elementalPower3`, `breakPoint` (int), `vanishWaitTime` (float), `additionalEffectDurations` (int[]). How many steps the UI expects is unknown | +| `wincePoint` | `int` | Unknown | +| `elementalType1`, `elementalType2`, `elementalType3` | `int` | 0–6 | +| `attackId` | `int` | Unknown | +| `attackActionIds`, `additionalEffectIds`, `bulletIds`, `noVanishmentAttackIds`, `additionalEffectBaseValues`, `additionalEffectBaseDurations` | `int[]` | `[]` in the mock | +| `baseMaxCharge`, `baseBreakPoint`, `baseAttackPower`, `baseElementalPower1`, `baseElementalPower2`, `baseElementalPower3`, `baseCoolTime` | `int` | Base values | +| `baseVanishWaitTime` | `float` | Base value | + +--- + +## 🧠 Reverse Engineering & Implementation Notes +* **Current Mock Behavior:** All fields set. The response is accepted, but the view still aborts with "Failed to load" because three bundles are missing (see below). +* **Client Dependencies / Edge Cases:** + * **Lookup through the database:** `OptionMonsterModel.Monster` is a getter that searches the client database for `MonsterId == optionMonster.monsterId`. The `monster` object of the response ends up there via `UpdateDatabase()`. Use a unique `monsterId` other than `0`, and restart the game after changing IDs. + * **Which bundles are loaded (from `CharacterBuilder.SimpleMonster`, 🔎):** + + | Field | Bundle name | + | :--- | :--- | + | `monster.modelId` | `character/monster/model/m_{id:D7}` | + | `monster.sequenceId` | `character/enemy/sequence/en_{id:D6}_seq_list` | + | `monster.motionId` | `character/enemy/animation/en_{id:D6}_motion_list` and `…_transition_list` | + | pattern texture | `character/monster/patterntexture/m_ptn_{name}` (no error so far) | + + `D6` is only the minimum width; the IDs are 7 or 9 digits long. + * **Missing bundles:** If a bundle is not listed in the manifest `local_latest_custom_manifest`, `DefaultManifest.GetAssetBundleVersion` returns `name.GetHashCode()` instead of a Hash128 (read from the ISIL). That produces a numeric path such as `StreamingAssets/1/w/-6/13/123133`, while existing bundles live under hex paths such as `b2/be/d1cee40f…`. The client ignores `assetBundleLatestHash` from `boot/asset-bundle` and hard-codes the manifest name `local_latest_custom_manifest` (confirmed from the ISIL). + * HTTP `404` shows a connection-error dialog and the game keeps running; HTTP `200` with an empty or invalid body freezes the game without a crash. + * Invalid or non resolveable asset Ids force a "failed to load asset" error and failback to the main menu. +* **Open Problem:** The model `m_101001610` (and `…611` to `…614`) is listed in the manifest. However, the models of the families 101 to 104 have **no** sequence or motion list under their own ID there. Their real `sequenceId` and `motionId` most likely point to the lists of another monster (inferred from the absence). Which ones is stored in the master data (`MonsterModel`: `ModelId`, `MotionId`, `SequenceId`), not in the manifest. For testing, used random IDs for which `seq_list`, `motion_list` and `transition_list` exist. The loading errors then disappear, but the animation will probably not fit the model (unknown original values). +* **Database Requirements:** Master data per option monster including the `MonsterModel` mapping (`ModelId` / `MotionId` / `SequenceId`) and a skill table with steps. \ No newline at end of file diff --git a/docs/api/monster_index/option-monster.md b/docs/api/monster_index/option-monster.md new file mode 100644 index 0000000..7fa947d --- /dev/null +++ b/docs/api/monster_index/option-monster.md @@ -0,0 +1,82 @@ +# Endpoint: `POST /api/monster-index/option-monster` + +* **Status:** 🟡 Mock / Skeleton +* **Category:** Monsters (Monster Index, Option Monsters) +* **Related Game Classes (Cpp2IL):** `Ammo.MonsterIndexOptionMonsterApi`, `Ammo.MonsterIndexOptionMonsterRequest`, `Ammo.MonsterIndexOptionMonsterResponse`, `Ammo.OptionMonsterThumbnailModel`, `Ammo.MonsterThumbnailModel`, `Ammo.MonsterDictionaryTopScene` (`d__11`), `Ammo.MonsterDictionaryOptionMonsterListScene`, `Ammo.MonsterDictionaryMonsterSelectViewModel` + +--- + +## 📋 Overview +Called when the player opens the "Option Monster" section of the monster index. Structure and behavior match the mount monster list, only the entries have different fields (role instead of rarity, mount type and grade). + +The HTTP method: the API constructor sets a method field of `2`, which I read as POST based on the pattern across all 220 `*Api` classes. The constructor also sets two flag bytes (`257`); their meaning is unknown. + +--- + +## 📥 Request (Client ➔ Server) + +### Headers (if special) +```http +Accept: application/msgpack +Accept-Encoding: gzip +Authorization: Bearer +``` + +### Payload Structure +No body. `MonsterIndexOptionMonsterRequest` has no fields. + +| Field | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| – | – | – | – | + +--- + +## 📤 Response (Server ➔ Client) + +### Response Headers +```http +Content-Type: application/msgpack +``` + +### Expected Structure (MessagePack map, shown as JSON) +```json +{ + "commonResource": { "subNotifications": [], "badges": [] }, + "thumbnails": [ + { + "indexNo": 1, + "optionMonsterId": 101001610, + "elementalType": 1, + "optionMonsterRole": 1, + "monsterThumbnail": { + "monsterId": 101001610, + "name": "Test", + "iconId": 101001610, + "monsterIndexStatus": 4, + "monsterModelId": 101001610 + } + } + ] +} +``` + +| Field | Type | Description / Expected Values | +| :--- | :--- | :--- | +| `thumbnails` | array | `OptionMonsterThumbnailModel[]` | +| `thumbnails[].indexNo` | `int` | Index number | +| `thumbnails[].optionMonsterId` | `long` | ID used for `option-monster-detail` | +| `thumbnails[].elementalType` | `int` | 0 None, 1 Fire, 2 Wind, 3 Thunder, 4 Water, 5 Light, 6 Dark | +| `thumbnails[].optionMonsterRole` | `int` | 1 Attacker, 2 Tanker, 3 Healer, 4 Buffer, 5 Debuffer (starts at **1**; `0` is not a defined value) | +| `thumbnails[].monsterThumbnail` | object | `MonsterThumbnailModel`, identical to the mount monster list: `monsterId` (int), `name` (string), `iconId` (int), `monsterIndexStatus` (int: 0 Unidentified, 1 NewIdentified, 2 Identified, 3 NewObtained, 4 Obtained), `monsterModelId` (int) | + +There is no `rarity`, `mountType` or `grade`. Note that the field is called `optionMonsterRole` here but `role` in the detail response. + +--- + +## 🧠 Reverse Engineering & Implementation Notes +* **Current Mock Behavior:** Returns one entry with `iconId: 101001610`. No error was reported. +* **Client Dependencies / Edge Cases:** + * As with mount monsters, the icon bundle `ui/monster/icon/m_{iconId:D7}` must exist locally. `ui/monster/icon/m_101001610` is listed in the asset manifest. + * `UpdateDatabase()` on the response and on each entry writes into the client database. + * HTTP `404` shows a connection-error dialog and the game keeps running; HTTP `200` with an empty or invalid body freezes the game without a crash. +* **Database Requirements:** A master table of option monsters and, per player, the index status. \ No newline at end of file diff --git a/docs/api/monster_index/top.md b/docs/api/monster_index/top.md new file mode 100644 index 0000000..9897aa9 --- /dev/null +++ b/docs/api/monster_index/top.md @@ -0,0 +1,72 @@ +# Endpoint: `GET /api/monster-index/top` + +* **Status:** 🟡 Mock / Skeleton +* **Category:** Monsters (Monster Index / Dictionary) +* **Related Game Classes (Cpp2IL):** `Ammo.MonsterIndexTopApi`, `Ammo.MonsterIndexTopRequest`, `Ammo.MonsterIndexTopResponse`, `Ammo.MonsterDictionaryTopScene` (`d__5`), `Ammo.MonsterDictionaryTopViewModel`, `Ammo.CommonResourceModel`, `Ammo.BadgeModel`, `Ammo.NetworkManager` + +--- + +## 📋 Overview +Called when the player opens the start page of the monster index. The response has no fields of its own, only the inherited `commonResource` block with badges. Afterwards the scene reads two badges from the local database (`BadgeModel` with `Type == 18` and `Type == 19`), builds `MonsterDictionaryTopViewModel.Setup(mountMonster, optionMonster)` from them and loads the UI `New/Dictionary/UIDictionarySelectMenu`. The two badges most likely belong to the "Mount Monster" and "Option Monster" button. + +--- + +## 📥 Request (Client ➔ Server) + +### Headers (if special) +```http +Accept: application/msgpack +Accept-Encoding: gzip +Authorization: Bearer +``` + +### Payload Structure +No body. `MonsterIndexTopRequest` has no fields. + +| Field | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| – | – | – | – | + +--- + +## 📤 Response (Server ➔ Client) + +### Response Headers +```http +Content-Type: application/msgpack +x-server-time: 1795745291 +AssetBundle-Manifest: local_latest +``` +`x-server-time` is optional. + +### Expected Structure (MessagePack map, shown as JSON) +```json +{ + "commonResource": { + "subNotifications": [], + "badges": [ + { "type": 18, "enable": false, "count": 0 }, + { "type": 19, "enable": false, "count": 0 } + ] + } +} +``` + +| Field | Type | Description / Expected Values | +| :--- | :--- | :--- | +| `commonResource` | object | `CommonResourceModel` | +| `commonResource.subNotifications` | array | `SubNotificationModel[]`. `[]` is enough. Fields: `text` (string), `type` (int, `SubNotificationType`, values), `noticeAt` (DateTime, MessagePack encoding), `param` (string) | +| `commonResource.badges` | array | `BadgeModel[]`. The scene looks up `type` 18 and 19 in it (required, see notes) | +| `commonResource.badges[].type` | `int` | `BadgeType`. 18 and 19 are read. Meaning probably mount / option monster button | +| `commonResource.badges[].enable` | `bool` | Probably an "exclamation mark" badge (`BadgeModel.IsExclamation()`), maybe to show new available entries | +| `commonResource.badges[].count` | `int` | Probably a number badge (`BadgeModel.IsNumber()`) | + +--- + +## 🧠 Reverse Engineering & Implementation Notes +* **Current Mock Behavior:** Returns the map above, i.e. both badges with `enable: false, count: 0`. The client then loads the dictionary menu. +* **Client Dependencies / Edge Cases:** + * With `badges: []` the game froze (observed; `Player.log` showed `Curl error 42: Callback aborted`). It only worked once both badges (18 and 19) were present. The cause is probably a `null` access while building the view model (not proven). + * An empty body, or JSON instead of MessagePack, did not work. + * HTTP `404` shows a connection-error dialog and the game keeps running; HTTP `200` with an empty body freezes the game without a crash. +* **Database Requirements:** Per player, the "new" state of the dictionary entries (drives `enable` / `count` of the two badges). This is a recommendation and cannot be read from the client. \ No newline at end of file diff --git a/progress_img/MonsterPedia_Main.png b/progress_img/MonsterPedia_Main.png new file mode 100644 index 0000000..d884509 Binary files /dev/null and b/progress_img/MonsterPedia_Main.png differ diff --git a/progress_img/MonsterPedia_Mini-Mon.png b/progress_img/MonsterPedia_Mini-Mon.png new file mode 100644 index 0000000..c77c4b1 Binary files /dev/null and b/progress_img/MonsterPedia_Mini-Mon.png differ diff --git a/progress_img/MonsterPedia_Mou-Mon.png b/progress_img/MonsterPedia_Mou-Mon.png new file mode 100644 index 0000000..9739128 Binary files /dev/null and b/progress_img/MonsterPedia_Mou-Mon.png differ diff --git a/progress_img/MonsterPedia_Mou-Mon_MonsterDetail_Parameters.png b/progress_img/MonsterPedia_Mou-Mon_MonsterDetail_Parameters.png new file mode 100644 index 0000000..b9f0c93 Binary files /dev/null and b/progress_img/MonsterPedia_Mou-Mon_MonsterDetail_Parameters.png differ diff --git a/progress_img/MonsterPedia_Mou-Mon_MonsterDetail_Profile.png b/progress_img/MonsterPedia_Mou-Mon_MonsterDetail_Profile.png new file mode 100644 index 0000000..1fdaaa6 Binary files /dev/null and b/progress_img/MonsterPedia_Mou-Mon_MonsterDetail_Profile.png differ diff --git a/serverfiles/routes/__init__.py b/serverfiles/routes/__init__.py index ef8bf8c..9c341a1 100644 --- a/serverfiles/routes/__init__.py +++ b/serverfiles/routes/__init__.py @@ -24,3 +24,5 @@ def register(path: str, handler: Callable) -> None: from . import farm # noqa: E402, F401 from . import data # noqa: E402, F401 from . import misc # noqa: E402, F401 +from . import monster_index + diff --git a/serverfiles/routes/monster_index.py b/serverfiles/routes/monster_index.py new file mode 100644 index 0000000..d493d4b --- /dev/null +++ b/serverfiles/routes/monster_index.py @@ -0,0 +1,145 @@ +"""Handlers for /api/monster-index/* endpoints.""" +from serverfiles import skel + +from . import register + +# Req body: {} +def _monsterIndex_top(q, b): + return { + "commonResource":{ + "subNotifications":[], + "badges":[ + { + "type": 18, "enable": False, "count": 0 + }, + { + "type": 19, "enable": False, "count": 0 + } + ] + } + } + +# Req body: {} +def mountMonster(q, b): + return { + "commonResource":{ + "subNotifications":[], + "badges":[] + }, + "thumbnails": [ # Array of "MonsterThumbnailModel : Model, IHasNameSortStrategyValue, IHasMonsterIndexStatus" + { + "indexNo": 1, # Derived + "mountMonsterId": 1000001, # Derived + "rarity": 1, # Derived + "elementalType": 1, # Derived + "mountType": 1, # Derived + "grade": 1, # Derived + "monsterThumbnail": { + "monsterId": 1000001, + "name": "MockMount", + "iconId": 1000001, + "monsterIndexStatus": 4, + "monsterModelId": 1 + } + } + ] + } + +# Req body: {"mountMonsterId": } +def mountMonsterDetail(q, b): + mount = skel.default("MountMonsterModel") + mount["name"] = "MockMount" + mount["iconId"] = 1000001 + mount["mountMonsterId"] = 1000001 + mount["indexNo"] = 1 + mount["monsterId"] = 1000001 + + monster = skel.default("MonsterModel") + monster["name"] = "MockMonster" + monster["monsterId"] = 1000001 + monster["modelId"] = 1000001 + monster["motionId"] = 1000001 + monster["sequenceId"] = 1000001 + monster["monsterId"] = 1000001 + + MonsterIndexMountMonsterDetailResponse = skel.default("MonsterIndexMountMonsterDetailResponse") + MonsterIndexMountMonsterDetailResponse["mountMonster"] = mount + MonsterIndexMountMonsterDetailResponse["monster"] = monster + MonsterIndexMountMonsterDetailResponse["descriptions"] = [ + { + "text": "Mock description", + "iconType": 1, + "isLocked": False + } + ] + MonsterIndexMountMonsterDetailResponse["strongStatusTypes"] = [2] + MonsterIndexMountMonsterDetailResponse["weakStatusTypes"] = [3] + + MonsterIndexMountMonsterDetailResponse["commonResource"] = { + "subNotifications": [], + "badges": [] + } + + return MonsterIndexMountMonsterDetailResponse + +# Req body: {} +def optionMonster(q, b): + return { + "commonResource":{ + "subNotifications":[], + "badges":[] + }, + "thumbnails": [ # Array of "OptionMonsterThumbnailModel : Model, IHasMonsterIndexStatus, IHasSortFilterTargetModel, IHasMonsterIndexNoSortStrategyValue, IHasOptionMonsterRole, IHasElementalType" + { + "indexNo": 1, + "optionMonsterId": 101001610, + "elementalType": 1, # Derived + "optionMonsterRole": 1, # Derived + "monsterThumbnail": { + "monsterId": 101001610, + "name": "MockMonster", + "iconId": 101001610, + "monsterIndexStatus": 4, + "monsterModelId": 1 + } + } + ] + } + +# Req body: {"optionMonsterId": } +def optionMonsterDetail(q, b): + OptionMonsterModel = skel.default("OptionMonsterModel") + OptionMonsterModel["optionMonsterId"] = 101001610 + OptionMonsterModel["name"] = "MockOptionMonster" + OptionMonsterModel["indexNo"] = 1 + OptionMonsterModel["monsterId"] = 101001610 + OptionMonsterModel["iconId"] = 101001610 + OptionMonsterModel["role"] = 1 + + OptionMonsterModel["scaleFactor"] = 1 + OptionMonsterModel["radius"] = 1 + + MonsterModel = skel.default("MonsterModel") + MonsterModel["name"] = "MockMonster" + MonsterModel["monsterId"] = 101001610 + MonsterModel["modelId"] = 101001610 + MonsterModel["motionId"] = 300800110 # assets/app/external/character/enemy/animation/en_300800110_motion_list.asset + MonsterModel["sequenceId"] = 301500111 # assets/app/external/character/enemy/sequence/en_301500111_seq_list.asset + + MonsterIndexOptionMonsterDetailResponse = skel.default("MonsterIndexOptionMonsterDetailResponse") + MonsterIndexOptionMonsterDetailResponse["optionMonster"] = OptionMonsterModel + MonsterIndexOptionMonsterDetailResponse["monster"] = MonsterModel + MonsterIndexOptionMonsterDetailResponse["commonResource"] = { + "subNotifications": [], + "badges": [] + } + + return MonsterIndexOptionMonsterDetailResponse + +register("/api/monster-index/top", _monsterIndex_top) + +register("/api/monster-index/mount-monster", mountMonster) +register("/api/monster-index/mount-monster-detail", mountMonsterDetail) + +register("/api/monster-index/option-monster", optionMonster) +register("/api/monster-index/option-monster-detail", optionMonsterDetail) \ No newline at end of file diff --git a/serverfiles/server.py b/serverfiles/server.py index f9e6e97..716f518 100644 --- a/serverfiles/server.py +++ b/serverfiles/server.py @@ -89,7 +89,7 @@ def _handle(self): data = msgpack.packb(out, use_bin_type=True) self.send_response(code) self.send_header("Content-Type", "application/msgpack") - if u.path == "/api/quest/enter": + if u.path == "/api/quest/enter" or u.path == "/api/monster-index/top": self.send_header("AssetBundle-Manifest", "local_latest") self.send_header("Content-Length", str(len(data))) self.send_header("x-server-time", str(now()))