Handler.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. local XianzhiLogic = require("xianzhi.XianzhiLogic")
  2. -- 先知查询
  3. function CG_XIANZHI_QUERY(human, msg)
  4. XianzhiLogic.query(human, msg.type)
  5. end
  6. -- 召唤
  7. function CG_XIANZHI_ZHAOHUAN_DO(human, msg)
  8. local Log = require("common.Log")
  9. local drawType = (msg.cnt == 10) and "10连" or ((msg.cnt == 1) and "单抽" or "未知")
  10. -- Log.write(Log.LOGID_DEBUG, "[CG_XIANZHI_ZHAOHUAN_DO] 收到天命召唤请求("..drawType.."): uuid="..(human.db._id or "nil")..", camp="..(msg.camp or "nil")..", cnt="..(msg.cnt or "nil")..", skip="..(msg.skip or "nil"))
  11. -- -- 验证cnt参数
  12. -- if msg.cnt ~= 1 and msg.cnt ~= 10 then
  13. -- Log.write(Log.LOGID_DEBUG, "[CG_XIANZHI_ZHAOHUAN_DO] WARNING: cnt值异常,不是1或10: cnt="..(msg.cnt or "nil"))
  14. -- end
  15. XianzhiLogic.zhaohuanDo(human, msg.camp, msg.cnt, msg.skip)
  16. end
  17. -- 置换
  18. function CG_XIANZHI_ZHIHUAN_QUERY(human, msg)
  19. XianzhiLogic.zhihuanQuery(human, msg.heroID, msg.heroIndex)
  20. end
  21. function CG_XIANZHI_ZHIHUAN_DO(human, msg)
  22. XianzhiLogic.zhihuanDo(human, msg.heroID, msg.heroIndex)
  23. end
  24. function CG_XIANZHI_DETAIL(human, msg)
  25. XianzhiLogic.detail(human, msg.camp)
  26. end
  27. function CG_XIANZHI_ZHIHUAN_PREVIEW(human, msg)
  28. XianzhiLogic.preview(human, msg.camp, msg.star)
  29. end
  30. function CG_XIANZHI_SHOP_QUERY(human,msg)
  31. XianzhiLogic.shopQuery(human)
  32. end
  33. function CG_XIANZHI_SHOP_BUY(human,msg)
  34. XianzhiLogic.shopBuy(human,msg.id,msg.count)
  35. end