Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: coin3d on June 11, 2009, 02:28 PM

Title: WC3 Custom Game -> Sending a chat message?
Post by: coin3d on June 11, 2009, 02:28 PM
Hello everybody,

I'm trying to send a chat message via a socket into the chat of a custom game. Therefore I joined the private game of a friend and sniffed a chat package with wireshark, which contained the message "abc":

0xf7, 0x28, 0x0c, 0x00, 0x01, 0x01, 0x02, 0x10, 0x61, 0x62, 0x63, 0x00

Afterwards I created a new game for myself, created a socket in my python script and sent a join packet - and, finally the chat message packet, which worked perfectly. But when I tried to point the script to my friend's ip, the bot just joined and left the channel without saying "abc" - after I left the game, and started the script again, the bot joint the game and sent my friend "abc", but then ONLY to my friend.

To cut a long story short: Has anybody experience with chat messages in custom games, and could help me out? What am I doing wrong?

Thanks!
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: Sveet on June 11, 2009, 09:47 PM
correct me if i'm wrong, but don't you have to send chat to each player in the game? thats how ghost sends the motd/enter message to only 1 person at a time.
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: MysT_DooM on June 12, 2009, 12:33 PM
If W3GS is anything like SCGS than yeah, one would have to send the chat to each person.
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: brew on June 12, 2009, 12:42 PM
Quote from: MysT_DooM on June 12, 2009, 12:33 PM
If W3GS is anything like SCGS than yeah, one would have to send the chat to each person.
Funny you'd say that, i thought it was overwhelmingly obvious there is no SCGS.
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: Perma on June 12, 2009, 01:43 PM
Quote from: Sveet on June 11, 2009, 09:47 PMdon't you have to send chat to each player in the game?

Yes, this is correct as far as I know.
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: MysT_DooM on June 12, 2009, 02:14 PM
Quote from: brew on June 12, 2009, 12:42 PM
Quote from: MysT_DooM on June 12, 2009, 12:33 PM
If W3GS is anything like SCGS than yeah, one would have to send the chat to each person.
Funny you'd say that, i thought it was overwhelmingly obvious there is no SCGS.

wat do you mean
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: coin3d on June 13, 2009, 07:36 AM
You guys are absolutely right, I just tested it - if you send a message, then the message will be sent to each player. But what I still don't understand is:

How can a message be sent to someone, who has no related WC3 (e.g. 6112) port opened? And how does Warcraft get the IP adresses from each player?
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: brew on June 13, 2009, 09:09 AM
I assume it'd get that from the game server.
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: Sveet on June 13, 2009, 12:46 PM
i believe when a player joins the game, a packet is sent to you containing useful information. its up to the client to keep track of the players.
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: Perma on June 15, 2009, 11:24 PM
I could be totally speaking out of my ass here, because I honestly did very little digging at the network level of Warcraft 3 apart from things relating to unit commands, but it was my understanding that in a custom game it is up to the host client to maintain the connections of all of the players and not the game server (which is the case in ladder games).

Meaning the host would be the only one with access to every IP address in the game. I'm not certain on this, though.
Title: Re: WC3 Custom Game -> Sending a chat message?
Post by: Zephyrix on June 17, 2009, 01:37 AM
Lol.
While you are correct Perma, all chat is sent to the host before being forwarded to everyone else.
The reason why only your friend is receiving the chat message is because the packet for sending chat requires a list of player ids which the chat is directed to.