Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Server from Client
Home

[Freeciv-Dev] Re: Server from Client

[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 from Client
From: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Date: Fri, 28 Dec 2001 12:14:39 +0100 (MET)

On Fri, 28 Dec 2001, Daniel L Speyer wrote:
> Unfortunately, it doesn't.  An extended version of it might.
>
> I recently tried it for checking when a user had connected, but it was all
> the same '012' as tons of other messages.  I haven't looked at what would
> be needed to expand rfcstyle to what's needed.

The server often doesn't use the correct C_* attributes to messages. I'm
not fixing this in the console cleanup I am writing now, but I'll have a
go at it once that is done if none else wants to.

> What's needed is really something of a mess.  As I see it, it is nessesary
> to use C's string handling and raw unix io to both find the reply to our
> question (with potentially anything having been printed since we
> asked) and then to parse it in spite of numerous free-form strings.

No. With rfcstyle, you send the server a command, and then wait for a line
that starts with "100" or one of the warning/error codes. Once I get the
cleanup patch done, this number will be followed byseveral quoted
arguments, like this

        100 "Per I M" "AI"

which isn't a big problem to parse.

One problem might be that string results like "AI" might be translated...
there are a few such problem cases in the code... I am not sure what is
the best way to deal with it, but I think I would rewrite those few cases
to ensure rfcstyle sends untranslated information, or perhaps by exporting
console_rfcstyle and make if ... else tests for it in those cases.
Definitely solvable.

>  I'm
> starting to seriously think that every query should have a unique flag
> that the server echos back with the answer.  Does anybody have experience
> with this?

Wouldn't that be like rfcstyle except every answer has a unique number? I
don't see the point.

Yours,
Per

"Economics is extremely useful as a form of employment for economists."
 -- John Kenneth Galbraith



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