@xmobitea/gn-typescript-client 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/GNServerSettingsConfig.debug.json +21 -0
  2. package/dist/editor/GNServerSettingsEditor.d.ts +2 -0
  3. package/dist/index.d.ts +160 -0
  4. package/dist/runtime/GNNetwork.d.ts +85 -0
  5. package/dist/runtime/common/Action0.d.ts +3 -0
  6. package/dist/runtime/common/Action1.d.ts +3 -0
  7. package/dist/runtime/common/Action2.d.ts +3 -0
  8. package/dist/runtime/common/Action3.d.ts +3 -0
  9. package/dist/runtime/common/Action4.d.ts +3 -0
  10. package/dist/runtime/common/GNData.d.ts +69 -0
  11. package/dist/runtime/config/GNServerSettings.d.ts +56 -0
  12. package/dist/runtime/constant/Commands.d.ts +16 -0
  13. package/dist/runtime/constant/EventCode.d.ts +3 -0
  14. package/dist/runtime/constant/OperationCode.d.ts +13 -0
  15. package/dist/runtime/constant/ReturnCode.d.ts +12 -0
  16. package/dist/runtime/constant/enumType/FriendStatus.d.ts +6 -0
  17. package/dist/runtime/constant/enumType/GoogleLoginType.d.ts +4 -0
  18. package/dist/runtime/constant/enumType/InvalidMemberType.d.ts +17 -0
  19. package/dist/runtime/constant/enumType/LoginType.d.ts +10 -0
  20. package/dist/runtime/constant/enumType/PlatformType.d.ts +8 -0
  21. package/dist/runtime/constant/enumType/UserRoleType.d.ts +8 -0
  22. package/dist/runtime/constant/errorCode/DebugErrorCode.d.ts +3 -0
  23. package/dist/runtime/constant/errorCode/EnterDisplayNameErrorCode.d.ts +3 -0
  24. package/dist/runtime/constant/errorCode/FetchAllDataErrorCode.d.ts +4 -0
  25. package/dist/runtime/constant/errorCode/FetchSparkPlayerErrorCode.d.ts +4 -0
  26. package/dist/runtime/constant/errorCode/FileUploadInfoErrorCode.d.ts +5 -0
  27. package/dist/runtime/constant/errorCode/GetAppConfigErrorCode.d.ts +3 -0
  28. package/dist/runtime/constant/errorCode/LoginErrorCode.d.ts +11 -0
  29. package/dist/runtime/constant/errorCode/RegisterSocketErrorCode.d.ts +3 -0
  30. package/dist/runtime/constant/parameterCode/DebugParameterCode.d.ts +7 -0
  31. package/dist/runtime/constant/parameterCode/EnterDisplayNameParameterCode.d.ts +4 -0
  32. package/dist/runtime/constant/parameterCode/FetchAllDataParameterCode.d.ts +7 -0
  33. package/dist/runtime/constant/parameterCode/FetchSparkPlayerParameterCode.d.ts +15 -0
  34. package/dist/runtime/constant/parameterCode/FileUploadInfoParameterCode.d.ts +11 -0
  35. package/dist/runtime/constant/parameterCode/GetAppConfigParameterCode.d.ts +4 -0
  36. package/dist/runtime/constant/parameterCode/LoginParameterCode.d.ts +18 -0
  37. package/dist/runtime/constant/parameterCode/ParameterCode.d.ts +6 -0
  38. package/dist/runtime/constant/parameterCode/RegisterSocketParameterCode.d.ts +3 -0
  39. package/dist/runtime/entity/InvalidMember.d.ts +5 -0
  40. package/dist/runtime/entity/OperationEvent.d.ts +14 -0
  41. package/dist/runtime/entity/OperationHelper.d.ts +16 -0
  42. package/dist/runtime/entity/OperationRequest.d.ts +23 -0
  43. package/dist/runtime/entity/OperationResponse.d.ts +27 -0
  44. package/dist/runtime/entity/request/CreateNewFileUploadInfoOperationRequest.d.ts +6 -0
  45. package/dist/runtime/entity/request/CustomOperationRequest.d.ts +10 -0
  46. package/dist/runtime/entity/request/DebugOperationRequest.d.ts +7 -0
  47. package/dist/runtime/entity/request/EnterDisplayNameOperationRequest.d.ts +6 -0
  48. package/dist/runtime/entity/request/FetchAllDataOperationRequest.d.ts +6 -0
  49. package/dist/runtime/entity/request/FetchSparkPlayerOperationRequest.d.ts +6 -0
  50. package/dist/runtime/entity/request/GetAppConfigOperationRequest.d.ts +7 -0
  51. package/dist/runtime/entity/request/GetFileUploadInfoOperationRequest.d.ts +6 -0
  52. package/dist/runtime/entity/request/LoginOperationRequest.d.ts +33 -0
  53. package/dist/runtime/entity/request/LogoutOperationRequest.d.ts +6 -0
  54. package/dist/runtime/entity/request/RegisterAccountOperationRequest.d.ts +6 -0
  55. package/dist/runtime/entity/request/RegisterSocketOperationRequest.d.ts +6 -0
  56. package/dist/runtime/entity/request/TemplateOperationRequest.d.ts +6 -0
  57. package/dist/runtime/entity/response/CreateNewFileUploadInfoOperationResponse.d.ts +10 -0
  58. package/dist/runtime/entity/response/CustomOperationResponse.d.ts +14 -0
  59. package/dist/runtime/entity/response/DebugOperationResponse.d.ts +11 -0
  60. package/dist/runtime/entity/response/EnterDisplayNameOperationResponse.d.ts +7 -0
  61. package/dist/runtime/entity/response/FetchAllDataOperationResponse.d.ts +10 -0
  62. package/dist/runtime/entity/response/FetchSparkPlayerOperationResponse.d.ts +20 -0
  63. package/dist/runtime/entity/response/GetAppConfigOperationResponse.d.ts +6 -0
  64. package/dist/runtime/entity/response/GetFileUploadInfoOperationResponse.d.ts +15 -0
  65. package/dist/runtime/entity/response/LoginOperationResponse.d.ts +9 -0
  66. package/dist/runtime/entity/response/LogoutOperationResponse.d.ts +5 -0
  67. package/dist/runtime/entity/response/PublicAddressGetRandomMessageOperationResponse.d.ts +6 -0
  68. package/dist/runtime/entity/response/RegisterAccountOperationResponse.d.ts +5 -0
  69. package/dist/runtime/entity/response/RegisterSocketOperationResponse.d.ts +5 -0
  70. package/dist/runtime/entity/response/TemplateOperationResponse.d.ts +6 -0
  71. package/dist/runtime/helper/CodeHelper.d.ts +16 -0
  72. package/dist/runtime/helper/GNSupport.d.ts +5 -0
  73. package/dist/runtime/logger/GNDebug.d.ts +15 -0
  74. package/dist/runtime/networking/HttpPeer.d.ts +29 -0
  75. package/dist/runtime/networking/IPeer.d.ts +9 -0
  76. package/dist/runtime/networking/NetworkingPeer.d.ts +74 -0
  77. package/dist/runtime/networking/NetworkingPeerBase.d.ts +47 -0
  78. package/dist/runtime/networking/NetworkingPeerSocket.d.ts +22 -0
  79. package/dist/runtime/networking/OperationPending.d.ts +17 -0
  80. package/dist/runtime/networking/PeerBase.d.ts +28 -0
  81. package/dist/runtime/networking/SocketPeer.d.ts +24 -0
  82. package/dist/runtime/networking/handler/IServerEventHandler.d.ts +14 -0
  83. package/dist/runtime/networking/handler/OnDebugEventHander.d.ts +6 -0
  84. package/index.js +391 -0
  85. package/package.json +37 -0
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "debug",
3
+ "options": {
4
+ "serverAddress": "127.0.0.1",
5
+ "serverPort": 2202,
6
+ "useSsl": false,
7
+ "useSocket": true,
8
+ "useHttp": true,
9
+
10
+ "sendRate": 20,
11
+ "reconnectDelay": 5000,
12
+ "pingInterval": 20000,
13
+ "pingTimeout": 20000,
14
+
15
+ "codeCanSendNotAuthorized": [
16
+ -1, 1, 2, 3
17
+ ],
18
+ "gnServerSourcePath": "./../GNServer/",
19
+ "logType": 4
20
+ }
21
+ }
@@ -0,0 +1,2 @@
1
+ export declare class GNServerSettingsEditor {
2
+ }
@@ -0,0 +1,160 @@
1
+ import { Action0 } from "./runtime/common/Action0";
2
+ import { Action1 } from "./runtime/common/Action1";
3
+ import { Action2 } from "./runtime/common/Action2";
4
+ import { Action3 } from "./runtime/common/Action3";
5
+ import { Action4 } from "./runtime/common/Action4";
6
+ import { GNHashtableBuilder, GNHashtable, GNArrayBuilder, GNArray } from "./runtime/common/GNData";
7
+ export { Action0 };
8
+ export { Action1 };
9
+ export { Action2 };
10
+ export { Action3 };
11
+ export { Action4 };
12
+ export { GNHashtableBuilder, GNHashtable, GNArrayBuilder, GNArray };
13
+ import { GNServerSettings, GNServerSettingsOptions } from "./runtime/config/GNServerSettings";
14
+ export { GNServerSettings, GNServerSettingsOptions };
15
+ import { FriendStatus } from "./runtime/constant/enumType/FriendStatus";
16
+ import { GoogleLoginType } from "./runtime/constant/enumType/GoogleLoginType";
17
+ import { InvalidMemberType } from "./runtime/constant/enumType/InvalidMemberType";
18
+ import { LoginType } from "./runtime/constant/enumType/LoginType";
19
+ import { PlatformType } from "./runtime/constant/enumType/PlatformType";
20
+ import { UserRoleType } from "./runtime/constant/enumType/UserRoleType";
21
+ export { FriendStatus };
22
+ export { GoogleLoginType };
23
+ export { InvalidMemberType };
24
+ export { LoginType };
25
+ export { PlatformType };
26
+ export { UserRoleType };
27
+ import { DebugErrorCode } from "./runtime/constant/errorCode/DebugErrorCode";
28
+ import { EnterDisplayNameErrorCode } from "./runtime/constant/errorCode/EnterDisplayNameErrorCode";
29
+ import { FetchAllDataErrorCode } from "./runtime/constant/errorCode/FetchAllDataErrorCode";
30
+ import { FetchSparkPlayerErrorCode } from "./runtime/constant/errorCode/FetchSparkPlayerErrorCode";
31
+ import { FileUploadInfoErrorCode } from "./runtime/constant/errorCode/FileUploadInfoErrorCode";
32
+ import { GetAppConfigErrorCode } from "./runtime/constant/errorCode/GetAppConfigErrorCode";
33
+ import { LoginErrorCode } from "./runtime/constant/errorCode/LoginErrorCode";
34
+ import { RegisterSocketErrorCode } from "./runtime/constant/errorCode/RegisterSocketErrorCode";
35
+ import { DebugParameterCode } from "./runtime/constant/parameterCode/DebugParameterCode";
36
+ import { EnterDisplayNameParameterCode } from "./runtime/constant/parameterCode/EnterDisplayNameParameterCode";
37
+ import { FetchAllDataParameterCode } from "./runtime/constant/parameterCode/FetchAllDataParameterCode";
38
+ import { FetchSparkPlayerParameterCode } from "./runtime/constant/parameterCode/FetchSparkPlayerParameterCode";
39
+ import { FileUploadInfoParameterCode } from "./runtime/constant/parameterCode/FileUploadInfoParameterCode";
40
+ import { GetAppConfigParameterCode } from "./runtime/constant/parameterCode/GetAppConfigParameterCode";
41
+ import { LoginParameterCode } from "./runtime/constant/parameterCode/LoginParameterCode";
42
+ import { ParameterCode } from "./runtime/constant/parameterCode/ParameterCode";
43
+ import { RegisterSocketParameterCode } from "./runtime/constant/parameterCode/RegisterSocketParameterCode";
44
+ export { DebugErrorCode };
45
+ export { EnterDisplayNameErrorCode };
46
+ export { FetchAllDataErrorCode };
47
+ export { FetchSparkPlayerErrorCode };
48
+ export { FileUploadInfoErrorCode };
49
+ export { GetAppConfigErrorCode };
50
+ export { LoginErrorCode };
51
+ export { RegisterSocketErrorCode };
52
+ export { DebugParameterCode };
53
+ export { EnterDisplayNameParameterCode };
54
+ export { FetchAllDataParameterCode };
55
+ export { FetchSparkPlayerParameterCode };
56
+ export { FileUploadInfoParameterCode };
57
+ export { GetAppConfigParameterCode };
58
+ export { LoginParameterCode };
59
+ export { ParameterCode };
60
+ export { RegisterSocketParameterCode };
61
+ import { Commands } from "./runtime/constant/Commands";
62
+ import { EventCode } from "./runtime/constant/EventCode";
63
+ import { OperationCode } from "./runtime/constant/OperationCode";
64
+ import { ReturnCode } from "./runtime/constant/ReturnCode";
65
+ export { Commands };
66
+ export { EventCode };
67
+ export { OperationCode };
68
+ export { ReturnCode };
69
+ import { CreateNewFileUploadInfoOperationRequest } from "./runtime/entity/request/CreateNewFileUploadInfoOperationRequest";
70
+ import { CustomOperationRequest } from "./runtime/entity/request/CustomOperationRequest";
71
+ import { DebugOperationRequest } from "./runtime/entity/request/DebugOperationRequest";
72
+ import { EnterDisplayNameOperationRequest } from "./runtime/entity/request/EnterDisplayNameOperationRequest";
73
+ import { FetchAllDataOperationRequest } from "./runtime/entity/request/FetchAllDataOperationRequest";
74
+ import { FetchSparkPlayerOperationRequest } from "./runtime/entity/request/FetchSparkPlayerOperationRequest";
75
+ import { GetAppConfigOperationRequest } from "./runtime/entity/request/GetAppConfigOperationRequest";
76
+ import { GetFileUploadInfoOperationRequest } from "./runtime/entity/request/GetFileUploadInfoOperationRequest";
77
+ import { LoginOperationRequest, AccountLoginOperationRequest, AppleLoginOperationRequest, CustomIdLoginOperationRequest, DeviceLoginOperationRequest, FacebookLoginOperationRequest, GoogleLoginOperationRequest, PublicAddressGetRandomMessageOperationRequest, PublicAddressLoginOperationRequest, UserIdLoginOperationRequest } from "./runtime/entity/request/LoginOperationRequest";
78
+ import { LogoutOperationRequest } from "./runtime/entity/request/LogoutOperationRequest";
79
+ import { RegisterAccountOperationRequest } from "./runtime/entity/request/RegisterAccountOperationRequest";
80
+ import { RegisterSocketOperationRequest } from "./runtime/entity/request/RegisterSocketOperationRequest";
81
+ import { TemplateOperationRequest } from "./runtime/entity/request/TemplateOperationRequest";
82
+ export { CreateNewFileUploadInfoOperationRequest };
83
+ export { CustomOperationRequest };
84
+ export { DebugOperationRequest };
85
+ export { EnterDisplayNameOperationRequest };
86
+ export { FetchAllDataOperationRequest };
87
+ export { FetchSparkPlayerOperationRequest };
88
+ export { GetAppConfigOperationRequest };
89
+ export { GetFileUploadInfoOperationRequest };
90
+ export { LoginOperationRequest, AccountLoginOperationRequest, AppleLoginOperationRequest, CustomIdLoginOperationRequest, DeviceLoginOperationRequest, FacebookLoginOperationRequest, GoogleLoginOperationRequest, PublicAddressGetRandomMessageOperationRequest, PublicAddressLoginOperationRequest, UserIdLoginOperationRequest };
91
+ export { LogoutOperationRequest };
92
+ export { RegisterAccountOperationRequest };
93
+ export { RegisterSocketOperationRequest };
94
+ export { TemplateOperationRequest };
95
+ import { CreateNewFileUploadInfoOperationResponse } from "./runtime/entity/response/CreateNewFileUploadInfoOperationResponse";
96
+ import { CustomOperationResponse } from "./runtime/entity/response/CustomOperationResponse";
97
+ import { DebugOperationResponse } from "./runtime/entity/response/DebugOperationResponse";
98
+ import { EnterDisplayNameOperationResponse } from "./runtime/entity/response/EnterDisplayNameOperationResponse";
99
+ import { FetchAllDataOperationResponse } from "./runtime/entity/response/FetchAllDataOperationResponse";
100
+ import { FetchSparkPlayerOperationResponse, UserExternal } from "./runtime/entity/response/FetchSparkPlayerOperationResponse";
101
+ import { GetAppConfigOperationResponse } from "./runtime/entity/response/GetAppConfigOperationResponse";
102
+ import { GetFileUploadInfoOperationResponse } from "./runtime/entity/response/GetFileUploadInfoOperationResponse";
103
+ import { LoginOperationResponse } from "./runtime/entity/response/LoginOperationResponse";
104
+ import { LogoutOperationResponse } from "./runtime/entity/response/LogoutOperationResponse";
105
+ import { PublicAddressGetRandomMessageOperationResponse } from "./runtime/entity/response/PublicAddressGetRandomMessageOperationResponse";
106
+ import { RegisterAccountOperationResponse } from "./runtime/entity/response/RegisterAccountOperationResponse";
107
+ import { RegisterSocketOperationResponse } from "./runtime/entity/response/RegisterSocketOperationResponse";
108
+ import { TemplateOperationResponse } from "./runtime/entity/response/TemplateOperationResponse";
109
+ export { CreateNewFileUploadInfoOperationResponse };
110
+ export { CustomOperationResponse };
111
+ export { DebugOperationResponse };
112
+ export { EnterDisplayNameOperationResponse };
113
+ export { FetchAllDataOperationResponse };
114
+ export { FetchSparkPlayerOperationResponse, UserExternal };
115
+ export { GetAppConfigOperationResponse };
116
+ export { GetFileUploadInfoOperationResponse };
117
+ export { LoginOperationResponse };
118
+ export { LogoutOperationResponse };
119
+ export { PublicAddressGetRandomMessageOperationResponse };
120
+ export { RegisterAccountOperationResponse };
121
+ export { RegisterSocketOperationResponse };
122
+ export { TemplateOperationResponse };
123
+ import { InvalidMember } from "./runtime/entity/InvalidMember";
124
+ import { OperationEvent } from "./runtime/entity/OperationEvent";
125
+ import { OperationHelper } from "./runtime/entity/OperationHelper";
126
+ import { OperationRequest } from "./runtime/entity/OperationRequest";
127
+ import { OperationResponse } from "./runtime/entity/OperationResponse";
128
+ export { InvalidMember };
129
+ export { OperationEvent };
130
+ export { OperationHelper };
131
+ export { OperationRequest };
132
+ export { OperationResponse };
133
+ import { GNDebug, LogType } from "./runtime/logger/GNDebug";
134
+ export { GNDebug, LogType };
135
+ import { IServerEventHandler } from "./runtime/networking/handler/IServerEventHandler";
136
+ import { OnDebugEventHander } from "./runtime/networking/handler/OnDebugEventHander";
137
+ export { IServerEventHandler };
138
+ export { OnDebugEventHander };
139
+ import { HttpPeer, HttpAppResponse, PostType } from "./runtime/networking/HttpPeer";
140
+ import { IPeer } from "./runtime/networking/IPeer";
141
+ import { NetworkingPeer } from "./runtime/networking/NetworkingPeer";
142
+ import { NetworkingPeerBase, SocketPacket } from "./runtime/networking/NetworkingPeerBase";
143
+ import { NetworkingPeerSocket } from "./runtime/networking/NetworkingPeerSocket";
144
+ import { OperationPending } from "./runtime/networking/OperationPending";
145
+ import { PeerBase } from "./runtime/networking/PeerBase";
146
+ import { SocketPeer } from "./runtime/networking/SocketPeer";
147
+ export { HttpPeer, HttpAppResponse, PostType };
148
+ export { IPeer };
149
+ export { NetworkingPeer };
150
+ export { NetworkingPeerBase, SocketPacket };
151
+ export { NetworkingPeerSocket };
152
+ export { OperationPending };
153
+ export { PeerBase };
154
+ export { SocketPeer };
155
+ import { GNNetwork } from "./runtime/GNNetwork";
156
+ export { GNNetwork };
157
+ import { GNSupport } from "./runtime/helper/GNSupport";
158
+ import { CodeHelper } from "./runtime/helper/CodeHelper";
159
+ export { GNSupport };
160
+ export { CodeHelper };
@@ -0,0 +1,85 @@
1
+ import { Action0 } from "./common/Action0";
2
+ import { Action1 } from "./common/Action1";
3
+ import { GNArray, GNHashtable } from "./common/GNData";
4
+ import { GNServerSettings } from "./config/GNServerSettings";
5
+ import { GoogleLoginType } from "./constant/enumType/GoogleLoginType";
6
+ import { OperationRequest } from "./entity/OperationRequest";
7
+ import { OperationResponse } from "./entity/OperationResponse";
8
+ import { CreateNewFileUploadInfoOperationResponse } from "./entity/response/CreateNewFileUploadInfoOperationResponse";
9
+ import { DebugOperationResponse } from "./entity/response/DebugOperationResponse";
10
+ import { EnterDisplayNameOperationResponse } from "./entity/response/EnterDisplayNameOperationResponse";
11
+ import { FetchAllDataOperationResponse } from "./entity/response/FetchAllDataOperationResponse";
12
+ import { FetchSparkPlayerOperationResponse } from "./entity/response/FetchSparkPlayerOperationResponse";
13
+ import { GetAppConfigOperationResponse } from "./entity/response/GetAppConfigOperationResponse";
14
+ import { GetFileUploadInfoOperationResponse } from "./entity/response/GetFileUploadInfoOperationResponse";
15
+ import { LoginOperationResponse } from "./entity/response/LoginOperationResponse";
16
+ import { LogoutOperationResponse } from "./entity/response/LogoutOperationResponse";
17
+ import { PublicAddressGetRandomMessageOperationResponse } from "./entity/response/PublicAddressGetRandomMessageOperationResponse";
18
+ import { RegisterAccountOperationResponse } from "./entity/response/RegisterAccountOperationResponse";
19
+ import { RegisterSocketOperationResponse } from "./entity/response/RegisterSocketOperationResponse";
20
+ import { TemplateOperationResponse } from "./entity/response/TemplateOperationResponse";
21
+ import { IServerEventHandler } from "./networking/handler/IServerEventHandler";
22
+ import { HttpAppResponse } from "./networking/HttpPeer";
23
+ import { NetworkingPeer } from "./networking/NetworkingPeer";
24
+ import { CustomOperationRequest } from "./entity/request/CustomOperationRequest";
25
+ import { CustomOperationResponse } from "./entity/response/CustomOperationResponse";
26
+ export declare class GNNetwork {
27
+ private static readonly AUTH_TOKEN_KEY;
28
+ private static readonly USER_ID_KEY;
29
+ private static readonly DEVICE_ID_KEY;
30
+ private static gnServerSettings;
31
+ static getGNServerSettings(): GNServerSettings;
32
+ static peer: NetworkingPeer;
33
+ static getPing(): number;
34
+ static getServerTimestamp(): number;
35
+ static setAuthToken(authToken: string): void;
36
+ static getAuthToken(): string;
37
+ static setUserId(userId: string): void;
38
+ static getUserId(): string;
39
+ static getPlatform(): number;
40
+ static getDeviceId(): string;
41
+ static getDeviceInfo(): string;
42
+ static init(gnServerSettings: GNServerSettings): void;
43
+ static run(): void;
44
+ static getClientSdkVersion(): string;
45
+ private static initServerSettings;
46
+ private static initGNDebug;
47
+ private static initGNSocketObject;
48
+ static sendViaSocket(request: OperationRequest, onResponse?: Action1<OperationResponse>): void;
49
+ static sendViaHttp(request: OperationRequest, onResponse?: Action1<OperationResponse>): void;
50
+ static sendViaSocketTRequestTResponse<TRequest extends CustomOperationRequest, TResponse extends CustomOperationResponse>(request: TRequest, onResponse?: Action1<TResponse>): void;
51
+ static sendViaHttpTRequestTResponse<TRequest extends CustomOperationRequest, TResponse extends CustomOperationResponse>(request: TRequest, onResponse?: Action1<TResponse>): void;
52
+ static sendViaSocketTResponse<TResponse extends CustomOperationResponse>(request: OperationRequest, onResponse?: Action1<TResponse>): void;
53
+ static sendViaHttpTResponse<TResponse extends CustomOperationResponse>(request: OperationRequest, onResponse?: Action1<TResponse>): void;
54
+ static connectSocket(_onSocketConnect?: Action0): void;
55
+ static disconnectSocket(_onSocketDisconnect?: Action0): void;
56
+ static setOnConnectHandler(_onConnectHandler: Action0): void;
57
+ static setOnDisconnectHandler(_onDisconnectHandler: Action0): void;
58
+ static removeOnConnectHandler(_onConnectHandler: Action0): void;
59
+ static removeOnDisconnectHandler(_onDisconnectHandler: Action0): void;
60
+ static subscriberServerEventHandler(serverEventHandler: IServerEventHandler): void;
61
+ static syncTs(onResponse?: Action1<number>): void;
62
+ static getConfig(configName: string, onResponse: Action1<string>): void;
63
+ static downloadFile(fileId: string, onHttpAppResponse: Action1<HttpAppResponse>): void;
64
+ static uploadFile(fileId: string, content: Uint8Array, mimeType: string, onHttpAppResponse: Action1<HttpAppResponse>): void;
65
+ static debug(booleanValue: boolean, numberValue: number, stringValue: string, gnHashtableValue: GNHashtable, gnArrayValue: GNArray, onResponse?: Action1<DebugOperationResponse>): void;
66
+ static enterDisplayName(displayName: string, onResponse?: Action1<EnterDisplayNameOperationResponse>): void;
67
+ static fetchAllData(onResponse?: Action1<FetchAllDataOperationResponse>): void;
68
+ static fetchSparkPlayer(onResponse?: Action1<FetchSparkPlayerOperationResponse>): void;
69
+ static getAppConfig(configTypes: GNArray, onResponse?: Action1<GetAppConfigOperationResponse>): void;
70
+ static accountLogin(username: string, password: string, onResponse?: Action1<LoginOperationResponse>): void;
71
+ static deviceLogin(onResponse?: Action1<LoginOperationResponse>): void;
72
+ static facebookLogin(facebookToken: string, onResponse?: Action1<LoginOperationResponse>): void;
73
+ static googleLogin(googleToken: string, googleLoginType: GoogleLoginType, onResponse?: Action1<LoginOperationResponse>): void;
74
+ static appleLogin(appleToken: string, displayName?: string, onResponse?: Action1<LoginOperationResponse>): void;
75
+ static userIdLogin(userId: string, onResponse?: Action1<LoginOperationResponse>): void;
76
+ static publicAddressLogin(signature: string, publicAddress: string, message: string, onResponse?: Action1<LoginOperationResponse>): void;
77
+ static publicAddressGetRandomMessage(onResponse?: Action1<PublicAddressGetRandomMessageOperationResponse>): void;
78
+ static customIdLogin(customId: string, onResponse?: Action1<LoginOperationResponse>): void;
79
+ static registerAccount(username: string, password: string, onResponse?: Action1<RegisterAccountOperationResponse>): void;
80
+ static registerSocket(sid: string, onResponse?: Action1<RegisterSocketOperationResponse>): void;
81
+ static template(booleanValue: boolean, onResponse?: Action1<TemplateOperationResponse>): void;
82
+ static createNewFileUploadInfo(originFileName: string, onResponse?: Action1<CreateNewFileUploadInfoOperationResponse>): void;
83
+ static getFileUploadInfo(fileId: string, onResponse?: Action1<GetFileUploadInfoOperationResponse>): void;
84
+ static logout(onResponse?: Action1<LogoutOperationResponse>): void;
85
+ }
@@ -0,0 +1,3 @@
1
+ export interface Action0 {
2
+ invoke: () => void;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface Action1<T> {
2
+ invoke: (t: T) => void;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface Action2<T1, T2> {
2
+ invoke: (t1: T1, t2: T2) => void;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface Action3<T1, T2, T3> {
2
+ invoke: (t1: T1, t2: T2, t3: T3) => void;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface Action4<T1, T2, T3, T4> {
2
+ invoke: (t1: T1, t2: T2, t3: T3, t4: T4) => void;
3
+ }
@@ -0,0 +1,69 @@
1
+ type GNDataType = string | number | boolean | null | GNArray | GNHashtable;
2
+ interface IGNData {
3
+ clear(): void;
4
+ remove(k: string | number): boolean;
5
+ count(): string | number;
6
+ getObject(k: string | number, def?: object): object;
7
+ getBoolean(k: string | number, def?: boolean): boolean;
8
+ getString(k: string | number, def?: string): string;
9
+ getNumber(k: string | number, def?: number): number;
10
+ getGNHashtable(k: string | number, def?: GNHashtable): GNHashtable;
11
+ getGNArray(k: string | number, def?: GNArray): GNArray;
12
+ }
13
+ declare abstract class GNData implements IGNData {
14
+ protected get<T>(k: string | number, def?: T): T;
15
+ abstract clear(): void;
16
+ abstract remove(k: string | number): boolean;
17
+ abstract count(): string | number;
18
+ getBoolean(k: string | number, def?: boolean): boolean;
19
+ getObject(k: string | number, def?: object): object;
20
+ getString(k: string | number, def?: string): string;
21
+ getNumber(k: string | number, def?: number): number;
22
+ getGNHashtable(k: string | number, def?: GNHashtable): GNHashtable;
23
+ getGNArray(k: string | number, def?: GNArray): GNArray;
24
+ private static createGNHashtableFromObject;
25
+ private static createGNArrayFromArray;
26
+ protected static createUseDataFromOriginData(value: any): GNDataType;
27
+ protected static createDataFromUseData(value: GNDataType): any;
28
+ abstract toData(): any;
29
+ }
30
+ export declare class GNHashtableBuilder {
31
+ private dict;
32
+ add(k: string, value: any): GNHashtableBuilder;
33
+ addAll(dict: {
34
+ [k: string]: any;
35
+ }): this;
36
+ constructor();
37
+ build(): GNHashtable;
38
+ }
39
+ export declare class GNHashtable extends GNData {
40
+ private dict;
41
+ clear(): void;
42
+ remove(k: string): boolean;
43
+ count(): number;
44
+ containsKey(k: string): boolean;
45
+ protected get<T>(k: string, def?: T): T;
46
+ add(k: string, value: any): void;
47
+ toData(): {};
48
+ static builder(): GNHashtableBuilder;
49
+ toString(): string;
50
+ }
51
+ export declare class GNArrayBuilder {
52
+ private array;
53
+ add(value: any): GNArrayBuilder;
54
+ addAll(array: any[]): GNArrayBuilder;
55
+ build(): GNArray;
56
+ constructor();
57
+ }
58
+ export declare class GNArray extends GNData {
59
+ private array;
60
+ clear(): void;
61
+ remove(k: number): boolean;
62
+ count(): number;
63
+ protected get<T>(k: number, def?: T): T;
64
+ add(value: any): void;
65
+ toData(): any[];
66
+ static builder(): GNArrayBuilder;
67
+ toString(): string;
68
+ }
69
+ export {};
@@ -0,0 +1,56 @@
1
+ import { LogType } from "./../logger/GNDebug";
2
+ export interface GNServerSettingsOptions {
3
+ serverAddress: string;
4
+ serverPort: number;
5
+ useSsl: boolean;
6
+ useSocket: boolean;
7
+ useHttp: boolean;
8
+ sendRate: number;
9
+ reconnectDelay: number;
10
+ pingInterval: number;
11
+ pingTimeout: number;
12
+ codeCanSendNotAuthorized: number[];
13
+ gnServerSourcePath: string;
14
+ logType: LogType;
15
+ }
16
+ export declare class GNServerSettings {
17
+ private serverAddress;
18
+ private serverPort;
19
+ private useSsl;
20
+ private useSocket;
21
+ private useHttp;
22
+ private sendRate;
23
+ private reconnectDelay;
24
+ private pingInterval;
25
+ private pingTimeout;
26
+ private codeCanSendNotAuthorized;
27
+ private gnServerSourcePath;
28
+ private logType;
29
+ config(options: GNServerSettingsOptions): void;
30
+ getServerAddress(): string;
31
+ setServerAddress(serverAddress: string): void;
32
+ getServerPort(): number;
33
+ setServerPort(serverPort: number): void;
34
+ isUseSsl(): boolean;
35
+ setUseSsl(useSsl: boolean): void;
36
+ isUseSocket(): boolean;
37
+ setUseSocket(useSocket: boolean): void;
38
+ isUseHttp(): boolean;
39
+ setUseHttp(useHttp: boolean): void;
40
+ getSendRate(): number;
41
+ setSendRate(sendRate: number): void;
42
+ getReconnectDelay(): number;
43
+ setReconnectDelay(reconnectDelay: number): void;
44
+ getPingInterval(): number;
45
+ setPingInterval(pingInterval: number): void;
46
+ getPingTimeout(): number;
47
+ setPingTimeout(pingTimeout: number): void;
48
+ getCodeCanSendNotAuthorized(): number[];
49
+ setCodeCanSendNotAuthorized(codeCanSendNotAuthorized: number[]): void;
50
+ getGNServerSourcePath(): string;
51
+ setGNServerSourcePath(gnServerSourcePath: string): void;
52
+ getLogType(): LogType;
53
+ setLogType(logType: LogType): void;
54
+ getSocketUrl(): string;
55
+ getHttpUrl(): string;
56
+ }
@@ -0,0 +1,16 @@
1
+ export declare class Commands {
2
+ static readonly USER_AGENT: string;
3
+ static readonly CONTENT_TYPE: string;
4
+ static readonly CONTENT_LENGHT: string;
5
+ static readonly APPLICATION_JSON: string;
6
+ static readonly APPLICATION_MSGPACK: string;
7
+ static readonly RequestAuthTokenCmd: string;
8
+ static readonly RequestCmd_MsgPack: string;
9
+ static readonly ResponseCmd_MsgPack: string;
10
+ static readonly EventCmd_MsgPack: string;
11
+ static readonly RequestCmd_Json: string;
12
+ static readonly ResponseCmd_Json: string;
13
+ static readonly EventCmd_Json: string;
14
+ static readonly Data: string;
15
+ static readonly File: string;
16
+ }
@@ -0,0 +1,3 @@
1
+ export declare class EventCode {
2
+ static readonly OnDebug: number;
3
+ }
@@ -0,0 +1,13 @@
1
+ export declare class OperationCode {
2
+ static readonly Logout: number;
3
+ static readonly Debug: number;
4
+ static readonly GetAppConfig: number;
5
+ static readonly Login: number;
6
+ static readonly RegisterAccount: number;
7
+ static readonly EnterDisplayName: number;
8
+ static readonly RegisterSocket: number;
9
+ static readonly FetchAllData: number;
10
+ static readonly CreateNewFileUploadInfo: number;
11
+ static readonly GetFileUploadInfo: number;
12
+ static readonly FetchSparkPlayer: number;
13
+ }
@@ -0,0 +1,12 @@
1
+ export declare class ReturnCode {
2
+ static readonly MaxSizeRequestReject: number;
3
+ static readonly MaxRequestReject: number;
4
+ static readonly MaxCCUReject: number;
5
+ static readonly OperationNotAuthorized: number;
6
+ static readonly InvalidRequestParameters: number;
7
+ static readonly OperationInvalid: number;
8
+ static readonly InternalServerError: number;
9
+ static readonly OperationTimeout: number;
10
+ static readonly UnknownError: number;
11
+ static readonly Ok: number;
12
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum FriendStatus {
2
+ Friend = 0,
3
+ WaitingAccept = 1,
4
+ SentRequestAndWaitingAccept = 2,
5
+ Unknown = 3
6
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum GoogleLoginType {
2
+ AccessToken = 1,
3
+ IdToken = 2
4
+ }
@@ -0,0 +1,17 @@
1
+ export declare enum InvalidMemberType {
2
+ UnknownError = 0,
3
+ DataRequired = 1,
4
+ TypeInvalid = 2,
5
+ StringNull = 3,
6
+ StringMinLength = 4,
7
+ StringMaxLength = 5,
8
+ NumberMinValue = 6,
9
+ NumberMaxValue = 7,
10
+ NumberMustInt = 8,
11
+ GNHashtableNull = 9,
12
+ GNHashtableMinLength = 10,
13
+ GNHashtableMaxLength = 11,
14
+ GNArrayNull = 12,
15
+ GNArrayMinLength = 13,
16
+ GNArrayMaxLength = 14
17
+ }
@@ -0,0 +1,10 @@
1
+ export declare enum LoginType {
2
+ Account = 1,
3
+ Device = 2,
4
+ Facebook = 3,
5
+ Google = 4,
6
+ Apple = 5,
7
+ UserId = 6,
8
+ PublicAddress = 7,
9
+ CustomId = 8
10
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum PlatformType {
2
+ PC = 0,
3
+ Android = 1,
4
+ iOS = 2,
5
+ WebGL = 3,
6
+ Editor = 4,
7
+ Unknown = 9
8
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum UserRoleType {
2
+ Administrator = 0,
3
+ GameMaster = 1,
4
+ SuperModerazor = 2,
5
+ Moderazor = 3,
6
+ User = 100,
7
+ UserNonActivate = 101
8
+ }
@@ -0,0 +1,3 @@
1
+ export declare class DebugErrorCode {
2
+ static readonly Ok: number;
3
+ }
@@ -0,0 +1,3 @@
1
+ export declare class EnterDisplayNameErrorCode {
2
+ static readonly Ok: number;
3
+ }
@@ -0,0 +1,4 @@
1
+ export declare class FetchAllDataErrorCode {
2
+ static readonly Ok: number;
3
+ static readonly UserHadBanned: number;
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare class FetchSparkPlayerErrorCode {
2
+ static readonly Ok: number;
3
+ static readonly UserHadBanned: number;
4
+ }
@@ -0,0 +1,5 @@
1
+ export declare class FileUploadInfoErrorCode {
2
+ static readonly Ok: number;
3
+ static readonly LimitFileUpload: number;
4
+ static readonly FileIdNotFound: number;
5
+ }
@@ -0,0 +1,3 @@
1
+ export declare class GetAppConfigErrorCode {
2
+ static readonly Ok: number;
3
+ }
@@ -0,0 +1,11 @@
1
+ export declare class LoginErrorCode {
2
+ static readonly Ok: number;
3
+ static readonly UserDoesNotExists: number;
4
+ static readonly ErrorWhenLoginFacebook: number;
5
+ static readonly UserDoesExists: number;
6
+ static readonly UserHadBanned: number;
7
+ static readonly ErrorWhenLoginApple: number;
8
+ static readonly RandomMessageExpired: number;
9
+ static readonly PublicAddressWrong: number;
10
+ static readonly MaxCCU: number;
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare class RegisterSocketErrorCode {
2
+ static readonly Ok: number;
3
+ }
@@ -0,0 +1,7 @@
1
+ export declare class DebugParameterCode {
2
+ static readonly String: string;
3
+ static readonly Number: string;
4
+ static readonly Boolean: string;
5
+ static readonly GNHashtable: string;
6
+ static readonly GNArray: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare class EnterDisplayNameParameterCode {
2
+ static readonly DisplayName: string;
3
+ static readonly UserRole: string;
4
+ }
@@ -0,0 +1,7 @@
1
+ export declare class FetchAllDataParameterCode {
2
+ static readonly UserId: string;
3
+ static readonly DisplayName: string;
4
+ static readonly UserRole: string;
5
+ static readonly TsExpire: string;
6
+ static readonly Reason: string;
7
+ }
@@ -0,0 +1,15 @@
1
+ export declare class FetchSparkPlayerParameterCode {
2
+ static readonly UserId: string;
3
+ static readonly UserExternal: string;
4
+ static readonly CustomId: string;
5
+ static readonly FacebookId: string;
6
+ static readonly GoogleUserId: string;
7
+ static readonly AppleUserId: string;
8
+ static readonly DeviceInfo: string;
9
+ static readonly PublicAddress: string;
10
+ static readonly TsExpire: string;
11
+ static readonly Reason: string;
12
+ static readonly UserRole: string;
13
+ static readonly TsCreate: string;
14
+ static readonly Fullname: string;
15
+ }
@@ -0,0 +1,11 @@
1
+ export declare class FileUploadInfoParameterCode {
2
+ static readonly FileId: string;
3
+ static readonly OriginFileName: string;
4
+ static readonly TsCreate: string;
5
+ static readonly TsUploadExpire: string;
6
+ static readonly UserId: string;
7
+ static readonly TsUploadFile: string;
8
+ static readonly MimeType: string;
9
+ static readonly Size: string;
10
+ static readonly FolderFileName: string;
11
+ }