コード例 #1
0
ファイル: Engine.cs プロジェクト: liftir/airvpn-client
		public virtual void OnDeInit()
        {
            SessionStop();

			WaitMessageSet(Messages.AppExiting, false);
			//Engine.Log(Engine.LogType.InfoImportant, Messages.AppExiting);

            if (m_threadManifest != null)
				m_threadManifest.RequestStopSync();				

			if (m_threadPenalities != null)
				m_threadPenalities.RequestStopSync();

			if (m_threadPinger != null)
				m_threadPinger.RequestStopSync();

			m_networkLockManager.Deactivation(true);
			m_networkLockManager = null;
			
			TemporaryFiles.Clean();

            Platform.DeInit();
        }
コード例 #2
0
ファイル: Engine.cs プロジェクト: liftir/airvpn-client
		public bool Initialization()
		{	
			if(ResourcesFiles.Count() == 0)			
			{
				ResourcesFiles.SetString("auth.xml", Lib.Core.Properties.Resources.Auth);
				ResourcesFiles.SetString("manifest.xml", Lib.Core.Properties.Resources.Manifest);
				ResourcesFiles.SetString("license.txt", Lib.Core.Properties.Resources.License);
				ResourcesFiles.SetString("thirdparty.txt", Lib.Core.Properties.Resources.ThirdParty);
				ResourcesFiles.SetString("tos.txt", Lib.Core.Properties.Resources.TOS);
			}

			CountriesManager.Init();

			Console.CancelKeyPress += new ConsoleCancelEventHandler(Console_CancelKeyPress);

			DevelopmentEnvironment = File.Exists(Platform.Instance.NormalizePath(Platform.Instance.GetProgramFolder() + "/dev.txt"));

			bool manMode = (CommandLine.SystemEnvironment.Exists("help"));
			if (manMode == false)
			{
				Log(LogType.Info, "AirVPN client version: " + Constants.VersionDesc + " / " + Platform.Instance.GetArchitecture() + ", System: " + Platform.Instance.GetCode() + ", Name: " + Platform.Instance.GetName() + " / " + Platform.Instance.GetOsArchitecture());

				if (DevelopmentEnvironment)
					Log(LogType.Info, "Development environment.");
			}


			m_storage = new Core.Storage();

			// This is before the Storage.Load, because non-root can't read option (chmod)
			if (Storage.GetBool("advanced.skip_privileges") == false)
			{
				if (Platform.Instance.IsAdmin() == false)
				{
					if (OnNoRoot() == false)
						Log(LogType.Fatal, Messages.AdminRequiredStop);

					return false;
				}
			}

			m_storage.Load(manMode);

			if (Storage.GetBool("cli"))
				ConsoleMode = true;

			if(Storage.Get("paramtest") != "") // Look comment in storage.cs
				Log(LogType.Warning, "Param test:-" + Storage.Get("paramtest") + "-");			

			m_stats = new Core.Stats();

			m_networkLockManager = new NetworkLockManager();
			m_networkLockManager.Init();			

			CompatibilityManager.Init();
			
			return true;
		}