Exemple #1
0
        public void Dispose()
        {
#if UNITYSOURCEMODIFIED && !UNITYEDITOR
            UnityProfiler.EnableProfiler(false);
#endif
            state      = RoomState.Disposing;
            isDisposed = true;
            DisposePlayerConnections();
            if (sendSnapshotManager != null)
            {
                sendSnapshotManager.Dispose();
            }

            GameModuleManagement.Dispose();
            try
            {
                ResetContexts(true);
                sessionStateMachine.ShutDown();
            }
            catch (Exception e)
            {
                logger.ErrorFormat("Reset Contexts Error {0}", e);
            }



            DestoryObjectUnderDefaultGoBattleServer();
            ContextsWrapper.CoRoutineManager.StartCoRoutine(UnloadScene());
            ContextsWrapper.Dispose();
            logger.InfoFormat("Server Room is Disposing...");
        }
Exemple #2
0
        public void Dispose()
        {
#if UNITY_SOURCE_MODIFIED && !UNITY_EDITOR
            UnityProfiler.EnableProfiler(false);
#endif
            _state = RoomState.Disposing;
            DisposePlayerConnections();
            if (_bin2DManager != null)
            {
                _bin2DManager.Dispose();
            }

            if (_sendSnapshotManager != null)
            {
                _sendSnapshotManager.Dispose();
            }

            _contexts.session.commonSession.Dispose();
            _contexts.session.serverSessionObjects.Dispose();

            GameModuleManagement.Dispose();
            try
            {
                ResetContexts(true);
                _sessionStateMachine.ShutDown();
                _contexts.Reset();
            }
            catch (Exception e)
            {
                _logger.ErrorFormat("Reset Contexts Error {0}", e);
            }

            _contexts = null;

            DestoryObjectUnderDefaultGoBattleServer();
            _coRoutineManager.StartCoRoutine(UnloadScene());

            _logger.InfoFormat("Server Room is Disposing...");
        }