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
|
using System;
using System.Collections.Generic;
using KKSG;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class XTeamLeagueBattleDocument : XDocComponent
{
public override uint ID
{
get
{
return XTeamLeagueBattleDocument.uuID;
}
}
public LeagueBattleTeamData LoadingInfoBlue
{
get
{
return this.m_LoadingInfoBlue;
}
}
public LeagueBattleTeamData LoadingInfoRed
{
get
{
return this.m_LoadingInfoRed;
}
}
public LeagueBattleOneTeam BattleBaseInfoBlue
{
get
{
return this.m_BattleBaseInfoBlue;
}
}
public LeagueBattleOneTeam BattleBaseInfoRed
{
get
{
return this.m_BattleBaseInfoRed;
}
}
public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("TeamLeagueBattleDocument");
private LeagueBattleTeamData m_LoadingInfoBlue;
private LeagueBattleTeamData m_LoadingInfoRed;
private LeagueBattleOneTeam m_BattleBaseInfoBlue;
private LeagueBattleOneTeam m_BattleBaseInfoRed;
public bool IsInTeamLeague = false;
public bool IsInBattleTeamLeague = false;
public LeagueBattleRoleState SelfBattleState = LeagueBattleRoleState.LBRoleState_None;
public int BlueCanBattleNum = 0;
public int RedCanBattleNum = 0;
public ulong BluePKingRoleID = 0UL;
public ulong RedPKingRoleID = 0UL;
public LeagueBattleFightState BattleState = LeagueBattleFightState.LBFight_None;
protected override void OnReconnected(XReconnectedEventArgs arg)
{
}
public override void OnEnterSceneFinally()
{
base.OnEnterSceneFinally();
DlgBase<XTeamLeagueLoadingView, XTeamLeagueLoadingBehaviour>.singleton.HidePkLoading();
}
public ulong GetBattleTeamLeagueID(ulong roleID)
{
bool flag = this.LoadingInfoBlue != null;
if (flag)
{
for (int i = 0; i < this.LoadingInfoBlue.members.Count; i++)
{
bool flag2 = this.LoadingInfoBlue.members[i].roleid == roleID;
if (flag2)
{
return this.LoadingInfoBlue.league_teamid;
}
}
}
bool flag3 = this.LoadingInfoRed != null;
if (flag3)
{
for (int j = 0; j < this.LoadingInfoRed.members.Count; j++)
{
bool flag4 = this.LoadingInfoRed.members[j].roleid == roleID;
if (flag4)
{
return this.LoadingInfoRed.league_teamid;
}
}
}
return 0UL;
}
public void SetBattlePKInfo(LeagueBattleLoadInfoNtf data)
{
XFreeTeamVersusLeagueDocument specificDocument = XDocuments.GetSpecificDocument<XFreeTeamVersusLeagueDocument>(XFreeTeamVersusLeagueDocument.uuID);
bool flag = data.team1 == null || data.team2 == null;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("[TeamLeague:SetBattlePKInfo] LeagueBattleLoadInfoNtf team == null", null, null, null, null, null);
}
else
{
bool flag2 = data.team1.league_teamid == specificDocument.TeamLeagueID;
if (flag2)
{
this.m_LoadingInfoBlue = data.team1;
this.m_LoadingInfoRed = data.team2;
}
else
{
bool flag3 = data.team2.league_teamid == specificDocument.TeamLeagueID;
if (flag3)
{
this.m_LoadingInfoBlue = data.team2;
this.m_LoadingInfoRed = data.team1;
}
else
{
this.m_LoadingInfoBlue = data.team1;
this.m_LoadingInfoRed = data.team2;
}
}
}
}
public void UpdateBattleBaseData(LeagueBattleBaseDataNtf data)
{
XSingleton<XDebug>.singleton.AddLog("[TeamLeague]UpdateBattleBaseData", null, null, null, null, null, XDebugColor.XDebug_None);
bool flag = data.team1 == null || data.team2 == null;
if (flag)
{
XSingleton<XDebug>.singleton.AddLog("[TeamLeague]UpdateBattleBaseData team == null", null, null, null, null, null, XDebugColor.XDebug_None);
}
else
{
this.IsInTeamLeague = false;
this.IsInBattleTeamLeague = false;
this.SelfBattleState = LeagueBattleRoleState.LBRoleState_None;
this.BlueCanBattleNum = 0;
this.RedCanBattleNum = 0;
this.BluePKingRoleID = 0UL;
this.RedPKingRoleID = 0UL;
XFreeTeamVersusLeagueDocument specificDocument = XDocuments.GetSpecificDocument<XFreeTeamVersusLeagueDocument>(XFreeTeamVersusLeagueDocument.uuID);
List<LeagueBattleOneTeam> list = new List<LeagueBattleOneTeam>();
list.Add(data.team1);
list.Add(data.team2);
bool flag2 = data.team1.league_teamid == specificDocument.TeamLeagueID;
if (flag2)
{
this.m_BattleBaseInfoBlue = data.team1;
this.m_BattleBaseInfoRed = data.team2;
this.IsInTeamLeague = true;
}
else
{
bool flag3 = data.team2.league_teamid == specificDocument.TeamLeagueID;
if (flag3)
{
this.m_BattleBaseInfoBlue = data.team2;
this.m_BattleBaseInfoRed = data.team1;
this.IsInTeamLeague = true;
}
else
{
this.m_BattleBaseInfoBlue = data.team1;
this.m_BattleBaseInfoRed = data.team2;
}
}
for (int i = 0; i < list.Count; i++)
{
LeagueBattleOneTeam leagueBattleOneTeam = list[i];
for (int j = 0; j < leagueBattleOneTeam.members.Count; j++)
{
bool flag4 = leagueBattleOneTeam.members[j].basedata.roleid == XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID;
if (flag4)
{
this.IsInBattleTeamLeague = true;
this.SelfBattleState = leagueBattleOneTeam.members[j].state;
}
bool flag5 = leagueBattleOneTeam.members[j].state == LeagueBattleRoleState.LBRoleState_Fighting;
if (flag5)
{
bool flag6 = leagueBattleOneTeam == this.m_BattleBaseInfoBlue;
if (flag6)
{
this.BluePKingRoleID = leagueBattleOneTeam.members[j].basedata.roleid;
}
else
{
bool flag7 = leagueBattleOneTeam == this.m_BattleBaseInfoRed;
if (flag7)
{
this.RedPKingRoleID = leagueBattleOneTeam.members[j].basedata.roleid;
}
}
}
bool flag8 = leagueBattleOneTeam.members[j].state != LeagueBattleRoleState.LBRoleState_Failed && leagueBattleOneTeam.members[j].state != LeagueBattleRoleState.LBRoleState_Leave && leagueBattleOneTeam.members[j].state != LeagueBattleRoleState.LBRoleState_None;
if (flag8)
{
bool flag9 = leagueBattleOneTeam == this.m_BattleBaseInfoBlue;
if (flag9)
{
this.BlueCanBattleNum++;
}
else
{
bool flag10 = leagueBattleOneTeam == this.m_BattleBaseInfoRed;
if (flag10)
{
this.RedCanBattleNum++;
}
}
}
}
}
bool flag11 = DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.IsVisible();
if (flag11)
{
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.RefreshBattleBaseInfo();
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.RefreshBattleState();
}
}
}
public void ReqBattle(LeagueBattleReadyOper type)
{
RpcC2G_LeagueBattleReadyReq rpcC2G_LeagueBattleReadyReq = new RpcC2G_LeagueBattleReadyReq();
rpcC2G_LeagueBattleReadyReq.oArg.type = type;
XSingleton<XClientNetwork>.singleton.Send(rpcC2G_LeagueBattleReadyReq);
}
public void OnLeagueBattleStateNtf(LeagueBattleStateNtf data)
{
XSingleton<XDebug>.singleton.AddLog("[TeamLeague]OnLeagueBattleStateNtf", data.state.ToString(), " ", data.lefttime.ToString(), null, null, XDebugColor.XDebug_None);
this.BattleState = data.state;
switch (data.state)
{
case LeagueBattleFightState.LBFight_None:
XSingleton<XDebug>.singleton.AddErrorLog("OnLeagueBattleStateNtf state == LBFight_None", null, null, null, null, null);
break;
case LeagueBattleFightState.LBFight_Wait:
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.SetVisible(true, true);
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.RefreshBattleState();
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.ResetCommonUI(false);
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.CloseSmallReward();
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.RefreahCountTime(data.lefttime);
break;
case LeagueBattleFightState.LBFight_Fight:
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.SetVisible(true, true);
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.RefreshBattleState();
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.ResetCommonUI(true);
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.CloseSmallReward();
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.RefreahCountTime(data.lefttime);
break;
case LeagueBattleFightState.LBFight_Result:
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.SetVisible(false, true);
break;
}
bool flag = DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.IsVisible();
if (flag)
{
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.RefreshBattleBaseInfo();
}
}
public void OnSmallReward(LeagueBattleOneResultNtf data)
{
bool flag = data == null;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("SmallReward Is Null", null, null, null, null, null);
}
else
{
bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_LEAGUE_BATTLE;
if (flag2)
{
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.PlaySmallReward(data);
}
}
}
public void OnBigReward(LeagueBattleResultNtf data)
{
bool flag = data == null;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("BigReward Is Null", null, null, null, null, null);
}
else
{
bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_LEAGUE_BATTLE;
if (flag2)
{
DlgBase<XTeamLeagueBattlePrepareView, XTeamLeagueBattlePrepareBehaviour>.singleton.PlayBigReward(data);
}
}
}
public bool FindBlueMember(ulong roleid)
{
bool flag = this.m_LoadingInfoBlue == null;
bool result;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("m_LoadingInfoBlue is null", null, null, null, null, null);
result = false;
}
else
{
for (int i = 0; i < this.m_LoadingInfoBlue.members.Count; i++)
{
bool flag2 = roleid == this.m_LoadingInfoBlue.members[i].roleid;
if (flag2)
{
return true;
}
}
result = false;
}
return result;
}
public bool FindRedMember(ulong roleid)
{
bool flag = this.m_LoadingInfoRed == null;
bool result;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("m_LoadingInfoRed is null", null, null, null, null, null);
result = false;
}
else
{
for (int i = 0; i < this.m_LoadingInfoRed.members.Count; i++)
{
bool flag2 = roleid == this.m_LoadingInfoRed.members[i].roleid;
if (flag2)
{
return true;
}
}
result = false;
}
return result;
}
}
}
|