• Welcome to Valhalla Legends Archive.
 

[0x50] TZ bias, et al

Started by Camel, August 21, 2007, 09:47 AM

Previous topic - Next topic

Camel

Anybody know how to determine TZ bias, LocaleID, LanguageID, Country abbreviation, and Country in Java?

p = new BNCSPacket(BNCSCommandIDs.SID_AUTH_INFO);
p.writeDWord(0); // Protocol ID (0)
p.writeDWord(PlatformIDs.PLATFORM_IX86); // Platform ID (IX86)
p.writeDWord(productID); // Product ID
p.writeDWord(verByte); // Version byte
p.writeDWord("enUS"); // Product language
p.writeDWord(0); // Local IP
p.writeDWord(0xf0); // TZ bias
p.writeDWord(0x409); // Locale ID
p.writeDWord(0x409); // Language ID
p.writeNTString("USA"); // Country abreviation
p.writeNTString("United States"); // Country
p.SendPacket(dos, cs.packetLog);
break;

rabbit

Not sure if it covers everything, but clicky.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Camel

#2
Thanks for the pointer. Got all but locale id/language id so far.

Locale loc = Locale.getDefault();
String prodLang = loc.getLanguage() + loc.getCountry();
int tzBias = TimeZone.getDefault().getOffset(new Date().getTime()) / -60000;
Out.info(this.getClass(), "tzBias=" + tzBias);


p = new BNCSPacket(BNCSCommandIDs.SID_AUTH_INFO);
p.writeDWord(0); // Protocol ID (0)
p.writeDWord(PlatformIDs.PLATFORM_IX86); // Platform ID (IX86)
p.writeDWord(productID); // Product ID
p.writeDWord(verByte); // Version byte
p.writeDWord(prodLang); // Product language
p.writeDWord(0); // Local IP
p.writeDWord(tzBias); // TZ bias
p.writeDWord(0x409); // Locale ID
p.writeDWord(0x409); // Language ID
p.writeNTString(loc.getISO3Country()); // Country abreviation
p.writeNTString(loc.getDisplayCountry()); // Country
p.SendPacket(dos, cs.packetLog);

Chriso

Don't know if this will help but it shows you how to use the TimeZone class:
http://java.sun.com/developer/JDCTechTips/2003/tt1104.html#2