• Welcome to Valhalla Legends Archive.
 

WC3 Custom Game -> Sending a chat message?

Started by coin3d, June 11, 2009, 02:28 PM

Previous topic - Next topic

coin3d

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!

Sveet

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.

MysT_DooM

If W3GS is anything like SCGS than yeah, one would have to send the chat to each person.


vb6, something about that combination of numbers and letters is sexy

brew

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.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Perma

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.

MysT_DooM

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


vb6, something about that combination of numbers and letters is sexy

coin3d

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?

brew

I assume it'd get that from the game server.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Sveet

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.

Perma

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.

Zephyrix

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.