Author: cazfi
Date: Wed Sep 28 07:13:38 2016
New Revision: 33933

URL: http://svn.gna.org/viewcvs/freeciv?rev=33933&view=rev
Log:
Lower default cmdlevel to basic on game start.

Reported by taka <taka>

See bug #24774

Modified:
    branches/S2_6/server/srv_main.c
    branches/S2_6/server/stdinhand.c
    branches/S2_6/server/stdinhand.h

Modified: branches/S2_6/server/srv_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/srv_main.c?rev=33933&r1=33932&r2=33933&view=diff
==============================================================================
--- branches/S2_6/server/srv_main.c     (original)
+++ branches/S2_6/server/srv_main.c     Wed Sep 28 07:13:38 2016
@@ -1583,6 +1583,7 @@
       conn_set_access(pconn, ALLOW_BASIC, FALSE);
     }
   } conn_list_iterate_end;
+  set_running_game_access_level();
 
   con_puts(C_OK, _("Starting game."));
 

Modified: branches/S2_6/server/stdinhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/stdinhand.c?rev=33933&r1=33932&r2=33933&view=diff
==============================================================================
--- branches/S2_6/server/stdinhand.c    (original)
+++ branches/S2_6/server/stdinhand.c    Wed Sep 28 07:13:38 2016
@@ -1538,6 +1538,17 @@
   return TRUE;
 }
 
+/**************************************************************************
+  Adjust default command level on game start.
+**************************************************************************/
+void set_running_game_access_level(void)
+{
+  if (default_access_level > ALLOW_BASIC) {
+    notify_conn(NULL, NULL, E_SETTING, ftc_server,
+                _("Default cmdlevel lowered to 'basic' on game start."));
+    default_access_level = ALLOW_BASIC;
+  }
+}
 
 /**************************************************************************
   Returns possible parameters for the commands that take server options

Modified: branches/S2_6/server/stdinhand.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/stdinhand.h?rev=33933&r1=33932&r2=33933&view=diff
==============================================================================
--- branches/S2_6/server/stdinhand.h    (original)
+++ branches/S2_6/server/stdinhand.h    Wed Sep 28 07:13:38 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@
 bool start_command(struct connection *caller, bool check, bool notify);
 
 void toggle_ai_player_direct(struct connection *caller,
-                            struct player *pplayer);
+                             struct player *pplayer);
 
 /* for sernet.c in initing a new connection */
 enum cmdlevel access_level_for_next_connection(void);
@@ -62,6 +62,8 @@
 
 bool conn_is_kicked(struct connection *pconn, int *time_remaining);
 
+void set_running_game_access_level(void);
+
 #ifdef FREECIV_HAVE_LIBREADLINE
 char **freeciv_completion(const char *text, int start, int end);
 #endif


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to