1,584
edits
DrinkyBird (talk | contribs) (Remove remnants of old segmented protocol) Tag: Source edit |
DrinkyBird (talk | contribs) (Further corrections to segmented protocol) Tag: Source edit |
||
Line 206: | Line 206: | ||
|} | |} | ||
The server will respond with one or more | 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 | |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 | |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 | |Short || TotalSize || Total size of the assembled packet. | ||
|} | |} | ||
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 | * <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. | ||
|- | |- | ||
| 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. | ||
|- | |- | ||
| 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 | |||
|- | |- | ||
| 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. |