Author: sveinung
Date: Fri Mar 24 12:44:40 2017
New Revision: 35155

URL: http://svn.gna.org/viewcvs/freeciv?rev=35155&view=rev
Log:
Allow non hack users to disable timeout.

A non hack user may enable timeout by setting it to a value above 30
seconds. Let him disable it too.

Requested by drdogbot7 at the Freeciv forum.

See hrm Feature #647101

Modified:
    trunk/server/settings.c

Modified: trunk/server/settings.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/settings.c?rev=35155&r1=35154&r2=35155&view=diff
==============================================================================
--- trunk/server/settings.c     (original)
+++ trunk/server/settings.c     Fri Mar 24 12:44:40 2017
@@ -1043,7 +1043,8 @@
                              char *reject_msg, size_t reject_msg_len)
 {
   /* Disallow low timeout values for non-hack connections. */
-  if (caller && caller->access_level < ALLOW_HACK && value < 30) {
+  if (caller && caller->access_level < ALLOW_HACK
+      && value < 30 && value != 0) {
     settings_snprintf(reject_msg, reject_msg_len,
                       _("You are not allowed to set timeout values less "
                         "than 30 seconds."));
@@ -1080,7 +1081,8 @@
                                    char *reject_msg, size_t reject_msg_len)
 {
   /* Disallow low timeout values for non-hack connections. */
-  if (caller && caller->access_level < ALLOW_HACK && value < 30) {
+  if (caller && caller->access_level < ALLOW_HACK
+      && value < 30 && value != 0) {
     settings_snprintf(reject_msg, reject_msg_len,
                       _("You are not allowed to set timeout values less "
                         "than 30 seconds."));
@@ -2629,7 +2631,7 @@
              "means there is no timeout. In servers compiled with "
              "debugging, a timeout of -1 sets the autogame test mode. "
              "Only connections with hack level access may set the "
-             "timeout to lower than 30 seconds. Use this with the "
+             "timeout to fewer than 30 seconds. Use this with the "
              "command \"timeoutincrease\" to have a dynamic timer. "
              "The first turn is treated as a special case and is controlled "
              "by the 'first_timeout' setting."),


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

Reply via email to