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
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
339
340
341
342
343
344
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
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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
|
using System;
using System.Collections.Generic;
using KKSG;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class XActivityDocument : XDocComponent
{
public override uint ID
{
get
{
return XActivityDocument.uuID;
}
}
public static XActivityDocument Doc
{
get
{
return XSingleton<XGame>.singleton.Doc.GetXComponent(XActivityDocument.uuID) as XActivityDocument;
}
}
public ActivityListTable _ActivityListTable
{
get
{
return XActivityDocument._activityListTable;
}
}
public List<int> DragonResetTime
{
get
{
bool flag = this.m_DragonResetTime == null;
if (flag)
{
this.m_DragonResetTime = XSingleton<XGlobalConfig>.singleton.GetIntList("DragonResetWeekDay");
}
return this.m_DragonResetTime;
}
}
public List<MulActivityInfo> MulActivityList
{
get
{
return this.m_mulActivityList;
}
}
public MultiActivityList MulActivityTable
{
get
{
return XActivityDocument.m_mulActivityTable;
}
}
public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("ActivityDocument");
public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader();
private static ActivityListTable _activityListTable = new ActivityListTable();
private static DoubleActivity m_doubleActivityTab = new DoubleActivity();
public ActivityHandler View;
public int ServerOpenDay = 10000;
public int ServerOpenWeek = 10000;
public uint SeverOpenSecond = 10000u;
public uint ServerTimeSince1970 = 0u;
private int m_DayCountReqNum;
private List<int> m_DragonResetTime = null;
private List<MulActivityInfo> m_mulActivityList = new List<MulActivityInfo>();
private static MultiActivityList m_mulActivityTable = new MultiActivityList();
public string MainInterfaceTips = "";
public static void Execute(OnLoadedCallback callback = null)
{
XActivityDocument.AsyncLoader.AddTask("Table/ActivityList", XActivityDocument._activityListTable, false);
XActivityDocument.AsyncLoader.AddTask("Table/MultiActivityList", XActivityDocument.m_mulActivityTable, false);
XActivityDocument.AsyncLoader.AddTask("Table/DoubleActivity", XActivityDocument.m_doubleActivityTab, false);
XActivityDocument.AsyncLoader.Execute(callback);
}
public override void OnAttachToHost(XObject host)
{
base.OnAttachToHost(host);
}
public override void OnEnterSceneFinally()
{
base.OnEnterSceneFinally();
bool flag = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall;
if (flag)
{
this.SendQueryGetMulActInfo();
this.ReqDayCount();
}
}
protected override void EventSubscribe()
{
base.EventSubscribe();
base.RegisterEvent(XEventDefine.XEvent_GuildLevelChanged, new XComponent.XEventHandler(this.OnGuildLevelChanged));
base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnInGuildStateChanged));
base.RegisterEvent(XEventDefine.XEvent_PlayerLevelChange, new XComponent.XEventHandler(this.OnPlayerLevelChange));
}
protected override void OnReconnected(XReconnectedEventArgs arg)
{
bool flag = this.View != null && this.View.IsVisible();
if (flag)
{
this.ReqDayCount();
this.SendQueryGetMulActInfo();
}
}
public void ReqDayCount()
{
this.m_DayCountReqNum = 5;
XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
specificDocument.ReqTeamOp(TeamOperate.TEAM_QUERYCOUNT, 0UL, null, TeamMemberType.TMT_NORMAL, null);
XExpeditionDocument specificDocument2 = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
specificDocument2.GetSingleTowerActivityTop();
XBossBushDocument specificDocument3 = XDocuments.GetSpecificDocument<XBossBushDocument>(XBossBushDocument.uuID);
specificDocument3.SendQuery(BossRushReqStatus.BOSSRUSH_REQ_LEFTCOUNT);
XDragonCrusadeDocument specificDocument4 = XDocuments.GetSpecificDocument<XDragonCrusadeDocument>(XDragonCrusadeDocument.uuID);
specificDocument4.DEProgressReq();
XSuperRiskDocument doc = XSuperRiskDocument.Doc;
bool flag = XSingleton<XGameSysMgr>.singleton.IsSystemOpened(XSysDefine.XSys_SuperRisk);
if (flag)
{
RiskMapFile.RowData mapIdByIndex = doc.GetMapIdByIndex(0);
bool flag2 = mapIdByIndex != null && (ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level >= (ulong)((long)mapIdByIndex.NeedLevel);
if (flag2)
{
doc.ReqMapDynamicInfo(doc.CurrentMapID, false, true);
this.m_DayCountReqNum++;
}
}
XGuildDailyTaskDocument specificDocument5 = XDocuments.GetSpecificDocument<XGuildDailyTaskDocument>(XGuildDailyTaskDocument.uuID);
specificDocument5.SendGetDailyTaskInfo();
XGuildWeeklyBountyDocument.Doc.SendGetWeeklyTaskInfo();
XDragonNestDocument specificDocument6 = XDocuments.GetSpecificDocument<XDragonNestDocument>(XDragonNestDocument.uuID);
specificDocument6.SendReqDragonNestInfo();
}
public void SendQueryGetMulActInfo()
{
RpcC2G_MulActivityReq rpc = new RpcC2G_MulActivityReq();
XSingleton<XClientNetwork>.singleton.Send(rpc);
}
public void OnGetDayCount()
{
bool flag = this.m_DayCountReqNum == 0;
if (!flag)
{
this.m_DayCountReqNum--;
bool flag2 = this.m_DayCountReqNum == 0;
if (flag2)
{
bool flag3 = this.View != null && this.View.IsVisible();
if (flag3)
{
this.View.RefreshDailyActivity();
}
XSingleton<XTutorialHelper>.singleton.ActivityOpen = true;
}
}
}
public void SetMulActivityInfo(List<MulActivitInfo> list)
{
this.m_mulActivityList.Clear();
for (int i = 0; i < list.Count; i++)
{
MulActivityInfo mulActivityInfo = this.TurnSeverDataToSlientData(list[i]);
bool flag = mulActivityInfo == null;
if (!flag)
{
this.m_mulActivityList.Add(mulActivityInfo);
}
}
this.m_mulActivityList.Sort(new Comparison<MulActivityInfo>(this.Compare));
this.CheckEntranceState();
this.SetTagTips();
bool flag2 = this.View != null && this.View.IsVisible();
if (flag2)
{
this.View.RefreshMulActivity();
}
}
public void ChangeActivityState(List<MulActivitInfo> list)
{
for (int i = 0; i < list.Count; i++)
{
for (int j = 0; j < this.m_mulActivityList.Count; j++)
{
bool flag = this.m_mulActivityList[j].ID == list[i].id;
if (flag)
{
this.m_mulActivityList[j] = this.TurnSeverDataToSlientData(list[i]);
}
}
}
this.m_mulActivityList.Sort(new Comparison<MulActivityInfo>(this.Compare));
this.CheckEntranceState();
this.SetTagTips();
bool flag2 = this.View != null && this.View.IsVisible();
if (flag2)
{
this.View.RefreshMulActivity();
}
}
public MulActivityInfo TurnSeverDataToSlientData(MulActivitInfo serverData)
{
MulActivityInfo mulActivityInfo = new MulActivityInfo();
MultiActivityList.RowData byID = XActivityDocument.m_mulActivityTable.GetByID(serverData.id);
bool flag = byID == null || XSingleton<XAttributeMgr>.singleton.XPlayerData == null;
MulActivityInfo result;
if (flag)
{
result = null;
}
else
{
bool flag2 = !XSingleton<XGameSysMgr>.singleton.IsSystemOpen(byID.SystemID);
if (flag2)
{
result = null;
}
else
{
mulActivityInfo.Row = byID;
mulActivityInfo.isOpenAllDay = (byID.OpenDayTime[0, 0] == 0u && byID.OpenDayTime[0, 1] == 0u);
mulActivityInfo.ID = serverData.id;
mulActivityInfo.time = serverData.lefttime;
mulActivityInfo.timeState = serverData.openstate;
mulActivityInfo.endTime = (int)serverData.endmin;
mulActivityInfo.startTime = (int)serverData.beginmin;
bool flag3 = byID.SystemID == XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_WeekEndNest);
if (flag3)
{
mulActivityInfo.dayjoincount = (int)WeekEndNestDocument.Doc.JoindTimes;
}
else
{
mulActivityInfo.dayjoincount = serverData.dayjoincount;
}
mulActivityInfo.serverOpenWeekLeft = (int)(byID.OpenServerWeek - (uint)this.ServerOpenWeek);
mulActivityInfo.roleLevel = (uint)XSingleton<XGameSysMgr>.singleton.GetSysOpenLevel(byID.SystemID);
mulActivityInfo.serverOpenDayLeft = XSingleton<XGameSysMgr>.singleton.GetSysOpenServerDay(byID.SystemID) - this.ServerOpenDay;
bool flag4 = byID.NeedOpenAgain && serverData.real_open_state == ActOpenState.ActOpenState_NotOpen;
if (flag4)
{
mulActivityInfo.openState = false;
}
else
{
mulActivityInfo.openState = true;
}
XGuildDocument specificDocument = XDocuments.GetSpecificDocument<XGuildDocument>(XGuildDocument.uuID);
bool flag5 = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level < mulActivityInfo.roleLevel || (!specificDocument.bInGuild && byID.GuildLevel != 0u) || (specificDocument.bInGuild && specificDocument.Level < mulActivityInfo.Row.GuildLevel) || mulActivityInfo.serverOpenDayLeft > 0 || mulActivityInfo.serverOpenWeekLeft > 0;
if (flag5)
{
mulActivityInfo.state = MulActivityState.Lock;
}
else
{
bool flag6 = (byID.DayCountMax != -1 && serverData.dayjoincount >= byID.DayCountMax) || serverData.openstate == MulActivityTimeState.MULACTIVITY_END || serverData.openstate == MulActivityTimeState.MULACTIVITY_UNOPEN_TODAY;
if (flag6)
{
XVoiceQADocument specificDocument2 = XDocuments.GetSpecificDocument<XVoiceQADocument>(XVoiceQADocument.uuID);
bool flag7 = serverData.openstate == MulActivityTimeState.MULACTIVITY_RUNNING && byID.DayCountMax != -1 && serverData.dayjoincount >= byID.DayCountMax && (mulActivityInfo.ID == 4 || mulActivityInfo.ID == 6) && specificDocument2.IsVoiceQAIng;
if (flag7)
{
mulActivityInfo.state = MulActivityState.Open;
mulActivityInfo.dayjoincount = byID.DayCountMax - 1;
}
else
{
mulActivityInfo.state = MulActivityState.Grey;
bool flag8 = serverData.openstate == MulActivityTimeState.MULACTIVITY_UNOPEN_TODAY;
if (flag8)
{
mulActivityInfo.sortWeight = 9;
}
else
{
bool flag9 = serverData.openstate == MulActivityTimeState.MULACTIVITY_END;
if (flag9)
{
mulActivityInfo.sortWeight = 8;
}
else
{
mulActivityInfo.sortWeight = 7;
}
}
}
}
else
{
bool flag10 = serverData.openstate == MulActivityTimeState.MULACTIVITY_RUNNING;
if (flag10)
{
mulActivityInfo.state = MulActivityState.Open;
mulActivityInfo.sortWeight = (mulActivityInfo.isOpenAllDay ? 2 : 1);
}
else
{
bool flag11 = serverData.openstate == MulActivityTimeState.MULACTIVITY_BEfOREOPEN;
if (flag11)
{
mulActivityInfo.state = MulActivityState.WillOpen;
}
else
{
XSingleton<XDebug>.singleton.AddErrorLog("Undefine MulActivity State. MulActivity Name = ", mulActivityInfo.Row.Name, null, null, null, null);
}
}
}
}
result = mulActivityInfo;
}
}
return result;
}
public void SetScrollView(int sysId)
{
bool flag = DlgBase<DailyActivityDlg, TabDlgBehaviour>.singleton.ActivityHandler != null && DlgBase<DailyActivityDlg, TabDlgBehaviour>.singleton.ActivityHandler.IsVisible();
if (flag)
{
DlgBase<DailyActivityDlg, TabDlgBehaviour>.singleton.ActivityHandler.SetScrollView(sysId);
}
}
public void GetLeftDay(int sysID, ref int leftDay)
{
leftDay = 0;
if (sysID == 526)
{
DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0);
dateTime = dateTime.AddSeconds(this.ServerTimeSince1970);
dateTime = dateTime.ToLocalTime();
int num = XFastEnumIntEqualityComparer<DayOfWeek>.ToInt(dateTime.DayOfWeek);
for (int i = 0; i < this.DragonResetTime.Count; i++)
{
bool flag = num < this.DragonResetTime[i];
if (flag)
{
leftDay = this.DragonResetTime[i] - num;
bool flag2 = dateTime.Hour < 5;
if (flag2)
{
leftDay++;
}
break;
}
bool flag3 = num == this.DragonResetTime[i];
if (flag3)
{
bool flag4 = dateTime.Hour < 5;
if (flag4)
{
leftDay = 1;
break;
}
}
}
}
}
public void GetCount(int sysID, ref int leftCount, ref int totalCount, ref int canBuyCount)
{
XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
XArenaDocument specificDocument2 = XDocuments.GetSpecificDocument<XArenaDocument>(XArenaDocument.uuID);
totalCount = 0;
leftCount = 0;
canBuyCount = 0;
if (sysID <= 530)
{
if (sysID <= 111)
{
switch (sysID)
{
case 48:
{
XBossBushDocument specificDocument3 = XDocuments.GetSpecificDocument<XBossBushDocument>(XBossBushDocument.uuID);
leftCount = specificDocument3.leftChanllageCnt;
totalCount = XSingleton<XGlobalConfig>.singleton.GetInt("BossRushDayCount");
return;
}
case 49:
leftCount = XSuperRiskDocument.Doc.LeftDiceTime;
totalCount = XSingleton<XGlobalConfig>.singleton.GetInt("RiskDiceMaxNum");
return;
case 50:
{
XDragonCrusadeDocument specificDocument4 = XDocuments.GetSpecificDocument<XDragonCrusadeDocument>(XDragonCrusadeDocument.uuID);
leftCount = specificDocument4.leftChanllageCnt;
totalCount = XSingleton<XGlobalConfig>.singleton.GetInt("DragonCrusadeMaxNum");
return;
}
default:
if (sysID == 111)
{
leftCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelAbyss, null);
totalCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelAbyss, null);
canBuyCount = specificDocument.GetBuyLimit(TeamLevelType.TeamLevelAbyss) - specificDocument.GetBuyCount(TeamLevelType.TeamLevelAbyss);
canBuyCount = ((canBuyCount > 0) ? canBuyCount : 0);
return;
}
break;
}
}
else
{
if (sysID == 520)
{
leftCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelNest, null);
totalCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelNest, null);
canBuyCount = specificDocument.GetBuyLimit(TeamLevelType.TeamLevelNest) - specificDocument.GetBuyCount(TeamLevelType.TeamLevelNest);
canBuyCount = ((canBuyCount > 0) ? canBuyCount : 0);
return;
}
switch (sysID)
{
case 527:
case 530:
leftCount = specificDocument.SingleTowerData.leftcount;
totalCount = XSingleton<XGlobalConfig>.singleton.GetInt("TowerTeamDayCount");
return;
case 529:
leftCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelGoddessTrial, null);
totalCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelGoddessTrial, null);
return;
}
}
}
else if (sysID <= 886)
{
if (sysID == 540)
{
leftCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelEndlessAbyss, null);
totalCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelEndlessAbyss, null);
return;
}
if (sysID == 886)
{
XGuildDailyTaskDocument specificDocument5 = XDocuments.GetSpecificDocument<XGuildDailyTaskDocument>(XGuildDailyTaskDocument.uuID);
totalCount = specificDocument5.GetTaskItemCount();
leftCount = totalCount - specificDocument5.GetRewardedTaskCount();
return;
}
}
else
{
if (sysID == 890)
{
XGuildInheritDocument specificDocument6 = XDocuments.GetSpecificDocument<XGuildInheritDocument>(XGuildInheritDocument.uuID);
leftCount = (int)(specificDocument6.TeacherCount + specificDocument6.StudentCount);
totalCount = XSingleton<XGlobalConfig>.singleton.GetInt("GuildInheritTeaLimit") + XSingleton<XGlobalConfig>.singleton.GetInt("GuildInheritStuLimit");
return;
}
if (sysID == 904)
{
totalCount = XGuildWeeklyBountyDocument.Doc.CurGuildWeeklyTaskList.Count;
leftCount = totalCount - XGuildWeeklyBountyDocument.Doc.GetRewardedTaskCount();
return;
}
}
totalCount = 0;
leftCount = 0;
canBuyCount = 0;
}
protected bool OnGuildLevelChanged(XEventArgs e)
{
this.CheckEntranceState();
return true;
}
protected bool OnInGuildStateChanged(XEventArgs e)
{
this.CheckEntranceState();
return true;
}
private bool OnPlayerLevelChange(XEventArgs arg)
{
this.CheckEntranceState();
return true;
}
public void CheckEntranceState()
{
XGuildDocument specificDocument = XDocuments.GetSpecificDocument<XGuildDocument>(XGuildDocument.uuID);
int num = -1;
for (int i = 0; i < this.m_mulActivityList.Count; i++)
{
MulActivityInfo mulActivityInfo = this.m_mulActivityList[i];
MultiActivityList.RowData byID = XActivityDocument.m_mulActivityTable.GetByID(mulActivityInfo.ID);
bool flag = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level < mulActivityInfo.roleLevel || (!specificDocument.bInGuild && byID.GuildLevel != 0u) || (specificDocument.bInGuild && specificDocument.Level < mulActivityInfo.Row.GuildLevel);
if (!flag)
{
bool flag2 = byID.DayCountMax != -1 && mulActivityInfo.dayjoincount >= byID.DayCountMax;
if (!flag2)
{
bool flag3 = mulActivityInfo.timeState == MulActivityTimeState.MULACTIVITY_BEfOREOPEN;
if (flag3)
{
bool flag4 = num == -1;
if (flag4)
{
num = i;
}
else
{
bool flag5 = mulActivityInfo.startTime < this.m_mulActivityList[num].startTime;
if (flag5)
{
num = i;
}
}
}
}
}
}
bool flag6 = num == -1;
if (flag6)
{
this.MainInterfaceTips = "";
}
else
{
this.MainInterfaceTips = string.Format(XSingleton<UiUtility>.singleton.ReplaceReturn(XStringDefineProxy.GetString("MULACT_MAININTERFACE_TIPS")), XSingleton<UiUtility>.singleton.TimeFormatString(this.m_mulActivityList[num].startTime * 60, 3, 3, 3, false, true), this.m_mulActivityList[num].Row.Name);
}
}
public MultiActivityList.RowData GetMultiActivityTableInfo(XSysDefine sys)
{
for (int i = 0; i < XActivityDocument.m_mulActivityTable.Table.Length; i++)
{
bool flag = XActivityDocument.m_mulActivityTable.Table[i].SystemID == (int)sys;
if (flag)
{
return XActivityDocument.m_mulActivityTable.Table[i];
}
}
return null;
}
private int Compare(MulActivityInfo x, MulActivityInfo y)
{
bool flag = x.ID == y.ID;
int result;
if (flag)
{
result = 0;
}
else
{
bool flag2 = x.state != y.state;
if (flag2)
{
result = y.state - x.state;
}
else
{
bool flag3 = x.state == MulActivityState.Grey;
if (flag3)
{
result = x.sortWeight - y.sortWeight;
}
else
{
bool flag4 = x.state == MulActivityState.Open;
if (flag4)
{
bool flag5 = x.sortWeight != y.sortWeight;
if (flag5)
{
result = x.sortWeight - y.sortWeight;
}
else
{
result = (int)(x.time - y.time);
}
}
else
{
bool flag6 = x.state == MulActivityState.WillOpen;
if (flag6)
{
result = x.startTime - y.startTime;
}
else
{
result = 0;
}
}
}
}
}
return result;
}
private void SetTagTips()
{
bool flag = false;
for (int i = 0; i < this.m_mulActivityList.Count; i++)
{
MulActivityInfo mulActivityInfo = this.m_mulActivityList[i];
bool flag2 = mulActivityInfo == null;
if (!flag2)
{
bool flag3 = mulActivityInfo.state == MulActivityState.Open;
if (flag3)
{
mulActivityInfo.tagType = MulActivityTagType.Opening;
}
else
{
bool flag4 = mulActivityInfo.state == MulActivityState.WillOpen && !flag;
if (flag4)
{
mulActivityInfo.tagType = MulActivityTagType.WillOpen;
flag = true;
}
else
{
mulActivityInfo.tagType = MulActivityTagType.None;
}
}
}
}
}
public bool MainCityNeedEffect()
{
bool flag = XActivityDocument.m_doubleActivityTab == null;
bool result;
if (flag)
{
result = false;
}
else
{
for (int i = 0; i < XActivityDocument.m_doubleActivityTab.Table.Length; i++)
{
bool flag2 = !XSingleton<XGameSysMgr>.singleton.IsSystemOpen((int)XActivityDocument.m_doubleActivityTab.Table[i].SystemId);
if (!flag2)
{
bool flag3 = this.ParseData(XActivityDocument.m_doubleActivityTab.Table[i]);
if (flag3)
{
return true;
}
}
}
result = false;
}
return result;
}
public bool IsInnerDropTime(uint sysId)
{
bool flag = XActivityDocument.m_doubleActivityTab == null;
bool result;
if (flag)
{
result = false;
}
else
{
DoubleActivity.RowData bySystemId = XActivityDocument.m_doubleActivityTab.GetBySystemId(sysId);
result = this.ParseData(bySystemId);
}
return result;
}
private bool ParseData(DoubleActivity.RowData data)
{
bool flag = data == null;
bool result;
if (flag)
{
result = false;
}
else
{
bool flag2 = data.WeekOpenDays != null;
if (flag2)
{
result = this.ParseWeekDays(data.WeekOpenDays);
}
else
{
bool flag3 = data.TimeSpan != null;
result = (flag3 && this.ParseTimeSpan(data.TimeSpan));
}
}
return result;
}
private bool ParseWeekDays(uint[] weekOpenDays)
{
DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0);
dateTime = dateTime.AddSeconds(this.ServerTimeSince1970);
dateTime = dateTime.ToLocalTime();
for (int i = 0; i < weekOpenDays.Length; i++)
{
uint num = (weekOpenDays[i] != 7u) ? weekOpenDays[i] : 0u;
bool flag = num < 0u || num > 6u;
if (!flag)
{
bool flag2 = (ulong)num == (ulong)((long)XFastEnumIntEqualityComparer<DayOfWeek>.ToInt(dateTime.DayOfWeek));
if (flag2)
{
bool flag3 = dateTime.Hour >= 5;
if (flag3)
{
return true;
}
}
num = ((num + 1u > 6u) ? 0u : (num + 1u));
bool flag4 = (ulong)num == (ulong)((long)XFastEnumIntEqualityComparer<DayOfWeek>.ToInt(dateTime.DayOfWeek));
if (flag4)
{
bool flag5 = dateTime.Hour < 5;
if (flag5)
{
return true;
}
}
}
}
return false;
}
private bool ParseTimeSpan(uint[] timeSpan)
{
bool flag = timeSpan.Length < 5;
bool result;
if (flag)
{
result = false;
}
else
{
bool flag2 = timeSpan[1] > 12u || timeSpan[1] < 1u;
if (flag2)
{
result = false;
}
else
{
bool flag3 = timeSpan[2] > 31u || timeSpan[2] < 1u;
if (flag3)
{
result = false;
}
else
{
bool flag4 = timeSpan[3] > 24u;
if (flag4)
{
result = false;
}
else
{
DateTime d = new DateTime((int)timeSpan[0], (int)timeSpan[1], (int)timeSpan[2], (int)timeSpan[3], 0, 0);
DateTime d2 = new DateTime(1970, 1, 1, 0, 0, 0);
uint num = (uint)(d - d2).TotalSeconds;
uint num2 = num + timeSpan[4] * 3600u;
bool flag5 = this.ServerTimeSince1970 >= num && this.ServerTimeSince1970 <= num2;
result = flag5;
}
}
}
}
return result;
}
public void OnSystemChanged(List<uint> openIds, List<uint> closeIds)
{
bool flag = this.View == null || !this.View.IsVisible();
if (!flag)
{
bool flag2 = false;
bool flag3 = XActivityDocument._activityListTable != null;
if (flag3)
{
for (int i = 0; i < XActivityDocument._activityListTable.Table.Length; i++)
{
uint item = XActivityDocument._activityListTable.Table[i].SysID;
bool flag4 = openIds.Contains(item) || closeIds.Contains(item);
if (flag4)
{
flag2 = true;
break;
}
}
}
bool flag5 = false;
bool flag6 = XActivityDocument.m_mulActivityTable != null;
if (flag6)
{
for (int j = 0; j < XActivityDocument.m_mulActivityTable.Table.Length; j++)
{
uint item = (uint)XActivityDocument.m_mulActivityTable.Table[j].SystemID;
bool flag7 = openIds.Contains(item) || closeIds.Contains(item);
if (flag7)
{
flag5 = true;
break;
}
}
}
bool flag8 = flag2;
if (flag8)
{
this.View.RefreshDailyActivity();
}
bool flag9 = flag5;
if (flag9)
{
this.SendQueryGetMulActInfo();
}
}
}
}
}
|