Valhalla Legends Forums Archive | Battle.net Bot Development | Battle.net Chat Protocol Issues?

AuthorMessageTime
TheMinistered
Telos and I were working on a socket library for generic use. I was testing it on battle.net using overlapped sockets and I kept running into a problem. Here is some logs:

This is the normal data you should receive from battle.net upon connection. NAME packet, CHANNEL packet, USER packet(s).
[quote]
Connection from [68.47.226.172]

Enter your account name and password.
Use 'anonymous' if you only want to issue queries.

Username: ;i
Password:

2010 NAME ;i
1007 CHANNEL "Public Chat 1"
1001 USER tbd-cokes-king 0000 [SEXP]
1001 USER The-Brethren#2 0010 [CHAT]

...
[/quote]


However, I was experiencing a problem receiving data upon connection. I was not receiving the NAME packet, CHANNEL packet, and some USER packet(s).
[quote]
Connection from [68.47.226.172]

Enter your account name and password.
Use 'anonymous' if you only want to issue queries.

Username: ;i
Password:

1001 USER lsucmlsh 0000 [SEXP]
1001 USER ;i 0010 [CHAT]

...
[/quote]

After becoming extremely frusterated, I went to op [vL] and asked for some help and I got a little here and there. Eventually, I ended up relying on my self to fix the problem.

I determined, after much testing, that WSASend was causing the phenomena with WSARecv.

I was invoking the function like so:
[code]
// send function-prototype
Send(BYTE* lpData, DWORD dwSize);

// example of wrong invokation
char Login[] = "c;i\rxxxx\r";
Send(Login, 10);
[/code]

The problem with the code above, is that it was sending the null terminator along with the data. I can only assume that this caused the problem, because invoking send like so cures the problem:
[code]
// example of right invokation
char Login[] = "c;i\rxxxx\r";
Send(Login, 9);
[/code]

Does anyone know why sending the null terminator causes this phenomena?
April 5, 2004, 4:34 AM
Adron
You should send the null terminator and then packetlog and see if you're getting the right data, or if the null terminator is interpreted by battle.net to do something strange...
April 5, 2004, 5:34 PM
iago
I was also going to suggest packetlogging, preferably with your program. If you need a c++ function to dump out pretty output, let me know, I'll send you mine on aim.
April 5, 2004, 6:08 PM

Search