Kaynağa Gözat

返回值加task

cyzhao 1 yıl önce
ebeveyn
işleme
4263697f7b
1 değiştirilmiş dosya ile 13 ekleme ve 13 silme
  1. 13 13
      Gameserver/App/base/Resp.php

+ 13 - 13
Gameserver/App/base/Resp.php

@@ -98,19 +98,19 @@ class Resp extends Object_ext {
     public function AfterProc() {
 //        $this->tag = arr2obj(array_merge((array) $this->tag, (array) self::$ext_tag)); # 合并附加tags
 //        self::$ext_tag = ObjectInit();
-//        $this->events = self::$ext_events;                                      # 合并附加events
-//        self::$ext_events = array();
-//        if (count($this->events) > 0) {                                         # 对于出现event的情况下自动附带store到客户端.
-//            if (is_array($this->result)) {
-//                if (!array_key_exists('store', (array) $this->result)) {
-//                    //$this->result['store'] = ctx()->store;
-//                }
-//            } else {
-//                if (!array_key_exists('store', (array) $this->result)) {
-//                    //$this->result->store = ctx()->store;
-//                }
-//            }
-//        }
+        $this->events = self::$ext_events;                                      # 合并附加events
+        self::$ext_events = array();
+        if (count($this->events) > 0) {                                         # 对于出现event的情况下自动附带store到客户端.
+            if (is_array($this->result)) {
+                if (!array_key_exists('task', (array) $this->result)) {
+                    $this->result['task'] = ctx()->task;
+                }
+            } else {
+                if (!array_key_exists('task', (array) $this->result)) {
+                    $this->result->task = ctx()->task;
+                }
+            }
+        }
     }
 
     // <editor-fold defaultstate="collapsed" desc="附加event带回">