甘艺伟 2 周之前
父節點
當前提交
f6725db151

+ 2 - 2
assets/script/common/xlsConfig.ts

@@ -25,10 +25,10 @@ export type xlsPackageInfo = {id:string,group:string,plat:string,wayhttp:string,
 
 export class XlsConfig {
     xlsAudioInfo: xlsAudioInfo[]
+    xlsGuideInfo: xlsGuideInfo[]
+    xlsPackageInfo: xlsPackageInfo[]
     xlsLanguageSeverHouduan: xlsLanguageSeverHouduan[]
     xlsMathInfo: xlsMathInfo[]
-    xlsPackageInfo: xlsPackageInfo[]
-    xlsGuideInfo: xlsGuideInfo[]
     xlsLanguageClientText: xlsLanguageClientText[]
     xlsItemKind: xlsItemKind[]
     xlsItemMoney: xlsItemMoney[]

+ 6 - 8
assets/script/logic/fgui/Home/Home/HomeCtrl.ts

@@ -12,7 +12,6 @@ import { GameServerConfig } from "../../../../network/GameServerConfig";
 import { TsrpcNet } from "../../../../network/TsrpcNet";
 import { HomeVM } from "./HomeVM";
 import { HomeView } from "./HomeView";
-
 export class HomeCtrl extends FguiViewCtrl<HomeVM> {
     OnInited(): void {
     }
@@ -21,13 +20,12 @@ export class HomeCtrl extends FguiViewCtrl<HomeVM> {
         GameDataCenter.gameServer.Init();
         await GameDataCenter.gameServer.Connect();
 
-
-        // let ret = await GameDataCenter.gameServer.callApi("user/LookFuser", {});
-        // if (ret.isSucc) {
-        //     console.log("user/LookFuser", '成功');
-        // } else {
-        //     console.log("user/LookFuser", '失败');
-        // }
+        let ret = await GameDataCenter.gameServer.callApi("player/Info", { content: '测试一下' });
+        if (ret.isSucc) {
+            console.log('成功');
+        } else {
+            console.log('失败');
+        }
     }
 
 

+ 2 - 1
assets/script/network/GameServerConfig.ts

@@ -4,7 +4,8 @@
 export class GameServerConfig {
     public static isLocalServer: boolean = false;
     /** 游戏服务器地址 */
-    public static GAME_SERVER = 'wss://localcc.xmsgame.com:6000';
+    // public static GAME_SERVER = 'wss://localcc.xmsgame.com:6000';
+    public static GAME_SERVER = 'ws://106.55.54.28:7000';
     // public static GAME_SERVER = 'ws://192.168.31.231:4000';
     // public static GAME_SERVER = 'ws://192.168.31.229:3000';
     // public static GAME_SERVER = 'ws://192.168.31.8:3000';

+ 2 - 7
assets/script/network/ShareConfig.ts

@@ -1,14 +1,9 @@
-/*
- * @Author: dgflash
- * @Date: 2022-06-29 16:39:42
- * @LastEditors: dgflash
- * @LastEditTime: 2022-11-14 10:57:00
- */
+
 export class ShareConfig {
     /** 强制HTTPS */
     static https: boolean = false;
     /** 传输协议是否使用加密功能 */
-    static security: boolean = false;
+    static security: boolean = true;
     /** 传输加密key */
     static securityKey: string = 'Z1hd&*dgej#2s';
     /** 是否用JSON协议,否则用二进制 */

+ 1 - 1
assets/script/network/TsrpcNet.ts

@@ -36,7 +36,7 @@ export class TsrpcNet {
             // logMsg: true,
         });
 
-        // this.flowClientApi(wscRoom);
+        this.flowClientApi(wscRoom);
         // this.flowAuth(wscRoom);
 
         return wscRoom;

+ 2 - 2
assets/script/server/GameServerModel.ts

@@ -12,9 +12,8 @@ export class GameServerModel extends IDataModel {
     /** 连接房间服务器 Websocket 客户端 */
     wscRoom: WsClient_Browser<ServiceTypeRoom> = null!;
 
-    Init() {
+    async Init() {
         this.wscRoom = eg.tspcNet.createWscRoom(GameServerConfig.GAME_SERVER);
-
     }
 
     async Connect() {
@@ -68,4 +67,5 @@ export class GameServerModel extends IDataModel {
             callback(v);
         });
     }
+
 }

+ 10 - 10
assets/script/shared/base.ts

@@ -1,11 +1,11 @@
-export interface BaseRequest {
-    
-}
-
-export interface BaseResponse {
-    
-}
-
-export interface BaseMessage {
-
+export interface BaseRequest {
+    
+}
+
+export interface BaseResponse {
+    
+}
+
+export interface BaseMessage {
+
 }

+ 16 - 13
assets/script/shared/player/PtlInfo.ts

@@ -1,13 +1,16 @@
-import { BaseRequest, BaseResponse } from '../base';
-
-export interface ReqInfo extends BaseRequest {
-    // 定义请求参数
-    // 例如: name: string;
-}
-
-export interface ResInfo extends BaseResponse {
-    // 定义返回字段
-    ret: string;
-}
-
-
+import { BaseRequest, BaseResponse } from '../base';
+
+export interface ReqInfo extends BaseRequest {
+    // 定义请求参数
+    // 例如: name: string;
+    content:string
+}
+
+export interface ResInfo extends BaseResponse {
+    // 定义返回字段
+    ret: string;
+}
+
+export const conf = {
+    needLogin: true,
+}

+ 18 - 3
assets/script/shared/serviceProto.ts

@@ -19,17 +19,23 @@ export interface ServiceType {
 }
 
 export const serviceProto: ServiceProto<ServiceType> = {
-    "version": 2,
+    "version": 4,
     "services": [
         {
             "id": 0,
             "name": "player/Info",
-            "type": "api"
+            "type": "api",
+            "conf": {
+                "needLogin": true
+            }
         },
         {
             "id": 2,
             "name": "user/LookFuser",
-            "type": "api"
+            "type": "api",
+            "conf": {
+                "needLogin": true
+            }
         }
     ],
     "types": {
@@ -43,6 +49,15 @@ export const serviceProto: ServiceProto<ServiceType> = {
                         "target": "base/BaseRequest"
                     }
                 }
+            ],
+            "properties": [
+                {
+                    "id": 0,
+                    "name": "content",
+                    "type": {
+                        "type": "String"
+                    }
+                }
             ]
         },
         "base/BaseRequest": {

+ 3 - 1
assets/script/shared/user/PtlLookFuser.ts

@@ -10,4 +10,6 @@ export interface ResLookFuser extends BaseResponse {
     ret: string;
 }
 
-
+export const conf = {
+    needLogin: true
+}

+ 6 - 0
settings/services.json

@@ -0,0 +1,6 @@
+{
+	"game": {
+		"name": "未知游戏",
+		"appid": "UNKNOW"
+	}
+}