[PY] HWShell

2 replies [Last post]
ironzorg
User offline. Last seen 13 years 36 weeks ago. Offline
Joined: 2010-07-31
Posts: 1

I've been playing Hedgewars for a few weeks now, and I wanted to know more about the protocol used by the servers. After a few wireshark scans I finally decided to look at the source code and I found the file 'netnewclient.cpp'. Still out of curiosity I netcat'ed to the masterserver and decided to make a little interface that would reproduce a regular client's behaviour in game.

This python shell (put a lot of double quotes around 'shell') connects and auth to the masterserver and allows you to chat with other players online (you can also get an incomplete list of the created rooms).

This script is not meant to be used at all (except if you want an easy way to chat with hw players on the main server), I only did it out of curiosity for the protocol used in hw, and also because I like to share my work Smile You can quit the shell by typing '/quit', and get a list (incomplete) of rooms with '/rooms'. Any other input will be sent to the server as a chat string.

If you have questions about the code, I'll answer them Smile
Thank you.

Download

Cairo
Cairo's picture
User offline. Last seen 1 year 2 weeks ago. Offline
Joined: 2010-07-06
Posts: 198

ironzorg allegedly wrote:

I've been playing Hedgewars for a few weeks now, and I wanted to know more about the protocol used by the servers. After a few wireshark scans I finally decided to look at the source code and I found the file 'netnewclient.cpp'. Still out of curiosity I netcat'ed to the masterserver and decided to make a little interface that would reproduce a regular client's behaviour in game.

This python shell (put a lot of double quotes around 'shell') connects and auth to the masterserver and allows you to chat with other players online (you can also get an incomplete list of the created rooms).

This script is not meant to be used at all (except if you want an easy way to chat with hw players on the main server), I only did it out of curiosity for the protocol used in hw, and also because I like to share my work Smile You can quit the shell by typing '/quit', and get a list (incomplete) of rooms with '/rooms'. Any other input will be sent to the server as a chat string.

If you have questions about the code, I'll answer them Smile
Thank you.

Download


Cool!
Will you keep on producing it?
It would be great to have a chat program without starting Hedgewars. (though I don't know why. It will probably be useful at some point)

Style is spelled style not stile.
Use Dropbox to backup your important goodies!

Koda
Koda's picture
User offline. Last seen 9 weeks 3 hours ago. Offline
Joined: 2008-11-10
Posts: 215

i like this idea
sheepluva implemented something similar and created an irc bot (#hedgewars-lobby)
why don't you work with him to create something powerful that we can use to debug our server?

drop in irc #hedgewars on irc.freenode.net Wink Smiley

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]