Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: server console cleanup patch v2
Home

[Freeciv-Dev] Re: server console cleanup patch v2

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: server console cleanup patch v2
From: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Date: Tue, 8 Jan 2002 22:12:20 +0100 (MET)

On Tue, 8 Jan 2002, Reinier Post wrote:
> Is this tabular format what you mean by "GUI-dependent"?
> I thought you meant it would differ for Xaw, GTK+, Amiga ...

No, just that each of Xaw, GTK, Amiga etc must make GUI widgets out of
this information somehow, and each in its own way.

> As far as I can see this is only the next step.  Above you deal with
> server->client communication; this can be implemented and used for a read-only
> GUI.

Yes.

>  The next step is to decide how to communicate update requests from
> the GUI commands to the server.  This can also use a syntax based
> on the registry file format.  Then you can have an update interface
> for registry items.

Yes. All that is needed is a struct packet_alter_ruleset { char *key, char
*value } to server, which the server validates and sends to clients.

> The next step would be to make server/stdinhand.c operate on registry data
> structures as well.

Yes.

> /set and /show would either die or be adapted to work
> on arbitrary bits of registry.  I'd prefer them to live on because command
> line control is very convenient (especially for wrapper scripts).

Ok.

On Tue, 8 Jan 2002, Reinier Post wrote:
> This looks like a hack to me: two very different ways ([foo] and {})
> to indicate grouping, mixed together.

They have very different purpose. One is a section label, the other a
table. Anyway, this is how the registry is now, and unless we redesign it
all, we'll have to support both. (Though not necessarily for game.ruleset,
since it does not use the tabular format, but I see further use for this
code.)

> (Really if I were doing the coding I'd prefer to switch to a different
> format, such as XML, with freely available third-party processors,
> rather than continuing to hack on registry.[ch] to improve support for
> structure.  But for a first implementation, using the existing registry
> code is a great idea.)

One thing at a time... XML/DOM is rather complex. The registry code is
relatively simple, and can be used as is, if you are correct that it is
fast enough with more frequent iterations with string-comparisons.

> Aren't city_min_dist and city_max_dist just that?  Why aren't they
> just called min and max?

Because they are just examples that I made up... here is a better example
with made up values:

        [option]
        cmdlevel = 2
        helptext = "slkdjslkfjlsdfkjfl"
        option_one = 23
        option_two = 42
        option_three = 11

Or an actual example from buildings ruleset:

        [building_airport]
        name            = _("Airport")
        tech_req        = "Radio"
        bldg_req        = "None"
        equiv_range     = "City"
        obsolete_by     = "None"
        is_wonder       = 0
        build_cost      = 160
        upkeep          = 3
        effect          =
            { "type", "range", "aff_unit"
                "Unit_Veteran", "City", "Air"
                "Unit_Repair", "City", "Air"
                "Airlift", "City"
            }
        helptext        = _("\  ...

There is no good way to define min/max values for is_wonder, upkeep and
build_cost.

BTW, I notice that the server as of now defines a few options as
"flexible", ie can be changed while in play (eg for of war). I see no
reason for allowing this. Should this be retained?

Yours,
Per

"Oil industry spokesmen dismissed as "absurd" and "nonsense" allegations
by aid experts, veteran East Africa analysts and several prominent Somalis
that President Bush, a former Texas oilman, was moved to act in Somalia,
at least in part, by the U.S. corporate oil stake." -- L.A. Times




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