From 905fdff15f85bfb0b5f6c84c762da85e547c9218 Mon Sep 17 00:00:00 2001 From: JianMiau Date: Mon, 11 Sep 2023 12:14:29 +0800 Subject: [PATCH] [add] Room OK --- BaseConnection.ts | 6 ++++++ define/enum.ts | 11 +++++++---- room/MsgChangeState.ts | 2 +- serviceProto.ts | 28 +++++++++++----------------- 4 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 BaseConnection.ts diff --git a/BaseConnection.ts b/BaseConnection.ts new file mode 100644 index 0000000..7e19c25 --- /dev/null +++ b/BaseConnection.ts @@ -0,0 +1,6 @@ +// declare module 'tsrpc' { +// export interface BaseConnection { +// // 自定义的新字段 +// userId: string; +// } +// } \ No newline at end of file diff --git a/define/enum.ts b/define/enum.ts index 036a568..aaf09e2 100644 --- a/define/enum.ts +++ b/define/enum.ts @@ -1,16 +1,19 @@ export enum EGameState { - Loading, + Ready, + Wait, TurnCards, ImageViewer, ChooseCards, - MyLoading = 100, + MyReady = 100, + MyWait, MyTurnCards, MyImageViewer, MyChooseCards, - OtherLoading = 200, - OtherTurnCards = 201, + OtherReady = 200, + OtherWait, + OtherTurnCards, OtherImageViewer, OtherChooseCards, } \ No newline at end of file diff --git a/room/MsgChangeState.ts b/room/MsgChangeState.ts index 12045f1..b532352 100644 --- a/room/MsgChangeState.ts +++ b/room/MsgChangeState.ts @@ -1 +1 @@ -export type MsgChangeState = number \ No newline at end of file +export type MsgChangeState = any[] \ No newline at end of file diff --git a/serviceProto.ts b/serviceProto.ts index fb4c8d4..105970e 100644 --- a/serviceProto.ts +++ b/serviceProto.ts @@ -46,35 +46,34 @@ export interface ServiceType { } export const serviceProto: ServiceProto = { - "version": 12, "services": [ { - "id": 4, + "id": 0, "name": "account/Login", "type": "api" }, { - "id": 0, + "id": 1, "name": "Chat", "type": "msg" }, { - "id": 12, + "id": 2, "name": "room/ChangeState", "type": "msg" }, { - "id": 10, + "id": 3, "name": "room/Exit", "type": "msg" }, { - "id": 11, + "id": 4, "name": "room/GoToGame", "type": "msg" }, { - "id": 13, + "id": 5, "name": "room/ChangeState", "type": "api" }, @@ -135,7 +134,10 @@ export const serviceProto: ServiceProto = { ] }, "room/MsgChangeState/MsgChangeState": { - "type": "Number" + "type": "Array", + "elementType": { + "type": "Any" + } }, "room/MsgExit/MsgExit": { "type": "Number" @@ -152,14 +154,6 @@ export const serviceProto: ServiceProto = { "type": { "type": "Number" } - }, - { - "id": 1, - "name": "data", - "type": { - "type": "Any" - }, - "optional": true } ] }, @@ -170,7 +164,7 @@ export const serviceProto: ServiceProto = { "type": "Interface", "properties": [ { - "id": 1, + "id": 0, "name": "null", "type": { "type": "String"