baxi 2 nedēļas atpakaļ
vecāks
revīzija
e79355d564

+ 492 - 21
assets/lobbyRes/scenes/Game.scene

@@ -55,7 +55,7 @@
     },
     "autoReleaseAssets": false,
     "_globals": {
-      "__id__": 18
+      "__id__": 30
     },
     "_id": "839abcee-b5fb-49c7-89d4-1b186bd76846"
   },
@@ -77,8 +77,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 640,
-      "y": 360,
+      "x": 812,
+      "y": 375,
       "z": 1000
     },
     "_lrot": {
@@ -118,7 +118,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 360,
+    "_orthoHeight": 375,
     "_near": 1,
     "_far": 2000,
     "_color": {
@@ -167,25 +167,31 @@
       },
       {
         "__id__": 12
+      },
+      {
+        "__id__": 15
+      },
+      {
+        "__id__": 19
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 15
+        "__id__": 27
       },
       {
-        "__id__": 16
+        "__id__": 28
       },
       {
-        "__id__": 17
+        "__id__": 29
       }
     ],
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 640,
-      "y": 360,
+      "x": 812,
+      "y": 375,
       "z": 0
     },
     "_lrot": {
@@ -376,8 +382,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720
+      "width": 1624,
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -548,20 +554,485 @@
     "_shadowBlur": 2,
     "_id": "19YTPdxRdLcIbnJOZgjn5q"
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "background",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 4
+    },
+    "_children": [],
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 16
+      },
+      {
+        "__id__": 17
+      },
+      {
+        "__id__": 18
+      }
+    ],
+    "_prefab": null,
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": "83xjJBGtlLUpb7/tn7ROd5"
+  },
   {
     "__type__": "cc.UITransform",
     "_name": "",
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
+      "__id__": 15
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 1624,
+      "height": 750
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": "a4r+Grw9ZDTqTF0IdpX7+j"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 15
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": null,
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": "acaAVZWKZLM4k6HazPoUo2"
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 15
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_alignFlags": 45,
+    "_target": null,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_horizontalCenter": 0,
+    "_verticalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 40,
+    "_originalHeight": 36,
+    "_alignMode": 2,
+    "_lockFlags": 0,
+    "_id": "1aifPCwwpDirQl3iQFznMM"
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Button",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
       "__id__": 4
     },
+    "_children": [
+      {
+        "__id__": 20
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 23
+      },
+      {
+        "__id__": 24
+      },
+      {
+        "__id__": 25
+      }
+    ],
+    "_prefab": null,
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -115.077,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": "96tUndKg9Ggp9oHMLkhXcy"
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 512,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 19
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 21
+      },
+      {
+        "__id__": 22
+      }
+    ],
+    "_prefab": null,
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": "13bJsgSHpFfptsLUA03oM5"
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 20
+    },
     "_enabled": true,
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1280,
-      "height": 720
+      "width": 100,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": "badUv8kDRPnKCp9mRLILXd"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 20
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_string": "button",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 20,
+    "_fontSize": 20,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 1,
+    "_enableWrapText": false,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": false,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": "e63tNik91On6IgvsCwg3N3"
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 19
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": "7aaYh/hEtMo4oSY+QFIbft"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 19
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": "d1MnguDVdCNJ1wVt3WOfGu"
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 19
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "clickEvents": [
+      {
+        "__id__": 26
+      }
+    ],
+    "_interactable": true,
+    "_transition": 3,
+    "_normalColor": {
+      "__type__": "cc.Color",
+      "r": 214,
+      "g": 214,
+      "b": 214,
+      "a": 255
+    },
+    "_hoverColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_pressedColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_normalSprite": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_hoverSprite": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_pressedSprite": {
+      "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_disabledSprite": {
+      "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_duration": 0.1,
+    "_zoomScale": 1.2,
+    "_target": {
+      "__id__": 19
+    },
+    "_id": "06dvLhPNpFUY/5I42kTTVR"
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 5
+    },
+    "component": "",
+    "_componentId": "8f7122oJzNKarXjQaGGn0Ks",
+    "handler": "showWebView",
+    "customEventData": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 4
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 1624,
+      "height": 750
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -619,28 +1090,28 @@
   {
     "__type__": "cc.SceneGlobals",
     "ambient": {
-      "__id__": 19
+      "__id__": 31
     },
     "shadows": {
-      "__id__": 20
+      "__id__": 32
     },
     "_skybox": {
-      "__id__": 21
+      "__id__": 33
     },
     "fog": {
-      "__id__": 22
+      "__id__": 34
     },
     "octree": {
-      "__id__": 23
+      "__id__": 35
     },
     "skin": {
-      "__id__": 24
+      "__id__": 36
     },
     "lightProbeInfo": {
-      "__id__": 25
+      "__id__": 37
     },
     "postSettings": {
-      "__id__": 26
+      "__id__": 38
     },
     "bakedWithStationaryMainLight": false,
     "bakedWithHighpLightmap": false

+ 57 - 0
assets/scripts/api/ApiHelper.ts

@@ -0,0 +1,57 @@
+import { AppKernel } from "@scripts/app/AppKernel";
+import { ApiEnvelope } from "@scripts/request";
+
+export function getHttpMsg(data) {
+    if (data === null || data === undefined) return;
+    let result = data.result ?? data.msg;
+    if (!result) return;
+
+    if (Array.isArray(result)) {
+        let key = result[0];
+        let def = result[1];
+        if (AppKernel.i18n.has(key)) {
+            return AppKernel.i18n.t(key);
+        }
+        return def;
+    }
+
+    if (AppKernel.i18n.has(result)) {
+        return AppKernel.i18n.t(result);
+    }
+    return result;
+}
+
+
+export const success = (res: ApiEnvelope) => {
+    return res && (res.code === 0 || res.code === 200);
+}
+
+export function checkResponse(res) {
+    if (success(res)) return true;
+    if (res.code === -1) {
+        ///网络异常 请求失败
+        AppKernel.ui.dialog({
+            message: AppKernel.i18n.t("home.networkError"),
+            showClose: true,
+        })
+        return false;
+    }
+
+    if (res.code === 404) {
+        ///登录失效
+        const tips = getHttpMsg(res);
+        AppKernel.ui.dialog({
+            message: tips,
+            callBack: (res) => {
+                AppKernel.appLobby.openLogin();
+                return true;
+            }
+        })
+    }
+
+    const msg = getHttpMsg(res);
+    if (!!msg) {
+        AppKernel.ui.toast(msg);
+    }
+    return false;
+}

+ 9 - 0
assets/scripts/api/ApiHelper.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "a0f5adce-6802-4c1a-a22e-681923c54051",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 1 - 1
assets/scripts/app/AppConfig.ts

@@ -16,7 +16,7 @@ const AppConfig = {
      * 非空时使用本地 Manifest 的资源列表与该地址下的远端 Manifest 做检测。
      */
     HotUpdateUrl: "",
-    HotUpdateEnable: false,
+    HotUpdateEnable: true,
 
 
     FBAppID: "1056149470661855",

+ 4 - 2
assets/scripts/framework/scene/SceneNavigator.ts

@@ -72,9 +72,11 @@ export class SceneNavigator {
     }
   }
 
-  goToLobby(): Promise<void> { return this.go(SceneId.Lobby); }
-  goToGame(): Promise<void> {
+  goToLobby(): Promise<void> {
+    return this.go(SceneId.Lobby);
+  }
 
+  goToGame(): Promise<void> {
     return this.go(SceneId.Game);
   }
 }

+ 23 - 23
assets/scripts/modules/game/GameController.ts

@@ -1,21 +1,16 @@
-import { _decorator, Component, EventKeyboard, input, Input, KeyCode, Node, WebView } from 'cc';
+import { _decorator, Camera, Component, Node, RenderTexture, screen, Sprite, SpriteFrame, WebView } from 'cc';
 import { AppKernel } from '../../app/AppKernel';
 import AppConfig from '@scripts/app/AppConfig';
-import { ANDROID, IOS } from 'cc/env';
-import { getUrlParams } from '@scripts/utils/Helper';
-import { WebViewHandler } from './WebViewHandler';
+import { IWebEventHandler, IWebViewMsg, WebViewHandler } from './WebViewHandler';
+import LZString from 'lz-string';
+import { waitForSeconds } from '@scripts/utils/Helper';
 
 const { ccclass, property } = _decorator;
 
-interface IFrameEvent {
-  cmd?: string;
-  [key: string]: string | undefined;
-}
-
-const GAME_FRAME = "http://192.168.1.3:3001";
+const GAME_FRAME = "http://192.168.1.21:3000";
 
 @ccclass('GameController')
-export class GameController extends Component {
+export class GameController extends Component implements IWebEventHandler {
 
   @property(WebView)
   webView: WebView | null = null;
@@ -31,13 +26,16 @@ export class GameController extends Component {
       return;
     }
 
+    const gameStore = AppKernel.stores.gameStore;
+    const gameUrl = `${GAME_FRAME}?game=${LZString.compressToBase64(gameStore.gameLink)}`;
     this._gameWeb = new WebViewHandler(
       this.webView,
-      GAME_FRAME,
-      this as any,
+      gameUrl,
+      this,
       AppConfig.GameScheme
     )
 
+    this.webView.node.setPosition(10000, 10000, 0);
     AppKernel.services.gameService.onEntered();
   }
 
@@ -47,17 +45,16 @@ export class GameController extends Component {
     AppKernel.services.gameService.onExited();
   }
 
-  onHandleMsg(data: IFrameEvent) {
-    console.log(">>>>>>>>>>>> handleWebEvent: ", data);
+  onHandleMsg(data: IWebViewMsg) {
     switch (data.cmd) {
-      case "game_ready":
-        const game_url = AppKernel.stores.gameStore.gameLink;
-        if (!this._gameWeb) {
-          console.warn('[GameController] Ignored game_ready after WebView disposal.');
-          return;
-        }
-        this._gameWeb.sendMessage({ cmd: "update_gamelink", url: game_url })
-        break;
+      // case "game_ready":
+      //   const game_url = AppKernel.stores.gameStore.gameLink;
+      //   if (!this._gameWeb) {
+      //     console.warn('[GameController] Ignored game_ready after WebView disposal.');
+      //     return;
+      //   }
+      //   this._gameWeb.sendMessage({ cmd: "update_gamelink", url: game_url })
+      //   break;
       case "game_exit":
         this.exitGame();
         break;
@@ -68,4 +65,7 @@ export class GameController extends Component {
     await AppKernel.services.gameService.exitGame();
   }
 
+  showWebView() {
+    this.webView.node.setPosition(0, 0, 0);
+  }
 }

+ 15 - 4
assets/scripts/modules/game/WebViewHandler.ts

@@ -1,3 +1,4 @@
+import { getUrlParams } from "@scripts/utils/Helper";
 import { WebView } from "cc";
 import { ANDROID, IOS } from "cc/env";
 
@@ -6,6 +7,7 @@ const HISTORY_STATE_KEY = '__game_webview_locked__';
 export interface IWebViewMsg {
     cmd: string;
     url?: string;
+    [key: string]: string | undefined;
 }
 
 export interface IWebEventHandler {
@@ -17,19 +19,28 @@ export interface IWebEventHandler {
 
 export class WebViewHandler {
     private disposed = false;
+    private origin: string;
 
     constructor(private readonly webView: WebView,
         private readonly url: string,
         private readonly eventer: IWebEventHandler,
         scheme: string) {
         if (ANDROID || IOS) {
+
+            const onSchemeCallback = (target, url: string) => {
+                if (!url.startsWith(scheme)) return;
+                const params = getUrlParams(url) as IWebViewMsg;
+                this.handleWebEvent(params);
+            }
+
             this.webView.setJavascriptInterfaceScheme(scheme);
             //@ts-ignore
-            this.webView.setOnJSCallback(this.onSchemeCallback);
-            url = `${url}?scheme=${scheme}`;
+            this.webView.setOnJSCallback(onSchemeCallback);
+            url = `${url}&scheme=${scheme}`;
         }
-        this.webView.url = url;
 
+        this.webView.url = url;
+        this.origin = (new URL(url)).origin;
 
         webView.node.on(WebView.EventType.LOADED, this.onWebViewLoaded, this);
         webView.node.on(WebView.EventType.LOADING, this.onWebViewLoading, this);
@@ -98,7 +109,7 @@ export class WebViewHandler {
 
     private readonly onWindowMessage = (event: MessageEvent): void => {
         if (this.disposed) return;
-        if (event.origin !== this.url) return;
+        if (event.origin !== this.origin) return;
         this.handleWebEvent(event?.data);
     };
 

+ 0 - 5
assets/scripts/modules/lobby/ui/HomeView/GameItem.ts

@@ -28,11 +28,6 @@ export class GameItem extends Component {
         addBtnClick(this.btnFavo, this.onBtnFavoClick, this);
     }
 
-    protected onDestroy(): void {
-        removeBtnClick(this.node, this.onClick, this);
-        removeBtnClick(this.btnFavo, this.onBtnFavoClick, this);
-    }
-
     public updateItem(data: IGameInfo, index: number) {
         this._data = data;
         this._dataIdx = index;

+ 4 - 1
assets/scripts/modules/lobby/ui/HomeView/HomeView.ts

@@ -58,7 +58,6 @@ export class HomeView extends UIView {
     private btnFirst: Node;
 
     protected onCreate(): void | Promise<void> {
-        AppKernel.events.on('login:success', this.updateView, this);
         AppKernel.events.on('user:update', this.updateUserInfo, this);
         AppKernel.events.on('firstPack:update', this.onUpdateFirstPack, this);
 
@@ -132,6 +131,10 @@ export class HomeView extends UIView {
         AppKernel.redpoint.on(RED_POINTS.DailyReward, dailyPoint, this);
     }
 
+    protected onOpen(_params: unknown) {
+        this.updateView();
+    }
+
     private onUpdateFirstPack() {
         const payStore = AppKernel.stores.payStore;
         this.btnFirst.active = payStore.firstPackVisible;

+ 1 - 1
assets/scripts/network/colyseus/ColyseusRoomClient.ts

@@ -249,7 +249,7 @@ export class ColyseusRoomClient {
     this.pendingPings = 0;
 
     room.onMessage('*', (type: string, message: unknown) => {
-      console.log('[Hall ← Server]', type, message);
+      //console.log('[Hall ← Server]', type, message);
       if (type === 'PONG') {
         this.pendingPings = Math.max(0, this.pendingPings - 1);
         return;

+ 6 - 3
assets/scripts/services/AppLobby.ts

@@ -55,7 +55,9 @@ class AppLobby {
 
     private async onGameBack() {
         await AppKernel.ui.open(UIViewID.HomeView);
-        AppKernel.ui.closeAll();
+        await Promise.all([
+            AppKernel.stores.mainStore.reqUserInfo(),
+        ])
 
         const gameStore = AppKernel.stores.gameStore;
         const gameId = String(gameStore.gameID);
@@ -72,12 +74,13 @@ class AppLobby {
         const mainStore = AppKernel.stores.mainStore;
         const gameStore = AppKernel.stores.gameStore;
 
-        const url = await gameStore.reqLaunchGame(game.gameCode, mainStore.currencyKind);
+        let url = await gameStore.reqLaunchGame(game.gameCode, mainStore.currencyKind);
         AppKernel.ui.loading(false);
         console.log('game url: ', url);
         if (!!url) {
+            AppKernel.scenes.goToGame();
             const currency = mainStore.currencyKind;
-            gameStore.onEnterGame(game, currency);
+            gameStore.onEnterGame(game, currency, url);
             AppKernel.services.hallClient.sendState();
         }
 

+ 1 - 1
assets/scripts/services/hall/HallClient.ts

@@ -96,7 +96,7 @@ class HallClient {
 
   private onMessage(type: string, rawMessage: unknown): void {
     const message = this.asMessage(rawMessage);
-    console.log(`[HallClient] onMessage type:${type}  cmd:${message?.cmd}`);
+    //console.log(`[HallClient] onMessage type:${type}  cmd:${message?.cmd}`);
     switch (type) {
       case 'operate':
         this.handleOperate(message);

+ 2 - 1
assets/scripts/store/gameStore/GameStore.ts

@@ -127,7 +127,8 @@ class GameStore {
         this._recentMap = {};
     }
 
-    onEnterGame(game: IGameInfo, currency = '') {
+    onEnterGame(game: IGameInfo, currency: CurrencyType, url: string) {
+        this.gameLink = url;
         this.gameID = game.gameID;
         if (this._recentMap[currency]) {
             const recents = this._recentMap[currency];