Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: RFC Metaserver overhaul
Home

[Freeciv-Dev] Re: RFC Metaserver overhaul

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Cc: Paul Zastoupil <paul@xxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: RFC Metaserver overhaul
From: Paul Zastoupil <paul@xxxxxxxxxxxxx>
Date: Sat, 2 Nov 2002 08:38:07 -0800

On Sat, Nov 02, 2002 at 04:24:52PM +0000, Vasco Alexandre Da Silva Costa wrote:
> On Fri, 1 Nov 2002, Paul Zastoupil wrote:
> 
> > I think the metaserver needs a complete overhaul.
> >
> > I propose that the new metaserver consist of purely HTTP calls.
> >
> > The server will use POSTs and the client will issue GETs.
> >
> > I volunteer my time to write the actual metaserver on the freeciv
> > website.  But before I start I would like to have some input as well as
> > some people willing to help with the new client and server code.
> >
> > As for the input, I want to build this protocol so its easily extensable.
> > It would be nice to be able to tie this in with any future player
> > authentication so we can support things like friends lists.  What else
> > would be nice?
> >
> > What information needs to be sent from the server to the metaserver?
> > How often should the server update itself in the metaserver?  How does the
> 
> The server should send updates any time the previous information sent is
> invalid. i.e.:
> 
> * After boot.
> * Every turn.
> * Everytime game status changes.
> * Everytime someone changes a server variable.
> * Everytime someone changes the comment.
> * Everytime a player is created, destroyed, set to computer or human
>   control, connects or disconnects .
> 
> Since this may cause too many updates to be sent we could make the server
> only send updates at most every 5 seconds or so.

This would be nice.

> 
> I do not expect the size of the data sent per update to be larger than
> 2-4KB.
> 
> > metaserver determine if the server is no longer there?  What information
> 
> Since the metaserver will know the server host and port why not make it
> try to connect a socket to it every minute or so to check if its there or
> not?

Well, this is slightly more complicated.  This can't be done with only
HTTP.  If we set a maximum time between updates (as well as a minimum
as you mentioned above), and since this will now be TCP, we can assume
a server is gone when its entry has aged over that amount.


> 
> > needs to be available to the client?
> 
> Server name, port, version, status, comment are essential.
> Number of players also is helpful.
> 
> The rest is IMHO optional.
> 
> > Once we have answers to these and any other questions we can get a good
> > idea of the overall design of what we want.
> 
> I propose we format the information from the server to the metaserver
> in XML. Here is a sample of the proposed format minus XML info:
> 
> <metainfo version="1.0">
>   <game name="Freeciv">
>     <server>civserver.freeciv.org</server>
>     <port>5555</port>
> 
>     <version>1.14.0</version>
>     <capability>+1.14.0 conn_info</capability>
> 
>     <status>Running</status>
>     <comment>Come on, join now or never!</comment>
> 
>     <year>4000 BC</year>
> 
>     <options>
>       <option name="xsize" value="80" />
>       <option name="ysize" value="50" />
>       <option name="generator" value="1" />
>       .
>       .
>       .
>     </options>
> 
>     <players number="2">
>       <player>
>               <name>War King</name>
>       <nation>Latvian</nation>
>       <ai>0</ai>
>               <host>h453n2gfd65o835.telia.com</host>
>       </player>
> 
>       <player>
>               <name>HAL 9000</name>
>       <nation>Mordor</nation>
>       <ai>1</ai>
>               <host></host>
>       </player>
>     </players>
>   </game>
> </metainfo>

I really like this XML idea.  It will make the metaserver easily
extensable in the future.

> 
> The <server> tag should really NOT be used. But I do not know how easy it
> will be for the metaserver to lookup the name of the connecting server in
> case we use PHP.

The souce IP will be available to the PHP.  I think we ought to grab
that souce IP and see if the forward lookup for the <server> matches.
If it does, lets use that.  That will allow people, like me, who have a
reverse lookup from their ISP but a different forward.  But this still
leaves an open issue if they are connecting through a proxy.


-- 
Paul Zastoupil


[Prev in Thread] Current Thread [Next in Thread]