diff --git a/account/PtlLogin.ts b/account/PtlLogin.ts index 7ef6516..abd16e5 100644 --- a/account/PtlLogin.ts +++ b/account/PtlLogin.ts @@ -1,5 +1,7 @@ +import { ILiffData } from "../define/interface"; + export interface ReqLogin { - name: string + token: string } -export type ResLogin = number \ No newline at end of file +export type ResLogin = ILiffData \ No newline at end of file diff --git a/define/interface.ts b/define/interface.ts new file mode 100644 index 0000000..277b1b4 --- /dev/null +++ b/define/interface.ts @@ -0,0 +1,7 @@ +// Liff資料 +export interface ILiffData { + userId: string; + displayName: string; + statusMessage: string; + pictureUrl: string; +} \ No newline at end of file diff --git a/room/MsgGoToGame.ts b/room/MsgGoToGame.ts index 931bc7f..83b2096 100644 --- a/room/MsgGoToGame.ts +++ b/room/MsgGoToGame.ts @@ -1 +1,3 @@ -export type MsgGoToGame = number \ No newline at end of file +import { ILiffData } from "../define/interface"; + +export type MsgGoToGame = [number, [ILiffData, ILiffData]] \ No newline at end of file diff --git a/serviceProto.ts b/serviceProto.ts index ac33819..3bbebf4 100644 --- a/serviceProto.ts +++ b/serviceProto.ts @@ -51,7 +51,7 @@ export interface ServiceType { } export const serviceProto: ServiceProto = { - "version": 3, + "version": 6, "services": [ { "id": 0, @@ -114,8 +114,8 @@ export const serviceProto: ServiceProto = { "type": "Interface", "properties": [ { - "id": 0, - "name": "name", + "id": 1, + "name": "token", "type": { "type": "String" } @@ -123,7 +123,41 @@ export const serviceProto: ServiceProto = { ] }, "account/PtlLogin/ResLogin": { - "type": "Number" + "type": "Reference", + "target": "define/interface/ILiffData" + }, + "define/interface/ILiffData": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "userId", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "displayName", + "type": { + "type": "String" + } + }, + { + "id": 2, + "name": "statusMessage", + "type": { + "type": "String" + } + }, + { + "id": 3, + "name": "pictureUrl", + "type": { + "type": "String" + } + } + ] }, "MsgChat/MsgChat": { "type": "Interface", @@ -154,7 +188,25 @@ export const serviceProto: ServiceProto = { "type": "Number" }, "room/MsgGoToGame/MsgGoToGame": { - "type": "Number" + "type": "Tuple", + "elementTypes": [ + { + "type": "Number" + }, + { + "type": "Tuple", + "elementTypes": [ + { + "type": "Reference", + "target": "define/interface/ILiffData" + }, + { + "type": "Reference", + "target": "define/interface/ILiffData" + } + ] + } + ] }, "room/PtlChangeState/ReqChangeState": { "type": "Interface",