Эх сурвалжийг харах

fix: oplog记录未包含errcode!=0的信息

wanggangzero 5 сар өмнө
parent
commit
b57de5cb3b

+ 4 - 3
Gameserver/App/Services/AppServer.php

@@ -61,7 +61,7 @@ class AppServer {
      * 后处理逻辑
      * @param Resp $resp
      */
-    private static function AfterProc(&$resp) {
+    static function AfterProc(&$resp) {
         if (req()->cmd != CmdCode::cmd_user_delUserUid) {
             if (req()->userInfoChanged || (null != ctx() && ctx()->NeedSave())) {   # 回写玩家数据
                 if (!UserProc::setUserInfo(ctx())) {                                # 失败, 改写返回值
@@ -70,8 +70,9 @@ class AppServer {
             }
         }
 
-        $resp->AfterProc();
-
+        if (null != $resp) {                                                    # resp后处理
+            $resp->AfterProc();
+        }
         self::LogCmdMongo($resp);                                               # 向MongoDB写入操作日志
 //        CLog::flush();                                                          # flush日志
         return true;

+ 2 - 1
Gameserver/App/index.php

@@ -142,7 +142,8 @@ class Index {
             $err = ErrCode::err_innerfault;
         }
         $resp = Resp::err($err, $msg);
-        $resp->AfterProc();
+//        $resp->AfterProc();
+        AppServer::AfterProc($resp);                                            # 后处理
         exit(Index::OverPass($resp));                                           # 直接返回错误信息
     }
 }