[Freeciv-Dev] (PR#13257) Firstlevel & voting change
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] (PR#13257) Firstlevel & voting change |
From: |
"Per I. Mathisen" <per@xxxxxxxxxxx> |
Date: |
Mon, 13 Jun 2005 10:37:07 -0700 |
Reply-to: |
bugs@xxxxxxxxxxx |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13257 >
This patch renames 'firstlevel' to 'first', whoever has ctrl cmdlevel
becomes a 'game organizer', whoever has ctrl cmdlevel when game starts
loses it, and voting is disabled in pregame.
This means in pregame, we go from a voting model to a 'game host decides'
model.
Feel free to suggest better names for the above.
- Per
Index: server/commands.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/commands.c,v
retrieving revision 1.12
diff -u -r1.12 commands.c
--- server/commands.c 21 May 2005 19:40:25 -0000 1.12
+++ server/commands.c 13 Jun 2005 17:30:56 -0000
@@ -282,7 +282,7 @@
"If 'new' is specified, the level is set for newly connecting clients.\n"
"If 'first come' is specified, the 'first come' level is set; it will
be\n"
"granted to the first client to connect, or if there are connections\n"
- "already, the first client to issue the 'firstlevel' command.\n"
+ "already, the first client to issue the 'first' command.\n"
"If a connection name is specified, the level is set for that "
"connection only.\n"
"Command access levels do not persist if a client disconnects, "
@@ -290,12 +290,9 @@
"Note that this command now takes connection names, not player names."
)
},
- {"firstlevel", ALLOW_INFO, /* Not really "informational", but needs to
- be ALLOW_INFO to be useful. */
- "firstlevel",
- N_("Grab the 'first come' command access level."),
- N_("If 'cmdlevel first come' has been used to set a special 'first come'\n"
- "command access level, this is the command to grab it with.")
+ {"first", ALLOW_INFO, "first",
+ N_("If there is none, become the game organizer with increased
permissions."),
+ NULL,
},
{"timeoutincrease", ALLOW_CTRL,
/* TRANS: translate text between <> only */
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.269
diff -u -r1.269 srv_main.c
--- server/srv_main.c 9 Jun 2005 18:30:13 -0000 1.269
+++ server/srv_main.c 13 Jun 2005 17:30:57 -0000
@@ -797,6 +797,15 @@
return;
}
+ /* Remove ALLOW_CTRL from whoever has it (gotten from 'first'). */
+ conn_list_iterate(game.game_connections, pconn) {
+ if (pconn->access_level == ALLOW_CTRL) {
+ notify_conn(game.game_connections, _("%s lost control cmdlevel on "
+ "game start. Use voting from now on."), pconn->username);
+ pconn->access_level = ALLOW_INFO;
+ }
+ } conn_list_iterate_end;
+
con_puts(C_OK, _("Starting game."));
server_state = RUN_GAME_STATE; /* loaded ??? */
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.419
diff -u -r1.419 stdinhand.c
--- server/stdinhand.c 9 Jun 2005 18:24:48 -0000 1.419
+++ server/stdinhand.c 13 Jun 2005 17:30:57 -0000
@@ -1184,8 +1191,8 @@
{
if (first_access_level > default_access_level
&& !first_access_level_is_taken()) {
- notify_player(NULL, _("Anyone can assume command access level "
- "'%s' now by issuing the 'firstlevel' command."),
+ notify_player(NULL, _("Anyone can now become game organizer "
+ "'%s' by issuing the 'first' command."),
cmdlevel_name(first_access_level));
}
}
@@ -1343,7 +1350,7 @@
{
if (!caller) {
cmd_reply(CMD_FIRSTLEVEL, caller, C_FAIL,
- _("The 'firstlevel' command makes no sense from the server command
line."));
+ _("The 'first' command makes no sense from the server command line."));
return FALSE;
} else if (caller->access_level >= first_access_level) {
cmd_reply(CMD_FIRSTLEVEL, caller, C_FAIL,
@@ -1352,15 +1359,13 @@
return FALSE;
} else if (first_access_level_is_taken()) {
cmd_reply(CMD_FIRSTLEVEL, caller, C_FAIL,
- _("Someone else already has command access level '%s' or better."),
- cmdlevel_name(first_access_level));
+ _("Someone else already is game organizer."));
return FALSE;
} else if (!check) {
caller->access_level = first_access_level;
cmd_reply(CMD_FIRSTLEVEL, caller, C_OK,
- _("Command access level '%s' has been grabbed by connection %s."),
- cmdlevel_name(first_access_level),
- caller->username);
+ _("Connection %s has opted to become the game organizer."),
+ caller->username);
}
return TRUE;
}
@@ -2138,6 +2143,11 @@
} else if (caller->player->is_observer) {
cmd_reply(CMD_VOTE, caller, C_FAIL, _("Observers cannot vote."));
return FALSE;
+ } else if (server_state != RUN_GAME_STATE) {
+ cmd_reply(CMD_VOTE, caller, C_FAIL, _("You can only vote in a "
+ "running game. Use 'first' to become the game organizer "
+ "if there currently is none."));
+ return FALSE;
} else if (!str || strlen(str) == 0) {
int j = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#13257) Firstlevel & voting change,
Per I. Mathisen <=
|
|