Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</key>
</field>

<flag>
<enum>
<type>int32</type>
<name>EmoteFlags</name>
<options>
Expand All @@ -34,7 +34,7 @@
<option name="shout" value="0x40" />
<option name="laugh" value="0x80" />
</options>
</flag>
</enum>

<field>
<type>EmoteFlags</type>
Expand Down
41 changes: 36 additions & 5 deletions schemas/world/message.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"items": {
"oneOf": [
{ "$ref": "#/$defs/field" },
{ "$ref": "#/$defs/group" }
{ "$ref": "#/$defs/group" },
{ "$ref": "#/$defs/if_chain" }
]
},
"minItems": 1,
Expand All @@ -74,6 +75,11 @@
"type": {
"$ref": "#/$defs/field_type"
},
"as": {
"type": "string",
"description": "Semantic type exposed in the generated struct. The on-wire representation is still `type`; reads/writes cast between the two. Must be a declared enum/flags whose underlying matches `type` OR a declared struct whose layout is equivalent.",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"when": {
"$ref": "#/$defs/condition"
},
Expand All @@ -86,15 +92,17 @@
},
"array": {
"type": "object",
"description": "Marks the field as either a fixed-size array (size) or a dynamic vector sized by a prior field (count_field)",
"description": "Marks the field as a fixed-size array (size), a dynamic vector sized by a prior field (count_field), or an unbounded vector read until the stream is drained (until_end).",
"properties": {
"size": { "type": "integer", "minimum": 1 },
"count_field": { "type": "string" }
"count_field": { "type": "string" },
"until_end": { "const": true }
},
"additionalProperties": false,
"oneOf": [
{ "required": ["size"], "not": { "required": ["count_field"] } },
{ "required": ["count_field"], "not": { "required": ["size"] } }
{ "required": ["size"], "not": { "anyOf": [ { "required": ["count_field"] }, { "required": ["until_end"] } ] } },
{ "required": ["count_field"], "not": { "anyOf": [ { "required": ["size"] }, { "required": ["until_end"] } ] } },
{ "required": ["until_end"], "not": { "anyOf": [ { "required": ["size"] }, { "required": ["count_field"] } ] } }
]
},
"group": {
Expand All @@ -114,6 +122,29 @@
"required": ["type", "fields"],
"additionalProperties": false
},
"if_chain": {
"type": "object",
"description": "if / else-if / else cascade. Branches are evaluated in order; the first `when` that matches selects a body. The optional `else` body runs when none of the branches matched. Semantically identical to a sequence of `group` entries, but the generator emits `if / else if / else` instead of independent `if` blocks (clearer code and one compile-time check per chain).",
"properties": {
"type": { "const": "if_chain" },
"branches": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["when", "fields"],
"additionalProperties": false,
"properties": {
"when": { "$ref": "#/$defs/condition" },
"fields": { "$ref": "#/$defs/fields" }
}
}
},
"else": { "$ref": "#/$defs/fields" }
},
"required": ["type", "branches"],
"additionalProperties": false
},
"value_ref": {
"type": "object",
"description": "Right-hand side of a comparison referring to another prior field (optionally negated with `!`)",
Expand Down
2 changes: 1 addition & 1 deletion schemas/world/packets/cmsg_accept_trade.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"fields": [
{ "name": "unknown", "type": "uint32" }
]
}
}
6 changes: 3 additions & 3 deletions schemas/world/packets/cmsg_activatetaxi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"opcode": "cmsg_activatetaxi",
"direction": "client",
"fields": [
{ "name": "guid", "type": "uint64" },
{ "name": "source_node", "type": "uint32" },
{ "name": "guid", "type": "uint64" },
{ "name": "source_node", "type": "uint32" },
{ "name": "destination_node", "type": "uint32" }
]
}
}
11 changes: 11 additions & 0 deletions schemas/world/packets/cmsg_activatetaxiexpress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Activatetaxiexpress",
"opcode": "cmsg_activatetaxiexpress",
"direction": "client",
"fields": [
{ "name": "guid", "type": "uint64" },
{ "name": "total_cost", "type": "uint32" },
{ "name": "node_count", "type": "uint32" },
{ "name": "nodes", "type": "uint32", "array": {"count_field": "node_count"} }
]
}
2 changes: 1 addition & 1 deletion schemas/world/packets/cmsg_add_friend.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"fields": [
{ "name": "name", "type": "CString" }
]
}
}
2 changes: 1 addition & 1 deletion schemas/world/packets/cmsg_add_ignore.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"fields": [
{ "name": "name", "type": "CString" }
]
}
}
2 changes: 1 addition & 1 deletion schemas/world/packets/cmsg_area_spirit_healer_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"fields": [
{ "name": "guid", "type": "uint64" }
]
}
}
2 changes: 1 addition & 1 deletion schemas/world/packets/cmsg_area_spirit_healer_queue.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"fields": [
{ "name": "guid", "type": "uint64" }
]
}
}
2 changes: 1 addition & 1 deletion schemas/world/packets/cmsg_areatrigger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"fields": [
{ "name": "trigger_id", "type": "uint32" }
]
}
}
4 changes: 2 additions & 2 deletions schemas/world/packets/cmsg_attackswing.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"opcode": "cmsg_attackswing",
"direction": "client",
"fields": [
{ "name": "guid", "type": "uint64" } // todo, guid
{ "name": "guid", "type": "uint64" }
]
}
}
8 changes: 8 additions & 0 deletions schemas/world/packets/cmsg_auction_hello_client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "AuctionHelloClient",
"opcode": "cmsg_auction_hello_client",
"direction": "client",
"fields": [
{ "name": "auctioneer", "type": "uint64" }
]
}
11 changes: 11 additions & 0 deletions schemas/world/packets/cmsg_auction_list_bidder_items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "AuctionListBidderItems",
"opcode": "cmsg_auction_list_bidder_items",
"direction": "client",
"fields": [
{ "name": "auctioneer", "type": "uint64" },
{ "name": "start_from_page", "type": "uint32" },
{ "name": "amount_of_outbid_items", "type": "uint32" },
{ "name": "outbid_item_ids", "type": "uint32", "array": {"count_field": "amount_of_outbid_items"} }
]
}
17 changes: 17 additions & 0 deletions schemas/world/packets/cmsg_auction_list_items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "AuctionListItems",
"opcode": "cmsg_auction_list_items",
"direction": "client",
"fields": [
{ "name": "auctioneer", "type": "uint64" },
{ "name": "list_start_item", "type": "uint32" },
{ "name": "searched_name", "type": "CString" },
{ "name": "minimum_level", "type": "uint8" },
{ "name": "maximum_level", "type": "uint8" },
{ "name": "auction_slot_id", "type": "uint32" },
{ "name": "auction_main_category", "type": "uint32" },
{ "name": "auction_sub_category", "type": "uint32" },
{ "name": "auction_quality", "type": "uint32" },
{ "name": "usable", "type": "uint8" }
]
}
9 changes: 9 additions & 0 deletions schemas/world/packets/cmsg_auction_list_owner_items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "AuctionListOwnerItems",
"opcode": "cmsg_auction_list_owner_items",
"direction": "client",
"fields": [
{ "name": "auctioneer", "type": "uint64" },
{ "name": "list_from", "type": "uint32" }
]
}
10 changes: 10 additions & 0 deletions schemas/world/packets/cmsg_auction_place_bid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "AuctionPlaceBid",
"opcode": "cmsg_auction_place_bid",
"direction": "client",
"fields": [
{ "name": "auctioneer", "type": "uint64" },
{ "name": "auction_id", "type": "uint32" },
{ "name": "price", "type": "uint32" }
]
}
4 changes: 2 additions & 2 deletions schemas/world/packets/cmsg_auction_remove_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"opcode": "cmsg_auction_remove_item",
"direction": "client",
"fields": [
{ "name": "auctioneer", "type": "uint64" }, // todo, guid
{ "name": "auctioneer", "type": "uint64" },
{ "name": "guid", "type": "uint32" }
]
}
}
27 changes: 6 additions & 21 deletions schemas/world/packets/cmsg_auction_sell_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,10 @@
"opcode": "cmsg_auction_sell_item",
"direction": "client",
"fields": [
{
"name": "auctioneer",
"type": "uint64" // guid, todo
},
{
"name": "item",
"type": "uint64" // guid, todo
},
{
"name": "starting_bid",
"type": "uint32"
},
{
"name": "buyout",
"type": "uint32"
},
{
"name": "auction_duration_mins",
"type": "uint32"
}
{ "name": "auctioneer", "type": "uint64" },
{ "name": "item", "type": "uint64" },
{ "name": "starting_bid", "type": "uint32" },
{ "name": "buyout", "type": "uint32" },
{ "name": "auction_duration_mins", "type": "uint32" }
]
}
}
2 changes: 1 addition & 1 deletion schemas/world/packets/cmsg_autobank_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
{ "name": "bag_index", "type": "uint8" },
{ "name": "slot_index", "type": "uint8" }
]
}
}
9 changes: 9 additions & 0 deletions schemas/world/packets/cmsg_autoequip_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "AutoequipItem",
"opcode": "cmsg_autoequip_item",
"direction": "client",
"fields": [
{ "name": "source_bag", "type": "uint8" },
{ "name": "source_slot", "type": "uint8" }
]
}
9 changes: 9 additions & 0 deletions schemas/world/packets/cmsg_autoequip_item_slot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "AutoequipItemSlot",
"opcode": "cmsg_autoequip_item_slot",
"direction": "client",
"fields": [
{ "name": "guid", "type": "uint64" },
{ "name": "destination_slot", "type": "uint8" }
]
}
10 changes: 10 additions & 0 deletions schemas/world/packets/cmsg_autostore_bag_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "AutostoreBagItem",
"opcode": "cmsg_autostore_bag_item",
"direction": "client",
"fields": [
{ "name": "source_bag", "type": "uint8" },
{ "name": "source_slot", "type": "uint8" },
{ "name": "destination_bag", "type": "uint8" }
]
}
9 changes: 9 additions & 0 deletions schemas/world/packets/cmsg_autostore_bank_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "AutostoreBankItem",
"opcode": "cmsg_autostore_bank_item",
"direction": "client",
"fields": [
{ "name": "bag_index", "type": "uint8" },
{ "name": "slot_index", "type": "uint8" }
]
}
8 changes: 8 additions & 0 deletions schemas/world/packets/cmsg_autostore_loot_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "AutostoreLootItem",
"opcode": "cmsg_autostore_loot_item",
"direction": "client",
"fields": [
{ "name": "item_slot", "type": "uint8" }
]
}
8 changes: 8 additions & 0 deletions schemas/world/packets/cmsg_banker_activate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "BankerActivate",
"opcode": "cmsg_banker_activate",
"direction": "client",
"fields": [
{ "name": "guid", "type": "uint64" }
]
}
8 changes: 8 additions & 0 deletions schemas/world/packets/cmsg_battlefield_join.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "BattlefieldJoin",
"opcode": "cmsg_battlefield_join",
"direction": "client",
"fields": [
{ "name": "map", "type": "Map" }
]
}
8 changes: 8 additions & 0 deletions schemas/world/packets/cmsg_battlefield_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "BattlefieldList",
"opcode": "cmsg_battlefield_list",
"direction": "client",
"fields": [
{ "name": "map", "type": "Map" }
]
}
9 changes: 9 additions & 0 deletions schemas/world/packets/cmsg_battlefield_port.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "BattlefieldPort",
"opcode": "cmsg_battlefield_port",
"direction": "client",
"fields": [
{ "name": "map", "type": "Map" },
{ "name": "action", "type": "BattlefieldPortAction" }
]
}
2 changes: 1 addition & 1 deletion schemas/world/packets/cmsg_battlefield_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"name": "BattlefieldStatus",
"opcode": "cmsg_battlefield_status",
"direction": "client"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "BattlegroundPlayerPositionsClient",
"opcode": "cmsg_battleground_player_positions_client",
"direction": "client"
}
8 changes: 8 additions & 0 deletions schemas/world/packets/cmsg_battlemaster_hello.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "BattlemasterHello",
"opcode": "cmsg_battlemaster_hello",
"direction": "client",
"fields": [
{ "name": "guid", "type": "uint64" }
]
}
Loading
Loading