GameResumedCommand.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. local GameResumedCommand = class('GameResumedCommand', framework.SimpleCommand)
  2. function GameResumedCommand:ctor()
  3. end
  4. function GameResumedCommand:execute(note)
  5. --debug
  6. print("OnGameResumed")
  7. global.Facade:sendNotification(global.NoticeTable.Audio_Resume_All)
  8. if SL:GetMetaValue("GAME_DATA", "openResumeConnectCheck") == 1 then
  9. PerformWithDelayGlobal(function()
  10. local DisconnectProxy = global.Facade:retrieveProxy(global.ProxyTable.Disconnect)
  11. if DisconnectProxy:IsDisconnect() then
  12. return
  13. end
  14. if global.MMO.GAME_STATE_WORLD == GET_GAME_STATE() then
  15. LuaSendMsg(global.MsgType.MSG_CS_SERVER_TIME_REQUEST)
  16. local ServerTimeProxy = global.Facade:retrieveProxy(global.ProxyTable.ServerTimeProxy)
  17. ServerTimeProxy:SetResumeConnect(false)
  18. end
  19. end, 0.2)
  20. else
  21. if global.MMO.GAME_STATE_WORLD == GET_GAME_STATE() then
  22. LuaSendMsg(global.MsgType.MSG_CS_SERVER_TIME_REQUEST)
  23. end
  24. end
  25. ssr.ssrBridge:onGameResumed()
  26. if GetModListServerTime then
  27. GetModListServerTime()--刷新cdn鉴权时间
  28. end
  29. end
  30. return GameResumedCommand