com.xmobitea.changx.gn-unity 2.0.0 → 2.0.2
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 +294 -294
- package/Runtime/Config/GNServerSettings.cs +5 -9
- package/Runtime/Constant/EnumType/MatchmakingMemberStatus.cs.meta +11 -11
- package/Runtime/Constant/EnumType/MatchmakingTicketStatus.cs.meta +11 -11
- package/Runtime/Entity/DataMember.cs +1 -1
- package/Runtime/Entity/Models/MultiplayerModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerRequestModels.cs.meta +11 -11
- package/Runtime/Entity/Models/MultiplayerResponseModels.cs.meta +11 -11
- package/Runtime/GNNetworkMultiplayerApi.cs.meta +11 -11
- package/Runtime/Helper/ConverterService.cs +41 -12
- package/Runtime/Networking/Http/HttpPeer.cs +6 -2
- package/Runtime/Networking/Http/NetworkingPeerHttpClientRequest.cs +480 -363
- package/Runtime/Networking/Http/NetworkingPeerHttpRequest.cs +3 -68
- package/Runtime/Networking/Http/NetworkingPeerUnityWebRequest.cs +5 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
SerializedProperty pingInterval;
|
|
25
25
|
SerializedProperty pingTimout;
|
|
26
26
|
SerializedProperty peerSocketVersion;
|
|
27
|
-
SerializedProperty gnServerSourcePath;
|
|
27
|
+
//SerializedProperty gnServerSourcePath;
|
|
28
28
|
SerializedProperty httpRequestType;
|
|
29
29
|
SerializedProperty logType;
|
|
30
30
|
SerializedProperty adminSecretKey;
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
this.pingInterval = serializedObject.FindProperty("pingInterval");
|
|
48
48
|
this.pingTimout = serializedObject.FindProperty("pingTimeout");
|
|
49
49
|
this.peerSocketVersion = serializedObject.FindProperty("peerSocketVersion");
|
|
50
|
-
this.gnServerSourcePath = serializedObject.FindProperty("gnServerSourcePath");
|
|
50
|
+
//this.gnServerSourcePath = serializedObject.FindProperty("gnServerSourcePath");
|
|
51
51
|
this.httpRequestType = serializedObject.FindProperty("httpRequestType");
|
|
52
52
|
//postType = serializedObject.FindProperty("postType");
|
|
53
53
|
this.logType = serializedObject.FindProperty("logType");
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
EditorGUILayout.PropertyField(this.peerSocketVersion);
|
|
88
88
|
EditorGUILayout.Space(20);
|
|
89
89
|
|
|
90
|
-
EditorGUILayout.PropertyField(this.gnServerSourcePath);
|
|
90
|
+
//EditorGUILayout.PropertyField(this.gnServerSourcePath);
|
|
91
91
|
EditorGUILayout.PropertyField(this.httpRequestType);
|
|
92
92
|
//EditorGUILayout.PropertyField(postType);
|
|
93
93
|
EditorGUILayout.PropertyField(this.logType);
|
|
@@ -139,303 +139,303 @@
|
|
|
139
139
|
Application.OpenURL("https://github.com/XmobiTea-Family/GN-server");
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
[MenuItem("XmobiTea GN/Sync Server Folder")]
|
|
143
|
-
private static void SyncServerFolder()
|
|
144
|
-
{
|
|
145
|
-
|
|
142
|
+
//[MenuItem("XmobiTea GN/Sync Server Folder")]
|
|
143
|
+
//private static void SyncServerFolder()
|
|
144
|
+
//{
|
|
145
|
+
// Debug.Log("Sync Server Folder");
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
// SyncConstantFolder();
|
|
148
|
+
// SyncEnumTypeFolder();
|
|
149
|
+
// SyncParameterCodeFolder();
|
|
150
|
+
// SyncErrorCodeFolder();
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
}
|
|
152
|
+
// AssetDatabase.Refresh();
|
|
153
|
+
//}
|
|
154
154
|
|
|
155
|
-
private static void SyncEnumTypeFolder()
|
|
156
|
-
{
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
//private static void SyncEnumTypeFolder()
|
|
156
|
+
//{
|
|
157
|
+
// var gnServerSettings = GetSettings();
|
|
158
|
+
// var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/enumType";
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
160
|
+
// var allPathFiles = Directory.GetFiles(dir, "*.ts");
|
|
161
|
+
// for (var i = 0; i < allPathFiles.Length; i++)
|
|
162
|
+
// {
|
|
163
|
+
// GenerateEnumTypeFile(allPathFiles[i]);
|
|
164
|
+
// }
|
|
165
|
+
//}
|
|
166
166
|
|
|
167
|
-
private static void GenerateEnumTypeFile(string dirPath)
|
|
168
|
-
{
|
|
169
|
-
|
|
167
|
+
//private static void GenerateEnumTypeFile(string dirPath)
|
|
168
|
+
//{
|
|
169
|
+
// const string Template = "$name = $code,";
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
// var fileInfo = new FileInfo(dirPath);
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
private static void SyncParameterCodeFolder()
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
private static void GenerateParameterCodeFile(string dirPath)
|
|
225
|
-
{
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
private static void SyncErrorCodeFolder()
|
|
276
|
-
{
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
private static void GenerateErrorCodeFile(string dirPath)
|
|
288
|
-
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
private static void SyncConstantFolder()
|
|
339
|
-
{
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
private static void GenerateOperationCode()
|
|
345
|
-
{
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
private static void GenerateEventCode()
|
|
388
|
-
{
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
private static void WriteFile(string fileNameWithExtension, string dirPath, StringBuilder contentBuilder)
|
|
431
|
-
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
173
|
+
// var allLines = File.ReadAllLines(dirPath);
|
|
174
|
+
|
|
175
|
+
// var fileName = fileInfo.Name.Replace(".ts", string.Empty);
|
|
176
|
+
|
|
177
|
+
// var stringBuilder = new StringBuilder();
|
|
178
|
+
|
|
179
|
+
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
180
|
+
// stringBuilder.AppendLine();
|
|
181
|
+
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
182
|
+
// stringBuilder.AppendLine("{");
|
|
183
|
+
// stringBuilder.AppendLine(" public enum " + fileName);
|
|
184
|
+
// stringBuilder.AppendLine(" {");
|
|
185
|
+
// // Value0 = 0,
|
|
186
|
+
// for (var i = 0; i < allLines.Length; i++)
|
|
187
|
+
// {
|
|
188
|
+
// var line = allLines[i].Trim();
|
|
189
|
+
// if (string.IsNullOrEmpty(line)) continue;
|
|
190
|
+
// if (line.Contains("import")) continue;
|
|
191
|
+
// if (line.Contains("export class")) continue;
|
|
192
|
+
// if (line.Contains("export enum")) continue;
|
|
193
|
+
// if (line.Contains("{")) continue;
|
|
194
|
+
// if (line.Contains("}")) continue;
|
|
195
|
+
// if (line.Contains("//")) continue;
|
|
196
|
+
|
|
197
|
+
// var lineSpl0s = line.Split(',');
|
|
198
|
+
// var lineSpl01s = lineSpl0s[0].Split('=');
|
|
199
|
+
|
|
200
|
+
// var code = lineSpl01s[1].Trim();
|
|
201
|
+
// var name = lineSpl01s[0].Trim();
|
|
202
|
+
|
|
203
|
+
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
204
|
+
// }
|
|
205
|
+
|
|
206
|
+
// stringBuilder.AppendLine(" }");
|
|
207
|
+
// stringBuilder.AppendLine("}");
|
|
208
|
+
|
|
209
|
+
// WriteFile(fileName + ".cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant/EnumType", stringBuilder);
|
|
210
|
+
//}
|
|
211
|
+
|
|
212
|
+
//private static void SyncParameterCodeFolder()
|
|
213
|
+
//{
|
|
214
|
+
// var gnServerSettings = GetSettings();
|
|
215
|
+
// var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/parameterCode";
|
|
216
|
+
|
|
217
|
+
// var allPathFiles = Directory.GetFiles(dir, "*.ts");
|
|
218
|
+
// for (var i = 0; i < allPathFiles.Length; i++)
|
|
219
|
+
// {
|
|
220
|
+
// GenerateParameterCodeFile(allPathFiles[i]);
|
|
221
|
+
// }
|
|
222
|
+
//}
|
|
223
|
+
|
|
224
|
+
//private static void GenerateParameterCodeFile(string dirPath)
|
|
225
|
+
//{
|
|
226
|
+
// const string Template = "public const string $name = $code;";
|
|
227
|
+
|
|
228
|
+
// var fileInfo = new FileInfo(dirPath);
|
|
229
|
+
|
|
230
|
+
// var allLines = File.ReadAllLines(dirPath);
|
|
231
|
+
|
|
232
|
+
// var fileName = fileInfo.Name.Replace(".ts", string.Empty);
|
|
233
|
+
|
|
234
|
+
// if (fileName.Contains(".ext"))
|
|
235
|
+
// {
|
|
236
|
+
// fileName = fileName.Replace(".ext", string.Empty);
|
|
237
|
+
// }
|
|
238
|
+
|
|
239
|
+
// var stringBuilder = new StringBuilder();
|
|
240
|
+
|
|
241
|
+
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
242
|
+
// stringBuilder.AppendLine();
|
|
243
|
+
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
244
|
+
// stringBuilder.AppendLine("{");
|
|
245
|
+
// stringBuilder.AppendLine(" public partial class " + fileName);
|
|
246
|
+
// stringBuilder.AppendLine(" {");
|
|
247
|
+
// // Value0 = 0,
|
|
248
|
+
// for (var i = 0; i < allLines.Length; i++)
|
|
249
|
+
// {
|
|
250
|
+
// var line = allLines[i].Trim();
|
|
251
|
+
// if (string.IsNullOrEmpty(line)) continue;
|
|
252
|
+
// if (line.Contains("import")) continue;
|
|
253
|
+
// if (line.Contains("export class")) continue;
|
|
254
|
+
// if (line.Contains("export enum")) continue;
|
|
255
|
+
// if (line.Contains("{")) continue;
|
|
256
|
+
// if (line.Contains("}")) continue;
|
|
257
|
+
// if (line.Contains("//")) continue;
|
|
258
|
+
|
|
259
|
+
// var lineSpl0s = line.Split('=');
|
|
260
|
+
// var lineSpl01s = lineSpl0s[0].Split(' ');
|
|
261
|
+
// var lineSpl013s = lineSpl01s[3].Split(':');
|
|
262
|
+
|
|
263
|
+
// var code = lineSpl0s[1].Split(';')[0].Trim();
|
|
264
|
+
// var name = lineSpl013s[0];
|
|
265
|
+
|
|
266
|
+
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
267
|
+
// }
|
|
268
|
+
|
|
269
|
+
// stringBuilder.AppendLine(" }");
|
|
270
|
+
// stringBuilder.AppendLine("}");
|
|
271
|
+
|
|
272
|
+
// WriteFile(fileName + ".cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant/ParameterCode", stringBuilder);
|
|
273
|
+
//}
|
|
274
|
+
|
|
275
|
+
//private static void SyncErrorCodeFolder()
|
|
276
|
+
//{
|
|
277
|
+
// var gnServerSettings = GetSettings();
|
|
278
|
+
// var dir = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/errorCode";
|
|
279
|
+
|
|
280
|
+
// var allPathFiles = Directory.GetFiles(dir, "*.ts");
|
|
281
|
+
// for (var i = 0; i < allPathFiles.Length; i++)
|
|
282
|
+
// {
|
|
283
|
+
// GenerateErrorCodeFile(allPathFiles[i]);
|
|
284
|
+
// }
|
|
285
|
+
//}
|
|
286
|
+
|
|
287
|
+
//private static void GenerateErrorCodeFile(string dirPath)
|
|
288
|
+
//{
|
|
289
|
+
// const string Template = "public const int $name = $code;";
|
|
290
|
+
|
|
291
|
+
// var fileInfo = new FileInfo(dirPath);
|
|
292
|
+
|
|
293
|
+
// var allLines = File.ReadAllLines(dirPath);
|
|
294
|
+
|
|
295
|
+
// var fileName = fileInfo.Name.Replace(".ts", string.Empty);
|
|
296
|
+
|
|
297
|
+
// if (fileName.Contains(".ext"))
|
|
298
|
+
// {
|
|
299
|
+
// fileName = fileName.Replace(".ext", string.Empty);
|
|
300
|
+
// }
|
|
301
|
+
|
|
302
|
+
// var stringBuilder = new StringBuilder();
|
|
303
|
+
|
|
304
|
+
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
305
|
+
// stringBuilder.AppendLine();
|
|
306
|
+
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
307
|
+
// stringBuilder.AppendLine("{");
|
|
308
|
+
// stringBuilder.AppendLine(" public partial class " + fileName);
|
|
309
|
+
// stringBuilder.AppendLine(" {");
|
|
310
|
+
// // Value0 = 0,
|
|
311
|
+
// for (var i = 0; i < allLines.Length; i++)
|
|
312
|
+
// {
|
|
313
|
+
// var line = allLines[i].Trim();
|
|
314
|
+
// if (string.IsNullOrEmpty(line)) continue;
|
|
315
|
+
// if (line.Contains("import")) continue;
|
|
316
|
+
// if (line.Contains("export class")) continue;
|
|
317
|
+
// if (line.Contains("export enum")) continue;
|
|
318
|
+
// if (line.Contains("{")) continue;
|
|
319
|
+
// if (line.Contains("}")) continue;
|
|
320
|
+
// if (line.Contains("//")) continue;
|
|
321
|
+
|
|
322
|
+
// var lineSpl0s = line.Split('=');
|
|
323
|
+
// var lineSpl01s = lineSpl0s[0].Split(' ');
|
|
324
|
+
// var lineSpl013s = lineSpl01s[3].Split(':');
|
|
325
|
+
|
|
326
|
+
// var code = lineSpl0s[1].Split(';')[0].Trim();
|
|
327
|
+
// var name = lineSpl013s[0];
|
|
328
|
+
|
|
329
|
+
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
330
|
+
// }
|
|
331
|
+
|
|
332
|
+
// stringBuilder.AppendLine(" }");
|
|
333
|
+
// stringBuilder.AppendLine("}");
|
|
334
|
+
|
|
335
|
+
// WriteFile(fileName + ".cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant/ErrorCode", stringBuilder);
|
|
336
|
+
//}
|
|
337
|
+
|
|
338
|
+
//private static void SyncConstantFolder()
|
|
339
|
+
//{
|
|
340
|
+
// GenerateOperationCode();
|
|
341
|
+
// GenerateEventCode();
|
|
342
|
+
//}
|
|
343
|
+
|
|
344
|
+
//private static void GenerateOperationCode()
|
|
345
|
+
//{
|
|
346
|
+
// const string Template = "public const int $name = $code;";
|
|
347
|
+
|
|
348
|
+
// var gnServerSettings = GetSettings();
|
|
349
|
+
// var dirPath = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/OperationCode.ext.ts";
|
|
350
|
+
// var allLines = File.ReadAllLines(dirPath);
|
|
351
|
+
|
|
352
|
+
// var stringBuilder = new StringBuilder();
|
|
353
|
+
|
|
354
|
+
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
355
|
+
// stringBuilder.AppendLine();
|
|
356
|
+
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
357
|
+
// stringBuilder.AppendLine("{");
|
|
358
|
+
// stringBuilder.AppendLine(" public partial class OperationCode");
|
|
359
|
+
// stringBuilder.AppendLine(" {");
|
|
360
|
+
|
|
361
|
+
// for (var i = 0; i < allLines.Length; i++)
|
|
362
|
+
// {
|
|
363
|
+
// var line = allLines[i].Trim();
|
|
364
|
+
// if (string.IsNullOrEmpty(line)) continue;
|
|
365
|
+
// if (line.Contains("import")) continue;
|
|
366
|
+
// if (line.Contains("export class")) continue;
|
|
367
|
+
// if (line.Contains("export enum")) continue;
|
|
368
|
+
// if (line.Contains("{")) continue;
|
|
369
|
+
// if (line.Contains("}")) continue;
|
|
370
|
+
// if (line.Contains("//")) continue;
|
|
371
|
+
|
|
372
|
+
// var lineSpl0s = line.Split('=');
|
|
373
|
+
// var lineSpl01s = lineSpl0s[0].Split(' ');
|
|
374
|
+
// var lineSpl013s = lineSpl01s[3].Split(':');
|
|
375
|
+
|
|
376
|
+
// var code = lineSpl0s[1].Split(';')[0].Trim();
|
|
377
|
+
// var name = lineSpl013s[0];
|
|
378
|
+
|
|
379
|
+
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
380
|
+
// }
|
|
381
|
+
|
|
382
|
+
// stringBuilder.AppendLine(" }");
|
|
383
|
+
// stringBuilder.AppendLine("}");
|
|
384
|
+
// WriteFile("OperationCode.cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant", stringBuilder);
|
|
385
|
+
//}
|
|
386
|
+
|
|
387
|
+
//private static void GenerateEventCode()
|
|
388
|
+
//{
|
|
389
|
+
// const string Template = "public const int $name = $code;";
|
|
390
|
+
|
|
391
|
+
// var gnServerSettings = GetSettings();
|
|
392
|
+
// var dirPath = Application.dataPath + "/../../" + gnServerSettings.getGNServerSourcePath() + "/src/common/constant/EventCode.ext.ts";
|
|
393
|
+
// var allLines = File.ReadAllLines(dirPath);
|
|
394
|
+
|
|
395
|
+
// var stringBuilder = new StringBuilder();
|
|
396
|
+
|
|
397
|
+
// stringBuilder.AppendLine("// The file auto generate, please dont change it");
|
|
398
|
+
// stringBuilder.AppendLine();
|
|
399
|
+
// stringBuilder.AppendLine("namespace XmobiTea.GN.Constant");
|
|
400
|
+
// stringBuilder.AppendLine("{");
|
|
401
|
+
// stringBuilder.AppendLine(" public partial class EventCode");
|
|
402
|
+
// stringBuilder.AppendLine(" {");
|
|
403
|
+
|
|
404
|
+
// for (var i = 0; i < allLines.Length; i++)
|
|
405
|
+
// {
|
|
406
|
+
// var line = allLines[i].Trim();
|
|
407
|
+
// if (string.IsNullOrEmpty(line)) continue;
|
|
408
|
+
// if (line.Contains("import")) continue;
|
|
409
|
+
// if (line.Contains("export class")) continue;
|
|
410
|
+
// if (line.Contains("export enum")) continue;
|
|
411
|
+
// if (line.Contains("{")) continue;
|
|
412
|
+
// if (line.Contains("}")) continue;
|
|
413
|
+
// if (line.Contains("//")) continue;
|
|
414
|
+
|
|
415
|
+
// var lineSpl0s = line.Split('=');
|
|
416
|
+
// var lineSpl01s = lineSpl0s[0].Split(' ');
|
|
417
|
+
// var lineSpl013s = lineSpl01s[3].Split(':');
|
|
418
|
+
|
|
419
|
+
// var code = lineSpl0s[1].Split(';')[0].Trim();
|
|
420
|
+
// var name = lineSpl013s[0];
|
|
421
|
+
|
|
422
|
+
// stringBuilder.AppendLine(" " + Template.Replace("$name", name).Replace("$code", code));
|
|
423
|
+
// }
|
|
424
|
+
|
|
425
|
+
// stringBuilder.AppendLine(" }");
|
|
426
|
+
// stringBuilder.AppendLine("}");
|
|
427
|
+
// WriteFile("EventCode.cs", Application.dataPath + "/XmobiTea-constance/GN/Scripts/Constant", stringBuilder);
|
|
428
|
+
//}
|
|
429
|
+
|
|
430
|
+
//private static void WriteFile(string fileNameWithExtension, string dirPath, StringBuilder contentBuilder)
|
|
431
|
+
//{
|
|
432
|
+
// if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath);
|
|
433
|
+
// var filePath = Path.Combine(dirPath, fileNameWithExtension);
|
|
434
|
+
|
|
435
|
+
// if (File.Exists(filePath)) File.Delete(filePath);
|
|
436
|
+
// File.WriteAllText(filePath, contentBuilder.ToString());
|
|
437
|
+
|
|
438
|
+
// Debug.Log("Create file path " + fileNameWithExtension + " at " + filePath + " success.");
|
|
439
|
+
//}
|
|
440
440
|
}
|
|
441
441
|
}
|