Handler.lua 7.9 KB

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