Launcher protocol: Difference between revisions

Further corrections to segmented protocol
(Remove remnants of old segmented protocol)
Tag: Source edit
(Further corrections to segmented protocol)
Tag: Source edit
Line 206: Line 206:
|}
|}


The server will respond with one or more packets (depending on if a segmented response was requested and supported by the server), each starting with a Long, which will be one of the following:
The server will respond with one or more datagrams (depending on if a segmented response was requested and supported by the server), each starting with a Long, which will be one of the following:


{| class="wikitable"
{| class="wikitable"
Line 229: Line 229:


==== Segmented protocol response ====
==== Segmented protocol response ====
If you asked for a segmented response, and the server supports it, you'll get:
If you asked for a segmented response, and the server supports it, you'll get in each datagram:


{| class="wikitable"
{| class="wikitable"
! Type||Value||Description
! Type||Value||Description
|-
|-
|Byte  || Segment  || Segment number. If the most significant bit is set, then this is the last segment.
|Byte  || Segment  || Segment number.
|-
|-
|Byte  || NumSegments    || Total number of segments that will be sent.
|Byte  || NumSegments    || Total number of segments that will be sent.
Line 240: Line 240:
|Short  || Offset    || Offset into the full packet this datagram contains.
|Short  || Offset    || Offset into the full packet this datagram contains.
|-
|-
|Short  || Size    || The size of this packet, not including this header.
|Short  || Size    || The size of the segment, not including this header. (The size of the datagram is this value plus 12 bytes.)
|-
|-
|Short  || TotalSize    || Total size of the data to be sent.
|Short  || TotalSize    || Total size of the assembled packet.
|}
|}


The segmented responses contain a full launcher packet split up into multiple segments. To use them, create a buffer of TotalSize bytes, then copy the data from each segment at the given offset.
Following this header, the segmented responses contain a full launcher packet split up into multiple segments. To use them, create a buffer of TotalSize bytes, then copy the data from each segment at the given offset.


=== Packet contents ===
=== Packet contents ===
Line 582: Line 582:
| Long || 35127297 || The fields contained in the response. <tt><nowiki>SQF_NAME|SQF_NUMPLAYERS|SQF_PLAYERDATA|SQF_TESTING_SERVER|SQF_EXTENDED_INFO</nowiki></tt>. Observe how:
| Long || 35127297 || The fields contained in the response. <tt><nowiki>SQF_NAME|SQF_NUMPLAYERS|SQF_PLAYERDATA|SQF_TESTING_SERVER|SQF_EXTENDED_INFO</nowiki></tt>. Observe how:
* <tt>SQF_NUMPLAYERS</tt> was added by the server as we requested <tt>SQF_PLAYERDATA</tt>.
* <tt>SQF_NUMPLAYERS</tt> was added by the server as we requested <tt>SQF_PLAYERDATA</tt>.
* <tt>SQF_EXTENDED_INFO</tt> was added indicating we'll get data from another flag set later in this segment.
* <tt>SQF_EXTENDED_INFO</tt> was added indicating we'll get data from the extended flags.
* <tt>SQF_TEAMINFO_NUMBER</tt> was removed as this is a co-operative server and team information is irrelevant.
* <tt>SQF_TEAMINFO_NUMBER</tt> was removed as this is a co-operative server and team information is irrelevant.
|-
|-
Line 588: Line 588:
|-
|-
| Byte || 1 || From <tt>SQF_NUMPLAYERS</tt>. The number of players online.
| Byte || 1 || From <tt>SQF_NUMPLAYERS</tt>. The number of players online.
|-
| Byte|| 0 || From <tt>SQF_PLAYERDATA</tt>. Whether the team field will be sent for players.
|-
|-
| String || <tt>Alphus</tt> || From <tt>SQF_PLAYERDATA</tt>. The name of the first player in the server.
| String || <tt>Alphus</tt> || From <tt>SQF_PLAYERDATA</tt>. The name of the first player in the server.
Line 607: Line 605:
| String || <tt>downloads/testing/3.2/ZandroDev3.2-230430-1741windows.zip</tt> || From <tt>SQF_TESTING_SERVER</tt>. Path to the testing binary on zandronum.com.
| String || <tt>downloads/testing/3.2/ZandroDev3.2-230430-1741windows.zip</tt> || From <tt>SQF_TESTING_SERVER</tt>. Path to the testing binary on zandronum.com.
|-
|-
| Byte || 1 || From <tt>SQF_EXTENDED_INFO</tt>. The flag set that follows.
| Long || 6 || From <tt>SQF_EXTENDED_INFO</tt>. The fields that follow from the extended flags: <tt><nowiki>SQF2_COUNTRY|SQF2_GAMEMODE_NAME</nowiki></tt>
|-
| Long || 6 || From <tt>SQF_EXTENDED_INFO</tt>. The fields that follow from that set: <tt><nowiki>SQF2_COUNTRY|SQF2_GAMEMODE_NAME</nowiki></tt>
|-
|-
| char[3] || <tt>GBR</tt> || From <tt>SQF2_COUNTRY</tt>. The country code the server presents, as set by sv_country.
| char[3] || <tt>GBR</tt> || From <tt>SQF2_COUNTRY</tt>. The country code the server presents, as set by sv_country.