News:

SimuTranslator
Make Simutrans speak your language.

Multiplayer server protocol?

Started by RichardG, July 06, 2011, 01:04:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RichardG


VS

There's the "nettool" which can be used for querying servers. It's a standalone binary, partially sharing code with Simutrans. I think it's not part of releases, though...?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

RichardG

#2

Dwachs

Parsley, sage, rosemary, and maggikraut.

RichardG

#4

VS

As to the compilation errors, maybe you are missing some files or defines. The project file might be outdated...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

RichardG

#6

Dwachs

Did you try to compile a debug build of nettool? Maybe the release configuration is broken.
Parsley, sage, rosemary, and maggikraut.

RichardG

#8

Dwachs

Quote from: RichardG on July 06, 2011, 08:48:45 PM
But one more issue left... where do I set the "password" nettool uses?
In simuconf.tab (see the file in the svn repo at trunk/simutrans/config/simuconf.tab) or as command line option.
Parsley, sage, rosemary, and maggikraut.

Ashley

Nettool doesn't have the ability to query the gameinfo for a server. I wrote a little python script which can do this by reverse engineering the protocol using the C++ code. It'd be better to build that functionality into Nettool (in case the protocol changes).

One thing to consider is the additional bandwidth drain which continual gameinfo queries would place on servers. Especially if this was generating the image regularly. A gameinfo query isn't an insignificant amount of data primarily due to the image contained within.

I'd recommend you seek the permission of individual server administrators before running such a service against their servers, and determine what the bandwidth usage would be.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

RichardG

#11

Ashley

It's not a terribly complex modification, but it may be better to think about exactly what information is needed for such a purpose and then set up a custom object which can be queried for using Nettool. Most of the Nettool functions are password protected, so maybe we can leave it up to the server admin as to whether this extended query mechanism requires a password or not (or allow it to rate limit the requests or something like that).

So what fields do you need? Currently the gameinfo object contains:


        # 1, xml version, none
        # 2, simutrans version, tag params - version, pak
        # 3, object name (gameinfo_t), none
        # 4, x dimensions of map, i32
        # 5, y dimensions of map, i32
        # 6 - 4101, minimap data (64x64px), i8
        # 4102, no. of industries, i32
        # 4103, no. of tourist attractions, i32
        # 4104, no. of cities, i32
        # 4105, population, i32
        # 4106, number of vehicles, i16
        # 4107, number of stops, i16
        # 4108, total passengers transported, i64
        # 4109, total mail transported, i64
        # 4110, total goods transported, i64
        # 4111, total goods transported, i64
        # 4112, freeplay on/off, bool
        # 4113, timeline on/off, bool
        # 4114, starting money, i64
        # 4115, current year/month  (how is this field represented?), i32
        # 4116, bits per month, i16
        # 4117, language code, CDATA
        # 4118, game comment, CDATA
        # 4119, samegame file name, CDATA
        # 4120, pak name, CDATA
        # 4121, game engine revision (svn version), i32
        # 4122 - 4137, player type in each slot (1-16), i8
        # 4138, total number of clients, i8
        # 4139 - 4158, checksum??, i8
        # 4159, closing object name tag, none
        # 4160, blank, none
        # 4161, closing simutrans tag, none
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

RichardG

#13

Dwachs

I do not understand what you try to achieve. Do you want to build a site that is equivalent to http://simutrans-germany.com/serverlist/index.php ?

Or do you want to do something different?
Parsley, sage, rosemary, and maggikraut.

RichardG

#15