Launcher protocol: Difference between revisions

Add SQF2_COUNTRY information
m (Re-uploaded huffman.zip)
(Add SQF2_COUNTRY information)
Line 172: Line 172:
| <tt>SQF_DEH</tt> || <tt>0x40000000</tt> || List of DEHACKED patches loaded by the server.
| <tt>SQF_DEH</tt> || <tt>0x40000000</tt> || List of DEHACKED patches loaded by the server.
|-
|-
| <tt>SQF_EXTENDED_INFO</tt> || <tt>0x80000000</tt> || {{Devfeature|3.1|alpha}} Additional server information, see the table below for more information.
| <tt>SQF_EXTENDED_INFO</tt> || <tt>0x80000000</tt> || {{Devfeature|3.1|alpha-180901-1533}} Additional server information, see the table below for more information.
|}
|}


=== Extended flags ===
=== Extended flags ===
{{Devfeature|3.1|alpha}}
{{Devfeature|3.1|alpha-180901-1533}}
{| class="wikitable"
{| class="wikitable"
! Name || Value || Description
! Name || Value || Description
|-
|-
| <tt>SQF2_PWAD_HASHES</tt> || <tt>0x00000001</tt> || The MD5 hashes of the server's loaded PWADs.
| <tt>SQF2_PWAD_HASHES</tt> || <tt>0x00000001</tt> || The MD5 hashes of the server's loaded PWADs.
|-
| <tt>SQF2_COUNTRY</tt> || <tt>0x00000002</tt> || The server's ISO 3166-1 alpha-3 country code.
|}
|}


Line 198: Line 200:
|Long || Time || Current time, this will be sent back to you so you can determine ping.
|Long || Time || Current time, this will be sent back to you so you can determine ping.
|-
|-
|Long || Flags2 || {{Devfeature|3.1|alpha}} The extended information you want. Ensure you specify <tt>SQF_EXTENDED_INFO</tt> in the normal Flags field as well. This field is optional - if this field is not present, its value is inferred to be 0. Older servers will ignore this field.
|Long || Flags2 || {{Devfeature|3.1|alpha-180901-1533}} The extended information you want. Ensure you specify <tt>SQF_EXTENDED_INFO</tt> in the normal Flags field as well. This field is optional - if this field is not present, its value is inferred to be 0. Older servers will ignore this field.
|}
|}


Line 437: Line 439:
| Long
| Long
| <tt>SQF_EXTENDED_INFO</tt>
| <tt>SQF_EXTENDED_INFO</tt>
| {{Devfeature|3.1|alpha}} The flags specifying extended server information you will receive. Check all <tt>SQF2</tt> values against this field.
| {{Devfeature|3.1|alpha-180901-1533}} The flags specifying extended server information you will receive. Check all <tt>SQF2</tt> values against this field.
|-
|-
| Byte
| Byte
| <tt>SQF2_PWAD_HASHES</tt>
| <tt>SQF2_PWAD_HASHES</tt>
| {{Devfeature|3.1|alpha}} The number of hashes sent.
| {{Devfeature|3.1|alpha-180901-1533}} The number of hashes sent.
|-
|-
| String
| String
| <tt>SQF2_PWAD_HASHES</tt>
| <tt>SQF2_PWAD_HASHES</tt>
| {{Devfeature|3.1|alpha}} The hash of the PWAD, sent for each PWAD. The indices are the same as sent in <tt>SQF_PWADS</tt>
| {{Devfeature|3.1|alpha-180901-1533}} The hash of the PWAD, sent for each PWAD. The indices are the same as sent in <tt>SQF_PWADS</tt>
|-
| Byte[3]
| <tt>SQF2_COUNTRY</tt>
| {{Devfeature|3.1|alpha}} The server's ISO 3166-1 alpha-3 country code. This is sent as a raw char array of 3 length, there is no null terminator. Zandronum also has two special values for this field, <tt>XIP</tt> and <tt>XUN</tt>. See [[#Country codes]] below for how to handle this field.
|}
|}


Line 454: Line 460:
== Notes ==
== Notes ==


'''Game modes:''' Game modes are defined as:
=== Game modes ===
 
Game modes are defined as:
     0  GAMEMODE_COOPERATIVE
     0  GAMEMODE_COOPERATIVE
     1  GAMEMODE_SURVIVAL
     1  GAMEMODE_SURVIVAL
Line 472: Line 480:
     15  GAMEMODE_DOMINATION
     15  GAMEMODE_DOMINATION


'''To discuss the protocol, ''' use [http://zandronum.com/forum/index.php this forum and create a new topic].
=== Country codes ===


Happy coding!
Zandronum 3.1 introduces the ability to server hosts to specify the country their server is located in via a new CVAR, <tt>sv_country</tt>. This was introduced to allow hosts to combat the inaccuracies of IP geolocation that launchers rely on. This value is specified to launchers via the new <tt>SQF2_COUNTRY</tt> field, which can have the following values:


* '''an ISO 3166-1 alpha-3 country code.''' Note that Zandronum doesn't validate whether the country code supplied in <tt>sv_country</tt> is a registered country code. If the launcher does not recognise the given code, then it should display a generic "unknown" flag.
* '''the value <tt>XIP</tt>''', which suggests to the launcher that it should attempt IP geolocation to determine the server's country. The default value of <tt>sv_country</tt> will cause it to return this by default, to preserve existing behaviour and make it easier for casual hosts. If geolocation is unsupported, disabled, or fails, then a generic "unknown" flag should be displayed.
* '''the value <tt>XUN</tt>''', in which case the launcher should display a generic "unknown" flag.


Also see {{Issue|3894|Allow servers to present their country to launchers}}.


[[Category:Developers_Articles]]
[[Category:Developers_Articles]]