SLReqMessage.lua 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938
  1. SL = SL or {}
  2. -- 常用函数
  3. ---------------------------------------------------------------------------
  4. -- 拉起充值面板(payChannel: 支付方式(微信/支付宝); currencyID: 货币ID; price: 支付金额; productIndex: 商品索引/商品ID
  5. function SL:RequestPay(channel, currencyID, price, productIndex)
  6. if not channel then
  7. SL:Print("[GUI ERROR] SL:RequestPay channel is empty")
  8. return nil
  9. end
  10. if not currencyID then
  11. SL:Print("[GUI ERROR] SL:RequestPay currencyID is empty")
  12. return nil
  13. end
  14. -- 商品是否存在
  15. local RechargeProxy = global.Facade:retrieveProxy(global.ProxyTable.RechargeProxy)
  16. local product = RechargeProxy:GetProductByID(currencyID)
  17. if not product then
  18. ShowSystemTips("未找到商品: " .. (currencyID or ""))
  19. return nil
  20. end
  21. -- 支付宝/花呗/微信
  22. local AuthProxy = global.Facade:retrieveProxy(global.ProxyTable.AuthProxy)
  23. local channels = {
  24. AuthProxy.PAY_CHANNEL.ALIPAY,
  25. AuthProxy.PAY_CHANNEL.HUABEI,
  26. AuthProxy.PAY_CHANNEL.WEIXIN,
  27. }
  28. local payChannel = channels[channel]
  29. -- 二维码充值回调
  30. local function qrcodeCB(isOK, filename)
  31. if isOK then
  32. -- 二维码拉取成功
  33. local qrcode_data = {
  34. filename = filename,
  35. channel = payChannel,
  36. }
  37. global.Facade:sendNotification(global.NoticeTable.Layer_Recharge_QRCode_Open, qrcode_data)
  38. end
  39. end
  40. -- 支付
  41. local info = {
  42. id = product.currency_itemid,
  43. name = product.currency_name,
  44. price = price,
  45. productIndex = productIndex,
  46. }
  47. local paytype = global.isWindows and AuthProxy.PAY_TYPE.QRCODE or AuthProxy.PAY_TYPE.NATIVE
  48. if global.L_GameEnvManager:GetEnvDataByKey("platform") == "mac" then
  49. paytype = AuthProxy.PAY_TYPE.QRCODE
  50. end
  51. local payData = { paytype = paytype, channel = payChannel, product = info, qrcodeCB = qrcodeCB }
  52. global.Facade:sendNotification(global.NoticeTable.PayProductRequest, payData)
  53. end
  54. -- 兑换激活码
  55. function SL:RequestCDK(cdk)
  56. local CDKProxy = global.Facade:retrieveProxy(global.ProxyTable.CDKProxy)
  57. CDKProxy:SendHTTPRequestPost(cdk)
  58. end
  59. -- 请求购买商品
  60. function SL:RequestStoreBuy(index, count)
  61. local PageStoreProxy = global.Facade:retrieveProxy(global.ProxyTable.PageStoreProxy)
  62. PageStoreProxy:RequestBuy(index, count)
  63. end
  64. -- 请求改变PK模式
  65. function SL:RequestChangePKMode(pkmode)
  66. local PlayerProperty = global.Facade:retrieveProxy(global.ProxyTable.PlayerProperty)
  67. PlayerProperty:RequestChangePKMode(pkmode)
  68. end
  69. -- 请求改变宠物战斗模式
  70. function SL:RequestChangePetPKMode(pkmode)
  71. local SummonsProxy = global.Facade:retrieveProxy(global.ProxyTable.SummonsProxy)
  72. return SummonsProxy:RequestModeChange(pkmode)
  73. end
  74. -- 请求从仓库取出道具
  75. function SL:RequestPutOutStorageData(data)
  76. local NPCStorageProxy = global.Facade:retrieveProxy(global.ProxyTable.NPCStorageProxy)
  77. return NPCStorageProxy:RequestPutOutStorageData(data.MakeIndex, data.Name)
  78. end
  79. -- 请求道具到仓库
  80. function SL:RequestSaveItemToNpcStorage(data, pageIndex)
  81. local NPCStorageProxy = global.Facade:retrieveProxy(global.ProxyTable.NPCStorageProxy)
  82. NPCStorageProxy:RequestSaveToStorageAllPage(data.MakeIndex, data.Name, pageIndex)
  83. end
  84. -- 请求使用道具
  85. function SL:RequestUseItem(itemData)
  86. local ItemUseProxy = global.Facade:retrieveProxy(global.ProxyTable.ItemUseProxy)
  87. return ItemUseProxy:UseItem(itemData)
  88. end
  89. -- 请求使用英雄道具
  90. function SL:RequestUseHeroItem(itemData)
  91. local ItemUseProxy = global.Facade:retrieveProxy(global.ProxyTable.ItemUseProxy)
  92. ItemUseProxy:HeroUseItem(itemData)
  93. end
  94. -- 请求拆分道具
  95. function SL:RequestSplitItem(data, num)
  96. local BagProxy = global.Facade:retrieveProxy(global.ProxyTable.Bag)
  97. BagProxy:RequestCountItem(data.MakeIndex, num)
  98. end
  99. -- 拆分道具(英雄)
  100. function SL:RequestSplitHeroItem(data, num)
  101. local HeroBagProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroBagProxy)
  102. HeroBagProxy:RequestCountItem(data.MakeIndex, num)
  103. end
  104. -- 召唤英雄或收起
  105. function SL:RequestCallOrOutHero()
  106. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  107. HeroPropertyProxy:RequestHeroInOrOut()
  108. end
  109. -- 请求玩家首饰盒状态
  110. function SL:RequestOpenPlayerBestRings()
  111. local EquipProxy = global.Facade:retrieveProxy(global.ProxyTable.Equip)
  112. EquipProxy:RequestBestRingsOpenState()
  113. end
  114. -- 请求英雄首饰盒状态
  115. function SL:RequestOpenHeroBestRings()
  116. local HeroEquipProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroEquipProxy)
  117. HeroEquipProxy:RequestBestRingsOpenState()
  118. end
  119. -- 请求宠物锁定
  120. function SL:RequestLockPetID(targetID)
  121. local SummonsProxy = global.Facade:retrieveProxy(global.ProxyTable.SummonsProxy)
  122. SummonsProxy:ReqLockActorByID(targetID)
  123. end
  124. -- 请求取消宠物锁定
  125. function SL:RequestUnLockPetID(targetID)
  126. local SummonsProxy = global.Facade:retrieveProxy(global.ProxyTable.SummonsProxy)
  127. SummonsProxy:ReqUnLockActorByID(targetID)
  128. end
  129. -- 释放技能
  130. function SL:RequestLaunchSkill(skillID, isNotFirst)
  131. local inputProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerInputProxy)
  132. local destPos = inputProxy:getCursorMapPosition()
  133. if global.isWinPlayMode then
  134. global.Facade:sendNotification(global.NoticeTable.UserInputLaunch, {skillID = skillID, destPos = destPos,isNotFirst = isNotFirst})
  135. else
  136. global.Facade:sendNotification(global.NoticeTable.UserInputLaunch, {skillID = skillID, priority = global.MMO.LAUNCH_PRIORITY_USER,isNotFirst = isNotFirst})
  137. end
  138. end
  139. -- 请求施法合击
  140. function SL:RequestMagicJointAttack()
  141. local HeroSkillProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroSkillProxy)
  142. local jointSkill = HeroSkillProxy:haveHeroSkill()
  143. if not jointSkill then
  144. return ShowSystemTips("当前没有英雄技能")
  145. end
  146. -- 在闪的时候才能放合击
  147. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  148. if HeroPropertyProxy:getShan() then
  149. -- 请求合击
  150. HeroPropertyProxy:ReqJointAttack()
  151. end
  152. end
  153. -- 查看目标玩家信息
  154. function SL:RequestLookPlayer(targetId, notForbid)
  155. local mapProxy = global.Facade:retrieveProxy(global.ProxyTable.Map)
  156. if not notForbid and mapProxy:IsForbidVisitPlayer() then
  157. ShowSystemChat(GET_STRING(30001071), 255, 249)
  158. return
  159. end
  160. local target = global.actorManager:GetActor(targetId)
  161. if target and target:IsHumanoid() then --人形怪
  162. local disHeadLookHumanoid = tonumber(SL:GetMetaValue("GAME_DATA", "disHeadLookHumanoid")) == 1
  163. if disHeadLookHumanoid then
  164. ShowSystemTips(GET_STRING(50000269))
  165. return
  166. end
  167. end
  168. local LookPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.LookPlayerProxy)
  169. LookPlayerProxy:RequestPlayerData(targetId)
  170. end
  171. -- 请求开关型技能开关
  172. function SL:RequestOnOffSkill(skillID)
  173. local SkillProxy = global.Facade:retrieveProxy(global.ProxyTable.Skill)
  174. SkillProxy:RequestSkillOnoff(skillID)
  175. end
  176. -- 常用函数
  177. ---------------------------------------------------------------------------
  178. ---------------------------------------------------------------------------
  179. -- 行会
  180. -- 请求行会申请列表
  181. function SL:RequestGuildAllyApplyList()
  182. local guildProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildProxy)
  183. guildProxy:RequestGuildAllyApplyList()
  184. end
  185. -- 设置结盟操作
  186. function SL:RequestAllyOperate(guildID, param)
  187. local guildProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildProxy)
  188. guildProxy:RequestGuildAllOperationy(guildID, param)
  189. end
  190. -- 请求行会成员列表
  191. function SL:RequestGuildMemberList()
  192. local GuildProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildProxy)
  193. GuildProxy:RequestMemberList()
  194. end
  195. -- 请求世界行会列表 分页id
  196. function SL:RequestWorldGuildList(page)
  197. local GuildProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildProxy)
  198. GuildProxy:RequestWorldGuildList(page)
  199. end
  200. -- 邀请入会
  201. function SL:RequestGuildInviteOther(uid)
  202. local GuildProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildProxy)
  203. GuildProxy:RequestGuildInviteOther(uid)
  204. end
  205. -- 踢出行会
  206. function SL:RequestSubGuildMember(uid)
  207. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  208. GuildPlayerProxy:RequestRemoveMember(uid)
  209. end
  210. -- 任命行会职位
  211. function SL:RequestAppointGuildRank(uid, rank)
  212. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  213. GuildPlayerProxy:RequestAppointRank(uid, rank)
  214. end
  215. -- 行会
  216. ---------------------------------------------------------------------------
  217. ---------------------------------------------------------------------------
  218. -- 组队
  219. -- 请求创建队伍
  220. function SL:RequestCreateTeam()
  221. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  222. TeamProxy:RequestCreateTeam()
  223. end
  224. -- 邀请玩家入队
  225. function SL:RequestInviteJoinTeam(uid, name)
  226. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  227. TeamProxy:RequestInvite(uid, name)
  228. end
  229. -- 拒绝组队邀请
  230. function SL:RequestRefuseTeamInvite(uid)
  231. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  232. TeamProxy:RequestApplyRefuse(uid)
  233. end
  234. -- 同意组队邀请
  235. function SL:RequestAgreeTeamInvite(uid)
  236. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  237. TeamProxy:RequestInviteAgree(uid)
  238. end
  239. -- 同意申请入队
  240. function SL:RequestApplyAgree(memberUID)
  241. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  242. TeamProxy:RequestApplyAgree(memberUID)
  243. end
  244. -- 请求入队申请列表
  245. function SL:RequestApplyData()
  246. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  247. TeamProxy:RequestApplyData()
  248. end
  249. -- 请求附近队伍
  250. function SL:RequestNearTeam()
  251. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  252. TeamProxy:RequestNearTeam()
  253. end
  254. -- 请求加入队伍 uid: 队长userID/队伍内任意玩家id
  255. function SL:RequestApplyJoinTeam(uid)
  256. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  257. TeamProxy:RequestApply(uid)
  258. end
  259. -- 召集队友
  260. function SL:RequestCallTeamMember()
  261. local FuncDockProxy = global.Facade:retrieveProxy(global.ProxyTable.FuncDockProxy)
  262. FuncDockProxy:TeamCallFunc()
  263. end
  264. -- 离开队伍
  265. function SL:RequestLeaveTeam()
  266. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  267. TeamProxy:RequestLeaveTeam()
  268. end
  269. -- 保存允许组队状态
  270. function SL:RequestSetTeamPermitStatus(status)
  271. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  272. TeamProxy:SetPermitStatus(status)
  273. TeamProxy:RequestPermit()
  274. end
  275. -- 踢出队伍
  276. function SL:RequestSubTeamMember(uid)
  277. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  278. TeamProxy:RequestSubMember(uid)
  279. end
  280. -- 移交队长
  281. function SL:RequestTransferTeamLeader(uid)
  282. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  283. TeamProxy:RequestTransferLeader(uid)
  284. end
  285. -- 组队
  286. ---------------------------------------------------------------------------
  287. ---------------------------------------------------------------------------
  288. -- 交易
  289. -- 请求进行交易
  290. function SL:RequestTrade(uid)
  291. local TradeProxy = global.Facade:retrieveProxy(global.ProxyTable.TradeProxy)
  292. TradeProxy:SendTradeRequest(uid)
  293. end
  294. -- 请求加入交易物品
  295. function SL:RequestPutInItem(makeindex, name)
  296. local TradeProxy = global.Facade:retrieveProxy(global.ProxyTable.TradeProxy)
  297. TradeProxy:RequestPutInItem(makeindex, name)
  298. end
  299. -- 交易
  300. ---------------------------------------------------------------------------
  301. ---------------------------------------------------------------------------
  302. -- 好友
  303. -- 请求好友列表
  304. function SL:RequestFriendList()
  305. local FriendProxy = global.Facade:retrieveProxy(global.ProxyTable.FriendProxy)
  306. FriendProxy:RequestFriendList()
  307. end
  308. -- 添加好友
  309. function SL:RequestAddFriend(uname)
  310. local FriendProxy = global.Facade:retrieveProxy(global.ProxyTable.FriendProxy)
  311. FriendProxy:requestAddFriend("", uname)
  312. end
  313. -- 删除好友
  314. function SL:RequestDelFriend(uid)
  315. local FriendProxy = global.Facade:retrieveProxy(global.ProxyTable.FriendProxy)
  316. FriendProxy:requestDelFriend(uid)
  317. end
  318. -- 好友加到黑名单
  319. function SL:RequestAddBlacklistByName(uname)
  320. local FriendProxy = global.Facade:retrieveProxy(global.ProxyTable.FriendProxy)
  321. FriendProxy:requestAddBlackList("", uname)
  322. end
  323. -- 移出黑名单
  324. function SL:RequestOutBlacklist(uid)
  325. local FriendProxy = global.Facade:retrieveProxy(global.ProxyTable.FriendProxy)
  326. FriendProxy:requestOutBlackList(uid)
  327. end
  328. -- 同意好友申请
  329. function SL:RequestAgreeFriendApply(uname)
  330. local FriendProxy = global.Facade:retrieveProxy(global.ProxyTable.FriendProxy)
  331. FriendProxy:requestAgreeFriendApply(uname)
  332. end
  333. -- 删除好友申请数据
  334. function SL:RequestDelFriendApplyData(uname)
  335. local FriendProxy = global.Facade:retrieveProxy(global.ProxyTable.FriendProxy)
  336. return FriendProxy:deleteApplyData(uname)
  337. end
  338. -- 清空好友申请列表
  339. function SL:RequestClearFriendApplyList()
  340. local FriendProxy = global.Facade:retrieveProxy(global.ProxyTable.FriendProxy)
  341. return FriendProxy:clearApplyData()
  342. end
  343. -- 好友
  344. ---------------------------------------------------------------------------
  345. ---------------------------------------------------------------------------
  346. -- 邮件
  347. -- 请求获取邮件列表 一次十条
  348. function SL:RequestMailList()
  349. local MailProxy = global.Facade:retrieveProxy(global.ProxyTable.MailProxy)
  350. MailProxy:RequestMailList()
  351. end
  352. -- 删除已读邮件
  353. function SL:RequestDelReadMail()
  354. local MailProxy = global.Facade:retrieveProxy(global.ProxyTable.MailProxy)
  355. return MailProxy:deleteReadMail()
  356. end
  357. -- 读邮件
  358. function SL:RequestReadMail(mailId)
  359. local MailProxy = global.Facade:retrieveProxy(global.ProxyTable.MailProxy)
  360. return MailProxy:readMail(mailId)
  361. end
  362. -- 删除邮件
  363. function SL:RequestDelMail(mailId)
  364. local MailProxy = global.Facade:retrieveProxy(global.ProxyTable.MailProxy)
  365. return MailProxy:deleteMail(mailId)
  366. end
  367. -- 邮件全部提取
  368. function SL:RequestGetAllMailItems()
  369. local MailProxy = global.Facade:retrieveProxy(global.ProxyTable.MailProxy)
  370. return MailProxy:getAllMailItems()
  371. end
  372. -- 邮件提取
  373. function SL:RequestGetMailItems(mailId)
  374. local MailProxy = global.Facade:retrieveProxy(global.ProxyTable.MailProxy)
  375. return MailProxy:getMailItems(mailId)
  376. end
  377. -- 邮件确定收货
  378. function SL:RequestSureTake(layer, data, func)
  379. local OtherTradingBankProxy = global.Facade:retrieveProxy(global.ProxyTable.OtherTradingBankProxy)
  380. OtherTradingBankProxy:equipTakeSure(layer, data, func)
  381. end
  382. -- 邮件拒绝收货
  383. function SL:RequestRefuseTake(layer, data, func)
  384. local OtherTradingBankProxy = global.Facade:retrieveProxy(global.ProxyTable.OtherTradingBankProxy)
  385. OtherTradingBankProxy:equipTakeRefuse(layer, data, func)
  386. end
  387. -- 邮件
  388. ---------------------------------------------------------------------------
  389. ---------------------------------------------------------------------------
  390. -- 拍卖行
  391. -- 请求拍卖行上架列表 listType 1表示查询自己上架的物品,2表示查询参与过的
  392. function SL:RequestAuctionPutList(listType)
  393. local AuctionProxy = global.Facade:retrieveProxy(global.ProxyTable.AuctionProxy)
  394. AuctionProxy:RequestItems(listType)
  395. end
  396. -- 拍卖行请求上架
  397. function SL:RequestAuctionPutin(makeindex, count, bidPrice, buyPrice, currencyID, rebate)
  398. local AuctionProxy = global.Facade:retrieveProxy(global.ProxyTable.AuctionProxy)
  399. local submitData = {
  400. makeindex = makeindex,
  401. count = count,
  402. price = bidPrice,
  403. lastprice = buyPrice,
  404. type = currencyID,
  405. meguildrate = rebate
  406. }
  407. AuctionProxy:RequestPutin(submitData)
  408. end
  409. -- 拍卖行请求重新上架
  410. function SL:RequestAuctionRePutin(makeindex, count, bidPrice, buyPrice, currencyID, rebate)
  411. local AuctionProxy = global.Facade:retrieveProxy(global.ProxyTable.AuctionProxy)
  412. local submitData = {
  413. makeindex = makeindex,
  414. count = count,
  415. price = bidPrice,
  416. lastprice = buyPrice,
  417. type = currencyID,
  418. meguildrate = rebate
  419. }
  420. AuctionProxy:RequestReputin(submitData)
  421. end
  422. -- 拍卖行请求下架
  423. function SL:RequestAuctionPutout(makeindex)
  424. local AuctionProxy = global.Facade:retrieveProxy(global.ProxyTable.AuctionProxy)
  425. local submitData = {
  426. makeindex = makeindex,
  427. }
  428. AuctionProxy:RequestPutout(submitData)
  429. end
  430. -- 拍卖行请求竞价
  431. function SL:RequestAuctionBid(makeindex, price)
  432. local AuctionProxy = global.Facade:retrieveProxy(global.ProxyTable.AuctionProxy)
  433. local submitData = {
  434. price = price,
  435. makeindex = makeindex,
  436. }
  437. AuctionProxy:RequestBid(submitData)
  438. end
  439. -- 拍卖行请求领取竞拍成功物品
  440. function SL:RequestAcquireBidItem(makeindex)
  441. local AuctionProxy = global.Facade:retrieveProxy(global.ProxyTable.AuctionProxy)
  442. local submitData = {
  443. makeindex = makeindex,
  444. }
  445. AuctionProxy:RequestAcquireItem(submitData)
  446. end
  447. -- 拍卖行
  448. ---------------------------------------------------------------------------
  449. ---------------------------------------------------------------------------
  450. -- 排行榜
  451. -- 请求排行榜数据 (通过类别)
  452. function SL:RequestRankData(type)
  453. local RankProxy = global.Facade:retrieveProxy(global.ProxyTable.RankProxy)
  454. RankProxy:RequestListData(type)
  455. end
  456. -- 请求玩家排行榜数据 1玩家 2英雄
  457. function SL:RequestPlayerRankData(userID, type)
  458. type = type - 1
  459. local RankProxy = global.Facade:retrieveProxy(global.ProxyTable.RankProxy)
  460. RankProxy:RequestPlayerShowData(userID, type)
  461. end
  462. -- 通知服务端点击排行榜类型 1玩家 2英雄
  463. function SL:ReqNotifyClickRankType(type)
  464. local RankProxy = global.Facade:retrieveProxy(global.ProxyTable.RankProxy)
  465. RankProxy:RequestNotifyClickRankType(type)
  466. end
  467. -- 通知服务端点击排行榜第几名
  468. function SL:ReqNotifyClickRankValue(value)
  469. local RankProxy = global.Facade:retrieveProxy(global.ProxyTable.RankProxy)
  470. RankProxy:RequestNotifyClickRankValue(value)
  471. end
  472. -- 排行榜
  473. ---------------------------------------------------------------------------
  474. ---------------------------------------------------------------------------
  475. -- 任务
  476. -- 提交任务
  477. function SL:RequestSubmitMission(missionID)
  478. if not missionID then
  479. SL:Print("[GUI ERROR] SL:RequestSubmitMission missionID is empty")
  480. return
  481. end
  482. local MissionProxy = global.Facade:retrieveProxy(global.ProxyTable.MissionProxy)
  483. MissionProxy:RequestSubmitMission(missionID)
  484. end
  485. -- 任务
  486. ---------------------------------------------------------------------------
  487. ---------------------------------------------------------------------------
  488. ---玩家面板
  489. --请求通知脚本查看uid的珍宝
  490. function SL:RequestLookZhenBao(uid)
  491. local LookPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.LookPlayerProxy)
  492. LookPlayerProxy:RequestLookZhenBao(uid)--
  493. end
  494. --[[
  495. 请求称号数据
  496. ]]
  497. function SL:ResquestTitleList()
  498. local PlayerTitleProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerTitleProxy)
  499. PlayerTitleProxy:ResquestTitleList()
  500. end
  501. --[[
  502. 请求取下称号
  503. ]]
  504. function SL:ResquestDisboardTitle()
  505. local PlayerTitleProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerTitleProxy)
  506. PlayerTitleProxy:ResquestDisboardTitle()
  507. end
  508. --[[
  509. 请求激活称号
  510. ]]
  511. function SL:ResquestActivateTitle(titleId)
  512. local PlayerTitleProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerTitleProxy)
  513. PlayerTitleProxy:ResquestActivateTitle(titleId)
  514. end
  515. --[[
  516. 2 --设置显示神魔
  517. 1 --设置时装显示
  518. ]]
  519. function SL:SendSuperEquipSetting(type)
  520. local PlayerProperty = global.Facade:retrieveProxy(global.ProxyTable.PlayerProperty)
  521. PlayerProperty:SendSuperEquipSetting(type)
  522. end
  523. --英雄
  524. --切换英雄状态
  525. function SL:RequestChangeHeroMode(type)
  526. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  527. HeroPropertyProxy:RequestChangeHeroMode(type)
  528. end
  529. --[[
  530. 英雄请求称号数据
  531. ]]
  532. function SL:ResquestTitleList_Hero()
  533. local HeroTitleProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroTitleProxy)
  534. HeroTitleProxy:ResquestTitleList()
  535. end
  536. --[[
  537. 英雄请求取下称号
  538. ]]
  539. function SL:ResquestDisboardTitle_Hero()
  540. local HeroTitleProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroTitleProxy)
  541. HeroTitleProxy:ResquestDisboardTitle()
  542. end
  543. --[[
  544. 请求激活称号
  545. ]]
  546. function SL:ResquestActivateTitle_Hero(titleId)
  547. local HeroTitleProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroTitleProxy)
  548. HeroTitleProxy:ResquestActivateTitle(titleId)
  549. end
  550. --[[
  551. 2 --设置显示神魔
  552. 1 --设置时装显示
  553. ]]
  554. function SL:SendSuperEquipSetting_Hero(type)
  555. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  556. HeroPropertyProxy:SendSuperEquipSetting(type)
  557. end
  558. -- 英雄请求锁定目标
  559. function SL:RequestLockTargetByHero(actorID, isPlayer)
  560. if not actorID then
  561. return
  562. end
  563. local actor = global.actorManager:GetActor(actorID)
  564. if not actor then
  565. return
  566. end
  567. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  568. HeroPropertyProxy:RequestLockTarget(actor:GetID(), actor:GetMapX(), actor:GetMapY(), isPlayer)
  569. end
  570. -- 英雄取消锁定
  571. function SL:RequestCancelLockByHero()
  572. local HeroPropertyProxy = global.Facade:retrieveProxy(global.ProxyTable.HeroPropertyProxy)
  573. HeroPropertyProxy:CancelLock()
  574. end
  575. ---
  576. ---------------------------------------------------------------------------
  577. --------------------------------------合成 begin---------------------------
  578. --请求合成
  579. function SL:ResquestCompoundItem()
  580. local ItemCompoundProxy = global.Facade:retrieveProxy(global.ProxyTable.ItemCompoundProxy)
  581. local compoundIndex = ItemCompoundProxy:GetOnCompoundIndex()
  582. if not compoundIndex then
  583. SL:Print("[GUI ERROR] SL:ResquestCompoundItem compoundIndex is empty")
  584. return
  585. end
  586. ItemCompoundProxy:RequestCompound()
  587. end
  588. -- 通知脚本打开不同合成 id:合成表id
  589. function SL:RequestCompoundChangeJson(id)
  590. local ItemCompoundProxy = global.Facade:retrieveProxy(global.ProxyTable.ItemCompoundProxy)
  591. ItemCompoundProxy:requestCompoundChangeJson(id)
  592. end
  593. --------------------------------------合成 end---------------------------
  594. ---------------------------------------------------------------------------
  595. --- 请求敏感词检测
  596. function SL:RequestCheckSensitiveWord(str, type, callback)
  597. if not tonumber(type) then
  598. return
  599. end
  600. local SensitiveWordProxy = global.Facade:retrieveProxy(global.ProxyTable.SensitiveWordProxy)
  601. if type == 1 then -- 昵称类
  602. SensitiveWordProxy:IsHaveSensitiveAddFilter(str, callback)
  603. elseif type == 2 then -- 聊天
  604. local function handle_Func(state, str, risk_param)
  605. if risk_param and risk_param ~= 0 then
  606. callback(false, false)
  607. else
  608. callback(state, str, risk_param)
  609. end
  610. end
  611. SensitiveWordProxy:fixSensitiveTalkAddFilter(str, handle_Func)
  612. elseif type == 3 then -- 行会公告
  613. SensitiveWordProxy:fixSensitiveTalkAddFilter(str, callback, 1)
  614. end
  615. end
  616. -- 批量检测敏感字
  617. function SL:RequestCheckSensitiveWordEx(strList, type, callback)
  618. if not strList or #strList <= 0 then
  619. return callback(false)
  620. end
  621. local SensitiveWordProxy = global.Facade:retrieveProxy(global.ProxyTable.SensitiveWordProxy)
  622. local idx = 1
  623. local function checkHaveSensitive(str)
  624. if type == 1 then
  625. SensitiveWordProxy:IsHaveSensitiveAddFilter(str, function(state)
  626. -- 检测,不通过
  627. if not state then
  628. return callback(false)
  629. end
  630. -- 检测,全部通过
  631. if idx == #strList then
  632. return callback(true)
  633. end
  634. idx = idx + 1
  635. checkHaveSensitive(strList[idx])
  636. end)
  637. elseif type == 2 then
  638. SensitiveWordProxy:IsHaveSensitiveTalkAddFilter(str, function(state)
  639. -- 检测,不通过
  640. if not state then
  641. return callback(false)
  642. end
  643. -- 检测,全部通过
  644. if idx == #strList then
  645. return callback(true)
  646. end
  647. idx = idx + 1
  648. checkHaveSensitive(strList[idx])
  649. end)
  650. end
  651. end
  652. checkHaveSensitive(strList[idx])
  653. end
  654. ----------------------------------------------------------------------------
  655. ---------------------------------------------------------------------------
  656. --- 邀请上马
  657. function SL:RequestInviteInHorse(uid)
  658. local mainActor = global.gamePlayerController:GetMainPlayer()
  659. local targetActor = global.actorManager:GetActor(uid)
  660. if not mainActor then
  661. return
  662. end
  663. if not mainActor:IsDoubleHorse() then
  664. ShowSystemTips(GET_STRING(310000801))
  665. return
  666. end
  667. if mainActor:GetHorseMasterID() and mainActor:GetHorseCopilotID() then
  668. ShowSystemTips(GET_STRING(310000802))
  669. return
  670. end
  671. if not targetActor then
  672. ShowSystemTips(GET_STRING(310000803))
  673. return
  674. end
  675. local mainPos = cc.p(mainActor:GetMapX(), mainActor:GetMapY())
  676. local targetPos = cc.p(targetActor:GetMapX(), targetActor:GetMapY())
  677. if cc.pGetDistance(mainPos, targetPos) > 3 then
  678. ShowSystemTips(GET_STRING(310000804))
  679. return
  680. end
  681. local HorseProxy = global.Facade:retrieveProxy( global.ProxyTable.HorseProxy )
  682. HorseProxy:RequestHorseUpInvite(uid)
  683. end
  684. ---------------------------------------------------------------------------
  685. ---------------------------------------------------------------------------
  686. -- 交易行
  687. -- 交易行外框按钮点击上报
  688. function SL:RequestTradingBankBtnUpload(type)
  689. if not type then
  690. return
  691. end
  692. local Box996Proxy = global.Facade:retrieveProxy(global.ProxyTable.Box996Proxy)
  693. Box996Proxy:requestLogUp(Box996Proxy.OTHER_UP_EVEIT[100+type])
  694. end
  695. -- 交易行
  696. ---------------------------------------------------------------------------
  697. ---------------------------------------------------------------------------
  698. -- 服务端特殊记录
  699. -- 通知服务端隐藏主界面聊天框
  700. function SL:NoticeChatVisible(state)
  701. LuaSendMsg(global.MsgType.MSG_CS_TELL_CHAT_VISIBLE, state and 1 or 0)
  702. end
  703. ---------------------------------------------------------------------------
  704. ---------------------------------------------------------------------------
  705. -- 小地图
  706. -- 请求组队成员数据
  707. function SL:RequestMiniMapTeam()
  708. local MiniMapProxy = global.Facade:retrieveProxy(global.ProxyTable.MiniMapProxy)
  709. MiniMapProxy:RequestTeamMemberData()
  710. end
  711. -- 请求地图怪物数据
  712. function SL:RequestMiniMapMonsters()
  713. local MiniMapProxy = global.Facade:retrieveProxy(global.ProxyTable.MiniMapProxy)
  714. MiniMapProxy:RequestMonsters()
  715. end
  716. -- 小地图
  717. ---------------------------------------------------------------------------
  718. ---------------------------------------------------------------------------
  719. -- 内功
  720. -- 请求内功技能数据
  721. function SL:RequestInternalSkillData(isHero)
  722. local SkillProxy = global.Facade:retrieveProxy(global.ProxyTable.Skill)
  723. SkillProxy:RequestNGSkillData(isHero)
  724. end
  725. -- 请求经络穴位激活
  726. function SL:RequestAucPointOpen(typeID, aucPointID, isHero)
  727. local MeridianProxy = global.Facade:retrieveProxy(global.ProxyTable.MeridianProxy)
  728. MeridianProxy:RequestAucPointOpen(typeID, aucPointID, isHero)
  729. end
  730. -- 修炼经络
  731. function SL:RequestMeridianLevelUp(typeID, isHero)
  732. local MeridianProxy = global.Facade:retrieveProxy(global.ProxyTable.MeridianProxy)
  733. MeridianProxy:RequestMeridianLevelUp(typeID, isHero)
  734. end
  735. -- 请求设置连击技能
  736. function SL:RequestSetComboSkill(key, skillID, isHero)
  737. local SkillProxy = global.Facade:retrieveProxy(global.ProxyTable.Skill)
  738. SkillProxy:RequestSetComboSkill(key, skillID, isHero)
  739. end
  740. -- 请求内功hud显示
  741. function SL:RequestNGHudShow(show)
  742. if show == nil then
  743. show = true
  744. end
  745. local MeridianProxy = global.Facade:retrieveProxy(global.ProxyTable.MeridianProxy)
  746. MeridianProxy:SetNGHudShow(show)
  747. MeridianProxy:OnRefreshNGHudShow()
  748. end
  749. -- 内功
  750. ---------------------------------------------------------------------------
  751. ---------------------------------------------------------------------------
  752. -- 宝箱
  753. -- 请求获取宝箱奖励
  754. function SL:RequestGetGoldBoxReward()
  755. local GoldBoxProxy = global.Facade:retrieveProxy(global.ProxyTable.GoldBoxProxy)
  756. GoldBoxProxy:RequsetGetBoxReward()
  757. end
  758. -- 请求再开启宝箱
  759. function SL:RequestOpenGoldBox()
  760. local GoldBoxProxy = global.Facade:retrieveProxy(global.ProxyTable.GoldBoxProxy)
  761. GoldBoxProxy:RequsetOpenBoxAgain()
  762. end
  763. ---------------------------------------------------------------------------
  764. -- 转生点加属性
  765. -- 请求确认加属性点 [新版]
  766. function SL:RequestAddReinAttr_N(data, m_nBonusPoint)
  767. local ReinAttrProxy = global.Facade:retrieveProxy(global.ProxyTable.ReinAttrProxy)
  768. ReinAttrProxy:RequestAddReinAttr_N(data, m_nBonusPoint)
  769. end
  770. ---------------------------------------------------------------------------
  771. -- 求购
  772. -- 请求求购列表
  773. function SL:RequestPurchaseItemList(data)
  774. local PurchaseProxy = global.Facade:retrieveProxy(global.ProxyTable.PurchaseProxy)
  775. PurchaseProxy:RequestItemList(data)
  776. end
  777. -- 求购 出售
  778. function SL:RequestPurchaseSell(data)
  779. local PurchaseProxy = global.Facade:retrieveProxy(global.ProxyTable.PurchaseProxy)
  780. PurchaseProxy:RequestSell(data)
  781. end
  782. -- 求购 上架
  783. function SL:RequestPurchasePutIn(data)
  784. local PurchaseProxy = global.Facade:retrieveProxy(global.ProxyTable.PurchaseProxy)
  785. PurchaseProxy:RequestPutIn(data)
  786. end
  787. -- 求购 下架
  788. function SL:RequestPurchasePutOut(data)
  789. local PurchaseProxy = global.Facade:retrieveProxy(global.ProxyTable.PurchaseProxy)
  790. PurchaseProxy:RequestPutOut(data)
  791. end
  792. -- 求购 取出
  793. function SL:RequestPurchaseTakeOut(data)
  794. local PurchaseProxy = global.Facade:retrieveProxy(global.ProxyTable.PurchaseProxy)
  795. PurchaseProxy:RequestTakeOut(data)
  796. end
  797. ---------------------------------------------------------------------------
  798. -- npc点击
  799. function SL:RequestNPCTalk(npcID)
  800. if not npcID then
  801. return false
  802. end
  803. local NPCProxy = global.Facade:retrieveProxy( global.ProxyTable.NPC )
  804. NPCProxy:CheckTalk( npcID )
  805. end
  806. ---------------------------------------------------------------------------
  807. -- 游戏内客服
  808. function SL:RequestOpen996ManualService()
  809. local ManualService996Proxy = global.Facade:retrieveProxy(global.ProxyTable.ManualService996Proxy)
  810. ManualService996Proxy:RequestManualService()
  811. end