• Welcome to Valhalla Legends Archive.
 

Using In-Game Chat to communicate

Started by Mesiah / haiseM, January 15, 2003, 05:23 PM

Previous topic - Next topic

Mesiah / haiseM

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?
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Moonshine

#1
Why would you need a second account?  In addition, it's already been done. :P

Mesiah / haiseM

#2
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.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Moonshine

#3
Oh, when you said
Quotebut surely adding another socket isnt all that hard..

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.

Mesiah / haiseM

#4
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.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

iago

#5
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 :'-(
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Mesiah / haiseM

#6
lol np
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Spht

#7
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.

iago

#8
QuoteRegarding 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.

That's almost exactly what I said :P
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


tA-Kane

#9
minus the signature comment, of course  :P
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Mesiah / haiseM

#10
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?
]HighBrow Innovations
Coming soon...

AIM Online Status: 

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  ::)
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

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.

Skywing

#13
Quotelink=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.
Yes, but they can get disconnected (server going down, flooding, ...), in which case they'll stay in the game.

Arta

#14
Yes, that much I followed :)