GuildProxy.lua 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. local RemoteProxy = requireProxy("remote/RemoteProxy")
  2. local GuildProxy = class("GuildProxy" , RemoteProxy)
  3. GuildProxy.NAME = global.ProxyTable.GuildProxy
  4. local proxyUtils = requireProxy( "proxyUtils" )
  5. local parseOneItemByJson = proxyUtils.parseOneItemByJson
  6. local cjson = require("cjson")
  7. function GuildProxy:ctor()
  8. GuildProxy.super.ctor(self)
  9. self._info = {}
  10. self._guildList = {}
  11. self._worldGuild = {}
  12. self._totalPage = 1 -- 行会列表总页数
  13. self._memberList = {}
  14. self._applyGuildList = {}
  15. self._isShowStoreRedTips = false
  16. self._first = true
  17. self._createAutoApply = 1 -- 创建行会后是否自动同意申请入会
  18. self._createAutoLevel = 1 -- 创建行会后自动同意的等级
  19. self._createCost = {} --创建行会消耗
  20. self._guildTitle = {} --行会封号
  21. self._allyApplyList = {} --行会联盟申请列表
  22. self._guildWarList = {} -- 行会战列表 自己的行会关系
  23. self._guildAllyList = {} -- 行会战列表 自己的行会关系
  24. self._guildShaBaKeWarList = {} -- 行会战列表 以沙巴克行会
  25. self._guildShaBaKeAllyList = {} -- 行会联盟列表 以沙巴克行会
  26. self._guildShaBaKe = nil -- 行会 沙巴克行会
  27. self._rank_guild_name = nil --行会名txt数据
  28. self._init = true
  29. end
  30. -- 获取世界行会列表
  31. function GuildProxy:GetWorldGuildList(page)
  32. return self._guildList[page] or {}
  33. end
  34. function GuildProxy:getWorldGuildById(guildId)
  35. return self._worldGuild[guildId]
  36. end
  37. -- 获取行会成员列表
  38. function GuildProxy:GetMemberList()
  39. return self._memberList
  40. end
  41. -- 行会随机名
  42. function GuildProxy:GetRankGuildName()
  43. if not self._rank_guild_name then
  44. self._rank_guild_name = {}
  45. -- 自定义敏感字
  46. local filePath = "data_config/guild_name.txt"
  47. local text = ""
  48. if global.FileUtilCtl:isFileExist(filePath) then
  49. local function callback(dataTable)
  50. if dataTable[1] and dataTable[1] ~= "" then
  51. text = string.trim(dataTable[1])
  52. if text ~= "" then
  53. self._rank_guild_name[#self._rank_guild_name + 1] = text
  54. end
  55. end
  56. end
  57. LoadTxt(filePath, nil, callback)
  58. end
  59. end
  60. local random = Random(1, #self._rank_guild_name)
  61. return self._rank_guild_name[random] or ""
  62. end
  63. function GuildProxy:getMemberByUID(uid)
  64. for index ,info in pairs(self._memberList) do
  65. if info.UserID == uid then
  66. return info
  67. end
  68. end
  69. return nil
  70. end
  71. function GuildProxy:RemoveMember(uid)
  72. for index ,info in pairs(self._memberList) do
  73. if info.UserID == uid then
  74. self._memberList[index] = nil
  75. end
  76. end
  77. end
  78. function GuildProxy:ClearMemberList()
  79. self._memberList = {}
  80. end
  81. -- 获取行会申请列表
  82. function GuildProxy:GetApplyGuildList()
  83. local list = self._applyGuildList
  84. self._applyGuildList = {}
  85. return list
  86. end
  87. -- 获取联盟申请列表
  88. function GuildProxy:getAllyApplyList()
  89. return self._allyApplyList
  90. end
  91. --是否是结盟行会
  92. function GuildProxy:isGuildAlly(guildId)
  93. local guildInfo = self:getWorldGuildById(guildId)
  94. if guildInfo and guildInfo.AllyTime and guildInfo.AllyTime >= GetServerTime() then
  95. return true
  96. end
  97. return false
  98. end
  99. -- 获取行会主界面信息
  100. function GuildProxy:GetGuildInfo()
  101. return self._info
  102. end
  103. function GuildProxy:GetGuildLevel()
  104. return self._info.Level or 0
  105. end
  106. function GuildProxy:SetGuildLevel(level)
  107. self._info.Level = level
  108. end
  109. function GuildProxy:GetGuildMemberMax()
  110. return self._info.membercount or 100
  111. end
  112. --获取行会人数
  113. function GuildProxy:GetGuildMember()
  114. return self._memberList and #self._memberList or 0
  115. end
  116. function GuildProxy:ClearGuildInfo()
  117. self._info = {}
  118. self._guildAllyList = {}
  119. self._guildWarList = {}
  120. self._guildShaBaKeAllyList = {}
  121. self._guildShaBaKeWarList = {}
  122. self._guildShaBaKe = nil
  123. global.Facade:sendNotification(global.NoticeTable.RefreshGuildActorColor )
  124. end
  125. function GuildProxy:getAutoJoin()
  126. return self._info.autojoin == 1
  127. end
  128. function GuildProxy:getJoinLevel()
  129. return self._info.joinlevel or 0
  130. end
  131. -- 创建行会是否可以自动加入
  132. function GuildProxy:SetCreateAutoApply(value)
  133. self._createAutoApply = value
  134. end
  135. function GuildProxy:GetCreateAutoApply(value)
  136. return self._createAutoApply
  137. end
  138. function GuildProxy:SetCreateAutoLevel(value)
  139. self._createAutoLevel = value
  140. end
  141. function GuildProxy:GetCreateAutoLevel()
  142. return self._createAutoLevel
  143. end
  144. function GuildProxy:saveGuildTitle(data)
  145. self._guildTitle = {}
  146. for i=1,20 do
  147. local title = data["rank"..i]
  148. if title then
  149. self._guildTitle[i] = title
  150. end
  151. end
  152. end
  153. function GuildProxy:getGuildTitleByRank(rank)
  154. return self._guildTitle[rank]
  155. end
  156. function GuildProxy:getGuildTitleList()
  157. return self._guildTitle or {}
  158. end
  159. -------------------------------行会颜色 beign
  160. function GuildProxy:IsGuildWar()
  161. if next(self._guildWarList) then
  162. return true
  163. end
  164. local MapProxy = global.Facade:retrieveProxy( global.ProxyTable.Map )
  165. return MapProxy:IsMapWar()
  166. end
  167. function GuildProxy:GetGuildWarNameColor(guildId)
  168. if not self:IsGuildWar() then
  169. return nil
  170. end
  171. local MapProxy = global.Facade:retrieveProxy( global.ProxyTable.Map )
  172. local isMapWar = MapProxy:IsMapWar()
  173. if not guildId or guildId == "" or guildId == 0 then
  174. return isMapWar and SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_SHABAKE_FREE_NAME_COLOR) or nil
  175. end
  176. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  177. local myGuildId = GuildPlayerProxy:GetGuildId()
  178. if not myGuildId or myGuildId == "" or myGuildId == 0 then
  179. return isMapWar and SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_SHABAKE_FREE_NAME_COLOR) or nil
  180. end
  181. local isCheckAlly = tonumber(global.ConstantConfig.check_guild_color) == 1
  182. if ((isMapWar or isCheckAlly) and self._guildAllyList[guildId]) or guildId == myGuildId then
  183. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_ALLY_GUILD_NAME_COLOR)
  184. end
  185. if self._guildWarList[guildId] then
  186. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_WAR_GUILD_NAME_COLOR)
  187. end
  188. return isMapWar and SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_WAR_GUILD_NAME_COLOR) or nil
  189. end
  190. -- 沙巴克开启颜色
  191. function GuildProxy:GetShaBaKeZoneNameColor(guildId)
  192. if not guildId or guildId == "" or guildId == 0 then
  193. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_SHABAKE_FREE_NAME_COLOR)
  194. end
  195. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  196. local myGuildId = GuildPlayerProxy:GetGuildId()
  197. if not myGuildId or myGuildId == "" or myGuildId == 0 then
  198. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_SHABAKE_FREE_NAME_COLOR)
  199. end
  200. -- 前提:攻沙开启且在攻沙区域
  201. -- 自己行会没参加攻杀, 其它行会都是绿色
  202. if myGuildId ~= self._guildShaBaKe and not self._guildShaBaKeWarList[myGuildId] and not self._guildShaBaKeAllyList[myGuildId] then
  203. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_SHABAKE_FREE_NAME_COLOR)
  204. end
  205. -- 前提:攻沙开启且在攻沙区域
  206. -- 不参与攻沙的都是绿色
  207. if guildId ~= self._guildShaBaKe and not self._guildShaBaKeWarList[guildId] and not self._guildShaBaKeAllyList[guildId] then
  208. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_SHABAKE_FREE_NAME_COLOR)
  209. end
  210. -- 结盟颜色
  211. if myGuildId == guildId or self._guildAllyList[guildId] then
  212. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_ALLY_GUILD_NAME_COLOR)
  213. end
  214. -- 守城方都是结盟颜色
  215. if self._guildShaBaKeAllyList[myGuildId] and self._guildShaBaKeAllyList[guildId] then
  216. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_ALLY_GUILD_NAME_COLOR)
  217. end
  218. -- 其余参与攻沙的都是宣战颜色。
  219. return SL:GetMetaValue("SERVER_OPTIONS", global.MMO.SERVER_WAR_GUILD_NAME_COLOR)
  220. end
  221. -- 行会关系 联盟
  222. function GuildProxy:SetGuildAllyRelation(data, diffData)
  223. local temp = self._guildAllyList or {}
  224. self._guildAllyList = {}
  225. for k, v in pairs(data or {}) do
  226. if v and v.GuildID then
  227. if diffData and not temp[v.GuildID] then
  228. diffData[v.GuildID] = true
  229. end
  230. self._guildAllyList[v.GuildID] = v
  231. if self._worldGuild[v.GuildID] then
  232. self._worldGuild[v.GuildID].AllyTime = v.WarAllyTime
  233. end
  234. end
  235. end
  236. for k,v in pairs(self._worldGuild) do
  237. if not self._guildAllyList[v.GuildID] and v.AllyTime then
  238. v.AllyTime = nil
  239. end
  240. end
  241. if diffData then
  242. for k, v in pairs(temp) do
  243. if k and not self._guildAllyList[k] then
  244. diffData[k] = true
  245. end
  246. end
  247. end
  248. end
  249. -- 行会关系 宣战
  250. function GuildProxy:SetGuildWarRelation(data,diffData)
  251. local temp = self._guildWarList or {}
  252. self._guildWarList = {}
  253. for k, v in pairs(data or {}) do
  254. if v and v.GuildID then
  255. if diffData and not temp[v.GuildID] then
  256. diffData[v.GuildID] = true
  257. end
  258. self._guildWarList[v.GuildID] = v
  259. if self._worldGuild[v.GuildID] then
  260. self._worldGuild[v.GuildID].WarTime = v.WarAllyTime
  261. end
  262. end
  263. end
  264. for k,v in pairs(self._worldGuild) do
  265. if not self._guildAllyList[v.GuildID] and v.WarTime then
  266. v.WarTime = nil
  267. end
  268. end
  269. if diffData then
  270. for k, v in pairs(temp) do
  271. if k and not self._guildWarList[k] then
  272. diffData[k] = true
  273. end
  274. end
  275. end
  276. end
  277. -- 沙巴克行会关系 联盟
  278. function GuildProxy:SetShaBaKeGuildAllyRelation(data, diffData)
  279. local temp = self._guildShaBaKeAllyList or {}
  280. self._guildShaBaKeAllyList = {}
  281. for k, v in pairs(data or {}) do
  282. if v and v then
  283. if diffData and not temp[v] then
  284. diffData[v] = true
  285. end
  286. self._guildShaBaKeAllyList[v] = v
  287. end
  288. end
  289. if diffData then
  290. for k, v in pairs(temp) do
  291. if k and not self._guildShaBaKeAllyList[k] then
  292. diffData[k] = true
  293. end
  294. end
  295. end
  296. end
  297. -- 沙巴克行会关系 宣战
  298. function GuildProxy:SetShaBaKeGuildWarRelation(data, diffData)
  299. local temp = self._guildShaBaKeWarList
  300. self._guildShaBaKeWarList = {}
  301. for k, v in pairs(data or {}) do
  302. if v then
  303. if diffData and not temp[v] then
  304. diffData[v] = true
  305. end
  306. self._guildShaBaKeWarList[v] = v
  307. end
  308. end
  309. if diffData then
  310. for k, v in pairs(temp) do
  311. if k and not self._guildShaBaKeWarList[k] then
  312. diffData[k] = true
  313. end
  314. end
  315. end
  316. end
  317. -------------------------------行会颜色 end
  318. -----------------------------------------------------消息收发----------------------------------------------------
  319. -- 行会信息
  320. function GuildProxy:RequestGuildInfo()
  321. local dataStr = ""
  322. LuaSendMsg(global.MsgType.MSG_CS_GUILD_BUILD_INFO_REQUEST, 0, 0, 0, 0, dataStr, string.len(dataStr))
  323. end
  324. function GuildProxy:ResponseGuildInfo(msg)
  325. local header = msg:GetHeader()
  326. local data = msg:GetData()
  327. if msg:GetDataLength() > 0 then
  328. local str = data:ReadString(msg:GetDataLength())
  329. local data = cjson.decode(str)
  330. if not data then
  331. return
  332. end
  333. local upgrade = false
  334. if data.Level and self._info and self._info.Level and data.Level > self._info.Level then
  335. upgrade = true
  336. end
  337. self._info = data
  338. self:saveGuildTitle(data)
  339. SLBridge:onLUAEvent(LUA_EVENT_GUILD_MAIN_INFO)
  340. --global.Facade:sendNotification(global.NoticeTable.Layer_Guild_Main_Refresh)
  341. global.Facade:sendNotification(global.NoticeTable.GuildInfo_Refresh)
  342. if self._first then
  343. self._first = false
  344. self:RequestMemberList()
  345. end
  346. end
  347. end
  348. -- 世界行会列表
  349. function GuildProxy:RequestWorldGuildList(page)
  350. if not page then
  351. page = 0
  352. else
  353. page = math.max(page - 1, 0)
  354. end
  355. LuaSendMsg(global.MsgType.MSG_CS_GUILD_LIST_REQUEST, 0, 0, 0, page)
  356. end
  357. function GuildProxy:GetTotalListPage( ... )
  358. return self._totalPage
  359. end
  360. function GuildProxy:handle_GUILD_LIST_RESPONSE(msg)
  361. local header = msg:GetHeader()
  362. local data = msg:GetData()
  363. local curPage = header.recog
  364. self._totalPage = header.param1
  365. if msg:GetDataLength() > 0 then
  366. local str = data:ReadString(msg:GetDataLength())
  367. local guildList = cjson.decode(str)
  368. self._guildList[curPage + 1] = guildList
  369. for _,v in pairs(guildList) do
  370. -- 结盟和宣战关系和时间由6216下发为准
  371. v.AllyTime = self._guildAllyList[v.GuildID] and self._guildAllyList[v.GuildID].WarAllyTime or nil
  372. v.WarTime = self._guildWarList[v.GuildID] and self._guildWarList[v.GuildID].WarAllyTime or nil
  373. self._worldGuild[v.GuildID] = v
  374. self._worldGuild[v.GuildID]._page = curPage + 1
  375. end
  376. SLBridge:onLUAEvent(LUA_EVENT_GUILD_WORLDLIST, curPage + 1)
  377. end
  378. if self._init and self._totalPage > 1 then
  379. self._init = false
  380. for i = 2, self._totalPage do
  381. self:RequestWorldGuildList(i)
  382. end
  383. end
  384. end
  385. -- 创建行会
  386. function GuildProxy:RequestCreateGuild(guildName)
  387. LuaSendMsg(global.MsgType.MSG_CS_GUILD_CREATE_REQUEST, 0, 0, 0, 0, guildName, string.len(guildName))
  388. end
  389. function GuildProxy:ResponseCreateGuild(msg)
  390. local header = msg:GetHeader()
  391. local data = msg:GetData()
  392. if header.recog == 0 then
  393. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  394. GuildPlayerProxy:SetJoinGuild(true)
  395. GuildPlayerProxy:SetRank(GuildPlayerProxy.GuildRank.chairman)
  396. SL:CloseGuildCreateUI()
  397. SL:OpenGuildMainUI()
  398. -- 同意自动申请入会
  399. local auto = self:GetCreateAutoApply()
  400. local autoLevel = self:GetCreateAutoLevel()
  401. self:RequestAutoAddMember( auto, autoLevel )
  402. -- 创建行会
  403. local VoiceManagerProxy = global.Facade:retrieveProxy( global.ProxyTable.VoiceManagerProxy )
  404. VoiceManagerProxy:VoiceGuildChange({
  405. operatorType = GuildPlayerProxy.ChangeType.CREATE
  406. })
  407. -- 语音2.0 行会创建
  408. VoiceManagerProxy:VoiceGuildCreate_New()
  409. self:RequestGuildInfo()
  410. elseif header.recog == -1 then
  411. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000075))
  412. elseif header.recog == -2 then
  413. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000076))
  414. elseif header.recog == -3 then
  415. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000077))
  416. elseif header.recog == -4 then
  417. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000079))
  418. elseif header.recog == -5 then
  419. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000090))
  420. elseif header.recog == -6 then
  421. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000080))
  422. end
  423. end
  424. -- 行会成员列表
  425. function GuildProxy:RequestMemberList()
  426. local dataStr = ""
  427. LuaSendMsg(global.MsgType.MSG_CS_GUILD_MEMBER_REQUEST, 0, 0, 0, 0, dataStr, string.len(dataStr))
  428. end
  429. function GuildProxy:ResponseMemberList(msg)
  430. local header = msg:GetHeader()
  431. local data = msg:GetData()
  432. local str = data:ReadString(msg:GetDataLength())
  433. self._memberList = cjson.decode(str)
  434. if not self._memberList then
  435. self._memberList = {}
  436. end
  437. global.Facade:sendNotification(global.NoticeTable.Layer_Guild_Member_Refresh)
  438. local GuildPlayerProxy = global.Facade:retrieveProxy( global.ProxyTable.GuildPlayerProxy )
  439. if not GuildPlayerProxy:GetJoinMemberFinish() then
  440. GuildPlayerProxy:SetJoinMemberFinish( true )
  441. end
  442. end
  443. function GuildProxy:RequestAddMember(uid)
  444. LuaSendMsg(global.MsgType.MSG_CS_GUILD_ADD_MEMBER_REQUEST, 1, 0, 0, 0, uid, string.len(uid))
  445. end
  446. function GuildProxy:ResponseAddMember(msg)
  447. local header = msg:GetHeader()
  448. if header.recog == 1 then
  449. --[[
  450. 0 成功
  451. -1 不是行会成员
  452. -2 没有行会
  453. -3 不是会长 副会长
  454. -4 拒绝加入
  455. ]]
  456. local code = header.param1
  457. if code == 0 then
  458. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000036))
  459. elseif code == -1 then
  460. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000088))
  461. end
  462. end
  463. -- 弹气泡处理
  464. if header.param2 == 0 then
  465. local data = {}
  466. data.id = 10
  467. data.status = false
  468. global.Facade:sendNotification( global.NoticeTable.BubbleTipsStatusChange, data )
  469. end
  470. self:RequestMemberList()
  471. end
  472. function GuildProxy:RequestAllAddMember()
  473. local dataStr = ""
  474. LuaSendMsg(global.MsgType.MSG_CS_GUILD_ADD_MEMBER_REQUEST, 2, 0, 0, 0, dataStr, string.len(dataStr))
  475. end
  476. function GuildProxy:RequestRefuseMember(uid)
  477. LuaSendMsg(global.MsgType.MS_CS_GUILD_REFUSE_MEMBER_REQUEST, 1, 0, 0, 0, uid, string.len(uid))
  478. end
  479. function GuildProxy:ResponseRefuseMember(msg)
  480. local header = msg:GetHeader()
  481. if header.param2 == 0 then -- 弹气泡处理
  482. local data = {}
  483. data.id = 10
  484. data.status = false
  485. global.Facade:sendNotification( global.NoticeTable.BubbleTipsStatusChange, data )
  486. end
  487. end
  488. function GuildProxy:RequestAutoAddMember(auto, level)
  489. local data = {}
  490. data.AutoJoin = auto
  491. data.JoinLevel = tonumber(level) or 1
  492. local jsonStr = cjson.encode(data)
  493. if not jsonStr then
  494. return nil
  495. end
  496. dump(data)
  497. LuaSendMsg(global.MsgType.MSG_CS_GUILD_JOIN_CONDITON, 0, 0, 0, 0, jsonStr, string.len(jsonStr))
  498. end
  499. -- 行会申请列表
  500. function GuildProxy:RequestApplyGuildList()
  501. local dataStr = ""
  502. LuaSendMsg(global.MsgType.MSG_CS_GUILD_JOIN_LIST_REQUEST)
  503. end
  504. function GuildProxy:ResponseApplyGuildList(msg)
  505. local header = msg:GetHeader()
  506. local data = msg:GetData()
  507. if msg:GetDataLength() > 0 then
  508. local str = data:ReadString(msg:GetDataLength())
  509. self._applyGuildList = cjson.decode(str)
  510. if not self._applyGuildList then
  511. self._applyGuildList = {}
  512. return
  513. end
  514. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  515. if GuildPlayerProxy:IsChairman() then
  516. -- 主界面气泡
  517. local function callback()
  518. SL:OpenGuildApplyListUI()
  519. end
  520. local data = {}
  521. data.id = 10
  522. data.status = #self._applyGuildList > 0
  523. data.callback = callback
  524. global.Facade:sendNotification( global.NoticeTable.BubbleTipsStatusChange, data )
  525. global.Facade:sendNotification( global.NoticeTable.Layer_Guild_ApplyList_Refresh )
  526. end
  527. end
  528. end
  529. function GuildProxy:RequestEditNotice(notice)
  530. LuaSendMsg(global.MsgType.MSG_CS_GUILD_NOTICE,0, 0, 0, 0,notice,string.len(notice))
  531. end
  532. function GuildProxy:ResponseEditNotice(msg)
  533. local header = msg:GetHeader()
  534. local data = msg:GetData()
  535. -- 1: 参数1为结果 header.param1
  536. -- 0:成功
  537. -- -3:权限不够
  538. -- -4:文字太长
  539. self:RequestGuildInfo()
  540. end
  541. function GuildProxy:RequestGuildInviteOther(uid)
  542. LuaSendMsg(global.MsgType.MSG_CS_GUILD_INVITE_OTHER_REQUEST,0, 0, 0, 0,uid,string.len(uid))
  543. end
  544. function GuildProxy:ResponseGuildInviteOther(msg)
  545. local header = msg:GetHeader()
  546. if header.recog == 0 then
  547. --成功
  548. elseif header.recog == -3 then
  549. --邀请玩家已经有行会
  550. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000070))
  551. elseif header.recog == -4 then
  552. --自己行会为空
  553. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000071))
  554. elseif header.recog == -6 then
  555. --玩家上次退会时间未到
  556. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000072))
  557. elseif header.recog == -5 then
  558. --权限不够
  559. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000073))
  560. elseif header.recog == -2 then
  561. --邀请玩家不在线
  562. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000074))
  563. elseif header.recog == -7 then
  564. --行会已满
  565. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50000056))
  566. end
  567. end
  568. function GuildProxy:ResponseGuildInviteEnter( msg )
  569. local header = msg:GetHeader()
  570. local data = msg:GetData()
  571. local length = msg:GetDataLength()
  572. if length > 0 then
  573. local str = data:ReadString( length )
  574. local jsonData = cjson.decode(str)
  575. if not jsonData then
  576. return
  577. end
  578. local data = { }
  579. data.str = string.format( GET_STRING( 50000003 ) , jsonData.Name , jsonData.GuildName )
  580. data.btnType = 2
  581. data.callback = function( tag )
  582. if tag == 1 then
  583. self:RequestGuildAcceptInvite( jsonData.UserID )
  584. end
  585. end
  586. global.Facade:sendNotification(global.NoticeTable.Layer_CommonTips_Open, data)
  587. end
  588. end
  589. function GuildProxy:RequestGuildAcceptInvite( param )
  590. LuaSendMsg( global.MsgType.MSG_CS_GUILD_ACCEPT_INVITE_REQUEST,0, 0, 0, 0,param,string.len( param ) )
  591. end
  592. function GuildProxy:ResponseGuildAcceptInvite( msg )
  593. local header = msg:GetHeader()
  594. local data = msg:GetData()
  595. dump(header)
  596. self:RequestGuildInfo()
  597. end
  598. --更新行会职位
  599. function GuildProxy:ResponseUpdateGuildJob(msg)
  600. local header = msg:GetHeader()
  601. local data = msg:GetData()
  602. if msg:GetDataLength() > 0 then
  603. local str = data:ReadString(msg:GetDataLength())
  604. local list = cjson.decode(str)
  605. for id,job in pairs(list) do
  606. for _,v in pairs(self._memberList) do
  607. if v.UserID == id then
  608. if job == 1 then
  609. --会长
  610. self._info.AdminName = v.ChrName
  611. self._info.AdminId = id
  612. end
  613. v.Rank = job
  614. end
  615. end
  616. end
  617. end
  618. end
  619. --创建行会消耗
  620. function GuildProxy:RequestGuildCreateCost()
  621. LuaSendMsg( global.MsgType.MSG_CS_GUILD_CREATE_COST_REQUEST )
  622. end
  623. function GuildProxy:handle_MSG_SC_GUILD_CREATE_COST_RESPONSE(msg)
  624. local jsonData = ParseRawMsgToJson(msg)
  625. if not jsonData then
  626. return -1
  627. end
  628. local ItemConfigProxy = global.Facade:retrieveProxy(global.ProxyTable.ItemConfigProxy)
  629. local data = {
  630. index = ItemConfigProxy:GetItemIndexByName(jsonData.item),
  631. gold = jsonData.gold,
  632. item = jsonData.item,
  633. }
  634. self._createCost = data
  635. SLBridge:onLUAEvent(LUA_EVENT_GUILD_CREATE)
  636. end
  637. function GuildProxy:getCreateCost()
  638. return self._createCost
  639. end
  640. --设置行会封号
  641. function GuildProxy:RequestSetGuildTitle(data)
  642. --[[
  643. rank1 = "xx",
  644. rank2 = "xx",
  645. rank3 = "xx",
  646. rank4 = "xx",
  647. rank5 = "xx"
  648. ]]
  649. local jsonStr = cjson.encode(data)
  650. if not jsonStr then
  651. return nil
  652. end
  653. LuaSendMsg(global.MsgType.MSG_CS_SET_GUILD_TITLE_REQUEST, 0, 0, 0, 0, jsonStr, string.len(jsonStr))
  654. end
  655. function GuildProxy:handle_MSG_SC_SET_GUILD_TITLE_RESPONSE(msg)
  656. local jsonData = ParseRawMsgToJson(msg)
  657. if not jsonData then
  658. return -1
  659. end
  660. self:saveGuildTitle(jsonData)
  661. global.Facade:sendNotification(global.NoticeTable.Layer_Guild_Member_Refresh)
  662. end
  663. --行会宣战
  664. function GuildProxy:RequestGuildSponsor(guildId, param)
  665. LuaSendMsg(global.MsgType.MSG_CS_GUILD_WAR_SPONEOR_REQUEST, param, 0, 0, 0, guildId,string.len( guildId ))
  666. end
  667. function GuildProxy:handle_MSG_SC_GUILD_WAR_SPONEOR_REPONSE(msg)
  668. local header = msg:GetHeader()
  669. if header.recog == 0 then
  670. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001420))
  671. -- GuildProxy:RequestWorldGuildList()
  672. elseif header.recog == -1 then
  673. --当前还没行会
  674. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001416))
  675. elseif header.recog == -2 then
  676. --宣战的行会不存在
  677. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001417))
  678. elseif header.recog == -3 then
  679. --已经是宣战状态
  680. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001418))
  681. elseif header.recog == -4 then
  682. --宣战费用不足
  683. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001419))
  684. elseif header.recog == -5 then
  685. --权限不足
  686. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001413))
  687. elseif header.recog == -6 then
  688. --不能对自己的行会宣战
  689. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001421))
  690. end
  691. end
  692. --申请结盟
  693. function GuildProxy:RequestGuildAlly(guildId, param)
  694. LuaSendMsg(global.MsgType.MSG_CS_GUILD_ALLY_SPONEOR_REQUEST, param, 0, 0, 0, guildId,string.len( guildId ))
  695. end
  696. function GuildProxy:handle_MSG_SC_GUILD_ALLY_SPONEOR_REPONSE(msg)
  697. local header = msg:GetHeader()
  698. dump(header)
  699. local recog = header.recog
  700. if recog == 0 then
  701. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001434))
  702. elseif recog == -1 then
  703. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001435))
  704. elseif recog == -2 then
  705. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001436))
  706. elseif recog == -3 then
  707. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001437))
  708. elseif recog == -4 then
  709. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001438))
  710. elseif recog == -5 then
  711. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001439))
  712. elseif recog == -6 then
  713. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001440))
  714. elseif recog == -7 then
  715. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001441))
  716. elseif recog == -8 then
  717. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001442))
  718. elseif recog == -9 then
  719. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001443))
  720. elseif recog == -10 then
  721. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001451))
  722. end
  723. end
  724. --结盟操作
  725. function GuildProxy:RequestGuildAllOperationy(guildId, param)
  726. LuaSendMsg(global.MsgType.MSG_CS_GUILD_ALLY_OPERATION_REQUEST, param, 0, 0, 0, guildId,string.len( guildId ))
  727. end
  728. function GuildProxy:handle_MSG_SC_GUILD_ALLY_OPERATION_REPONSE(msg)
  729. local header = msg:GetHeader()
  730. dump(header)
  731. local recog = header.recog
  732. if recog == 0 then
  733. -- self:RequestWorldGuildList()
  734. elseif recog == -1 then
  735. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001444))
  736. elseif recog == -2 then
  737. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001445))
  738. elseif recog == -3 then
  739. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001446))
  740. elseif recog == -4 then
  741. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(50001447))
  742. end
  743. end
  744. --结盟申请列表
  745. function GuildProxy:RequestGuildAllyApplyList()
  746. LuaSendMsg(global.MsgType.MSG_CS_GUILD_ALLY_APPLYLIST_REQUEST)
  747. end
  748. function GuildProxy:handle_MSG_SC_GUILD_ALLY_APPLYLIST_REPONSE(msg)
  749. local header = msg:GetHeader()
  750. local jsonData = ParseRawMsgToJson(msg) or {}
  751. self._allyApplyList = jsonData
  752. local function callback()
  753. SL:OpenGuildAllyApplyUI()
  754. end
  755. local data = {}
  756. data.id = 13
  757. data.status = #self._allyApplyList > 0
  758. data.callback = callback
  759. global.Facade:sendNotification( global.NoticeTable.BubbleTipsStatusChange, data )
  760. SLBridge:onLUAEvent(LUA_EVENT_GUILDE_ALLY_APPLY_UPDATE)
  761. end
  762. function GuildProxy:handle_MSG_SC_GUILD_ALLY_BACK_REPONSE(msg)
  763. local header = msg:GetHeader()
  764. local data = msg:GetData()
  765. local name = data:ReadString(msg:GetDataLength())
  766. local recog = header.recog
  767. if recog == 1 then
  768. global.Facade:sendNotification(global.NoticeTable.SystemTips, string.format(GET_STRING(50001448), name))
  769. -- self:RequestWorldGuildList()
  770. elseif recog == 2 then
  771. global.Facade:sendNotification(global.NoticeTable.SystemTips, string.format(GET_STRING(50001449), name))
  772. end
  773. end
  774. --结盟申请列表
  775. function GuildProxy:RequestGuildCrazy(type)
  776. LuaSendMsg(global.MsgType.MSG_CS_GUILD_CRAZY_REQUEST, type)
  777. end
  778. --取消结盟
  779. function GuildProxy:RequestGuildCancelAlly(guildId)
  780. LuaSendMsg(global.MsgType.MSG_CS_GUILD_CANCEL_ALLY__REQUEST, 0, 0, 0, 0, guildId,string.len( guildId ))
  781. end
  782. function GuildProxy:handle_MSG_SC_GUILD_CANCEL_ALLY_REPONSE(msg)
  783. -- self:RequestWorldGuildList()
  784. end
  785. --取消宣战
  786. function GuildProxy:RequestGuildCancelWar(guildId)
  787. LuaSendMsg(global.MsgType.MSG_CS_GUILD_CANCEL_WAR_REQUEST, 0, 0, 0, 0, guildId,string.len( guildId ))
  788. end
  789. function GuildProxy:handle_MSG_SC_GUILD_CANCEL_WAR_REPONSE(msg)
  790. -- self:RequestWorldGuildList()
  791. end
  792. -- 用于前端的攻击对象判断,行会结盟、宣战都会经过该触发,参数1:1开启,0关闭,参数2:宣战、结盟时间,字符串为 行会ID。
  793. -- WarTime 宣战, AllyTime 结盟
  794. function GuildProxy:handle_MSG_SC_REFRESH_ALLY_GUILD(msg)
  795. local header = msg:GetHeader()
  796. local isOpen = header.recog
  797. local guildName = ""
  798. local data = msg:GetData()
  799. local guildID = data:ReadString(msg:GetDataLength())
  800. if self._worldGuild[guildID] then
  801. self._worldGuild[guildID].AllyTime = header.param1
  802. if isOpen == 0 then
  803. self._worldGuild[guildID].AllyTime = nil
  804. end
  805. guildName = self._worldGuild[guildID].GuildName
  806. self:RequestWorldGuildList(self._worldGuild[guildID]._page)
  807. end
  808. if isOpen == 0 then
  809. self._guildAllyList[guildID] = nil
  810. else
  811. self._guildAllyList[guildID] = {
  812. GuildID = guildID,
  813. GuildName = guildName,
  814. WarAllyTime = header.param1
  815. }
  816. end
  817. local diffData = {[guildID] = true}
  818. global.Facade:sendNotification(global.NoticeTable.RefreshGuildActorColor,{guilds=diffData})
  819. end
  820. function GuildProxy:handle_MSG_SC_REFRESH_WAR_GUILD(msg)
  821. local header = msg:GetHeader()
  822. local isOpen = header.recog
  823. local guildName = ""
  824. local data = msg:GetData()
  825. local guildID = data:ReadString(msg:GetDataLength())
  826. if self._worldGuild[guildID] then
  827. self._worldGuild[guildID].WarTime = header.param1
  828. if isOpen == 0 then
  829. self._worldGuild[guildID].WarTime = nil
  830. end
  831. guildName = self._worldGuild[guildID].GuildName
  832. self:RequestWorldGuildList(self._worldGuild[guildID]._page)
  833. end
  834. local isWarState = self:IsGuildWar()
  835. if isOpen == 0 then
  836. self._guildWarList[guildID] = nil
  837. else
  838. self._guildWarList[guildID] = {
  839. GuildID = guildID,
  840. GuildName = guildName,
  841. WarAllyTime = header.param1
  842. }
  843. end
  844. local diffData = nil
  845. if isWarState == self:IsGuildWar() then
  846. diffData = {[guildID] = true}
  847. end
  848. global.Facade:sendNotification(global.NoticeTable.RefreshGuildActorColor,{guilds=diffData})
  849. end
  850. -- 行会关系消息
  851. function GuildProxy:handle_MSG_SC_GUILDRELATION(msg)
  852. local jsonData = ParseRawMsgToJson(msg) or {}
  853. local diffData = {}
  854. self:SetGuildAllyRelation(jsonData.GuildAllList, diffData)
  855. self:SetGuildWarRelation(jsonData.GuildWarList, diffData)
  856. -- 有改变 自身行会也要刷新
  857. if next(diffData) then
  858. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  859. local myGuildId = GuildPlayerProxy:GetGuildId()
  860. if myGuildId and diffData ~= "" then
  861. diffData[myGuildId] = true
  862. end
  863. end
  864. global.Facade:sendNotification( global.NoticeTable.RefreshGuildActorColor, {guilds=diffData} )
  865. end
  866. -- 沙巴克开启关闭消息
  867. function GuildProxy:handle_MSG_SC_UNDERWAR(msg)
  868. local header = msg:GetHeader()
  869. local jsonData = ParseRawMsgToJson(msg) or {}
  870. if self._guildShaBaKe ~= jsonData.Castle then
  871. self._guildShaBaKeAllyList = {}
  872. self._guildShaBaKeWarList = {}
  873. end
  874. self._guildShaBaKe = jsonData.Castle
  875. local MapProxy = global.Facade:retrieveProxy(global.ProxyTable.Map)
  876. MapProxy:SetShaBaKeOpen(header.recog == 1)
  877. local diffData = {}
  878. self:SetShaBaKeGuildAllyRelation(jsonData.GuildAllList, diffData)
  879. self:SetShaBaKeGuildWarRelation(jsonData.GuildWarList, diffData)
  880. global.Facade:sendNotification( global.NoticeTable.RefreshGuildActorColor, {guilds=diffData} )
  881. end
  882. function GuildProxy:onRegister()
  883. GuildProxy.super.onRegister(self)
  884. end
  885. function GuildProxy:RegisterMsgHandler()
  886. -- 创建行会
  887. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_CREATE_RESPONSE, handler(self, self.ResponseCreateGuild))
  888. -- 行会成员列表
  889. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_MEMBER_RESPONSE, handler(self, self.ResponseMemberList))
  890. -- 行会主界面信息
  891. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_BUILD_INFO, handler(self, self.ResponseGuildInfo))
  892. --世界行会列表
  893. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_LIST_RESPONSE, handler(self, self.handle_GUILD_LIST_RESPONSE))
  894. -- 入会申请列表
  895. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_JOIN_LIST_RESPONSE, handler(self, self.ResponseApplyGuildList))
  896. -- 同意入会申请
  897. LuaRegisterMsgHandler(global.MsgType.MSG_CS_GUILD_ADD_MEMBER_RESPONSE, handler(self, self.ResponseAddMember))
  898. -- 拒绝入会申请
  899. LuaRegisterMsgHandler(global.MsgType.MS_CS_GUILD_REFUSE_MEMBER_RESPONSE, handler(self, self.ResponseRefuseMember))
  900. -- 修改公告
  901. LuaRegisterMsgHandler(global.MsgType.MSG_CS_GUILD_NOTICE_RESPONSE, handler(self, self.ResponseEditNotice))
  902. -- 邀请入会结果
  903. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_INVITE_OTHER_RESPONSE, handler(self, self.ResponseGuildInviteOther))
  904. -- 被邀请入会信息
  905. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_INVITE_ENTER_RESPONSE, handler(self, self.ResponseGuildInviteEnter))
  906. -- 接受邀请入会
  907. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_ACCEPT_INVITE_RESPONSE, handler(self, self.ResponseGuildAcceptInvite))
  908. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_UPDATE_JOB_UPDATE, handler(self, self.ResponseUpdateGuildJob))
  909. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_CREATE_COST_RESPONSE, handler(self, self.handle_MSG_SC_GUILD_CREATE_COST_RESPONSE) )
  910. LuaRegisterMsgHandler(global.MsgType.MSG_SC_SET_GUILD_TITLE_RESPONSE, handler(self, self.handle_MSG_SC_SET_GUILD_TITLE_RESPONSE) )
  911. --结盟 宣战
  912. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_WAR_SPONEOR_REPONSE, handler(self, self.handle_MSG_SC_GUILD_WAR_SPONEOR_REPONSE))
  913. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_ALLY_SPONEOR_REPONSE, handler(self, self.handle_MSG_SC_GUILD_ALLY_SPONEOR_REPONSE))
  914. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_ALLY_OPERATION_REPONSE, handler(self, self.handle_MSG_SC_GUILD_ALLY_OPERATION_REPONSE))
  915. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_ALLY_APPLYLIST_REPONSE, handler(self, self.handle_MSG_SC_GUILD_ALLY_APPLYLIST_REPONSE))
  916. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_ALLY_BACK_REPONSE, handler(self, self.handle_MSG_SC_GUILD_ALLY_BACK_REPONSE))
  917. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_CANCEL_ALLY_REPONSE, handler(self, self.handle_MSG_SC_GUILD_CANCEL_ALLY_REPONSE))
  918. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILD_CANCEL_WAR_REPONSE, handler(self, self.handle_MSG_SC_GUILD_CANCEL_WAR_REPONSE))
  919. LuaRegisterMsgHandler(global.MsgType.MSG_SC_REFRESH_ALLY_GUILD, handler(self, self.handle_MSG_SC_REFRESH_ALLY_GUILD))
  920. LuaRegisterMsgHandler(global.MsgType.MSG_SC_REFRESH_WAR_GUILD, handler(self, self.handle_MSG_SC_REFRESH_WAR_GUILD))
  921. -- 行会关系 服务端会及时刷新
  922. LuaRegisterMsgHandler(global.MsgType.MSG_SC_GUILDRELATION, handler(self, self.handle_MSG_SC_GUILDRELATION))
  923. -- 沙巴克行会的关系列表
  924. LuaRegisterMsgHandler(global.MsgType.MSG_SC_UNDERWAR, handler(self, self.handle_MSG_SC_UNDERWAR))
  925. end
  926. return GuildProxy
  927. --endregion