Valhalla Legends Forums Archive | Battle.net Bot Development | Using In-Game Chat to communicate

AuthorMessageTime
MesiaH
What do you guys think about making our bots join games, and using in-game chat with user datagram protocol to communicate with each other? Sure it would require a second account to be logged in, but surely adding another socket isnt all that hard.. Good idea? bad idea? been done already?
January 15, 2003, 11:23 PM
Moonshine
Why would you need a second account?  In addition, it's already been done. :P
January 15, 2003, 11:56 PM
MesiaH
ud need a second account, because unless u wanna stay in the game the whole time ur on bnet, then youd need one to go in the game, and one to stay in the channel.
January 16, 2003, 12:00 AM
Moonshine
Oh, when you said
[quote]but surely adding another socket isnt all that hard..[/quote]

That implied you just wanted to add the UDP Socket, not another TCP connection to Battle.net as well, so that'd mean you'd need to add two more sockets, not one.  That would be alot of work, I'd just use the existing connection.
January 16, 2003, 12:59 AM
MesiaH
you wouldnt need another udp socket, 2 sockets for tcp, and 1 for udp. 1 udp and tcp will be used for account in the game/on bnet, and the other tcp will be used for the main account staying in the channels.
January 16, 2003, 1:57 AM
iago
You don't have to be logged onto TCP at all to be in a game, as long as you have some way of getting the ip and the port.

It's been done to the extent that skywing can have his bot join and watch a game while remaining in the channel and chatting in both.

Lastly, Please change your sig! It badly hurts this computer to display it :'-(
January 16, 2003, 12:02 PM
MesiaH
lol np
January 16, 2003, 1:15 PM
Spht
Ah good. That signature would really lag these computers at school when I tried viewing it!

Regarding this UDP game discussion, the only reason you'd need Battle.net for joining UDP games would be to acquire the host's IP address and port so that you can transfer data with that person. If you already know the IP and port of the host, then there is really no need for Battle.net.

In SphtBot, I have a /aj command (Aliases.bcp for /autojoin) which looks up the game title on Battle.net then once the IP address and port are returned, it will join the host's game using a UDP socket control.
January 16, 2003, 2:32 PM
iago
[quote]Regarding this UDP game discussion, the only reason you'd need Battle.net for joining UDP games would be to acquire the host's IP address and port so that you can transfer data with that person. If you already know the IP and port of the host, then there is really no need for Battle.net.[/quote]

That's almost exactly what I said :P
January 16, 2003, 4:07 PM
tA-Kane
minus the signature comment, of course  :P
January 16, 2003, 4:13 PM
MesiaH
yes good point, but you would still need to send 0x09 to get that info, then i suppose you could kill the connection to battle.net, but what would happen when u kill the tcp connection to battle.net, and keep the udp connection alive, in the game, and reconnect the tcp socket on the same account?
January 16, 2003, 10:03 PM
tA-Kane
Since the UDP connections are peer-to-peer (that's why when you get disconnected from Battle.net, you can still continue playing the game), the server doesn't receive any game packets from the client, and so the server will "act normal" to you reconnecting to Battle.net while still maintaining a UDP connection.

That's simple logic... use your head  ;)


Since that's a little too easy of an answer, I'll answer in a more obvious way...

1 )TCP Connection is connected
2 )TCP connection sends 0x09
3 )TCP connection receives gamelist
4 )UDP connection sends join request to game's creator (not to battle.net server)
5 )UDP Connection receives join acknowledgement from game's creator
6 )TCP connection sends SID_EXITCHAT and join notification to battle.net server
**purpose of this is so the user appears to be "in the game 'game 1234'" when someone does a /whois or /f l**
7 )TCP connection disconnects
8 )TCP connection reconnects, and logs into same account, while UDP connection is still active
9 )TCP connection is able to send and receive messages, and join channels

You could of course, skip the complexity of steps 6 through 9 by simply... not doing the steps... the end result is the same  ::)
January 17, 2003, 11:26 AM
Arta
Perhaps i'm not following you correctly, but Clients (at least not sexp/star) don't routinely disconnect from Battle.net after you join a game. They stay connected and continue exchanging SID_PING, among other things, until you leave the game. Then they resend SID_ENTERCHAT and SID_JOINCHANNEL after reporting game results. IIRC, clients also resend SID_GETCHANNELLIST, though i really don't know why :)

Addition: It's SID_LEAVECHAT, not SID_EXITCHAT.
January 17, 2003, 11:41 AM
Skywing
[quote] link=board=bot;num=1042687429;start=0#12 date=01/17/03 at 09:41:55]Perhaps i'm not following you correctly, but Clients (at least not sexp/star) don't routinely disconnect from Battle.net after you join a game. They stay connected and continue exchanging SID_PING, among other things, until you leave the game. Then they resend SID_ENTERCHAT and SID_JOINCHANNEL after reporting game results. IIRC, clients also resend SID_GETCHANNELLIST, though i really don't know why :)

Addition: It's SID_LEAVECHAT, not SID_EXITCHAT.[/quote]Yes, but they can get disconnected (server going down, flooding, ...), in which case they'll stay in the game.
January 17, 2003, 3:49 PM
Arta
Yes, that much I followed :)
January 18, 2003, 6:27 AM

Search