Skip to content

Commit 3a6317b

Browse files
Fahiengtker
authored andcommitted
world: Fix WhoPlayer for vanilla
Use u32 for class and race, and remove party_status (which appears until client v1.8.4).
1 parent d30a0ae commit 3a6317b

File tree

13 files changed

+57
-120
lines changed

13 files changed

+57
-120
lines changed

intermediate_representation.json

Lines changed: 28 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -269776,8 +269776,8 @@
269776269776
},
269777269777
"sizes": {
269778269778
"constant_sized": false,
269779-
"minimum_size": 16,
269780-
"maximum_size": 526
269779+
"minimum_size": 18,
269780+
"maximum_size": 528
269781269781
},
269782269782
"members": [
269783269783
{
@@ -269829,7 +269829,7 @@
269829269829
"data_type": {
269830269830
"data_type_tag": "Enum",
269831269831
"type_name": "Class",
269832-
"integer_type": "U8",
269832+
"integer_type": "U32",
269833269833
"tags": {
269834269834
"version": {
269835269835
"version_type_tag": "world",
@@ -269852,7 +269852,7 @@
269852269852
}
269853269853
}
269854269854
},
269855-
"upcast": false
269855+
"upcast": true
269856269856
},
269857269857
"constant_value": null,
269858269858
"used_as_size_in": null,
@@ -269868,7 +269868,7 @@
269868269868
"data_type": {
269869269869
"data_type_tag": "Enum",
269870269870
"type_name": "Race",
269871-
"integer_type": "U8",
269871+
"integer_type": "U32",
269872269872
"tags": {
269873269873
"version": {
269874269874
"version_type_tag": "world",
@@ -269933,7 +269933,7 @@
269933269933
}
269934269934
}
269935269935
},
269936-
"upcast": false
269936+
"upcast": true
269937269937
},
269938269938
"constant_value": null,
269939269939
"used_as_size_in": null,
@@ -269974,21 +269974,6 @@
269974269974
"used_in_if": false,
269975269975
"tags": {}
269976269976
}
269977-
},
269978-
{
269979-
"struct_member_tag": "Definition",
269980-
"struct_member_content": {
269981-
"name": "party_status",
269982-
"data_type": {
269983-
"data_type_tag": "Integer",
269984-
"integer_type": "U32"
269985-
},
269986-
"constant_value": null,
269987-
"used_as_size_in": null,
269988-
"size_of_fields_before_size": null,
269989-
"used_in_if": false,
269990-
"tags": {}
269991-
}
269992269977
}
269993269978
],
269994269979
"tags": {
@@ -270011,7 +269996,7 @@
270011269996
"file_info": {
270012269997
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
270013269998
"start_position": 1,
270014-
"end_position": 11
269999+
"end_position": 10
270015270000
},
270016270001
"only_has_io_error": false,
270017270002
"has_manual_size_field": false,
@@ -270049,11 +270034,6 @@
270049270034
"is_elseif_flag": false,
270050270035
"enum_part_of_separate_statements": false,
270051270036
"definer_type": "Enum"
270052-
},
270053-
{
270054-
"name": "party_status",
270055-
"is_elseif_flag": false,
270056-
"enum_part_of_separate_statements": false
270057270037
}
270058270038
],
270059270039
"optional": null
@@ -270293,8 +270273,8 @@
270293270273
"tests": [],
270294270274
"file_info": {
270295270275
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
270296-
"start_position": 13,
270297-
"end_position": 23
270276+
"start_position": 12,
270277+
"end_position": 22
270298270278
},
270299270279
"only_has_io_error": false,
270300270280
"has_manual_size_field": false,
@@ -270565,8 +270545,8 @@
270565270545
"tests": [],
270566270546
"file_info": {
270567270547
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
270568-
"start_position": 13,
270569-
"end_position": 23
270548+
"start_position": 12,
270549+
"end_position": 22
270570270550
},
270571270551
"only_has_io_error": false,
270572270552
"has_manual_size_field": false,
@@ -297940,8 +297920,8 @@
297940297920
},
297941297921
"sizes": {
297942297922
"constant_sized": false,
297943-
"minimum_size": 16,
297944-
"maximum_size": 526
297923+
"minimum_size": 18,
297924+
"maximum_size": 528
297945297925
},
297946297926
"members": [
297947297927
{
@@ -297993,7 +297973,7 @@
297993297973
"data_type": {
297994297974
"data_type_tag": "Enum",
297995297975
"type_name": "Class",
297996-
"integer_type": "U8",
297976+
"integer_type": "U32",
297997297977
"tags": {
297998297978
"version": {
297999297979
"version_type_tag": "world",
@@ -298016,7 +297996,7 @@
298016297996
}
298017297997
}
298018297998
},
298019-
"upcast": false
297999+
"upcast": true
298020298000
},
298021298001
"constant_value": null,
298022298002
"used_as_size_in": null,
@@ -298032,7 +298012,7 @@
298032298012
"data_type": {
298033298013
"data_type_tag": "Enum",
298034298014
"type_name": "Race",
298035-
"integer_type": "U8",
298015+
"integer_type": "U32",
298036298016
"tags": {
298037298017
"version": {
298038298018
"version_type_tag": "world",
@@ -298097,7 +298077,7 @@
298097298077
}
298098298078
}
298099298079
},
298100-
"upcast": false
298080+
"upcast": true
298101298081
},
298102298082
"constant_value": null,
298103298083
"used_as_size_in": null,
@@ -298138,21 +298118,6 @@
298138298118
"used_in_if": false,
298139298119
"tags": {}
298140298120
}
298141-
},
298142-
{
298143-
"struct_member_tag": "Definition",
298144-
"struct_member_content": {
298145-
"name": "party_status",
298146-
"data_type": {
298147-
"data_type_tag": "Integer",
298148-
"integer_type": "U32"
298149-
},
298150-
"constant_value": null,
298151-
"used_as_size_in": null,
298152-
"size_of_fields_before_size": null,
298153-
"used_in_if": false,
298154-
"tags": {}
298155-
}
298156298121
}
298157298122
],
298158298123
"tags": {
@@ -298175,7 +298140,7 @@
298175298140
"file_info": {
298176298141
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
298177298142
"start_position": 1,
298178-
"end_position": 11
298143+
"end_position": 10
298179298144
},
298180298145
"only_has_io_error": false,
298181298146
"has_manual_size_field": false,
@@ -298213,11 +298178,6 @@
298213298178
"is_elseif_flag": false,
298214298179
"enum_part_of_separate_statements": false,
298215298180
"definer_type": "Enum"
298216-
},
298217-
{
298218-
"name": "party_status",
298219-
"is_elseif_flag": false,
298220-
"enum_part_of_separate_statements": false
298221298181
}
298222298182
],
298223298183
"optional": null
@@ -298256,8 +298216,8 @@
298256298216
"tests": [],
298257298217
"file_info": {
298258298218
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
298259-
"start_position": 25,
298260-
"end_position": 31
298219+
"start_position": 24,
298220+
"end_position": 30
298261298221
},
298262298222
"only_has_io_error": false,
298263298223
"has_manual_size_field": false,
@@ -298566,8 +298526,8 @@
298566298526
"tests": [],
298567298527
"file_info": {
298568298528
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
298569-
"start_position": 13,
298570-
"end_position": 23
298529+
"start_position": 12,
298530+
"end_position": 22
298571298531
},
298572298532
"only_has_io_error": false,
298573298533
"has_manual_size_field": false,
@@ -298649,8 +298609,8 @@
298649298609
"tests": [],
298650298610
"file_info": {
298651298611
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
298652-
"start_position": 25,
298653-
"end_position": 31
298612+
"start_position": 24,
298613+
"end_position": 30
298654298614
},
298655298615
"only_has_io_error": false,
298656298616
"has_manual_size_field": false,
@@ -298947,8 +298907,8 @@
298947298907
"tests": [],
298948298908
"file_info": {
298949298909
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
298950-
"start_position": 13,
298951-
"end_position": 23
298910+
"start_position": 12,
298911+
"end_position": 22
298952298912
},
298953298913
"only_has_io_error": false,
298954298914
"has_manual_size_field": false,
@@ -299030,8 +298990,8 @@
299030298990
"tests": [],
299031298991
"file_info": {
299032298992
"file_name": "wow_message_parser/wowm/world/social/smsg_who.wowm",
299033-
"start_position": 25,
299034-
"end_position": 31
298993+
"start_position": 24,
298994+
"end_position": 30
299035298995
},
299036298996
"only_has_io_error": false,
299037298997
"has_manual_size_field": false,

wow_message_parser/tests/wireshark/imports.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ static int hf_woww_page_text;
502502
static int hf_woww_page_text_material;
503503
static int hf_woww_party_operation;
504504
static int hf_woww_party_result;
505-
static int hf_woww_party_status;
506505
static int hf_woww_periodic_log;
507506
static int hf_woww_pet;
508507
static int hf_woww_pet_command_state;

wow_message_parser/tests/wireshark/parser.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6507,10 +6507,9 @@
65076507
add_cstring(ptv, &hf_woww_name);
65086508
add_cstring(ptv, &hf_woww_guild);
65096509
ptvcursor_add(ptv, hf_woww_level, 4, ENC_LITTLE_ENDIAN);
6510-
ptvcursor_add(ptv, hf_woww_class, 1, ENC_LITTLE_ENDIAN);
6511-
ptvcursor_add(ptv, hf_woww_race, 1, ENC_LITTLE_ENDIAN);
6510+
ptvcursor_add(ptv, hf_woww_class, 4, ENC_LITTLE_ENDIAN);
6511+
ptvcursor_add(ptv, hf_woww_race, 4, ENC_LITTLE_ENDIAN);
65126512
ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN);
6513-
ptvcursor_add(ptv, hf_woww_party_status, 4, ENC_LITTLE_ENDIAN);
65146513
ptvcursor_pop_subtree(ptv);
65156514
}
65166515
break;

wow_message_parser/tests/wireshark/register.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3022,12 +3022,6 @@
30223022
NULL, HFILL
30233023
}
30243024
},
3025-
{ &hf_woww_party_status,
3026-
{ "Party Status", "woww.party.status",
3027-
FT_UINT32, BASE_HEX_DEC, NULL, 0,
3028-
NULL, HFILL
3029-
}
3030-
},
30313025
{ &hf_woww_periodic_log,
30323026
{ "Periodic Log", "woww.periodic.log",
30333027
FT_UINT8, BASE_HEX_DEC, NULL, 0,

wow_message_parser/wowm/world/social/smsg_who.wowm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ struct WhoPlayer {
22
CString name;
33
CString guild;
44
Level32 level;
5-
Class class;
6-
Race race;
5+
(u32)Class class;
6+
(u32)Race race;
77
Area area;
8-
u32 party_status;
98
} {
109
versions = "1.12";
1110
}

wow_world_messages/src/world/tbc/smsg_who.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::tbc::{
55
Area, Class, Gender, Race, WhoPlayer,
66
};
77

8-
/// Auto generated from the original `wowm` in file [`wow_message_parser/wowm/world/social/smsg_who.wowm:25`](https://github.com/gtker/wow_messages/tree/main/wow_message_parser/wowm/world/social/smsg_who.wowm#L25):
8+
/// Auto generated from the original `wowm` in file [`wow_message_parser/wowm/world/social/smsg_who.wowm:24`](https://github.com/gtker/wow_messages/tree/main/wow_message_parser/wowm/world/social/smsg_who.wowm#L24):
99
/// ```text
1010
/// smsg SMSG_WHO = 0x0063 {
1111
/// u32 listed_players;

wow_world_messages/src/world/tbc/who_player.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::tbc::{
55
Area, Class, Gender, Race,
66
};
77

8-
/// Auto generated from the original `wowm` in file [`wow_message_parser/wowm/world/social/smsg_who.wowm:13`](https://github.com/gtker/wow_messages/tree/main/wow_message_parser/wowm/world/social/smsg_who.wowm#L13):
8+
/// Auto generated from the original `wowm` in file [`wow_message_parser/wowm/world/social/smsg_who.wowm:12`](https://github.com/gtker/wow_messages/tree/main/wow_message_parser/wowm/world/social/smsg_who.wowm#L12):
99
/// ```text
1010
/// struct WhoPlayer {
1111
/// CString name;

wow_world_messages/src/world/vanilla/smsg_who.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::vanilla::{
55
Area, Class, Race, WhoPlayer,
66
};
77

8-
/// Auto generated from the original `wowm` in file [`wow_message_parser/wowm/world/social/smsg_who.wowm:25`](https://github.com/gtker/wow_messages/tree/main/wow_message_parser/wowm/world/social/smsg_who.wowm#L25):
8+
/// Auto generated from the original `wowm` in file [`wow_message_parser/wowm/world/social/smsg_who.wowm:24`](https://github.com/gtker/wow_messages/tree/main/wow_message_parser/wowm/world/social/smsg_who.wowm#L24):
99
/// ```text
1010
/// smsg SMSG_WHO = 0x0063 {
1111
/// u32 listed_players;
@@ -36,7 +36,7 @@ impl SMSG_WHO {
3636
let players = {
3737
let mut players = Vec::with_capacity(listed_players as usize);
3838

39-
let allocation_size = u64::from(listed_players) * 16;
39+
let allocation_size = u64::from(listed_players) * 18;
4040
if allocation_size > crate::errors::MAX_ALLOCATION_SIZE {
4141
return Err(crate::errors::ParseErrorKind::AllocationTooLargeError(allocation_size));
4242
}
@@ -84,7 +84,6 @@ impl crate::Message for SMSG_WHO {
8484
writeln!(s, " class = {};", v.class.as_test_case_value()).unwrap();
8585
writeln!(s, " race = {};", v.race.as_test_case_value()).unwrap();
8686
writeln!(s, " area = {};", v.area.as_test_case_value()).unwrap();
87-
writeln!(s, " party_status = {};", v.party_status).unwrap();
8887

8988
writeln!(s, " }},").unwrap();
9089
}
@@ -109,10 +108,9 @@ impl crate::Message for SMSG_WHO {
109108
crate::util::write_bytes(&mut s, &mut bytes, v.name.len() + 1, "name", " ");
110109
crate::util::write_bytes(&mut s, &mut bytes, v.guild.len() + 1, "guild", " ");
111110
crate::util::write_bytes(&mut s, &mut bytes, 4, "level", " ");
112-
crate::util::write_bytes(&mut s, &mut bytes, 1, "class", " ");
113-
crate::util::write_bytes(&mut s, &mut bytes, 1, "race", " ");
111+
crate::util::write_bytes(&mut s, &mut bytes, 4, "class", " ");
112+
crate::util::write_bytes(&mut s, &mut bytes, 4, "race", " ");
114113
crate::util::write_bytes(&mut s, &mut bytes, 4, "area", " ");
115-
crate::util::write_bytes(&mut s, &mut bytes, 4, "party_status", " ");
116114
writeln!(s, " /* players: WhoPlayer[listed_players] {i} end */").unwrap();
117115
}
118116
writeln!(s, " /* players: WhoPlayer[listed_players] end */").unwrap();

0 commit comments

Comments
 (0)