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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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
213
214
215
216
217
218
219
220
221
222
223
224
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
|
using System;
using System.Collections.Generic;
using KKSG;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class BiochemicalHellDogDocument : XDocComponent
{
public override uint ID
{
get
{
return BiochemicalHellDogDocument.uuID;
}
}
public XThemeActivityDocument ActDoc
{
get
{
return XSingleton<XGame>.singleton.Doc.GetXComponent(XThemeActivityDocument.uuID) as XThemeActivityDocument;
}
}
public List<SuperActivityTask.RowData> RewardTableData
{
get
{
bool flag = this._RewardTableData != null;
List<SuperActivityTask.RowData> rewardTableData;
if (flag)
{
rewardTableData = this._RewardTableData;
}
else
{
this._RewardTableData = XTempActivityDocument.Doc.GetDataByActivityType(this.ActInfo.actid);
rewardTableData = this._RewardTableData;
}
return rewardTableData;
}
}
public SuperActivityTime.RowData ActInfo
{
get
{
bool flag = this._actInfo != null;
SuperActivityTime.RowData actInfo;
if (flag)
{
actInfo = this._actInfo;
}
else
{
XTempActivityDocument specificDocument = XDocuments.GetSpecificDocument<XTempActivityDocument>(XTempActivityDocument.uuID);
this._actInfo = specificDocument.GetDataBySystemID((uint)this.systemID);
bool flag2 = this._actInfo == null;
if (flag2)
{
XSingleton<XDebug>.singleton.AddErrorLog("SuperActivityTime SystemID:" + this.systemID + "No Find", null, null, null, null, null);
}
actInfo = this._actInfo;
}
return actInfo;
}
}
public FirstPassRankList RankList
{
get
{
return this._rankList;
}
}
public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("BiochemicalHellDogDocument");
public int curTime;
public int systemID = XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_ThemeActivity_HellDog);
public string[] sceneID = XSingleton<XGlobalConfig>.singleton.GetValue("BioHellSceneStage").Split(new char[]
{
'|'
});
public string[] tex = XSingleton<XGlobalConfig>.singleton.GetValue("BioHellTex").Split(new char[]
{
'|'
});
public static readonly uint REWARD_MAX = 3u;
private List<SuperActivityTask.RowData> _RewardTableData;
private SuperActivityTime.RowData _actInfo = null;
private FirstPassRankList _rankList = new FirstPassRankList();
private List<DesignationTable.RowData> m_titleRowList;
public enum Stage
{
Ready,
Processing,
End
}
protected override void OnReconnected(XReconnectedEventArgs arg)
{
}
protected override void EventSubscribe()
{
base.EventSubscribe();
base.RegisterEvent(XEventDefine.XEvent_ActivityTaskUpdate, new XComponent.XEventHandler(this.OnTaskChange));
}
private bool OnTaskChange(XEventArgs e)
{
XActivityTaskUpdatedArgs xactivityTaskUpdatedArgs = e as XActivityTaskUpdatedArgs;
bool flag = xactivityTaskUpdatedArgs.xActID == this.ActInfo.actid;
if (flag)
{
bool flag2 = DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.m_HellDogHandler != null && DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.m_HellDogHandler.m_HelpRewardHandler != null && DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.m_HellDogHandler.m_HelpRewardHandler.IsVisible();
if (flag2)
{
DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.m_HellDogHandler.m_HelpRewardHandler.SetData(this.GetRewardData());
}
bool flag3 = DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.m_HellDogHandler != null;
if (flag3)
{
DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.m_HellDogHandler.RefreshRedPoint();
}
}
return true;
}
public void RecordActivityPastTime(uint time, SeqListRef<uint> timestage)
{
this.curTime = (int)(time / 3600u);
XSingleton<XDebug>.singleton.AddGreenLog("time:" + time, null, null, null, null, null);
}
public bool GetRedPoint()
{
int i = 0;
int count = this.RewardTableData.Count;
while (i < count)
{
bool flag = XTempActivityDocument.Doc.GetActivityState(this.RewardTableData[i].actid, this.RewardTableData[i].taskid) == 1u;
if (flag)
{
return true;
}
i++;
}
return false;
}
public BiochemicalHellDogDocument.Stage GetStage(int type)
{
BiochemicalHellDogDocument.Stage result;
int num;
int num2;
this.GetTime(type, out result, out num, out num2);
return result;
}
public void GetTime(int type, out BiochemicalHellDogDocument.Stage timeStage, out int actStartTime, out int actEndTime)
{
actStartTime = 0;
actEndTime = 0;
for (int i = 0; i < this.sceneID.Length; i++)
{
bool flag = i != 0;
if (flag)
{
actStartTime += (int)this.ActInfo.timestage[i - 1, 0];
}
actEndTime += (int)this.ActInfo.timestage[i, 0];
bool flag2 = i == type;
if (flag2)
{
break;
}
}
bool flag3 = this.curTime < actStartTime;
if (flag3)
{
timeStage = BiochemicalHellDogDocument.Stage.Ready;
}
else
{
bool flag4 = this.curTime < actEndTime;
if (flag4)
{
timeStage = BiochemicalHellDogDocument.Stage.Processing;
}
else
{
timeStage = BiochemicalHellDogDocument.Stage.End;
}
}
}
public List<ActivityHelpReward> GetRewardData()
{
List<ActivityHelpReward> list = new List<ActivityHelpReward>();
bool flag = this.RewardTableData != null;
if (flag)
{
int i = 0;
int count = this.RewardTableData.Count;
while (i < count)
{
ActivityHelpReward activityHelpReward = new ActivityHelpReward();
activityHelpReward.index = i;
activityHelpReward.tableData = this.RewardTableData[i];
activityHelpReward.state = XTempActivityDocument.Doc.GetActivityState(this.RewardTableData[i].actid, this.RewardTableData[i].taskid);
activityHelpReward.sort = (int)activityHelpReward.state;
bool flag2 = (long)activityHelpReward.sort == 2L;
if (flag2)
{
activityHelpReward.sort = -1;
}
activityHelpReward.progress = XTempActivityDocument.Doc.GetActivityProgress(this.RewardTableData[i].actid, this.RewardTableData[i].taskid);
list.Add(activityHelpReward);
i++;
}
}
return list;
}
public void SendRankList()
{
RpcC2M_ClientQueryRankListNtf rpcC2M_ClientQueryRankListNtf = new RpcC2M_ClientQueryRankListNtf();
rpcC2M_ClientQueryRankListNtf.oArg.RankType = (uint)XFastEnumIntEqualityComparer<RankeType>.ToInt(RankeType.BioHelllRank);
XSingleton<XClientNetwork>.singleton.Send(rpcC2M_ClientQueryRankListNtf);
}
public void ReceiveRankList(ClientQueryRankListRes oRes)
{
bool flag = oRes.ErrorCode > ErrorCode.ERR_SUCCESS;
if (flag)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(oRes.ErrorCode, "fece00");
}
else
{
this._rankList.Init(oRes, false);
bool flag2 = DlgBase<BiochemicalHellDogRankView, BiochemicalHellDogRankBehaviour>.singleton.IsVisible();
if (flag2)
{
DlgBase<BiochemicalHellDogRankView, BiochemicalHellDogRankBehaviour>.singleton.FillContent();
}
}
}
public DesignationTable.RowData GetTittleNameByRank(int rank)
{
bool flag = this.m_titleRowList == null;
if (flag)
{
XDesignationDocument xdesignationDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XDesignationDocument.uuID) as XDesignationDocument;
this.m_titleRowList = new List<DesignationTable.RowData>();
int @int = XSingleton<XGlobalConfig>.singleton.GetInt("BiochemicalHellTitleType");
for (int i = 0; i < xdesignationDocument._DesignationTable.Table.Length; i++)
{
DesignationTable.RowData rowData = xdesignationDocument._DesignationTable.Table[i];
bool flag2 = rowData != null && rowData.CompleteType == @int;
if (flag2)
{
bool flag3 = !this.m_titleRowList.Contains(rowData);
if (flag3)
{
this.m_titleRowList.Add(rowData);
}
}
}
}
for (int j = 0; j < this.m_titleRowList.Count; j++)
{
bool flag4 = this.m_titleRowList[j].CompleteValue != null && this.m_titleRowList[j].CompleteValue.Length == 2;
if (flag4)
{
bool flag5 = rank >= this.m_titleRowList[j].CompleteValue[0] && rank <= this.m_titleRowList[j].CompleteValue[1];
if (flag5)
{
return this.m_titleRowList[j];
}
}
}
return null;
}
}
}
|