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
|
using System;
using System.Collections.Generic;
using KKSG;
using MiniJSON;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUpdater;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class GameCommunityHandler : DlgHandlerBase
{
protected override string FileName
{
get
{
return "GameSystem/GameCommunityDlg";
}
}
private XMainInterfaceDocument _doc = null;
private int _bgWidthDelta;
private bool _widthInit = false;
public IXUISprite m_Bg;
public Transform m_SystemParent;
protected override void Init()
{
base.Init();
this._doc = XDocuments.GetSpecificDocument<XMainInterfaceDocument>(XMainInterfaceDocument.uuID);
this.m_Bg = (base.transform.Find("Bg/Bg").GetComponent("XUISprite") as IXUISprite);
this.m_SystemParent = base.transform.Find("Bg/Sys");
XSingleton<XChatIFlyMgr>.singleton.RefreshWebViewConfig();
}
protected override void OnShow()
{
base.OnShow();
bool flag = XSingleton<XLoginDocument>.singleton.Channel == XAuthorizationChannel.XAuthorization_QQ;
int num = 0;
int num2 = 0;
for (int i = 0; i < this._doc.GameCommunityReader.Table.Length; i++)
{
GameCommunityTable.RowData rowData = this._doc.GameCommunityReader.Table[i];
IXUIButton ixuibutton = this.m_SystemParent.Find(rowData.ButtonName).GetComponent("XUIButton") as IXUIButton;
ixuibutton.SetVisible(false);
GameObject gameObject = ixuibutton.gameObject.transform.Find("RedPoint").gameObject;
bool flag2 = i == 0;
if (flag2)
{
num2 = ixuibutton.spriteWidth;
bool flag3 = !this._widthInit;
if (flag3)
{
this._widthInit = true;
this._bgWidthDelta = this.m_Bg.spriteWidth - num2;
}
}
bool flag4 = (ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level < (ulong)((long)rowData.OpenLevel);
if (!flag4)
{
bool flag5 = !XSingleton<XGameSysMgr>.singleton.IsSystemOpened((XSysDefine)rowData.SysID);
if (!flag5)
{
bool flag6 = !this.LoginStateTrue(rowData);
if (!flag6)
{
bool flag7 = rowData.ID == 13;
if (flag7)
{
bool flag8 = this.IsSuportReplay();
if (flag8)
{
ixuibutton.SetVisible(true);
ixuibutton.gameObject.transform.localPosition = new Vector3((float)(num * num2), 0f);
ixuibutton.ID = (ulong)((long)rowData.ID);
ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSysBtnClick));
num++;
}
}
else
{
bool flag9 = rowData.ID == 12;
if (flag9)
{
bool flag10 = this.GetQuestionnaireStage() == 0;
if (!flag10)
{
ixuibutton.SetVisible(true);
ixuibutton.gameObject.transform.localPosition = new Vector3((float)(num * num2), 0f);
ixuibutton.ID = (ulong)((long)rowData.ID);
ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSysBtnClick));
num++;
gameObject.SetActive(XSingleton<XGameSysMgr>.singleton.GetSysRedPointStateConsiderBlock(XSysDefine.XSys_Questionnaire));
}
}
else
{
bool flag11 = rowData.ID == 14;
if (flag11)
{
XSingleton<XDebug>.singleton.AddLog("Is show tv: ", this._doc.ShowWebView.ToString(), null, null, null, null, XDebugColor.XDebug_None);
bool flag12 = SystemInfo.processorType.StartsWith("Intel");
int num3 = int.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("HideWebView"));
bool flag13 = SystemInfo.systemMemorySize >= XSingleton<XGlobalConfig>.singleton.GetInt("WebMemory");
XSingleton<XDebug>.singleton.AddLog("memory: ", flag13.ToString(), " x86: ", flag12.ToString(), " hide: ", num3.ToString(), XDebugColor.XDebug_None);
bool flag14 = this._doc.ShowWebView && num3 != 1 && !flag12 && flag13;
ixuibutton.SetVisible(flag14);
bool flag15 = flag14;
if (flag15)
{
ixuibutton.gameObject.transform.localPosition = new Vector3((float)(num * num2), 0f);
ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSysBtnClick));
num++;
ixuibutton.ID = (ulong)((long)rowData.ID);
}
}
else
{
bool flag16 = rowData.ID == 8 && (XSingleton<XLoginDocument>.singleton.GetLaunchTypeServerInfo() != StartUpType.StartUp_QQ || XSingleton<XLoginDocument>.singleton.Channel != XAuthorizationChannel.XAuthorization_QQ);
if (!flag16)
{
bool flag17 = rowData.ID == 9 && (XSingleton<XLoginDocument>.singleton.GetLaunchTypeServerInfo() != StartUpType.StartUp_WX || XSingleton<XLoginDocument>.singleton.Channel != XAuthorizationChannel.XAuthorization_WeChat);
if (!flag17)
{
ixuibutton.SetVisible(true);
ixuibutton.gameObject.transform.localPosition = new Vector3((float)(num * num2), 0f);
ixuibutton.ID = (ulong)((long)rowData.ID);
ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSysBtnClick));
num++;
gameObject.SetActive(XSingleton<XGameSysMgr>.singleton.GetSysRedPointStateConsiderBlock((XSysDefine)rowData.SysID));
}
}
}
}
}
}
}
}
}
this.m_Bg.spriteWidth = this._bgWidthDelta + num * num2;
}
private bool OnSysBtnClick(IXUIButton btn)
{
Dictionary<string, string> dictionary = new Dictionary<string, string>();
ulong id = btn.ID;
ulong num = id - 1UL;
if (num <= 15UL)
{
switch ((uint)num)
{
case 0u:
{
PtcC2G_CloseHintNtf ptcC2G_CloseHintNtf = new PtcC2G_CloseHintNtf();
ptcC2G_CloseHintNtf.Data.systemid = (uint)XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_GC_XinYueVIP);
XSingleton<XClientNetwork>.singleton.Send(ptcC2G_CloseHintNtf);
XSingleton<XGameSysMgr>.singleton.SetSysRedPointState(XSysDefine.XSys_GC_XinYueVIP, false);
XSingleton<XGameSysMgr>.singleton.RecalculateRedPointState(XSysDefine.XSys_GameCommunity, true);
GameObject gameObject = btn.gameObject.transform.Find("RedPoint").gameObject;
gameObject.SetActive(false);
string text = string.Format("{0}?game_id={1}&opencode={2}&partition_id={3}&role_id={4}", new object[]
{
XSingleton<XGlobalConfig>.singleton.GetValue("XinYueInternalURL"),
XSingleton<XClientNetwork>.singleton.GameId,
XSingleton<XClientNetwork>.singleton.OpenCode,
XSingleton<XClientNetwork>.singleton.ServerID,
XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID
});
XSingleton<XDebug>.singleton.AddLog("url = " + text, null, null, null, null, null, XDebugColor.XDebug_None);
dictionary["url"] = text;
dictionary["screendir"] = "SENSOR";
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary));
break;
}
case 6u:
XSingleton<UiUtility>.singleton.OpenHtmlUrl("DeepLinkAddress");
break;
case 7u:
case 8u:
DlgBase<XQQWXGameCenterPrivilegeView, XQQWXGameCenterPrivilegeBehaviour>.singleton.SetVisibleWithAnimation(true, null);
break;
case 9u:
{
string text = string.Format("{0}?partition={1}&roleid={2}&area={3}&algorithm={4}&version={5}×tamp={6}&appid={7}&openid={8}&sig={9}&encode={10}", new object[]
{
XSingleton<XGlobalConfig>.singleton.GetValue("MicroCommunityURL"),
XSingleton<XClientNetwork>.singleton.ServerID,
XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID,
XSingleton<XClientNetwork>.singleton.AreaId,
"v2",
XSingleton<XUpdater.XUpdater>.singleton.Version,
XSingleton<UiUtility>.singleton.GetTimeStamp(),
XSingleton<XClientNetwork>.singleton.AppId,
XSingleton<XLoginDocument>.singleton.OpenID,
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.GetMD5(string.Format("{0}{1}", XSingleton<XClientNetwork>.singleton.MSDKKey, XSingleton<UiUtility>.singleton.GetTimeStamp())),
"2"
});
XSingleton<XDebug>.singleton.AddLog("url = " + text, null, null, null, null, null, XDebugColor.XDebug_None);
dictionary["url"] = text;
dictionary["screendir"] = "SENSOR";
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary));
break;
}
case 10u:
XSingleton<UiUtility>.singleton.OpenHtmlUrl("HordeInsideAddress");
break;
case 11u:
{
PtcC2G_CancelRedDotReq ptcC2G_CancelRedDotReq = new PtcC2G_CancelRedDotReq();
ptcC2G_CancelRedDotReq.Data.systemid = (uint)XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_Questionnaire);
XSingleton<XClientNetwork>.singleton.Send(ptcC2G_CancelRedDotReq);
XSingleton<XGameSysMgr>.singleton.SetSysRedPointState(XSysDefine.XSys_Questionnaire, false);
XSingleton<XGameSysMgr>.singleton.RecalculateRedPointState(XSysDefine.XSys_GameCommunity, true);
GameObject gameObject2 = btn.gameObject.transform.Find("RedPoint").gameObject;
gameObject2.SetActive(false);
int questionnaireStage = this.GetQuestionnaireStage();
dictionary["url"] = XSingleton<XGlobalConfig>.singleton.GetValue(string.Format("QuestionnaireUrl{0}", questionnaireStage));
dictionary["screendir"] = "SENSOR";
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary));
break;
}
case 12u:
this.OnReplayClick(btn);
break;
case 13u:
DlgBase<WebView, WebViewBehaviour>.singleton.SetVisible(true, true);
break;
case 14u:
{
XSingleton<UiUtility>.singleton.CloseSysAndNoticeServer((uint)XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_GC_XiaoYueGuanJia));
btn.gameObject.transform.Find("RedPoint").gameObject.SetActive(false);
string text2 = ((int)Application.platform == 11) ? "1" : "0";
string text = string.Format("{0}?game_id={1}&opencode={2}&sig={3}×tamp={4}&role_id={5}&partition_id={6}&plat_id={7}", new object[]
{
XSingleton<XGlobalConfig>.singleton.GetValue("XiaoYueUrl"),
XSingleton<XGlobalConfig>.singleton.GetValue("XiaoYueGameID"),
XSingleton<XClientNetwork>.singleton.OpenCode,
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.GetMD5(string.Format("{0}{1}", XSingleton<XClientNetwork>.singleton.MSDKKey, XSingleton<UiUtility>.singleton.GetTimeStamp())),
XSingleton<UiUtility>.singleton.GetTimeStamp(),
XSingleton<UiUtility>.singleton.GetRoleId(),
XSingleton<XClientNetwork>.singleton.ServerID,
text2
});
XSingleton<XDebug>.singleton.AddLog("url = " + text, null, null, null, null, null, XDebugColor.XDebug_None);
dictionary["url"] = text;
dictionary["screendir"] = "SENSOR";
XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary));
break;
}
case 15u:
XSingleton<UiUtility>.singleton.OpenHtmlUrl("LibaozhongxinUrl");
break;
}
}
return true;
}
private bool LoginStateTrue(GameCommunityTable.RowData data)
{
bool flag = (int)Application.platform == 7 || Application.platform == 0;
bool result;
if (flag)
{
result = true;
}
else
{
switch (XSingleton<XLoginDocument>.singleton.Channel)
{
case XAuthorizationChannel.XAuthorization_QQ:
result = data.QQ;
break;
case XAuthorizationChannel.XAuthorization_WeChat:
result = data.WX;
break;
case XAuthorizationChannel.XAuthorization_Guest:
result = data.YK;
break;
default:
result = false;
break;
}
}
return result;
}
public bool IsSuportReplay()
{
bool flag = (int)Application.platform == 8;
return flag && !this.isIpadMode() && XSingleton<XUpdater.XUpdater>.singleton.XPlatform.CheckStatus("is_screen_record_available", "");
}
private bool isIpadMode()
{
return false;
}
private bool OnReplayClick(IXUIButton btn)
{
bool flag = DlgBase<ReplaykitDlg, ReplayBehaviour>.singleton.isPlaying || DlgBase<ReplaykitDlg, ReplayBehaviour>.singleton.isReadyPlaying;
if (flag)
{
XSingleton<XDebug>.singleton.AddLog("Close Replay..", null, null, null, null, null, XDebugColor.XDebug_None);
DlgBase<ReplaykitDlg, ReplayBehaviour>.singleton.OnStopClick(null);
}
else
{
bool isBroadcast = DlgBase<BroadMiniDlg, BroadcastMiniBehaviour>.singleton.isBroadcast;
if (isBroadcast)
{
XSingleton<XDebug>.singleton.AddLog("replay isBroadcasting", null, null, null, null, null, XDebugColor.XDebug_None);
XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("Replay_IsBroadcasting"), "fece00");
}
else
{
bool flag2 = XSingleton<XUpdater.XUpdater>.singleton.XPlatform.CheckStatus("is_broadcasting", "");
XSingleton<XDebug>.singleton.AddLog("open: ", flag2.ToString(), null, null, null, null, XDebugColor.XDebug_None);
bool flag3 = !flag2;
if (flag3)
{
DlgBase<ReplaykitDlg, ReplayBehaviour>.singleton.OpenRepaly();
}
else
{
bool flag4 = (int) Application.platform == 7;
if (flag4)
{
DlgBase<ReplaykitDlg, ReplayBehaviour>.singleton.Show(true);
}
}
}
}
return true;
}
private int GetQuestionnaireStage()
{
uint level = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level;
SeqList<int> sequenceList = XSingleton<XGlobalConfig>.singleton.GetSequenceList("QuestionnaireLevel", true);
for (int i = 0; i < (int)sequenceList.Count; i++)
{
bool flag = (ulong)level >= (ulong)((long)sequenceList[i, 0]) && (ulong)level <= (ulong)((long)sequenceList[i, 1]);
if (flag)
{
return i + 1;
}
}
return 0;
}
}
}
|