源战役客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

41 行
1.1 KiB

  1. require("game.proto.102.Require102")
  2. require("game.serverTime.ServerTimeModel")
  3. ServerTimeController = ServerTimeController or BaseClass(BaseController)
  4. function ServerTimeController:__init()
  5. ServerTimeController.Instance = self
  6. self.model = ServerTimeModel:getInstance()
  7. self:RegisterProtocals()
  8. self:InitEvent()
  9. end
  10. function ServerTimeController:RegisterProtocals()
  11. self:RegisterProtocal(10201,"on10201")
  12. end
  13. function ServerTimeController:on10201()
  14. local vo = SCMD10201.New(true)
  15. if vo then
  16. self.model:InitServerTime(vo)
  17. end
  18. self.open_init_eveny_can_fire = true--是否可以发送任务完成列表协议
  19. self:SendFmtToGame(30017)--这里判断任务 然后协议返回后再发—(GlobalEventSystem:Fire(EventName.OPEN_DAY_INIT))
  20. end
  21. function ServerTimeController:InitEvent()
  22. local game_start = function ()
  23. self:SendFmtToGame(10201)
  24. end
  25. GlobalEventSystem:Bind(EventName.GAME_START, game_start)
  26. GlobalEventSystem:Bind(EventName.CHANGE_ACCOUNT, function()
  27. self.model:EnableDayCheck(false)
  28. end)
  29. GlobalEventSystem:Bind(EventName.CHANGE_ROLE, function()
  30. self.model:EnableDayCheck(false)
  31. end)
  32. end