com.xmobitea.changx.gn-unity 2.0.3 → 2.3.0
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.
- package/Editor/GNServerSettingsEditor.cs +16 -300
- package/Runtime/Common/GNArray.cs +387 -302
- package/Runtime/Common/GNArray.cs.meta +11 -11
- package/Runtime/Common/GNData.cs +61 -48
- package/Runtime/Common/GNData.cs.meta +11 -11
- package/Runtime/Common/GNHashtable.cs +404 -241
- package/Runtime/Common/GNHashtable.cs.meta +11 -11
- package/Runtime/Common/IGNData.cs +20 -11
- package/Runtime/Common/IGNData.cs.meta +11 -11
- package/Runtime/Common.meta +8 -8
- package/Runtime/Config/GNServerSettings.cs +136 -92
- package/Runtime/Config/GNServerSettings.cs.meta +11 -11
- package/Runtime/Config.meta +8 -8
- package/Runtime/Constant/Commands.cs +82 -19
- package/Runtime/Constant/Commands.cs.meta +11 -11
- package/Runtime/Constant/EnumType/FriendStatus.cs +12 -12
- package/Runtime/Constant/EnumType/FriendStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/GoogleLoginType.cs +5 -5
- package/Runtime/Constant/EnumType/GoogleLoginType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/GroupStatus.cs +7 -7
- package/Runtime/Constant/EnumType/GroupStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/InvalidMemberType.cs +23 -23
- package/Runtime/Constant/EnumType/InvalidMemberType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/ItemType.cs +5 -5
- package/Runtime/Constant/EnumType/ItemType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs +6 -6
- package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs +2 -2
- package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/OwnerType.cs +3 -2
- package/Runtime/Constant/EnumType/OwnerType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/PermissionDataItem.cs +10 -10
- package/Runtime/Constant/EnumType/PermissionDataItem.cs.meta +11 -11
- package/Runtime/Constant/EnumType/PushPlatformType.cs +10 -0
- package/Runtime/Constant/EnumType/PushPlatformType.cs.meta +11 -0
- package/Runtime/Constant/EnumType/RequestRole.cs +11 -11
- package/Runtime/Constant/EnumType/RequestRole.cs.meta +7 -7
- package/Runtime/Constant/EnumType/RequestType.cs +20 -19
- package/Runtime/Constant/EnumType/RequestType.cs.meta +11 -11
- package/Runtime/Constant/EnumType/StoreReceiveType.cs +13 -0
- package/Runtime/Constant/EnumType/StoreReceiveType.cs.meta +11 -0
- package/Runtime/Constant/EnumType.meta +8 -8
- package/Runtime/Constant/ErrorCode/GNErrorCode.cs +53 -48
- package/Runtime/Constant/ErrorCode/GNErrorCode.cs.meta +7 -7
- package/Runtime/Constant/ErrorCode.meta +8 -8
- package/Runtime/Constant/EventCode.cs +43 -16
- package/Runtime/Constant/EventCode.cs.meta +11 -11
- package/Runtime/Constant/OperationCode.cs +249 -211
- package/Runtime/Constant/OperationCode.cs.meta +11 -11
- package/Runtime/Constant/ParameterCode/GNParameterCode.cs +610 -466
- package/Runtime/Constant/ParameterCode/GNParameterCode.cs.meta +11 -11
- package/Runtime/Constant/ParameterCode/ParameterCode.cs +12 -12
- package/Runtime/Constant/ParameterCode/ParameterCode.cs.meta +11 -11
- package/Runtime/Constant/ParameterCode.meta +8 -8
- package/Runtime/Constant/ReturnCode.cs +73 -25
- package/Runtime/Constant/ReturnCode.cs.meta +11 -11
- package/Runtime/Constant.meta +8 -8
- package/Runtime/Entity/DataMember.cs +342 -124
- package/Runtime/Entity/DataMember.cs.meta +11 -11
- package/Runtime/Entity/GNMetadata.cs +72 -27
- package/Runtime/Entity/GNMetadata.cs.meta +11 -11
- package/Runtime/Entity/InvalidMember.cs +52 -33
- package/Runtime/Entity/InvalidMember.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateModels.cs +251 -207
- package/Runtime/Entity/Models/AuthenticateModels.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateRequestModels.cs +153 -131
- package/Runtime/Entity/Models/AuthenticateRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/AuthenticateResponseModels.cs +61 -51
- package/Runtime/Entity/Models/AuthenticateResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerModels.cs +985 -849
- package/Runtime/Entity/Models/CharacterPlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs +957 -885
- package/Runtime/Entity/Models/CharacterPlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs +165 -150
- package/Runtime/Entity/Models/CharacterPlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/CloudScriptModels.cs +185 -0
- package/Runtime/Entity/Models/CloudScriptModels.cs.meta +11 -0
- package/Runtime/Entity/Models/CloudScriptRequestModels.cs +134 -0
- package/Runtime/Entity/Models/CloudScriptRequestModels.cs.meta +11 -0
- package/Runtime/Entity/Models/CloudScriptResponseModels.cs +34 -0
- package/Runtime/Entity/Models/CloudScriptResponseModels.cs.meta +11 -0
- package/Runtime/Entity/Models/ContentModels.cs +150 -153
- package/Runtime/Entity/Models/ContentModels.cs.meta +11 -11
- package/Runtime/Entity/Models/ContentRequestModels.cs +129 -129
- package/Runtime/Entity/Models/ContentRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/ContentResponseModels.cs +24 -24
- package/Runtime/Entity/Models/ContentResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardModels.cs +1684 -1156
- package/Runtime/Entity/Models/DashboardModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardRequestModels.cs +220 -147
- package/Runtime/Entity/Models/DashboardRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/DashboardResponseModels.cs +92 -57
- package/Runtime/Entity/Models/DashboardResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerModels.cs +1073 -933
- package/Runtime/Entity/Models/GamePlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerRequestModels.cs +939 -867
- package/Runtime/Entity/Models/GamePlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GamePlayerResponseModels.cs +162 -147
- package/Runtime/Entity/Models/GamePlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GenericModels.cs +102 -102
- package/Runtime/Entity/Models/GenericModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupModels.cs +812 -676
- package/Runtime/Entity/Models/GroupModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupRequestModels.cs +741 -669
- package/Runtime/Entity/Models/GroupRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/GroupResponseModels.cs +129 -114
- package/Runtime/Entity/Models/GroupResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryModels.cs +667 -558
- package/Runtime/Entity/Models/InventoryModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryRequestModels.cs +626 -579
- package/Runtime/Entity/Models/InventoryRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/InventoryResponseModels.cs +109 -99
- package/Runtime/Entity/Models/InventoryResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerModels.cs +1882 -1340
- package/Runtime/Entity/Models/MasterPlayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerRequestModels.cs +1643 -1253
- package/Runtime/Entity/Models/MasterPlayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MasterPlayerResponseModels.cs +293 -213
- package/Runtime/Entity/Models/MasterPlayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerModels.cs +293 -223
- package/Runtime/Entity/Models/MultiplayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerRequestModels.cs +199 -149
- package/Runtime/Entity/Models/MultiplayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs +59 -49
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryModels.cs +514 -323
- package/Runtime/Entity/Models/StoreInventoryModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryRequestModels.cs +236 -165
- package/Runtime/Entity/Models/StoreInventoryRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/StoreInventoryResponseModels.cs +45 -30
- package/Runtime/Entity/Models/StoreInventoryResponseModels.cs.meta +11 -11
- package/Runtime/Entity/Models.meta +8 -8
- package/Runtime/Entity/OperationEvent.cs +111 -75
- package/Runtime/Entity/OperationEvent.cs.meta +11 -11
- package/Runtime/Entity/OperationHelper.cs +51 -35
- package/Runtime/Entity/OperationHelper.cs.meta +11 -11
- package/Runtime/Entity/OperationRequest.cs +142 -99
- package/Runtime/Entity/OperationRequest.cs.meta +11 -11
- package/Runtime/Entity/OperationResponse.cs +111 -63
- package/Runtime/Entity/OperationResponse.cs.meta +11 -11
- package/Runtime/Entity/Request/CustomOperationRequest.cs +112 -61
- package/Runtime/Entity/Request/CustomOperationRequest.cs.meta +11 -11
- package/Runtime/Entity/Request.meta +8 -8
- package/Runtime/Entity/Response/CustomOperationResponse.cs +84 -63
- package/Runtime/Entity/Response/CustomOperationResponse.cs.meta +11 -11
- package/Runtime/Entity/Response.meta +8 -8
- package/Runtime/Entity.meta +8 -8
- package/Runtime/GNNetwork.cs +496 -182
- package/Runtime/GNNetwork.cs.meta +11 -11
- package/Runtime/GNNetworkApi.cs +38 -19
- package/Runtime/GNNetworkApi.cs.meta +11 -11
- package/Runtime/GNNetworkAuthenticateApi.cs +531 -98
- package/Runtime/GNNetworkAuthenticateApi.cs.meta +11 -11
- package/Runtime/GNNetworkCharacterPlayerApi.cs +1587 -762
- package/Runtime/GNNetworkCharacterPlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkCloudScriptApi.cs +181 -0
- package/Runtime/GNNetworkCloudScriptApi.cs.meta +11 -0
- package/Runtime/GNNetworkContentApi.cs +238 -132
- package/Runtime/GNNetworkContentApi.cs.meta +11 -11
- package/Runtime/GNNetworkDashboardApi.cs +278 -117
- package/Runtime/GNNetworkDashboardApi.cs.meta +11 -11
- package/Runtime/GNNetworkGamePlayerApi.cs +1558 -747
- package/Runtime/GNNetworkGamePlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkGroupApi.cs +1228 -582
- package/Runtime/GNNetworkGroupApi.cs.meta +11 -11
- package/Runtime/GNNetworkInventoryApi.cs +1048 -507
- package/Runtime/GNNetworkInventoryApi.cs.meta +11 -11
- package/Runtime/GNNetworkMasterPlayerApi.cs +2586 -1067
- package/Runtime/GNNetworkMasterPlayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkMultiplayerApi.cs +328 -147
- package/Runtime/GNNetworkMultiplayerApi.cs.meta +11 -11
- package/Runtime/GNNetworkStoreInventoryApi.cs +388 -162
- package/Runtime/GNNetworkStoreInventoryApi.cs.meta +11 -11
- package/Runtime/Helper/CodeHelper.cs +140 -98
- package/Runtime/Helper/CodeHelper.cs.meta +11 -11
- package/Runtime/Helper/ConverterService.cs +236 -52
- package/Runtime/Helper/ConverterService.cs.meta +11 -11
- package/Runtime/Helper/ParseGNHelper.cs +451 -451
- package/Runtime/Helper/ParseGNHelper.cs.meta +11 -11
- package/Runtime/Helper.meta +8 -8
- package/Runtime/Logger/GNDebug.cs +92 -49
- package/Runtime/Logger/GNDebug.cs.meta +11 -11
- package/Runtime/Logger.meta +8 -8
- package/Runtime/Networking/AuthenticateStatus.cs +57 -35
- package/Runtime/Networking/AuthenticateStatus.cs.meta +11 -11
- package/Runtime/Networking/Handler/IServerEventHandler.cs +25 -25
- package/Runtime/Networking/Handler/IServerEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs +61 -32
- package/Runtime/Networking/Handler/OnCharacterPlayerFriendUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs +54 -33
- package/Runtime/Networking/Handler/OnCharacterPlayerGroupUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs +54 -32
- package/Runtime/Networking/Handler/OnGamePlayerFriendUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs +54 -32
- package/Runtime/Networking/Handler/OnGamePlayerGroupUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs +48 -29
- package/Runtime/Networking/Handler/OnGroupMemberUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs +47 -29
- package/Runtime/Networking/Handler/OnGroupMessageUpdateEventHandler.cs.meta +11 -11
- package/Runtime/Networking/Handler.meta +8 -8
- package/Runtime/Networking/Http/HttpPeer.cs +68 -25
- package/Runtime/Networking/Http/HttpPeer.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs +65 -25
- package/Runtime/Networking/Http/NetworkingHttpPeerBase.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs +513 -486
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs +172 -142
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs.meta +11 -11
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs +225 -188
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs.meta +11 -11
- package/Runtime/Networking/Http.meta +8 -8
- package/Runtime/Networking/IPeer.cs +41 -19
- package/Runtime/Networking/IPeer.cs.meta +11 -11
- package/Runtime/Networking/NetworkingPeer.cs +198 -144
- package/Runtime/Networking/NetworkingPeer.cs.meta +11 -11
- package/Runtime/Networking/NetworkingPeerAPI.cs +20 -21
- package/Runtime/Networking/NetworkingPeerAPI.cs.meta +11 -11
- package/Runtime/Networking/OperationPending.cs +159 -95
- package/Runtime/Networking/OperationPending.cs.meta +11 -11
- package/Runtime/Networking/PeerBase.cs +305 -242
- package/Runtime/Networking/PeerBase.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingPeerSocketV2.cs +222 -185
- package/Runtime/Networking/Socket/NetworkingPeerSocketV2.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingPeerSocketV3.cs +235 -177
- package/Runtime/Networking/Socket/NetworkingPeerSocketV3.cs.meta +11 -11
- package/Runtime/Networking/Socket/NetworkingSocketPeerBase.cs +165 -23
- package/Runtime/Networking/Socket/NetworkingSocketPeerBase.cs.meta +11 -11
- package/Runtime/Networking/Socket/SocketPeer.cs +242 -197
- package/Runtime/Networking/Socket/SocketPeer.cs.meta +11 -11
- package/Runtime/Networking/Socket.meta +8 -8
- package/Runtime/Networking.meta +8 -8
- package/Runtime/Unity/ServiceCoroutine.cs +10 -0
- package/Runtime/Unity/ServiceCoroutine.cs.meta +11 -0
- package/Runtime/Unity/ServiceUpdate.cs +33 -20
- package/Runtime/Unity/ServiceUpdate.cs.meta +11 -11
- package/Runtime/Unity.meta +8 -8
- package/Runtime/XmobiTea.GN.runtime.asmdef +16 -16
- package/Runtime/XmobiTea.GN.runtime.asmdef.meta +7 -7
- package/package.json +1 -1
|
@@ -78,21 +78,36 @@
|
|
|
78
78
|
EditorGUILayout.PropertyField(this.serverPort);
|
|
79
79
|
EditorGUILayout.PropertyField(this.useSsl);
|
|
80
80
|
EditorGUILayout.PropertyField(this.sendRate);
|
|
81
|
+
EditorGUILayout.Space(10);
|
|
82
|
+
|
|
81
83
|
EditorGUILayout.PropertyField(this.useHttp);
|
|
84
|
+
if (this.useHttp.boolValue)
|
|
85
|
+
{
|
|
86
|
+
EditorGUILayout.PropertyField(this.httpRequestType);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
EditorGUILayout.Space(10);
|
|
90
|
+
|
|
82
91
|
EditorGUILayout.PropertyField(this.useSocket);
|
|
83
92
|
|
|
84
93
|
if (this.useSocket.boolValue)
|
|
85
94
|
{
|
|
95
|
+
#if UNITY_USING_BEST_HTTP
|
|
86
96
|
EditorGUILayout.PropertyField(this.reconnectDelay);
|
|
87
97
|
EditorGUILayout.PropertyField(this.pingInterval);
|
|
88
98
|
EditorGUILayout.PropertyField(this.pingTimout);
|
|
89
99
|
EditorGUILayout.PropertyField(this.peerSocketVersion);
|
|
100
|
+
#else
|
|
101
|
+
EditorGUILayout.LabelField("GN Unity Client current only support BEST_HTTP/2 to handle socket");
|
|
102
|
+
EditorGUILayout.LabelField("You must import BEST_HTTP/2 package");
|
|
103
|
+
EditorGUILayout.LabelField("\tand define UNITY_USING_BEST_HTTP on Project Settings/Player");
|
|
104
|
+
EditorGUILayout.LabelField("\t\t-> Scripting Define Symbols");
|
|
105
|
+
#endif
|
|
90
106
|
}
|
|
91
107
|
|
|
92
108
|
EditorGUILayout.Space(20);
|
|
93
109
|
|
|
94
110
|
//EditorGUILayout.PropertyField(this.gnServerSourcePath);
|
|
95
|
-
EditorGUILayout.PropertyField(this.httpRequestType);
|
|
96
111
|
//EditorGUILayout.PropertyField(postType);
|
|
97
112
|
EditorGUILayout.PropertyField(this.logType);
|
|
98
113
|
|
|
@@ -142,304 +157,5 @@
|
|
|
142
157
|
{
|
|
143
158
|
Application.OpenURL("https://github.com/XmobiTea-Family/GN-server");
|
|
144
159
|
}
|
|
145
|
-
|
|
146
|
-
//[MenuItem("XmobiTea GN/Sync Server Folder")]
|
|
147
|
-
//private static void SyncServerFolder()
|
|
148
|
-
//{
|
|
149
|
-
// Debug.Log("Sync Server Folder");
|
|
150
|
-
|
|
151
|
-
// SyncConstantFolder();
|
|
152
|
-
// SyncEnumTypeFolder();
|
|
153
|
-
// SyncParameterCodeFolder();
|
|
154
|
-
// SyncErrorCodeFolder();
|
|
155
|
-
|
|
156
|
-
// AssetDatabase.Refresh();
|
|
157
|
-
//}
|
|
158
|
-
|
|
159
|
-
//private static void SyncEnumTypeFolder()
|
|
160
|
-
//{
|
|
161
|
-
// var gnServerSettings = GetSettings();
|
|
162
|
-
// var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/enumType";
|
|
163
|
-
|
|
164
|
-
// var allPathFiles = Directory.GetFiles(dir, "*.ts");
|
|
165
|
-
// for (var i = 0; i < allPathFiles.Length; i++)
|
|
166
|
-
// {
|
|
167
|
-
// GenerateEnumTypeFile(allPathFiles[i]);
|
|
168
|
-
// }
|
|
169
|
-
//}
|
|
170
|
-
|
|
171
|
-
//private static void GenerateEnumTypeFile(string dirPath)
|
|
172
|
-
//{
|
|
173
|
-
// const string Template = "$name = $code,";
|
|
174
|
-
|
|
175
|
-
// var fileInfo = new FileInfo(dirPath);
|
|
176
|
-
|
|
177
|
-
// var allLines = File.ReadAllLines(dirPath);
|
|
178
|
-
|
|
179
|
-
// var fileName = fileInfo.Name.Replace(".ts", string.Empty);
|
|
180
|
-
|
|
181
|
-
// var stringBuilder = new StringBuilder();
|
|
182
|
-
|
|
183
|
-
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
184
|
-
// stringBuilder.AppendLine();
|
|
185
|
-
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
186
|
-
// stringBuilder.AppendLine("{");
|
|
187
|
-
// stringBuilder.AppendLine(" public enum " + fileName);
|
|
188
|
-
// stringBuilder.AppendLine(" {");
|
|
189
|
-
// // Value0 = 0,
|
|
190
|
-
// for (var i = 0; i < allLines.Length; i++)
|
|
191
|
-
// {
|
|
192
|
-
// var line = allLines[i].Trim();
|
|
193
|
-
// if (string.IsNullOrEmpty(line)) continue;
|
|
194
|
-
// if (line.Contains("import")) continue;
|
|
195
|
-
// if (line.Contains("export class")) continue;
|
|
196
|
-
// if (line.Contains("export enum")) continue;
|
|
197
|
-
// if (line.Contains("{")) continue;
|
|
198
|
-
// if (line.Contains("}")) continue;
|
|
199
|
-
// if (line.Contains("//")) continue;
|
|
200
|
-
|
|
201
|
-
// var lineSpl0s = line.Split(',');
|
|
202
|
-
// var lineSpl01s = lineSpl0s[0].Split('=');
|
|
203
|
-
|
|
204
|
-
// var code = lineSpl01s[1].Trim();
|
|
205
|
-
// var name = lineSpl01s[0].Trim();
|
|
206
|
-
|
|
207
|
-
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
208
|
-
// }
|
|
209
|
-
|
|
210
|
-
// stringBuilder.AppendLine(" }");
|
|
211
|
-
// stringBuilder.AppendLine("}");
|
|
212
|
-
|
|
213
|
-
// WriteFile(fileName + ".cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant/EnumType", stringBuilder);
|
|
214
|
-
//}
|
|
215
|
-
|
|
216
|
-
//private static void SyncParameterCodeFolder()
|
|
217
|
-
//{
|
|
218
|
-
// var gnServerSettings = GetSettings();
|
|
219
|
-
// var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/parameterCode";
|
|
220
|
-
|
|
221
|
-
// var allPathFiles = Directory.GetFiles(dir, "*.ts");
|
|
222
|
-
// for (var i = 0; i < allPathFiles.Length; i++)
|
|
223
|
-
// {
|
|
224
|
-
// GenerateParameterCodeFile(allPathFiles[i]);
|
|
225
|
-
// }
|
|
226
|
-
//}
|
|
227
|
-
|
|
228
|
-
//private static void GenerateParameterCodeFile(string dirPath)
|
|
229
|
-
//{
|
|
230
|
-
// const string Template = "public const string $name = $code;";
|
|
231
|
-
|
|
232
|
-
// var fileInfo = new FileInfo(dirPath);
|
|
233
|
-
|
|
234
|
-
// var allLines = File.ReadAllLines(dirPath);
|
|
235
|
-
|
|
236
|
-
// var fileName = fileInfo.Name.Replace(".ts", string.Empty);
|
|
237
|
-
|
|
238
|
-
// if (fileName.Contains(".ext"))
|
|
239
|
-
// {
|
|
240
|
-
// fileName = fileName.Replace(".ext", string.Empty);
|
|
241
|
-
// }
|
|
242
|
-
|
|
243
|
-
// var stringBuilder = new StringBuilder();
|
|
244
|
-
|
|
245
|
-
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
246
|
-
// stringBuilder.AppendLine();
|
|
247
|
-
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
248
|
-
// stringBuilder.AppendLine("{");
|
|
249
|
-
// stringBuilder.AppendLine(" public partial class " + fileName);
|
|
250
|
-
// stringBuilder.AppendLine(" {");
|
|
251
|
-
// // Value0 = 0,
|
|
252
|
-
// for (var i = 0; i < allLines.Length; i++)
|
|
253
|
-
// {
|
|
254
|
-
// var line = allLines[i].Trim();
|
|
255
|
-
// if (string.IsNullOrEmpty(line)) continue;
|
|
256
|
-
// if (line.Contains("import")) continue;
|
|
257
|
-
// if (line.Contains("export class")) continue;
|
|
258
|
-
// if (line.Contains("export enum")) continue;
|
|
259
|
-
// if (line.Contains("{")) continue;
|
|
260
|
-
// if (line.Contains("}")) continue;
|
|
261
|
-
// if (line.Contains("//")) continue;
|
|
262
|
-
|
|
263
|
-
// var lineSpl0s = line.Split('=');
|
|
264
|
-
// var lineSpl01s = lineSpl0s[0].Split(' ');
|
|
265
|
-
// var lineSpl013s = lineSpl01s[3].Split(':');
|
|
266
|
-
|
|
267
|
-
// var code = lineSpl0s[1].Split(';')[0].Trim();
|
|
268
|
-
// var name = lineSpl013s[0];
|
|
269
|
-
|
|
270
|
-
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
271
|
-
// }
|
|
272
|
-
|
|
273
|
-
// stringBuilder.AppendLine(" }");
|
|
274
|
-
// stringBuilder.AppendLine("}");
|
|
275
|
-
|
|
276
|
-
// WriteFile(fileName + ".cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant/ParameterCode", stringBuilder);
|
|
277
|
-
//}
|
|
278
|
-
|
|
279
|
-
//private static void SyncErrorCodeFolder()
|
|
280
|
-
//{
|
|
281
|
-
// var gnServerSettings = GetSettings();
|
|
282
|
-
// var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/errorCode";
|
|
283
|
-
|
|
284
|
-
// var allPathFiles = Directory.GetFiles(dir, "*.ts");
|
|
285
|
-
// for (var i = 0; i < allPathFiles.Length; i++)
|
|
286
|
-
// {
|
|
287
|
-
// GenerateErrorCodeFile(allPathFiles[i]);
|
|
288
|
-
// }
|
|
289
|
-
//}
|
|
290
|
-
|
|
291
|
-
//private static void GenerateErrorCodeFile(string dirPath)
|
|
292
|
-
//{
|
|
293
|
-
// const string Template = "public const int $name = $code;";
|
|
294
|
-
|
|
295
|
-
// var fileInfo = new FileInfo(dirPath);
|
|
296
|
-
|
|
297
|
-
// var allLines = File.ReadAllLines(dirPath);
|
|
298
|
-
|
|
299
|
-
// var fileName = fileInfo.Name.Replace(".ts", string.Empty);
|
|
300
|
-
|
|
301
|
-
// if (fileName.Contains(".ext"))
|
|
302
|
-
// {
|
|
303
|
-
// fileName = fileName.Replace(".ext", string.Empty);
|
|
304
|
-
// }
|
|
305
|
-
|
|
306
|
-
// var stringBuilder = new StringBuilder();
|
|
307
|
-
|
|
308
|
-
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
309
|
-
// stringBuilder.AppendLine();
|
|
310
|
-
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
311
|
-
// stringBuilder.AppendLine("{");
|
|
312
|
-
// stringBuilder.AppendLine(" public partial class " + fileName);
|
|
313
|
-
// stringBuilder.AppendLine(" {");
|
|
314
|
-
// // Value0 = 0,
|
|
315
|
-
// for (var i = 0; i < allLines.Length; i++)
|
|
316
|
-
// {
|
|
317
|
-
// var line = allLines[i].Trim();
|
|
318
|
-
// if (string.IsNullOrEmpty(line)) continue;
|
|
319
|
-
// if (line.Contains("import")) continue;
|
|
320
|
-
// if (line.Contains("export class")) continue;
|
|
321
|
-
// if (line.Contains("export enum")) continue;
|
|
322
|
-
// if (line.Contains("{")) continue;
|
|
323
|
-
// if (line.Contains("}")) continue;
|
|
324
|
-
// if (line.Contains("//")) continue;
|
|
325
|
-
|
|
326
|
-
// var lineSpl0s = line.Split('=');
|
|
327
|
-
// var lineSpl01s = lineSpl0s[0].Split(' ');
|
|
328
|
-
// var lineSpl013s = lineSpl01s[3].Split(':');
|
|
329
|
-
|
|
330
|
-
// var code = lineSpl0s[1].Split(';')[0].Trim();
|
|
331
|
-
// var name = lineSpl013s[0];
|
|
332
|
-
|
|
333
|
-
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
334
|
-
// }
|
|
335
|
-
|
|
336
|
-
// stringBuilder.AppendLine(" }");
|
|
337
|
-
// stringBuilder.AppendLine("}");
|
|
338
|
-
|
|
339
|
-
// WriteFile(fileName + ".cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant/ErrorCode", stringBuilder);
|
|
340
|
-
//}
|
|
341
|
-
|
|
342
|
-
//private static void SyncConstantFolder()
|
|
343
|
-
//{
|
|
344
|
-
// GenerateOperationCode();
|
|
345
|
-
// GenerateEventCode();
|
|
346
|
-
//}
|
|
347
|
-
|
|
348
|
-
//private static void GenerateOperationCode()
|
|
349
|
-
//{
|
|
350
|
-
// const string Template = "public const int $name = $code;";
|
|
351
|
-
|
|
352
|
-
// var gnServerSettings = GetSettings();
|
|
353
|
-
// var dirPath = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/OperationCode.ext.ts";
|
|
354
|
-
// var allLines = File.ReadAllLines(dirPath);
|
|
355
|
-
|
|
356
|
-
// var stringBuilder = new StringBuilder();
|
|
357
|
-
|
|
358
|
-
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
359
|
-
// stringBuilder.AppendLine();
|
|
360
|
-
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
361
|
-
// stringBuilder.AppendLine("{");
|
|
362
|
-
// stringBuilder.AppendLine(" public partial class OperationCode");
|
|
363
|
-
// stringBuilder.AppendLine(" {");
|
|
364
|
-
|
|
365
|
-
// for (var i = 0; i < allLines.Length; i++)
|
|
366
|
-
// {
|
|
367
|
-
// var line = allLines[i].Trim();
|
|
368
|
-
// if (string.IsNullOrEmpty(line)) continue;
|
|
369
|
-
// if (line.Contains("import")) continue;
|
|
370
|
-
// if (line.Contains("export class")) continue;
|
|
371
|
-
// if (line.Contains("export enum")) continue;
|
|
372
|
-
// if (line.Contains("{")) continue;
|
|
373
|
-
// if (line.Contains("}")) continue;
|
|
374
|
-
// if (line.Contains("//")) continue;
|
|
375
|
-
|
|
376
|
-
// var lineSpl0s = line.Split('=');
|
|
377
|
-
// var lineSpl01s = lineSpl0s[0].Split(' ');
|
|
378
|
-
// var lineSpl013s = lineSpl01s[3].Split(':');
|
|
379
|
-
|
|
380
|
-
// var code = lineSpl0s[1].Split(';')[0].Trim();
|
|
381
|
-
// var name = lineSpl013s[0];
|
|
382
|
-
|
|
383
|
-
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
384
|
-
// }
|
|
385
|
-
|
|
386
|
-
// stringBuilder.AppendLine(" }");
|
|
387
|
-
// stringBuilder.AppendLine("}");
|
|
388
|
-
// WriteFile("OperationCode.cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant", stringBuilder);
|
|
389
|
-
//}
|
|
390
|
-
|
|
391
|
-
//private static void GenerateEventCode()
|
|
392
|
-
//{
|
|
393
|
-
// const string Template = "public const int $name = $code;";
|
|
394
|
-
|
|
395
|
-
// var gnServerSettings = GetSettings();
|
|
396
|
-
// var dirPath = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/EventCode.ext.ts";
|
|
397
|
-
// var allLines = File.ReadAllLines(dirPath);
|
|
398
|
-
|
|
399
|
-
// var stringBuilder = new StringBuilder();
|
|
400
|
-
|
|
401
|
-
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
402
|
-
// stringBuilder.AppendLine();
|
|
403
|
-
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
404
|
-
// stringBuilder.AppendLine("{");
|
|
405
|
-
// stringBuilder.AppendLine(" public partial class EventCode");
|
|
406
|
-
// stringBuilder.AppendLine(" {");
|
|
407
|
-
|
|
408
|
-
// for (var i = 0; i < allLines.Length; i++)
|
|
409
|
-
// {
|
|
410
|
-
// var line = allLines[i].Trim();
|
|
411
|
-
// if (string.IsNullOrEmpty(line)) continue;
|
|
412
|
-
// if (line.Contains("import")) continue;
|
|
413
|
-
// if (line.Contains("export class")) continue;
|
|
414
|
-
// if (line.Contains("export enum")) continue;
|
|
415
|
-
// if (line.Contains("{")) continue;
|
|
416
|
-
// if (line.Contains("}")) continue;
|
|
417
|
-
// if (line.Contains("//")) continue;
|
|
418
|
-
|
|
419
|
-
// var lineSpl0s = line.Split('=');
|
|
420
|
-
// var lineSpl01s = lineSpl0s[0].Split(' ');
|
|
421
|
-
// var lineSpl013s = lineSpl01s[3].Split(':');
|
|
422
|
-
|
|
423
|
-
// var code = lineSpl0s[1].Split(';')[0].Trim();
|
|
424
|
-
// var name = lineSpl013s[0];
|
|
425
|
-
|
|
426
|
-
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
427
|
-
// }
|
|
428
|
-
|
|
429
|
-
// stringBuilder.AppendLine(" }");
|
|
430
|
-
// stringBuilder.AppendLine("}");
|
|
431
|
-
// WriteFile("EventCode.cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant", stringBuilder);
|
|
432
|
-
//}
|
|
433
|
-
|
|
434
|
-
//private static void WriteFile(string fileNameWithExtension, string dirPath, StringBuilder contentBuilder)
|
|
435
|
-
//{
|
|
436
|
-
// if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath);
|
|
437
|
-
// var filePath = Path.Combine(dirPath, fileNameWithExtension);
|
|
438
|
-
|
|
439
|
-
// if (File.Exists(filePath)) File.Delete(filePath);
|
|
440
|
-
// File.WriteAllText(filePath, contentBuilder.ToString());
|
|
441
|
-
|
|
442
|
-
// Debug.Log("Create file path " + fileNameWithExtension + " at " + filePath + " success.");
|
|
443
|
-
//}
|
|
444
160
|
}
|
|
445
161
|
}
|