Valhalla Legends Forums Archive | Battle.net Bot Development | File transfer and chat protocols

AuthorMessageTime
Xmas-Bob
Sorry for asking this newbie question, but I just can't find out on my own. I want to access bnet using a chat client but the logon sequences and packets described here do not resemble them. Data received from the server is for example :

New connection to europe.battle.net:6112
Send(0x03) for chat client
Answer : (string) Connection from ... Enter your account name etc...
.. somewhen later ...
1018 INFO "This server is hosted by Telia."

What about the logon sequences specified in the docs ? And what are the file transfer specs ?

Thanks a lot for your help !

January 22, 2004, 5:14 PM
iago
There are various ways to connect to the battle.net servers:

The easiest is through chat, which means the first byte you send is 0x03 (or ctrl-c), and you get an ascii protocol. That is the one that you are describing.

If the first byte you send is 0x01 (ctrl-a), it means you want a binary protocol, and things are much more complicated (as outlined in bnetdocs).

If the first byte you send is 0x02 (ctrl-b), it means you want a file transfer protocol, which I know nothing about.
January 22, 2004, 5:27 PM
Spht
[quote author=Xmas-Bob link=board=17;threadid=4846;start=0#msg40656 date=1074791697]
And what are the file transfer specs ?
[/quote]

This documentation Yoni wrote a long time ago should help:
http://www.valhallalegends.com/docs/File Transfer.txt
January 22, 2004, 6:13 PM
Xmas-Bob
Ah great thanks a lot! Where can I find more info on the ASCII protocol for the chat clients ?
January 22, 2004, 8:15 PM
iago
It should be fairly straight forward. Just connect to useast.battle.net (using telnet), hit ctrl-c, and follow the instructions. It should be obvious what the important stuff means, and the rest of the stuff (flags, etc.) aren't important (well, they are, just not critical to understand)

[ Edit by Skywing: Fixed spelling errors in useast.battle.net hostname ]
January 22, 2004, 8:20 PM
Tuberload
[quote author=Xmas-Bob link=board=17;threadid=4846;start=0#msg40689 date=1074802559]
Ah great thanks a lot! Where can I find more info on the ASCII protocol for the chat clients ?
[/quote]

When you connect to battle.net send 0x3 (ctrl-c). You will then be prompted for a username/password. After you logon it should be pretty self explanatory from their. An example:
1005 TALK Tuberload 0010 "Hello, World!"

1005 is the packet ID, TALK is a string version of the ID, Tuberload is the name of the person sending the event, 0010 is the flags of the person, "Hello, World!" is pretty obvious.

Another Example:

1002 JOIN divinemorgan 0000 [D2XP]

[D2XP] is the client type, in this case it is a DiabloII Expansion user.

All packets will look like this, and contain the same pieces give or take a few depending on the packet. Please note that chat clients are restricted to channels starting with "Public Chat". A good example of how to program a chat client in C++ is GreetBot. A google search should find it fairly easily. A java example can be found in this thread: https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=4844;start=0. Just look through until you find iago's examples.

Here soon I will be releasing the first issue of The Bot Creator, which may, or may not help you in creating a bot.
January 22, 2004, 8:26 PM
Xmas-Bob
Okay I read over the source code of another bot from Valhalla Legends and it sends 0x03 and 0x04 to the server.
What does code 0x04 stand for ?
And how about the chat flags etc. where can I find more info on them ?
thanks again for your help guys
January 23, 2004, 4:32 PM
iago
0x04 turns off local echoing. It's good for a bot, but bad for telnet.
January 23, 2004, 5:23 PM
Kp
[quote author=iago link=board=17;threadid=4846;start=0#msg40797 date=1074878621]
It's good for a bot, but bad for telnet.[/quote]

That depends on whether your telnet client is already in local echo mode. ^D turns off remote echo, not local echo. :)
January 23, 2004, 9:23 PM
iago
[quote author=Kp link=board=17;threadid=4846;start=0#msg40820 date=1074892993]
[quote author=iago link=board=17;threadid=4846;start=0#msg40797 date=1074878621]
It's good for a bot, but bad for telnet.[/quote]

That depends on whether your telnet client is already in local echo mode. ^D turns off remote echo, not local echo. :)
[/quote]

Yeah, you're right, I meant remote. And telnet doesn't echo when I'm connected to battle.net, I noticed.
January 23, 2004, 10:52 PM
Skywing
[quote author=iago link=board=17;threadid=4846;start=0#msg40836 date=1074898338]
[quote author=Kp link=board=17;threadid=4846;start=0#msg40820 date=1074892993]
[quote author=iago link=board=17;threadid=4846;start=0#msg40797 date=1074878621]
It's good for a bot, but bad for telnet.[/quote]

That depends on whether your telnet client is already in local echo mode. ^D turns off remote echo, not local echo. :)
[/quote]

Yeah, you're right, I meant remote. And telnet doesn't echo when I'm connected to battle.net, I noticed.
[/quote]
Because Battle.net does not send any telnet protocol commands, that's client-specific.
January 23, 2004, 10:55 PM
Kp
[quote author=Skywing link=board=17;threadid=4846;start=0#msg40837 date=1074898509]Because Battle.net does not send any telnet protocol commands, that's client-specific.[/quote]

To clarify and extend, whether to echo locally is specific to your instance of the application; the default varies depending on what telnet you run. The linux based telnet I use defaults to echo on and line buffering; Win32 telnet defaults to echo off (though at one time I had it turned on) and character mode buffering. Note that even this may vary within the Windows families, as Win9x and Win2k seem to have completely different implementations of telnet relative to each other.
January 23, 2004, 11:44 PM

Search