コード例 #1
0
        public void RunServer()
        {
            Singleton.Add(new FileSavior());
            Singleton.Add(new WarningHandler());
            Singleton.Add(new ScenariosRepository());
            Singleton.Add(new UsersRepository());
            Singleton.Add(new VisualSettingsRepository());
            Singleton.Add(new ServiceClientFactory());

            var scenariosRepository = Singleton.Resolve <ScenariosRepositoryBase>();
            var usersRepository     = Singleton.Resolve <UsersRepository>();

            if (!usersRepository.Users.Any(x => x.Login.Equals("anton")))
            {
                usersRepository.Add(new User()
                {
                    Login        = "******",
                    PasswordHash = CryptoUtils.CreatePasswordHash("123")
                });
            }

            var server = new LazuriteServer();

            server.StartAsync(null);

            while (true)
            {
                Thread.Sleep(5000);
            }
        }
コード例 #2
0
 public void Initialize()
 {
     Singleton.Add(new PluginsDataManager());
     Singleton.Add(UsersRepository = new UsersRepository());
     UsersRepository.Initialize();
     Singleton.Add(ScenariosRepository = new ScenariosRepository());
     Singleton.Add(PluginsManager      = new PluginsManager());
     ScenariosRepository.Initialize();
     Singleton.Add(VisualSettingsRepository = new VisualSettingsRepository());
     Singleton.Add(new StatisticsManager());
     Singleton.Add(Server = new LazuriteServer());
     if (DataManager.Has(SettingsKey))
     {
         SetSettings(DataManager.Get <CoreSettings>(SettingsKey));
     }
     else
     {
         SetSettings(new CoreSettings());
     }
 }