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: Mon, 7 Jan 2002 20:37:46 +0100 (MET)

On Mon, 7 Jan 2002, Reinier Post wrote:
> Yes, and I was trying to say, for that you need a different packet format,
> with both the values and the attribute names.

No, can just send it all as a single string, eg "topic.ouroption.somewhere
= { "first", "second",\n 15, 13 }", then pass it to registry functions to
parse.

> Once you have that, the code on the receiving end must encode the data
> structure not in the C struct but in an associative array, similar to
> the settings structure in server/stdinhand.c but with a hash for the
> attribute names.

I don't see why. This scheme would replace the settings struct in
server/stdinhand, but since this struct is not used for lookups during
the game, there is no need to encode the ruleset info into a new format.

The client must encode the data in a GUI-dependent fashion, though.

> I don't know, it seems acceptable to have a command like /set mintimeout 40
> so perhaps min* and max* can be regular variables.

I am not sure if I understand what you mean. What I have in mind is
something like this:

[topic]
mintimeout = 40
mintimeout.min = 0
mintimeout.max = 80
mintimeout.helptext = "Sets timeout for for blah blah blah"
nextoption = ...

> It's different for variables that take file paths or player names.

And some ints that must be lower/higher than another int, etc etc... there
are numerous "special cases" that must be checked+bounced from the server,
anyway, so I'm not entirely convinced that min/max info should be in the
ruleset...

> It would be good to still have the cmdline interface in the server binary,
> otherwise you need to start up two programs just to run a server.

No, that will not be necessary.

        $ civserver --read these.rules
        - or -
        $ civserver --read debug.rules --autostart

Gives you all you need without a client. Among these rules can be eg
aifill and create (ie moving commands into ruleset).

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]