Browse Source

Update timer.php to sent 1440 instead of 30 when Timekeeper is disabled.

Gregory Huxley 1 tuần trước cách đây
mục cha
commit
f3c61fd3f1

+ 5 - 2
timekeeperClientServices/timer.php

@@ -27,6 +27,8 @@
  *    The client calls it when it first sees a game so the first minute is no
  *    The client calls it when it first sees a game so the first minute is no
  *    longer charged twice
  *    longer charged twice
  *  - plain-text response header
  *  - plain-text response header
+ *  - a student with Timekeeper switched off gets 1440 (was 30, which the
+ *    Java client would read as a real 30 minutes and warn about every minute)
  */
  */
 if (!defined('e107_INIT')) {
 if (!defined('e107_INIT')) {
     require_once('../../../class2.php');
     require_once('../../../class2.php');
@@ -141,9 +143,10 @@ class timer {
         $this->debug(__FUNCTION__);
         $this->debug(__FUNCTION__);
 
 
         if (is_array($this->settings) && isset($this->settings['enabled'])) {
         if (is_array($this->settings) && isset($this->settings['enabled'])) {
-            // timekeeper switched off for this user: no limit (reply 30 as before)
+            // timekeeper switched off for this user: no limit. The reply is a large number
+            // (the Java client treats the number literally and warns at exactly 30 minutes).
             if (!$this->settings['enabled']) {
             if (!$this->settings['enabled']) {
-                echo 30;
+                echo 1440;
                 return false;
                 return false;
             }
             }
         } else {
         } else {