Handler.lua 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. local UnionLogic = require("union.UnionLogic")
  2. local UnionEctypeLogic = require("union.UnionEctypeLogic")
  3. local UnionTecLogic = require("union.UnionTecLogic")
  4. local UnionWarLogic = require("union.UnionWarLogic")
  5. local UnionLivenessLogic = require("union.UnionLivenessLogic")
  6. local UnionDonateLogic = require("union.UnionDonateLogic")
  7. local UnionRedBagLogic = require("union.UnionRedBagLogic")
  8. local UnionDBLogic = require("union.UnionDBLogic")
  9. function CG_UNION_CREATE(human, msg)
  10. UnionLogic.createUnion(human, msg.name,msg.bannerID,msg.notice, msg.needLv, msg.needAgree)
  11. end
  12. function CG_UNION_DISMISS(human)
  13. UnionLogic.dismissUnion(human)
  14. end
  15. function CG_UNION_APPLY_JOIN(human, msg)
  16. UnionLogic.applyJoinUnion(human, msg.unionUuid)
  17. end
  18. function CG_UNION_CANCEL_APPLY(human, msg)
  19. UnionLogic.cancelApply(human, msg.unionUuid)
  20. end
  21. function CG_UNION_AGREE_JOIN(human, msg)
  22. UnionLogic.agreeJoinUnion(human, msg.uuid, msg.flag)
  23. end
  24. function CG_UNION_LEAVE(human)
  25. UnionLogic.leaveUnion(human)
  26. end
  27. function CG_UNION_QUERY(human)
  28. UnionLogic.unionQuery(human)
  29. end
  30. function CG_UNION_FIND(human, msg)
  31. UnionLogic.findUnion(human,msg.val)
  32. end
  33. function CG_UNION_MEMBER_MAN(human, msg)
  34. UnionLogic.memberMam(human,msg.uuid,msg.type)
  35. end
  36. function CG_UNION_APPLY_MSG(human)
  37. UnionLogic.applyQuery(human)
  38. end
  39. function CG_UNION_CHANGE_NAME_QUERY(human)
  40. UnionLogic.sendChangeNameQuery(human)
  41. end
  42. function CG_UNION_CHANGE_NAME(human,msg)
  43. UnionLogic.changeUnionName(human, msg.name)
  44. end
  45. function CG_UNION_CHANGE_BANNERID(human,msg)
  46. UnionLogic.changeUnionBannerID(human, msg.bannerID)
  47. end
  48. function CG_UNION_GET_LOG(human,msg)
  49. UnionLogic.getLog(human,msg.type)
  50. end
  51. function CG_UNION_CHANGE_MSG(human,msg)
  52. UnionLogic.setNotice(human, msg.notice)
  53. end
  54. function CG_UNION_CHANGE_LIMIT_QUERY(human)
  55. UnionLogic.sendJoinLimitQuery(human)
  56. end
  57. function CG_UNION_CHANGE_LIMIT(human, msg)
  58. UnionLogic.setJoinLimit(human, msg.needLv, msg.needAgree)
  59. end
  60. function CG_UNION_MAIL(human,msg)
  61. UnionLogic.sendUnionMail(human,msg.content)
  62. end
  63. function CG_UNION_RECRUIT_QUERY(human)
  64. UnionLogic.sendRecruitQuery(human)
  65. end
  66. function CG_UNION_RECRUIT(human,msg)
  67. UnionLogic.unionRecruit(human,msg.str)
  68. end
  69. function CG_UNION_ECTYPE_QUERY(human,msg)
  70. UnionEctypeLogic.ectypeQuery(human)
  71. end
  72. -- 查询 指定关卡 副本
  73. function CG_UNION_ONE_ECTYPE_QUERY(human,msg)
  74. UnionEctypeLogic.oneEctypeQuery(human,msg.level)
  75. end
  76. -- 升级或者激活 公会BUF
  77. function CG_UNION_UP_ECTYPE_BUFF(human, msg)
  78. UnionEctypeLogic.upEctypeBuff(human, msg.level)
  79. end
  80. function CG_UNION_ONE_ECTYPE_SAODANG(human, msg)
  81. UnionEctypeLogic.saodang(human, msg.level, msg.touch)
  82. end
  83. -- 副本点赞
  84. function CG_UNION_ECTYPE_RANK_DO_LIKE(human, msg)
  85. UnionEctypeLogic.giveLike(human, msg.level, msg.uuid)
  86. end
  87. -- 副本集结
  88. function CG_UNION_ECTYPE_JIJIE(human, msg)
  89. UnionEctypeLogic.jiJie(human, msg.level,msg.str)
  90. end
  91. function CG_UNION_TECHNOLOGY_QUERY(human,msg)
  92. UnionTecLogic.techQuery(human,msg.occu)
  93. end
  94. function CG_UNION_TECHNOLOGY_LV_UP(human,msg)
  95. UnionTecLogic.techLvUp(human,msg.occu,msg.tier)
  96. end
  97. -- 科技类型重置查询
  98. function CG_UNION_TECHNOLOGY_RESET_QUERY(human, msg)
  99. UnionTecLogic.techResetQuery(human, msg.occu)
  100. end
  101. -- 科技类型重置
  102. function CG_UNION_TECHNOLOGY_RESET(human,msg)
  103. UnionTecLogic.techReset(human,msg.occu)
  104. end
  105. function CG_UNION_WAR_HALL_QUERY(human)
  106. UnionWarLogic.warHallQuery(human)
  107. end
  108. function CG_UNION_ONE_KEY_DISAGREE(human)
  109. UnionLogic.oneKeyDisagree(human)
  110. end
  111. function CG_UNION_LIVENESS_QUERY(human)
  112. UnionLivenessLogic.livenessQuery(human)
  113. end
  114. function CG_UNION_LIVENESS_REWARD_QUERY(human)
  115. UnionLivenessLogic.livenessRewardQuery(human)
  116. end
  117. function CG_UNION_LIVENESS_REWARD_GET(human,msg)
  118. UnionLivenessLogic.getReward(human,msg.lv)
  119. end
  120. function CG_UNION_DONATE_QUERY(human)
  121. UnionDonateLogic.unionDonateQuery(human)
  122. end
  123. function CG_UNION_DONATE_DO(human,msg)
  124. UnionDonateLogic.donateDo(human,msg.type)
  125. end
  126. function CG_UNION_DONATE_REWARD_GET(human,msg)
  127. UnionDonateLogic.getDonateReward(human,msg.id)
  128. end
  129. function CG_UNION_IMPEACH_PRESIDENT(human)
  130. UnionLogic.impeachPresident(human)
  131. end
  132. -- 红包列表
  133. function CG_UNION_RED_BAG_QUERY(human)
  134. UnionRedBagLogic.unionRedBagQuery(human)
  135. end
  136. -- 单个红包查询
  137. function CG_UNION_SINGLE_RED_BAG_QUERY(human,msg)
  138. UnionRedBagLogic.singleRedBag(human,msg.id)
  139. end
  140. -- 发红包查询
  141. function CG_UNION_SEND_RED_BAG_QUERY(human)
  142. UnionRedBagLogic.sendRedBagQuery(human)
  143. end
  144. -- 抢红包
  145. function CG_UNION_GET_RED_BAG(human,msg)
  146. UnionRedBagLogic.getRedBag(human,msg.id)
  147. end
  148. -- 红包榜查询
  149. function CG_UNION_RED_BAG_BILLBOARD(human)
  150. UnionRedBagLogic.redBagBillboardQuery(human)
  151. end
  152. --------------------------------------------------
  153. -- 公会战查找指定玩家
  154. function CG_UNION_WAR_INFO(human, msg)
  155. UnionWarLogic.CGInfo(human,msg.unionUuid, msg.uuid)
  156. end
  157. -- 公会战匹配列表
  158. function CG_UNION_WAR_MATCH(human, msg)
  159. UnionWarLogic.CGMatch(human)
  160. end
  161. -- 公会战大厅
  162. function CG_UNION_WAR_QUERY(human, msg)
  163. UnionWarLogic.CGQuery(human)
  164. end
  165. function CG_UNION_WAR_BUFF(human)
  166. UnionWarLogic.CGBuffQuery(human)
  167. end
  168. function CG_UNION_WAR_TIME(human)
  169. UnionWarLogic.getWarTime(human)
  170. end
  171. -- 用于给 客户端 给予 停留在公会战界面 倒计时结束 公会战结果 查询更新
  172. function CG_UNION_WAR_END_STATE_QUERY(human)
  173. UnionWarLogic.CGEndQuery(human)
  174. end
  175. function CG_UNION_WAR_ATKLOG(human,msg)
  176. UnionWarLogic.CGAtkLog(human, msg.type)
  177. end
  178. function CG_UNION_WAR_DEFLOG(human,msg)
  179. UnionWarLogic.CGDefLog(human,msg.uuid , msg.unionUuid)
  180. end
  181. function CG_UNION_WAR_VIDEO(human,msg)
  182. UnionWarLogic.CGVideo(human,msg.videoIndex)
  183. end
  184. function CG_UNION_WAR_BOX(human,msg)
  185. UnionWarLogic.CGBox(human)
  186. end
  187. function CG_UNION_WAR_BOX_GET(human,msg)
  188. UnionWarLogic.CGBoxGet(human, msg.ind)
  189. end
  190. function CG_UNION_WAR_CHENGJIU(human,msg)
  191. UnionWarLogic.CGChengjiu(human,msg.type)
  192. end
  193. function CG_UNION_WAR_CHENGJIU_GET(human,msg)
  194. UnionWarLogic.CGChengjiuGet(human,msg.type,msg.id)
  195. end
  196. function CG_UNION_WAR_SHOP_QUERY(human,msg)
  197. UnionWarLogic.CGShop(human,msg.type)
  198. end
  199. function CG_UNION_WAR_SHOP_BUY(human,msg)
  200. UnionWarLogic.CGBuy(human,msg.type,msg.id,msg.cnt)
  201. end
  202. function CG_UNION_WAR_RANK(human,msg)
  203. UnionWarLogic.CGRank(human)
  204. end
  205. function CG_UNION_WAR_RANK_REWARD(human)
  206. UnionWarLogic.CGRankReward(human)
  207. end
  208. -- 公会日志详情查询
  209. function CG_UNION_LOG_DETAIL_QUERY(human,msg)
  210. UnionLogic.getUnionLogMemberDetail(human,msg.type)
  211. end
  212. function isDot(human)
  213. print("[UnionLogic_Handler_isDot] 进入红点判断")
  214. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  215. if union == nil then
  216. -- 没加入公会 不显示红点
  217. print("[UnionLogic_Handler_isDot] 没加入公会 不显示红点")
  218. return
  219. end
  220. if UnionLogic.dot(human) then
  221. print("[UnionLogic_Handler] 111111")
  222. return true
  223. end
  224. if UnionEctypeLogic.isDot(human) then
  225. print("[UnionLogic_Handler] 222222")
  226. return true
  227. end
  228. -- if UnionLogic.hasLog(human, union) then
  229. -- return true
  230. -- end
  231. -- if UnionWarLogic.isDot(human) then
  232. -- print("[UnionLogic_Handler] 33333")
  233. -- return true
  234. -- end
  235. if UnionLivenessLogic.isDot(human) then
  236. print("[UnionLogic_Handler] 44444")
  237. return true
  238. end
  239. if UnionDonateLogic.isDot(human) then
  240. print("[UnionLogic_Handler] 55555")
  241. return true
  242. end
  243. print("[UnionLogic_Handler] 没有红点返回空")
  244. return nil
  245. end