C>S 0x12 SID_LOCALEINFO

Transport Layer:Transmission Control Protocol (TCP)
Application Layer:Battle.net v1 TCP Messages (SID)
Message Id:0x12
Message Name:SID_LOCALEINFO
Direction:Client to Server
Used By:Diablo Retail, Diablo Shareware
Warcraft II BNE
Message Format:
(does not include protocol header)
(FILETIME) System time
(FILETIME) Local time
  (INT32) Timezone bias
  (UINT32) System LCID
  (UINT32) User LCID
  (UINT32) User language ID
  (STRING) Abbreviated language name
  (STRING) Country code
  (STRING) Abbreviated country name
  (STRING) Country name

Remarks

Informs the server of the client's locale information. Much of this functionality has been incorporated into C>S 0x50 SID_AUTH_INFO, and more in-depth remarks can be found there.

These fields can all be retrieved from system calls:

  • System time: GetSystemTime()
  • Local time: GetLocalTime()
  • Timezone bias: Retrieve using TIME_ZONE_INFORMATION structure returned from GetTimeZoneInformation()
    • Depending on whether the return value is TIME_ZONE_ID_STANDARD or TIME_ZONE_ID_DAYLINE, add TZI.Bias + TZI.StandardBias or TZI.Bias + TZI.DaylightBias to get the bias in minutes, where TZI is the returned TIME_ZONE_INFORMATION structure.
    • Alternatively, you may use GetSystemTime(), GetLocalTime(), and SystemTimeToFileTime(): convert both system and local time to FILETIMEs, subtract local time from system time, and divide by 600,000,000 to get the bias in minutes.
  • System LCID: GetSystemDefaultLCID()
  • User LCID: GetUserDefaultLCID()
  • User language ID: GetUserDefaultLangID()
  • Abbreviated language name, country code, abbreviated country name, and country name: GetLocaleInfo() with LCType set to LOCALE_SABBREVLANGNAME (three-letter code), LOCALE_ICOUNTRY (numeric code), LOCALE_SABBREVCTRYNAME (three-letter code), LOCALE_SENGLISHCOUNTRYNAME (English country name) respectively.
| Edited: Anonymous

Comments

Davnit

Official Battle.net servers seem to ignore the timezone bias value here in favor of the explicitly set local time value, at least for the /time command.