This handles setting up/closing down connections, voice packets, other steam management stuff.
Reading https://partner.steamgames.com/doc/api may be helpful.
The two primary functions of interest are
void GetSteamData_Packet(DLNRD::SteamSessionLight *SteamSessionLight, DLNRD::SteamSessionMemberLight *SteamSessionMemberLight, uint param_3,uint8_t *data, uint data_len) @141088020
and
SendSteamData_Packet1 @1410B3F58
SendSteamData_Packet2 @1410B58DC
SendSteamData_Packet3 @1410B584C
(the type is stored in the byte at data+6 at this point)
For sending SteamData packets, the send function must be queued as a task in the SteamSession. This is done by SteamSessionLight_Queue_SendSteamMessage @14109cfd0.
For steam callbacks, you want to get the callback functions from the DLNRD::SteamSurveillance class, created by Init_DLNRD::SteamSurveillance @14107b750, and it's accessed by a global pointer at 141da1ab0.
Packet Types
This list is a Work-In-Progress. Underlined types are fully understood.
The functions which handle each type are labeled sendTypeXSteamMessage and readparseTypeXSteamMessage
Prolog for all packets:
char magic[4] = "VRXN";
uint16_t header = 0x584;
uint8_t type
(note this is converted to big endian before sending)
4. SessionPropertyReq
9. SyncSessionMemberRequest1
10. SyncSessionMemberRequest2
- Regularly sent every few frames from the host to the guests
- Contains a byte with the number of players the host sees present the world
- Followed by each player's steam name, separated by 0x7
11. SendHostSearchResponse
12. P2PCommunicationResponse
- First packet sent on start of session communication/initialization
- Doesn't contain any data
13. OnAuthTicket
15. Response sent by guest to type 46 packet
24. SessionProperties
29. StartGame
30. CreateSessionVisibleTask
31. CreateSessionInvisibleTask
34. SyncSessionMemberResponse
- Send as a response to type 10 from the guest to the host
- Contains the number of players that are present in the type 10 packet but NOT present in the guest's world
- If this value is >0 for a certain amount of time, the host will disconnect the guest with a 0xff000020 kickout reason
- A desync detection and prevention measure
35. SearchHostResponse
36. ReceiveRandomNumber
- Response automatically sent to type 12
- optional dword of data
37. SyncSessionMemberRequest3
38. Response packet sent by host upon receiving type 15
42. NotifyLeavePlayer
46. KickOutTask
- Packet requesting that you leave the session
- data = uint32_t //usually 0xff000019
49. Unk2
50. LeaveMember