Author: sveinung
Date: Fri Mar 24 12:50:06 2017
New Revision: 35157

URL: http://svn.gna.org/viewcvs/freeciv?rev=35157&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:
    branches/S3_0/server/settings.c

Modified: branches/S3_0/server/settings.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/server/settings.c?rev=35157&r1=35156&r2=35157&view=diff
==============================================================================
--- branches/S3_0/server/settings.c     (original)
+++ branches/S3_0/server/settings.c     Fri Mar 24 12:50:06 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."));
@@ -2611,7 +2613,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