Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/archive.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "archive/unit.kdl"
44 changes: 44 additions & 0 deletions assets/archive/unit.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
json UnitRecordStats {
doc "Generic hp, atk, def, rec stats for a given unit."

field hp type="u32::int" {
key "hp"
doc "hp of this unit."
}

field atk type="u32::int" {
key "atk"
doc "atk of this unit."
}

field def type="u32::int" {
key "def"
doc "def of this unit."
}

field rec type="u32::int" {
key "rec"
doc "rec of this unit."
}
}

json UnitRecord {
doc """
Server-owned curated unit archive data. This intentionally contains fewer
fields than the official unit MSTs because we should only preserve fields
that we understand and use.
"""

field unit_id type="u32::int" {
key "unit_id"
doc """
Unique identifier for the unit's archive record.
Used to look up this unit when creating player-owned units.
"""
}

field lord_stats type=UnitRecordStats {
key "lord_stats"
doc "Base stats for lord type."
}
}
20 changes: 20 additions & 0 deletions assets/net/handlers.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "../mst/sound.kdl"
import "../mst/first_desc.kdl"
import "../mst/frontier_hunter.kdl"
import "../net/signal_key.kdl"
import "../net/tutorial.kdl"
import "../net/challenge_arena.kdl"
import "../net/guild.kdl"
import "../net/daily_login.kdl"
Expand Down Expand Up @@ -340,6 +341,25 @@ json UserInfoReq {
}
}

json CreateUserReq {
doc "Creates the game user after the tutorial name/starter prompt."

field loginInfo type="[LoginInfoReq]::size(1)" {
key "IKqx1Cn9"
doc "Login information containing user, Gumi Live, device, and handle fields."
}

field selectedElement type="[TutorialSelectedElement]::size(1)" {
key "9u45RGcV"
doc "Starter element selected by the player."
}

field mstRequests type="[MstUrlList]" {
key "KeC10fuL"
doc "MST versions requested by the client."
}
}

json UserInfoResp {
doc "TODO"

Expand Down
8 changes: 8 additions & 0 deletions assets/net/tutorial.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
json TutorialSelectedElement {
doc "Starter element selected during the new-user tutorial."

field element type="u32::str" {
key "Kn51uR4Y"
doc "Selected starter element id sent by the client."
}
}
92 changes: 67 additions & 25 deletions assets/net/user.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -507,26 +507,35 @@ json UserTeamInfo {
}

json UserUnitInfo {
doc "TODO"
doc "Player-owned unit records."

field user_unit_id type="i32::str" {
field user_unit_id type="u32::str" {
key "edy7fq3L"
doc "TODO"
doc """
Unique id attributed to a specific unit of a given user.
Duplicates of the same unit will receive unique user unit ids.
"""
}

field user_id type="str" {
key "h7eY3sAK"
doc "ID of the user for this session."
}

field unit_id type="i32::str" {
field unit_id type="u32::str" {
key "pn16CNah"
doc "TODO"
doc """
Unique identifier for the unit's archive record.
Used to look up this unit in the MST assets.
"""
}

field unit_type_id type="i32::str" {
field unit_type_id type="u32::str" {
key "nBTx56W9"
doc "TODO"
doc """
Specifies the unit type, e.g. Lord, Anima, Breaker, Guardian, or Oracle.
TODO: Figure out which numeric value maps to each type.
"""
}

field unit_lv type="i32::str" {
Expand All @@ -544,82 +553,110 @@ json UserUnitInfo {
doc "TODO"
}

field base_hp type="i32::str" {
field base_hp type="u32::str" {
key "e7DK0FQT"
doc "TODO"
doc """
Current HP stat for this unit before imp/stat-up bonuses.
Includes level-based stat growth because this client passes
base_hp into GameUtils::getUnitHp(base_hp, unit_lv, ...),
which currently returns base_hp unchanged. This suggests the
server is expected to store the unit's level-adjusted normal
HP in this bucket. Naturally, this applies to all base_* stats.
"""
}

field add_hp type="i32::str" {
key "cuIWp89g"
doc "TODO"
}

field ext_hp type="i32::str" {
field ext_hp type="u32::str" {
key "TokWs1B3"
doc "TODO"
doc """
Imp/stat-up HP bucket.
We should cap this against the unit's HP stat-up limit from MST data.
"""
}

field limit_over_hp type="i32::int" {
key "ISj9u5VL"
doc "TODO"
}

field base_atk type="i32::str" {
field base_atk type="u32::str" {
key "67CApcti"
doc "TODO"
doc """
Current ATK stat for this unit before imp/stat-up bonuses.
See base_hp for why base_* stores the unit's level-adjusted normal stats.
"""
}

field add_atk type="i32::str" {
key "RT4CtH5d"
doc "TODO"
}

field ext_atk type="i32::str" {
field ext_atk type="u32::str" {
key "t4m1RH6Y"
doc "TODO"
doc """
Imp/stat-up ATK bucket.
We should cap this against the unit's ATK stat-up limit from MST data.
"""
}

field limit_over_atk type="i32::int" {
key "D6bKH5eV"
doc "TODO"
}

field base_def type="i32::str" {
field base_def type="u32::str" {
key "q08xLEsy"
doc "TODO"
doc """
Current DEF stat for this unit before imp/stat-up bonuses.
See base_hp for why base_* stores the unit's level-adjusted normal stats.
"""
}

field add_def type="i32::str" {
key "GcMD0hy6"
doc "TODO"
}

field ext_def type="i32::str" {
field ext_def type="u32::str" {
key "e6mY8Z0k"
doc "TODO"
doc """
Imp/stat-up DEF bucket.
We should cap this against the unit's DEF stat-up limit from MST data.
"""
}

field limit_over_def type="i32::int" {
key "3CsiQA0h"
doc "TODO"
}

field base_heal type="i32::str" {
field base_rec type="u32::str" {
key "PWXu25cg"
doc "TODO"
doc """
Current REC stat for this unit before imp/stat-up bonuses.
See base_hp for why base_* stores the unit's level-adjusted normal stats.
"""
}

field add_heal type="i32::str" {
field add_rec type="i32::str" {
key "C1HZr3pb"
doc "TODO"
}

field ext_heal type="i32::str" {
field ext_rec type="u32::str" {
key "X6jf8DUw"
doc "TODO"
doc """
Imp/stat-up REC bucket.
We should cap this against the unit's REC stat-up limit from MST data.
"""
}

field limit_over_heal type="i32::int" {
field limit_over_rec type="i32::int" {
key "XJs2rPx0"
doc "TODO"
}
Expand Down Expand Up @@ -787,6 +824,11 @@ json LoginInfoReq { // # TODO: actually support (GumiLiveInfo), as it's not sup
doc "TODO"
}

field unk5 type="i32::str" {
key "37d2Hi5p"
doc "TODO"
}

field device_id type="str" {
key "Ma5GnU0H"
doc "Device advertisement ID (the same as vid in the gumi api login)"
Expand Down
4 changes: 2 additions & 2 deletions src/generators/cpp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ fn generate_json_cxx(
}

let name = struct_field_format(&field.name);
let doc = split_documentation(&field.doc, 0);
let doc = split_documentation(&field.doc, 1);

Ok(format!(
"
{TAB}{doc}
{doc}
{TAB}{datatype} {name};"
))
})
Expand Down
Loading