blob: 714a8ab21247d396c07bc7d63abd300d52c9d169 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
using System;
using System.Collections.Generic;
using KKSG;
using XUtliPoolLib;
namespace XMainClient
{
internal class Process_PtcG2C_UnitAppear
{
private static Queue<PtcG2C_UnitAppear> delayQueue = new Queue<PtcG2C_UnitAppear>();
private static XTimerMgr.ElapsedEventHandler processCb = null;
private static PtcG2C_UnitAppear currentPtc = null;
private static int currentProcessCount = 0;
private static bool processImmediate = true;
public static void Process(PtcG2C_UnitAppear roPtc)
{
bool flag = !XSingleton<XGame>.singleton.SyncMode;
if (!flag)
{
bool flag2 = Process_PtcG2C_UnitAppear.processImmediate;
if (flag2)
{
for (int i = 0; i < roPtc.Data.units.Count; i++)
{
XSingleton<XEntityMgr>.singleton.CreateEntityByUnitAppearance(roPtc.Data.units[i]);
}
}
else
{
Protocol.ManualReturn();
bool flag3 = Process_PtcG2C_UnitAppear.processCb == null;
if (flag3)
{
Process_PtcG2C_UnitAppear.processCb = new XTimerMgr.ElapsedEventHandler(Process_PtcG2C_UnitAppear.DelayProcess);
}
bool flag4 = Process_PtcG2C_UnitAppear.currentPtc != null;
if (flag4)
{
Process_PtcG2C_UnitAppear.delayQueue.Enqueue(roPtc);
}
else
{
Process_PtcG2C_UnitAppear.currentPtc = roPtc;
Process_PtcG2C_UnitAppear.currentProcessCount = 0;
}
XSingleton<XTimerMgr>.singleton.SetTimer(0.01f, Process_PtcG2C_UnitAppear.processCb, null);
}
}
}
private static void DelayProcess(object o)
{
bool flag = Process_PtcG2C_UnitAppear.currentPtc != null;
if (flag)
{
bool flag2 = Process_PtcG2C_UnitAppear.currentProcessCount < Process_PtcG2C_UnitAppear.currentPtc.Data.units.Count;
if (flag2)
{
UnitAppearance unit = Process_PtcG2C_UnitAppear.currentPtc.Data.units[Process_PtcG2C_UnitAppear.currentProcessCount];
XSingleton<XEntityMgr>.singleton.CreateEntityByUnitAppearance(unit);
Process_PtcG2C_UnitAppear.currentProcessCount++;
bool flag3 = Process_PtcG2C_UnitAppear.currentProcessCount < Process_PtcG2C_UnitAppear.currentPtc.Data.units.Count;
if (flag3)
{
XSingleton<XTimerMgr>.singleton.SetTimer(0.01f, Process_PtcG2C_UnitAppear.processCb, null);
}
else
{
bool flag4 = Process_PtcG2C_UnitAppear.delayQueue.Count > 0;
if (flag4)
{
Process_PtcG2C_UnitAppear.currentPtc = Process_PtcG2C_UnitAppear.delayQueue.Dequeue();
Process_PtcG2C_UnitAppear.currentProcessCount = 0;
XSingleton<XTimerMgr>.singleton.SetTimer(0.01f, Process_PtcG2C_UnitAppear.processCb, null);
}
else
{
bool flag5 = Process_PtcG2C_UnitAppear.currentPtc != null;
if (flag5)
{
Protocol.ReturnProtocolThread(Process_PtcG2C_UnitAppear.currentPtc);
Process_PtcG2C_UnitAppear.currentPtc = null;
}
}
}
}
}
}
}
}
|