require("game.proto.102.Require102") require("game.serverTime.ServerTimeModel") ServerTimeController = ServerTimeController or BaseClass(BaseController) function ServerTimeController:__init() ServerTimeController.Instance = self self.model = ServerTimeModel:getInstance() self:RegisterProtocals() self:InitEvent() end function ServerTimeController:RegisterProtocals() self:RegisterProtocal(10201,"on10201") end function ServerTimeController:on10201() local vo = SCMD10201.New(true) if vo then self.model:InitServerTime(vo) end self.open_init_eveny_can_fire = true--是否可以发送任务完成列表协议 self:SendFmtToGame(30017)--这里判断任务 然后协议返回后再发—(GlobalEventSystem:Fire(EventName.OPEN_DAY_INIT)) end function ServerTimeController:InitEvent() local game_start = function () self:SendFmtToGame(10201) end GlobalEventSystem:Bind(EventName.GAME_START, game_start) GlobalEventSystem:Bind(EventName.CHANGE_ACCOUNT, function() self.model:EnableDayCheck(false) end) GlobalEventSystem:Bind(EventName.CHANGE_ROLE, function() self.model:EnableDayCheck(false) end) end