Python LobbyServer Rewrite

Discuss the future of Warzone 2100 with us.
gschaden
Greenhorn
Posts: 7
Joined: 04 Nov 2007, 16:53

Python LobbyServer Rewrite

Post by gschaden »

Hi, after a litte discussion on irc I checked out the svn source, and had a look at the lobbyserver.

I rewrote some sections of the code.
* use logging lib for different logging level
* use classes for Game, GameDB
* exception handling, which handles network errors
* StatusPrinter Thread (shows current games every second on the console)

I did some tests with two warzone instances running.

Are there future plans for the server?
* webgui
* telnet interface
* killing games
You do not have the required permissions to view the files attached to this post.
gschaden
Greenhorn
Posts: 7
Joined: 04 Nov 2007, 16:53

Re: Python LobbyServer Rewrite

Post by gschaden »

Here is an updated version

* commandline support
Commands: help, list, kill, info, quit

* decoding to gamestructure
You do not have the required permissions to view the files attached to this post.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Python LobbyServer Rewrite

Post by Buginator »

gschaden wrote:
Are there future plans for the server?
* webgui
* telnet interface
* killing games
First off, nice job!
I am not too sure how frequent the devs look in the forums, so it may be better to submit this either to the patch tracker at https://gna.org/patch/?group=warzone
or the mailing list at https://gna.org/mail/?group=warzone

A webgui would be nice, as would the other things you have listed.
I was thinking maybe implement one of the IRC bots  in #warzone to issue commands to it, like !game would PM people the current game list  (since we lack a real lobby system)  and then some OP commands like !killgame ID or !resetserver to handle server quirks.  But a webgui might be the way to go.

We are also in need of a lobby system that can be run on all the platforms that we support.
The current GUI code in warzone is less than stellar for handling a true lobby system that most people are familiar with, as you can probably tell. :)
and it ends here.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Python LobbyServer Rewrite

Post by DevUrandom »

Voice of the devs:
The initial code you provided was not yet commited, because it was found that it adds much complexity for little gain. Most of us are not really Python pros...

Personal voice:
If you add features like the ones you just posted, try to keep the complexity still low and comment good (they seem to be lacking completely currently...), I see a bright future. :)
gschaden
Greenhorn
Posts: 7
Joined: 04 Nov 2007, 16:53

Re: Python LobbyServer Rewrite

Post by gschaden »

Hi,


I mean the current code is not fault tollerant and complex and it does not work well. We know that because we sometimes get ghost games. Python is a very high level language, and i dont think it would be better to produce more code than necessary.

If there is not that much python know-how, why do you use a python server, and not the c++ version.

And what do you expect me to do now?
gschaden
Greenhorn
Posts: 7
Joined: 04 Nov 2007, 16:53

Re: Python LobbyServer Rewrite

Post by gschaden »

I also had a look at the last commit, it is just a work arround for a problem which only exists, ebecause there is no correct error handling.

And please dont tell me that this patch makes the code easier or more robust. Documentation is rare, and the most important thing the code introduces an other problem. Each ghost game still consumes resources at the server, so you have to restart it from time to time, to free it. 

If you want I can take care of this code, and make it as robust as possible.
Last edited by gschaden on 23 Dec 2007, 03:45, edited 1 time in total.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Python LobbyServer Rewrite

Post by DevUrandom »

Heyhey... No personal attack or anything...

On the comments I made: I just repeated what appeared to be common consensus on IRC...
On the rest: If you can spice it up with some comments, I'd be fine already. Since currently I find it rather hard to figure out what goes on and why...
And whether the last commit to it was a hack or not... I don't know, I didn't care that deeply about this server and neither am I a wizard with Python. I am trying to improve though. :)
Against the C++ one was that it uses Boost, which was to bothersome for the admin to install, iirc.

I'll have a look at your new code with comments, and if I can understand it and it works (which I do not expect otherwise), I'll set it up on the server for some public testing, as Fred suggested.
(Post that on the tracker, please, which makes it easier for us to ... track it.)

//edit:grammar...
Last edited by DevUrandom on 23 Dec 2007, 20:37, edited 1 time in total.
EvilGuru
Regular
Regular
Posts: 615
Joined: 23 Jun 2007, 22:41

Re: Python LobbyServer Rewrite

Post by EvilGuru »

I quite liked the new version. Although saying that I do have quite a good grounding in Python. The replacement, although possibly a little more complex is more extensible than the current one.

On a side note if you think the Python one is complex take a look at the C++ one. Took me a good 10-15 minutes to get my head around it.

Only possible improvement to the updated Python one is using the 'with' clause added in Python 2.5. That should get rid of the @ decorators.

Regards, Freddie.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Python LobbyServer Rewrite

Post by Buginator »

I tried out the newest version last night locally, worked well from what I could tell.

Thanks for the update of the code!
and it ends here.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Python LobbyServer Rewrite

Post by DevUrandom »

I've commited file #3421 and file #3422 in r3139.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Python LobbyServer Rewrite

Post by Buginator »

How hard would it be to keep track of daily stats ?

Something along the lines of # of games played today, # of connection attempts (visitors checking lobby), and things of that nature?

I know Kamaze is trying hard to get python 2.5 installed so we can use your work, but right now, I use it locally, and it is pretty nice! :)
and it ends here.
User avatar
Terminator
Regular
Regular
Posts: 1077
Joined: 05 Aug 2006, 13:46
Location: Ukraine

Re: Python LobbyServer Rewrite

Post by Terminator »

I think there stats is can be : # hosted games for last hour, # of visitors. Current host cannt support more features. If will be more..like users registrations, their ranks, played games.....so than will be more statistics..
Death is the only way out... sh*t Happens !

Russian-speaking Social network Group http://vk.com/warzone2100
Kamaze
Regular
Regular
Posts: 1017
Joined: 30 Jul 2006, 15:23

Re: Python LobbyServer Rewrite

Post by Kamaze »

Buginator wrote: I know Kamaze is trying hard to get python 2.5 installed so we can use your work, but right now, I use it locally, and it is pretty nice! :)
This server will receive a re-setup very soon since some things are broken, including apt-get...
We all have the same heaven, but not the same horizon.