blob: 98df9a701468594013cbac7f9d6417813cd6b2b3 (
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
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
|
using System;
using System.Collections.Generic;
using KKSG;
using XMainClient.UI;
using XUtliPoolLib;
namespace XMainClient
{
internal class XGuildHallDocument : XDocComponent, ILogSource
{
public override uint ID
{
get
{
return XGuildHallDocument.uuID;
}
}
public XGuildHallView GuildHallView { get; set; }
private XGuildDocument GuildDoc
{
get
{
bool flag = this._GuildDoc == null;
if (flag)
{
this._GuildDoc = XDocuments.GetSpecificDocument<XGuildDocument>(XGuildDocument.uuID);
}
return this._GuildDoc;
}
}
public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("GuildHallDocument");
private List<ILogData> m_LogList = new List<ILogData>();
private XGuildDocument _GuildDoc;
public List<ILogData> GetLogList()
{
return this.m_LogList;
}
protected override void EventSubscribe()
{
base.EventSubscribe();
base.RegisterEvent(XEventDefine.XEvent_GuildPositionChanged, new XComponent.XEventHandler(this.OnPositionChanged));
base.RegisterEvent(XEventDefine.XEvent_GuildLevelChanged, new XComponent.XEventHandler(this.OnLevelChanged));
base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnInGuildStateChanged));
}
protected bool OnPositionChanged(XEventArgs args)
{
XGuildPositionChangedEventArgs xguildPositionChangedEventArgs = args as XGuildPositionChangedEventArgs;
bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag)
{
this.GuildHallView.RefreshButtonsState();
}
return true;
}
protected bool OnLevelChanged(XEventArgs args)
{
XGuildLevelChangedEventArgs xguildLevelChangedEventArgs = args as XGuildLevelChangedEventArgs;
bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag)
{
this.ReqGuildBrief();
}
return true;
}
protected bool OnInGuildStateChanged(XEventArgs args)
{
XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs;
bool flag = !xinGuildStateChangedEventArgs.bIsEnter;
if (flag)
{
bool flag2 = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag2)
{
this.GuildHallView.SetVisibleWithAnimation(false, null);
}
}
return true;
}
public void ReqExitGuild()
{
RpcC2M_LeaveFromGuild rpcC2M_LeaveFromGuild = new RpcC2M_LeaveFromGuild();
rpcC2M_LeaveFromGuild.oArg.roleID = XSingleton<XEntityMgr>.singleton.Player.Attributes.EntityID;
XSingleton<XClientNetwork>.singleton.Send(rpcC2M_LeaveFromGuild);
}
public void OnExitGuild(LeaveGuildRes oRes)
{
bool flag = oRes.result > ErrorCode.ERR_SUCCESS;
if (flag)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(oRes.result, "fece00");
}
}
public void ReqGuildBrief()
{
RpcC2M_AskGuildBriefInfo rpc = new RpcC2M_AskGuildBriefInfo();
XSingleton<XClientNetwork>.singleton.Send(rpc);
}
public void OnGuildBrief(GuildBriefRes oRes)
{
bool flag = oRes.result > ErrorCode.ERR_SUCCESS;
if (flag)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(oRes.result, "fece00");
}
else
{
XGuildBasicData basicData = this.GuildDoc.BasicData;
basicData.Init(oRes);
bool flag2 = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag2)
{
this.GuildHallView.Refresh();
}
XGuildGrowthDocument specificDocument = XDocuments.GetSpecificDocument<XGuildGrowthDocument>(XGuildGrowthDocument.uuID);
specificDocument.SetPoint(this.GuildDoc.BasicData.resource, this.GuildDoc.BasicData.technology);
}
}
public void ReqLogList()
{
RpcC2M_FetchGuildHistoryNew rpc = new RpcC2M_FetchGuildHistoryNew();
XSingleton<XClientNetwork>.singleton.Send(rpc);
}
public void OnGetLogList(GuildHistoryRes oRes)
{
bool flag = oRes.result > ErrorCode.ERR_SUCCESS;
if (flag)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(oRes.result, "fece00");
}
else
{
for (int i = 0; i < this.m_LogList.Count; i++)
{
(this.m_LogList[i] as XDataBase).Recycle();
}
this.m_LogList.Clear();
for (int j = 0; j < oRes.records.Count; j++)
{
GHisRecord ghisRecord = oRes.records[j];
XGuildLogBase xguildLogBase = XGuildLogBase.CreateLog(ghisRecord.type);
xguildLogBase.SetData(ghisRecord);
this.m_LogList.Add(xguildLogBase);
}
bool flag2 = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag2)
{
bool flag3 = this.GuildHallView.LogView != null && this.GuildHallView.LogView.active;
if (flag3)
{
this.GuildHallView.LogView.Refresh();
}
}
}
}
public void ReqEditAnnounce(string s)
{
RpcC2M_ChangeGuildSettingNew rpcC2M_ChangeGuildSettingNew = new RpcC2M_ChangeGuildSettingNew();
rpcC2M_ChangeGuildSettingNew.oArg.annoucement = s;
XSingleton<XClientNetwork>.singleton.Send(rpcC2M_ChangeGuildSettingNew);
}
public void OnEditAnnounceSuccess(string s)
{
bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag)
{
this.GuildHallView.EditAnnounceView.SetVisible(false);
}
}
public void OnAnnounceChanged(string s)
{
this.GuildDoc.BasicData.announcement = s;
bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag)
{
this.GuildHallView.RefreshAnnouncement();
}
}
public void ReqEditPortrait(int index)
{
RpcC2M_ChangeGuildSettingNew rpcC2M_ChangeGuildSettingNew = new RpcC2M_ChangeGuildSettingNew();
rpcC2M_ChangeGuildSettingNew.oArg.Icon = index;
XSingleton<XClientNetwork>.singleton.Send(rpcC2M_ChangeGuildSettingNew);
}
public void OnPortraitChanged(int index)
{
this.GuildDoc.BasicData.portraitIndex = index;
bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag)
{
this.GuildHallView.RefreshPortrait();
}
}
protected override void OnReconnected(XReconnectedEventArgs arg)
{
bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible();
if (flag)
{
this.ReqGuildBrief();
}
}
}
}
|