Skip to content

Commit

Permalink
The great GSS-0076 (#46)
Browse files Browse the repository at this point in the history
GSS-0076, type 0x04 is sent before VS matches to communicate to every
user in a room just about every common user data structure of all users
in said room, including themselves. This results in understandably large
packets (roughly 12KiB per player, with presumably up to 4 players).

It is likely that the clubset information is also a common structure,
but not yet seen in a previously documented packet. Once it's seen
again, it will be separated to its own file.

Included is one such example from a 3-player match. Note that
Packetdoc's web interface fails to properly parse/display this file,
likely due to its length.

Type 0x00 appears to be event related, and only contains a timestamp. It
is 23 bytes large. Also included is such an example.

Also took the opportunity to make the common data structures readily
accessible from the sidebar, and link all said structures to an index of
them instead of to each other.
  • Loading branch information
EricChiz committed Jun 11, 2023
1 parent a067b16 commit 67e96e2
Show file tree
Hide file tree
Showing 15 changed files with 191 additions and 50 deletions.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions src/packets/common/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# PangYa Common Data Structures
Many packets reuse the same structures of data, primarily when it comes to
communicating user information and equipment.

By maintaining these structures as separate definitions, when refinements can
be made to the understanding of these data, the change can be reflected in all
packet definitions where they occur.

## Data Structures
* [User Caddie Data](/packets/common/user_caddie_data.ksy)
* [User Character Data](/packets/common/user_character_data.ksy)
* [User Course Record Data](/packets/common/user_course_record_data.ksy)
* [User Course Result Data](/packets/common/user_course_result_data.ksy)
* [User Equipment Data](/packets/common/user_equipment_data.ksy)
* [User Name Data](/packets/common/user_name_data.ksy)
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [User Statistic Data Extension](/packets/common/user_statistic_data_ext.ksy)
35 changes: 35 additions & 0 deletions src/packets/common/ms_systemtime.ksy
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
meta:
id: ms_systemtime
title: MS SYSTEMTIME
encoding: ASCII
endian: le

doc: |
Windows-formatted local system time. For reference, see [the MSDN article on the SYSTEMTIME structure](https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-systemtime).
seq:
- id: ms_year
type: u2
doc: Valid values are 1601 through 30827 (per MSDN).
- id: ms_month
type: u2
doc: Valid values are 1 (January) through 12 (December).
- id: ms_dayofweek
type: u2
doc: Valid values are 0 (Sunday) through 6 (Saturday).
- id: ms_day
type: u2
doc: Valid values are 1 through 31.
- id: ms_hour
type: u2
doc: Valid values are 0 through 23.
- id: ms_minute
type: u2
doc: Valid values are 0 through 59.
- id: ms_second
type: u2
doc: Valid values are 0 through 59.
- id: ms_microsecond
type: u2
doc: Valid values are 0 through 999.
9 changes: 2 additions & 7 deletions src/packets/common/user_caddie_data.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ doc: |
Oft-recurring format for communicating a user's in-game statistics to clients, including:
* [GameService Server 0x004B User Equipment Change Announce](/packets/gameservice/server/004b.ksy)
* [GameService Server 0x0071 User Caddie Roster](/packets/gameservice/server/0071.ksy)
* [GameService Server 0x0076 Room User Data](/packets/gameservice/server/0076.ksy)
If no caddie is specified (`roster_slot_caddie` and `item_id_caddie` are both 0), the remaining fields may contain garbage data.
**See Also**:
* [User Caddie Data](/packets/common/user_caddie_data.ksy)
* [User Character Data](/packets/common/user_character_data.ksy)
* [User Course Record Data](/packets/common/user_course_record_data.ksy)
* [User Course Result Data](/packets/common/user_course_result_data.ksy)
* [User Equipment Data](/packets/common/user_equipment_data.ksy)
* [User Name Data](/packets/common/user_name_data.ksy)
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [Common Data Structures](/packets/common/index.md)
seq:
- id: roster_slot_caddie
Expand Down
9 changes: 2 additions & 7 deletions src/packets/common/user_character_data.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ doc: |
* [Gameservice Server 0x004B User Equipment Announce](/packets/gameservice/server/004b.ksy)
* [Gameservice Server 0x006B Equipment Update Response](/packets/gameservice/server/006b.ksy)
* [Gameservice Server 0x0070 User Character Roster](/packets/gameservice/server/0070.ksy)
* [GameService Server 0x0076 Room User Data](/packets/gameservice/server/0076.ksy)
* [Gameservice Server 0x015E User Information Equipment](/packets/gameservice/server/015e.ksy)
* [Gameservice Server 0x0168 User Information](/packets/gameservice/server/0168.ksy)
**See Also**:
* [User Caddie Data](/packets/common/user_caddie_data.ksy)
* [User Character Data](/packets/common/user_character_data.ksy)
* [User Course Record Data](/packets/common/user_course_record_data.ksy)
* [User Course Result Data](/packets/common/user_course_result_data.ksy)
* [User Equipment Data](/packets/common/user_equipment_data.ksy)
* [User Name Data](/packets/common/user_name_data.ksy)
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [Common Data Structures](/packets/common/index.md)
seq:
- id: item_id_character
Expand Down
9 changes: 2 additions & 7 deletions src/packets/common/user_course_record_data.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ meta:
doc: |
Oft-recurring format for communicating a user's course records to clients, including:
* [GameService Server 0x0045 User Statistics](/packets/gameservice/server/0045.ksy)
* [GameService Server 0x0076 Room User Data](/packets/gameservice/server/0076.ksy)
* [GameService Server 0x015C User Course Records Response](/packets/gameservice/server/015c.ksy)
Its client-side counterpart is [User Course Result Data](/packets/common/user_course_result_data.ksy).
**See Also**:
* [User Caddie Data](/packets/common/user_caddie_data.ksy)
* [User Character Data](/packets/common/user_character_data.ksy)
* [User Course Record Data](/packets/common/user_course_record_data.ksy)
* [User Course Result Data](/packets/common/user_course_result_data.ksy)
* [User Equipment Data](/packets/common/user_equipment_data.ksy)
* [User Name Data](/packets/common/user_name_data.ksy)
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [Common Data Structures](/packets/common/index.md)
seq:
- id: course_id
Expand Down
8 changes: 1 addition & 7 deletions src/packets/common/user_course_result_data.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ doc: |
Its server-side counterpart is [User Course Record Data](/packets/common/user_course_record_data.ksy).
**See Also**:
* [User Caddie Data](/packets/common/user_caddie_data.ksy)
* [User Character Data](/packets/common/user_character_data.ksy)
* [User Course Record Data](/packets/common/user_course_record_data.ksy)
* [User Course Result Data](/packets/common/user_course_result_data.ksy)
* [User Equipment Data](/packets/common/user_equipment_data.ksy)
* [User Name Data](/packets/common/user_name_data.ksy)
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [Common Data Structures](/packets/common/index.md)
seq:
- id: user_stat_strokes
Expand Down
9 changes: 2 additions & 7 deletions src/packets/common/user_equipment_data.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ doc: |
Oft-recurring format for communicating a user's equipment data to clients, including:
* [GameService Server 0x0044 Unknown](/packets/gameservice/server/0044.ksy)
* [GameService Server 0x0072 User Equipment](/packets/gameservice/server/0072.ksy)
* [GameService Server 0x0076 Room User Data](/packets/gameservice/server/0076.ksy)
* [GameService Server 0x0156 User Equipment Response](/packets/gameservice/server/0156.ksy)
**See Also**:
* [User Caddie Data](/packets/common/user_caddie_data.ksy)
* [User Character Data](/packets/common/user_character_data.ksy)
* [User Course Record Data](/packets/common/user_course_record_data.ksy)
* [User Course Result Data](/packets/common/user_course_result_data.ksy)
* [User Equipment Data](/packets/common/user_equipment_data.ksy)
* [User Name Data](/packets/common/user_name_data.ksy)
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [Common Data Structures](/packets/common/index.md)
seq:
- id: roster_slot_caddie
Expand Down
9 changes: 2 additions & 7 deletions src/packets/common/user_name_data.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ meta:
doc: |
Oft-recurring format for communicating a user's display name and guild to clients, including:
* [Gameservice Server 0x0044 Unknown](/packets/gameservice/server/0044.ksy)
* [GameService Server 0x0076 Room User Data](/packets/gameservice/server/0076.ksy)
* [Gameservice Server 0x0157 User Name Response](/packets/gameservice/server/0157.ksy)
**See Also**:
* [User Caddie Data](/packets/common/user_caddie_data.ksy)
* [User Character Data](/packets/common/user_character_data.ksy)
* [User Course Record Data](/packets/common/user_course_record_data.ksy)
* [User Course Result Data](/packets/common/user_course_result_data.ksy)
* [User Equipment Data](/packets/common/user_equipment_data.ksy)
* [User Name Data](/packets/common/user_name_data.ksy)
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [Common Data Structures](/packets/common/index.md)
seq:
- id: room_id
Expand Down
9 changes: 2 additions & 7 deletions src/packets/common/user_statistic_data.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ doc: |
Oft-recurring format for communicating a user's in-game statistics to clients, including:
* [GameService Server 0x0044 Unknown](/packets/gameservice/server/0044.ksy)
* [GameService Server 0x0045 User Statistics](/packets/gameservice/server/0045.ksy)
* [GameService Server 0x0076 Room User Data](/packets/gameservice/server/0076.ksy)
* [GameService Server 0x0158 User Statistics Response](/packets/gameservice/server/0158.ksy)
Occasionally followed by [User Statistic Data Extension](/packets/common/user_statistic_data_ext.ksy)
**See Also**:
* [User Caddie Data](/packets/common/user_caddie_data.ksy)
* [User Character Data](/packets/common/user_character_data.ksy)
* [User Course Record Data](/packets/common/user_course_record_data.ksy)
* [User Course Result Data](/packets/common/user_course_result_data.ksy)
* [User Equipment Data](/packets/common/user_equipment_data.ksy)
* [User Name Data](/packets/common/user_name_data.ksy)
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [Common Data Structures](/packets/common/index.md)
seq:
- id: user_stat_total_strokes
Expand Down
2 changes: 1 addition & 1 deletion src/packets/common/user_statistic_data_ext.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ doc: |
Additional data that comes after some instances of `user_statistic_data`.
**See Also**:
* [User Statistic Data](/packets/common/user_statistic_data.ksy)
* [Common Data Structures](/packets/common/index.md)
seq:
- id: unknown_user_statistic_data_ak
Expand Down
120 changes: 120 additions & 0 deletions src/packets/gameservice/server/0076.ksy
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#pragma.examples gameservice/server 0076
#pragma.parseAs GameserviceServerPacket
---
meta:
id: gameservice_server_0076_room_user_data
title: GameService Server Room User Data
encoding: ASCII
endian: le
imports:
- ../../common/ms_systemtime
- ../../common/pstring
- ../../common/user_caddie_data
- ../../common/user_character_data
- ../../common/user_course_record_data
- ../../common/user_equipment_data
- ../../common/user_name_data
- ../../common/user_statistic_data

doc: |
This packet relays user info for all users once a VS match is launched, or merely timestamp in other modes.
seq:
- id: subtype
type: u1
- id: payload
type:
switch-on: subtype
cases:
0x00: full_payload
0x04: minimal_payload

types:
full_payload:
seq:
- id: user_count
type: u1
- id: user_entry
type: user_entry
repeat: expr
repeat-expr: user_count
minimal_payload:
seq:
- id: unknown_04_a
size: 4
- id: ms_systemtime_04
type: ms_systemtime
user_entry:
seq:
- id: user_name_data
type: user_name_data
- id: user_statistic_data
type: user_statistic_data
- id: user_entry_unknown_a
size: 78
doc: 78 B
- id: user_equipment_data
type: user_equipment_data
- id: user_course_season_data
type: user_course_season_data
repeat: expr
repeat-expr: 12
doc: 12 sets
- id: user_character_data
type: user_character_data
- id: user_caddie_data
type: user_caddie_data
- id: inventory_slot_clubset
type: u4
- id: item_id_clubset
type: u4
- id: user_entry_unknown_c
size: 10
doc: 10 B
- id: user_entry_unknown_d
type: u2
repeat: expr
repeat-expr: 5
doc: 5x 2 B values. Likely club stat upgrades? (Power, Accuracy, Impact, Spin, Curve)
- id: user_entry_unknown_e
size: 62
doc: 62 B
- id: ms_systemtime_01
type: ms_systemtime
- id: user_card_count
type: u1
- id: user_card_data
type: user_card_data
repeat: expr
repeat-expr: user_card_count
user_card_data:
seq:
- id: user_card_unknown_a
type: u4
- id: item_id_card
type: u4
- id: item_id_character
type: u4
- id: inventory_slot_card
type: u4
- id: user_card_unknown_b
type: u4
- id: user_card_unknown_c
type: u4
- id: user_card_unknown_d
type: u4
- id: user_card_unknown_e
size: 32
doc: 32 B
- id: user_card_unknown_f
type: u4
- id: user_card_unknown_g
type: u1
user_course_season_data:
seq:
- id: user_course_record_data
type: user_course_record_data
repeat: expr
repeat-expr: 21
doc: 21 courses

2 changes: 2 additions & 0 deletions src/packets/gameservice/server/index.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ meta:
- '0071'
- '0072'
- '0073'
- '0076'
- '0078'
- '007d'
- '0083'
Expand Down Expand Up @@ -191,6 +192,7 @@ seq:
0x0071: gameservice_server_0071_user_caddie_roster
0x0072: gameservice_server_0072_user_equipment
0x0073: gameservice_server_0073_user_inventory
0x0076: gameservice_server_0076_room_user_data
0x0078: gameservice_server_0078_room_user_ready_state_response
0x007d: gameservice_server_007d_user_team_change_announce
0x0083: gameservice_server_0083_room_invite
Expand Down
3 changes: 3 additions & 0 deletions src/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ <h2>Navigation</h2>
<li><a href="/packets/messageservice/server/index.ksy">Server Packets</a></li>
</ul>
</li>
<li>
<a href="/packets/common/index.md">Common Data Structures</a>
</li>
</ul>
</li>
</ul>
Expand Down

0 comments on commit 67e96e2

Please sign in to comment.