|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
|
* @Date: 2025-04-11 10:16:41
|
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
|
- * @LastEditTime: 2025-05-15 15:11:26
|
|
|
+ * @LastEditTime: 2025-05-16 11:20:54
|
|
|
* @Description:
|
|
|
*/
|
|
|
// ServerHandler.ts
|
|
|
@@ -12,10 +12,12 @@ import { oops } from 'db://oops-framework/core/Oops';
|
|
|
import { CocosHandler, CocosHandlerType } from './CocosHandler';
|
|
|
import { ProtocolEvent } from './ProtocolEvent';
|
|
|
import { DCHandler } from './DCHandler';
|
|
|
+import { TableGameConfig } from '../table/TableGameConfig';
|
|
|
|
|
|
export class ServerHandler {
|
|
|
private static _inst: ServerHandler;
|
|
|
private serverUrl: string = ""; // 存储服务器地址
|
|
|
+ private _tsGameConfig = new TableGameConfig();
|
|
|
|
|
|
public static get inst(): ServerHandler {
|
|
|
if (!this._inst) {
|
|
|
@@ -30,6 +32,7 @@ export class ServerHandler {
|
|
|
}
|
|
|
|
|
|
private initServerUrl() {
|
|
|
+ this._tsGameConfig.init(1);
|
|
|
let isDebug = smc.game.GameModel.isRelease;
|
|
|
// 设置服务器地址
|
|
|
this.serverUrl = isDebug ?
|
|
|
@@ -37,7 +40,7 @@ export class ServerHandler {
|
|
|
ProtocolEvent.ReleaseServer;
|
|
|
|
|
|
//如果是本地测试,则使用本地测试地址
|
|
|
- if (oops.config.game.isLocalTest) {
|
|
|
+ if (this._tsGameConfig.isLocalTest > 0) {
|
|
|
this.serverUrl = ProtocolEvent.LocalTest;
|
|
|
}
|
|
|
// console.log("[ServerHandler] 当前服务器地址:", this.serverUrl);
|