Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] (PR#7895) voting doesn't work with commands with arguments
Home

[Freeciv-Dev] (PR#7895) voting doesn't work with commands with arguments

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7895) voting doesn't work with commands with arguments
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Sat, 13 Mar 2004 03:16:23 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7895 >

When I try to execute a ctrl-level command using an info-level client
that has arguments, like /set endyear 2000, I get this:

/set: Undefined argument. Usage: set <option> <value>
/vote: Your new vote ("set") was not legal or was not recognized.

The problem is in handle_stdin_input, when it tries to call itself using
the command string.  Unfortunately, the command string only contains the
root command, not the arguments that go with it, so it rejects it as a
command with no arguments.

Here's a patch that changes this.  Now, in response to /set endyear
2000, I get this:

/set: You are not allowed to set this option.
/vote: Your new vote ("set endyear 2000") was not legal or was not
recognized.

Now the problem is that the call to handle_stdin_input within
handle_stdin_input uses the caller variable, which has the cmdlevel of
info, and so the ctrl-level command is rejected.

Obviously needs a bit more work here and there.  :)

-James Canete

Attachment: votecommandwithargs.diff
Description: Binary data


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