Valhalla Legends Forums Archive | Battle.net Bot Development | 0x101: Unknown Version

AuthorMessageTime
laurion
I'm getting the response 0x101 on my 0x51..I don't know whats wrong with it, take a look..

[code]
Public Sub 0x50()
With PBuffer
.InsertDWORD &H0
.InsertNonNTString "68XIPXES"
.InsertDWORD &HC7
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H360
.InsertDWORD GetSystemDefaultLCID
.InsertDWORD GetSystemDefaultLangID
.InsertNTString "USA"
.InsertNTString "United States"
.SendPacket &H50
End With
End Sub
[/code]
Thanks in advance..
By the way, I'm getting the error on the 0x50, not the 0x51.
June 16, 2003, 1:58 PM
TheMinistered
[code]
Private Const SID_AUTH_INFO as Long = &H50

Public Sub Send0x50(ByVal SocketHandle As Long, ByVal VersionByte As Long)
Set PacketBuffer = New CPacketBuffer
PacketBuffer.InsertDWORD &H0
PacketBuffer.InsertDWORD PacketBuffer.GetDWORD(StrReverse("IX86"))
PacketBuffer.InsertDWORD PacketBuffer.GetDWORD(StrReverse("SEXP"))
PacketBuffer.InsertDWORD VersionByte
PacketBuffer.InsertDWORD &H0
PacketBuffer.InsertDWORD &H0
PacketBuffer.InsertDWORD &H0
PacketBuffer.InsertDWORD GetSystemDefaultLCID
PacketBuffer.InsertDWORD GetSystemDefaultLangID
PacketBuffer.InsertNTString "USA"
PacketBuffer.InsertNTString "United States"
PacketBuffer.SendBNCSPacket SocketHandle, SID_AUTH_INFO
Set PacketBuffer = Nothing
End Sub
[/code]

You should attempt not to hardcode anything...
June 16, 2003, 4:24 PM
TheMinistered
while i'm at it I think I will post a few more gems! :)

[code]
Public Sub Send0x10(ByVal SocketHandle As Long)
Set PacketBuffer = New CPacketBuffer
PacketBuffer.InsertDWORD &H2
PacketBuffer.SendBNLSPacket SocketHandle, &H10
Set PacketBuffer = Nothing
End Sub

Public Sub Send0x0E(ByVal SocketHandle As Long, ByVal BotID As String)
Set PacketBuffer = New CPacketBuffer
PacketBuffer.InsertNTString BotID
PacketBuffer.SendBNLSPacket SocketHandle, &HE
Set PacketBuffer = Nothing
End Sub

Public Sub Send0x0F(ByVal SocketHandle As Long, ByVal ServerCode As Long, ByVal BotPassword As String)
Set PacketBuffer = New CPacketBuffer
PacketBuffer.InsertDWORD BNLSChecksum(BotPassword, ServerCode)
PacketBuffer.SendBNLSPacket SocketHandle, &HF
Set PacketBuffer = Nothing
End Sub
[/code]
June 16, 2003, 4:28 PM
Skywing
[quote author=TheMinistered link=board=17;threadid=1644;start=0#msg12424 date=1055780694]
[code]
Private Const SID_AUTH_INFO as Long = &H50

Public Sub Send0x50(ByVal SocketHandle As Long, ByVal VersionByte As Long)
Set PacketBuffer = New CPacketBuffer
PacketBuffer.InsertDWORD &H0
PacketBuffer.InsertDWORD PacketBuffer.GetDWORD(StrReverse("IX86SEXP"))
PacketBuffer.InsertDWORD VersionByte
PacketBuffer.InsertDWORD &H0
PacketBuffer.InsertDWORD &H0
PacketBuffer.InsertDWORD &H0
PacketBuffer.InsertDWORD GetSystemDefaultLCID
PacketBuffer.InsertDWORD GetSystemDefaultLangID
PacketBuffer.InsertNTString "USA"
PacketBuffer.InsertNTString "United States"
PacketBuffer.SendBNCSPacket SocketHandle, SID_AUTH_INFO
Set PacketBuffer = Nothing
End Sub
[/code]

You should attempt not to hardcode anything...
[/quote]
Err... You just hardcoded the game locale and the country shortname/country name.
June 16, 2003, 4:33 PM
TheMinistered
Yes, I did... that is why I said you should _attempt_ to not hardcode. By the way, your problem is this "68XIPXES" line... check mine for correctness :D
June 16, 2003, 4:36 PM
Arta
[quote author=laurion link=board=17;threadid=1644;start=0#msg12419 date=1055771932]
I'm getting the response 0x101 on my 0x51..I don't know whats wrong with it, take a look..
[/quote]

When does the error occur? If you get SID_AUTH_INFO wrong, you'll never get as far as receiving 0x101 in SID_AUTH_CHECK. Battle.net would just disconnect you, and most likely IPBan too. If you're getting invalid version, your problem will be with SID_AUTH_CHECK, unless you're getting your version byte wrong, which you aren't.
June 16, 2003, 6:33 PM
TheMinistered
I don't *think* that is right arta... I posted wrong code (but edited it later), if you try using the code skywing quoted it will weild undesired results without a socket closure (i *think*)
June 16, 2003, 6:37 PM
Arta
You don't think what's right?
June 16, 2003, 10:40 PM
c0ol
arta is saying that if 0x50 is wrong, you will never get around to recieving 0x51, if you are than ur 0x50 is correct.
June 16, 2003, 11:09 PM
Camel
[quote author=Skywing link=board=17;threadid=1644;start=0#msg12427 date=1055781222]Err... You just hardcoded the game locale and the country shortname/country name.[/quote]
what's wrong with that? blizz would have to decide to ban entire countries for that to become a flaw in one's bot...
i just send random values. iirc, the only time it makes a difference is for /time (unless you join country specific channels)
June 17, 2003, 2:57 AM
Skywing
[quote author=Camel link=board=17;threadid=1644;start=0#msg12480 date=1055818665]
[quote author=Skywing link=board=17;threadid=1644;start=0#msg12427 date=1055781222]Err... You just hardcoded the game locale and the country shortname/country name.[/quote]
what's wrong with that? blizz would have to decide to ban entire countries for that to become a flaw in one's bot...
i just send random values. iirc, the only time it makes a difference is for /time (unless you join country specific channels)
[/quote]What's wrong with that is it sucks for localization purposes to assume English and ignore the user's settings. Not to mention that it changes what languages friends notifications will be sent in.
June 17, 2003, 7:39 AM
laurion
Now I have

[code]
Public Sub 0x50()
With PBuffer
.InsertDWORD &H0
.InsertDWORD PBuffer.GetDWORD(StrReverse("IX86"))
.InsertDWORD PBuffer.GetDWORD(StrReverse("SEXP"))
.InsertDWORD &HC7
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H360
.InsertDWORD GetSystemDefaultLCID
.InsertDWORD GetSystemDefaultLangID
.InsertNTString "USA"
.InsertNTString "United States"
.SendPacket &H50
End With
End Sub
[/code]
and still no luck..
June 17, 2003, 6:30 PM
Camel
[quote author=Skywing link=board=17;threadid=1644;start=0#msg12494 date=1055835554]
Not to mention that it changes what languages friends notifications will be sent in.
[/quote]
perhaps that's a reason to assume it's english?
June 17, 2003, 11:33 PM
iago
Because you think that everybody in the world speaks english?
June 18, 2003, 3:53 AM
Zakath
Wasn't one of the main reasons NBBot was originally created because the CHAT protocol didn't support certain Swedish characters?

In any case, languages can be a big deal. Ask any of the many members of vL and this forum who live on the other side of the big lake from those of us in North America.
June 18, 2003, 4:02 AM
Camel
ah okay it seems i've made a big assumption i shouldnt have
for a chat bot, i entirely agree--the values should be determined based on system settings. however, my bot is a not-for-newbies ops bot. it's critical for many of the functions that it does to work that the strings be in english. for that reason, my bot will always connect to bnet in english. what the end-user sees, however, can be customized (command names, ranks, etc).
June 18, 2003, 4:31 AM
laurion
can someone help me.. -.-
June 18, 2003, 2:19 PM
Arta
Once again, camel is being.. well.. a camel.
June 18, 2003, 4:56 PM
DarkMinion
Skywing is right...hardcoding things can lead to problems.
[code]
void SendAuthInfo(unsigned long dwGame, unsigned char uVersion)
{
   dBuf.add((int)0); //protocol
   dBuf.add((int)'IX86'); //platform
   dBuf.add(dwGame); //game
   dBuf.add((int)uVersion); //game version byte
   dBuf.add((int)0);
   struct sockaddr_in sLocalAddr;
   int iLocalLen = sizeof(sLocalAddr);
   getsockname(sBNET, (struct sockaddr *)&sLocalAddr, &iLocalLen);
   dBuf.add((int)sLocalAddr.sin_addr.s_addr); //dword ip
   TIME_ZONE_INFORMATION Tzi;
   unsigned long dwResult = GetTimeZoneInformation(&Tzi);
   dBuf.add(Tzi.Bias + (dwResult == TIME_ZONE_ID_DAYLIGHT ? Tzi.DaylightBias : 0)); //time zone
   dBuf.add((int)GetUserDefaultLCID()); //language
   dBuf.add((int)GetUserDefaultLangID());
   char szBuffer[0x41];
   GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVCTRYNAME, szBuffer, 0x40);
   dBuf.add(szBuffer);
   GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGCOUNTRY, szBuffer, 0x40);
   dBuf.add(szBuffer);
   SendPacket(SID_AUTH_INFO);
}
[/code]
June 20, 2003, 5:56 PM
K
[quote]Not to mention that it changes what languages friends notifications will be sent in.[/quote]

Really? I can't seem to get mine in anything but english...Am I missing something?

[code]
void CBotBase::SendAuthInfo()
{
   TIME_ZONE_INFORMATION tziInfo;

   char szLocaleBuffer[255];
   char szLocalHost[80];
   
   DWORD dwTzId = GetTimeZoneInformation(&tziInfo);      
   DWORD dwLocalIP = MAKEIPADDRESS(127,0,0,1);
   DWORD dwLangId = MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN);
   DWORD dwLCID = MAKELCID(dwLangId, SORT_GERMAN_PHONE_BOOK);

   if (!gethostname(szLocalHost, sizeof(szLocalHost)))
   {
      LPHOSTENT hLocal = gethostbyname(szLocalHost);
      if (hLocal && hLocal->h_addr_list)
         memcpy(&dwLocalIP, hLocal->h_addr_list[0], 4);
   }
      
   BNCSPacket p;

   p.Command = SID_AUTH_INFO;
   p.dInsert(0);
   p.sInsert("68XI", false);
   p.sInsert(m_product.ProductCode(), false);
   p.dInsert(m_product.VersionByte());
   p.dInsert(0x00);
   p.dInsert(dwLocalIP);

   // Thanks DM, I was wondering why my time information was off by an hour half the time :P
   p.dInsert(tziInfo.Bias + ( dwTzId == TIME_ZONE_ID_DAYLIGHT ? tziInfo.DaylightBias : 0 ) );
   
   p.dInsert(dwLCID);
   p.dInsert(dwLangId);

   GetLocaleInfo(dwLCID, LOCALE_SABBREVCTRYNAME, szLocaleBuffer, sizeof(szLocaleBuffer));
   p.sInsert(szLocaleBuffer, true);

   GetLocaleInfo(dwLCID, LOCALE_SENGCOUNTRY, szLocaleBuffer, sizeof(szLocaleBuffer));
   p.sInsert(szLocaleBuffer, true);

   BNCSManager.Send(p);
}[/code]
June 20, 2003, 7:46 PM
Skywing
The MPQ localeid specifier determines which languages friends notifications about you will be sent in. I know this is kind of backwards (it'd be best if friends notifications were received in the language you specify, instead of sent, but that's how the Battle.net programmer felt like doing it).
June 20, 2003, 9:38 PM
Kp
[quote author=Skywing link=board=17;threadid=1644;start=15#msg12703 date=1056145081]
The MPQ localeid specifier determines which languages friends notifications about you will be sent in. I know this is kind of backwards (it'd be best if friends notifications were received in the language you specify, instead of sent, but that's how the Battle.net programmer felt like doing it).
[/quote]Just don't befriend anyone who speaks a language other than your own and you'll never notice that it's backwards. ;) After all, no one on battle.net speaks a second(/third/fourth) language well enough to talk to people from other countries anyway... *cough*
June 20, 2003, 9:49 PM
K
[quote author=Skywing link=board=17;threadid=1644;start=15#msg12703 date=1056145081]
The MPQ localeid specifier determines which languages friends notifications about you will be sent in.
[/quote]

I'm still seeing friends notifications about my bot in english.
June 20, 2003, 11:41 PM
Skywing
[quote author=K link=board=17;threadid=1644;start=15#msg12705 date=1056152471]
[quote author=Skywing link=board=17;threadid=1644;start=15#msg12703 date=1056145081]
The MPQ localeid specifier determines which languages friends notifications about you will be sent in.
[/quote]

I'm still seeing friends notifications about my bot in english.
[/quote]
Which field did you change? LCID/LangID or MPQ locale?
June 21, 2003, 5:07 AM
K
What is this "MPQ localeid" of which you speak? the DWORD after the product version ?
June 21, 2003, 5:25 AM
Adron
[quote author=Skywing link=board=17;threadid=1644;start=15#msg12703 date=1056145081]
The MPQ localeid specifier determines which languages friends notifications about you will be sent in. I know this is kind of backwards (it'd be best if friends notifications were received in the language you specify, instead of sent, but that's how the Battle.net programmer felt like doing it).
[/quote]

Wow, so people see me join channels in Swedish?
June 21, 2003, 2:56 PM
Skywing
[quote author=Adron link=board=17;threadid=1644;start=15#msg12720 date=1056207416]
[quote author=Skywing link=board=17;threadid=1644;start=15#msg12703 date=1056145081]
The MPQ localeid specifier determines which languages friends notifications about you will be sent in. I know this is kind of backwards (it'd be best if friends notifications were received in the language you specify, instead of sent, but that's how the Battle.net programmer felt like doing it).
[/quote]

Wow, so people see me join channels in Swedish?
[/quote]
Not with Starcraft, which isn't localized like that. IIRC, only Warcraft III sets the MPQ localeid to something other than language neutral.

The MPQ localeid is one of the fields which is always zero for non-Warcraft III games and is nonzero for Warcraft III :)
June 21, 2003, 3:11 PM
Arta
*cough*

BnetDocs.
June 21, 2003, 7:00 PM

Search