예제 #1
0
        public void Dispose()
        {
            isDisposed = true;
            try
            {
                Log(Id, "Shutting down game type '{0}'.", id);
                foreach (var scriptedGameInstance in gameInstances.ToArray())
                {
                    scriptedGameInstance.Dispose();
                }

                var counter = 30000;
                while (instanceCount > 0 && counter > 0)
                {
                    counter -= 50;
                    Thread.Sleep(50);
                }
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
            }
            finally
            {
                MonitoringFacade.UnregisterMonitoringSource(folderName);
            }
        }
예제 #2
0
        public void NotifyIstanceRenamed(string oldName, ScriptedGameInstance gameInstance)
        {
            MonitoringFacade.UnregisterMonitoringSource(oldName);
            MonitoringFacade.RegisterMonitoringSource(gameInstance.Name);

            if (OnUnRegisterInstance != null)
            {
                OnUnRegisterInstance(gameInstance, new ScriptedGameWrapperEventArgs(oldName));
            }

            if (OnRegisterInstance != null)
            {
                OnRegisterInstance(gameInstance, new ScriptedGameWrapperEventArgs(gameInstance.Id));
            }
        }