示例#1
0
        private void Log(string logMessage)
        {
            MainWindowViewModel mainWindowViewModel = IocKernel.Get <MainWindowViewModel>();

            mainWindowViewModel.LogMessages.Add(new LogMessageViewModel {
                LogTime = DateTime.Now, Message = logMessage
            });
        }
示例#2
0
        private static void ClearDb()
        {
            var sql = IocKernel.Get <SqlRepository>();

            sql.Drivers.RemoveRange(sql.Drivers);
            sql.Users.RemoveRange(sql.Users);
            sql.Notifications.RemoveRange(sql.Notifications);
            sql.Cars.RemoveRange(sql.Cars);
            sql.SaveChanges();
        }
示例#3
0
        private static void MarkFileAsCached(string fileName)
        {
            MainWindowViewModel mainWindowViewModel = IocKernel.Get <MainWindowViewModel>();
            FileViewModel       file = mainWindowViewModel.Files.FirstOrDefault(x => x.Name.Equals(fileName));

            if (file != null)
            {
                file.IsCached = true;
            }
        }
示例#4
0
        /// <summary>
        ///     Vytvoreni hrace
        /// </summary>
        /// <param name="view">
        ///     UI prototyp
        /// </param>
        public Player(Rectangle view) : base(view)
        {
            var gameManager = IocKernel.Get <IGameManager>();

            _paddleYPosition = gameManager.PlayGroundHeight - 100;

            _paddleLeftBoundary  = 10;
            _paddleRightBoundary = gameManager.PlayGroundWidth - 10;

            Center = Width / 2;
        }
示例#5
0
        //[EnableCors(origins: "*", headers: "*", methods: "POST")]
        public object Login(LoginRequestModel credentials)
        {
            var sql  = IocKernel.Get <SqlRepository>();
            var user = sql.Users.FirstOrDefault(x => x.Email == credentials.Credentials.Email && x.Password == credentials.Credentials.Password);

            if (user == null)
            {
                ThrowResponseException(HttpStatusCode.BadRequest, "Такой пары email и пароля не существует!");
            }
            return(Json(new { success = true, user = new { email = user.Email, token = user.GetToken(), type = user.Type } }));
        }
示例#6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            AutoMapperConfiguration.RegisterMappings();

            IocKernel.Initialize(new IocConfiguration());

            base.OnStartup(e);

            Current.MainWindow = IocKernel.Get <LoginWindow>();
            Current.MainWindow?.Show();
        }
示例#7
0
        public override void Execute()
        {
            var drivers = Sql.Drivers.ToList();
            var core    = IocKernel.Get <CoreProccessor>();

            foreach (var driver in drivers)
            {
                var car = Sql.Cars.Find(driver.CarId);
                core.ExecuteCommand(new AnalizeDriverComamnd(driver, car));
            }
        }
示例#8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            IocKernel.Initialize(new IocConfiguration());
            ApplicationViewModel applicationViewModel = IocKernel.Get <ApplicationViewModel>();

            MainWindow window = new MainWindow(applicationViewModel);

            window.Show();
        }
示例#9
0
        private static IEnumerable <IScreen> FindScreens()
        {
            Type customType   = typeof(BaseViewModel);
            var  extendedType = Assembly.GetAssembly(customType).GetTypes()
                                .Where(a => a.GetInterfaces()
                                       .Contains(typeof(IScreen)) &&
                                       !a.Name.Contains("Fake"));

            foreach (Type type in extendedType)
            {
                yield return((IScreen)IocKernel.Get(type));
            }
        }
示例#10
0
        public override void Execute()
        {
            _dateTimeExecute = DateTime.Now;
            var isFirst = true;

            while (true)
            {
                if (!isFirst)
                {
                    Thread.Sleep(1000);
                }
                else
                {
                    isFirst = false;
                }
                if ((DateTime.Now - _dateTimeExecute).TotalMinutes > 2)
                {
                    Logger.Warn($"Not finded today payment, driver: {_driver}");
                    return;
                }
                var balance = YandexApi.GetLastJobPayForDriver(_driver.YandexId);
                if (balance == null)
                {
                    Logger.Debug($"Not finded today payment, driver: {_driver}");
                    continue;
                }

                if (balance.IsToday &&
                    balance.PaymentType == "Job.Payment" &&
                    balance.Balance < 0)
                {
                    var unit = WialonApi.GetUnit(_car);
                    if (unit == null)
                    {
                        Logger.Warn($"Car for [{_driver}] not finded in wialon!");
                        Sql.Notifications.Add(new Notification
                        {
                            Type        = "WialonCarNotFinded",
                            Message     = $"Не удалось найти машину {_car} для блокировки",
                            InternalId  = _car.Id,
                            DateCreated = DateTime.Now
                        });
                        Sql.SaveChanges();
                        return;
                    }
                    IocKernel.Get <CoreProccessor>().ExecuteCommand(new BlockUnitCommand(_driver, unit));
                    Logger.Info($"Driver [{_driver}] send to block");
                    return;
                }
            }
        }
示例#11
0
        /// <summary>
        /// </summary>
        public GameScreen()
        {
            InitializeComponent();

            // hadler timeru
            _timer.Tick += TimerTickHandler;

            // ziskej game manager
            _gameManager = IocKernel.Get <IGameManager>();

            // nastav kontext pro UI at se zobrazuje zivot, level a body
            DataContext = _gameManager;

            // a cekej az se UI nahraje a pak poresime hru
            Loaded += (sender, args) => ScreenLoaded();
        }
示例#12
0
        public App()
        {
            ServicePointManager.SecurityProtocol     = SecurityProtocolType.Tls12;
            AppDomain.CurrentDomain.AssemblyResolve += Resolver;
            IocKernel.Initialize(new IocConfiguration());

            Current.DispatcherUnhandledException       += this.CurrentOnDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += this.CurrentDomainOnUnhandledException;

            LogMachineDetails();
            var settingsService = IocKernel.Get <SettingsService>();
            var path            = Path.Combine(Environment.CurrentDirectory, SettingsPath);

            settingsService.LoadAsync(path);
            this.FixPreferences();
        }
示例#13
0
        public ListGenres()
        {
            InitializeComponent();

            var vm = new GenresViewModel(IocKernel.Get <GenresModel>());

            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() =>
                {
                    this.DialogResult = true;
                    this.Close();
                }
                                            );
            }
            DataContext = vm;
        }
示例#14
0
        private static void Main()
        {
            IocKernel.Initialize(new IocConfiguration());

            //ClearDb();

            var core = IocKernel.Get <CoreProccessor>();

            CoreStarter.InitializeCore(core);

            var baseUrl = "http://*:3131";

            using (WebApp.Start <Startup>(baseUrl))
            {
                Console.ReadLine();
            }
        }
示例#15
0
 public static async void SendBugReport(object obj)
 {
     try
     {
         var userId          = 0;
         var settingsService = IocKernel.Get <SettingsService>();
         if (settingsService?.Settings != null)
         {
             userId = settingsService.Settings.UserId;
         }
         File.WriteAllText(
             Path.Combine(Environment.CurrentDirectory, $"crash_{DateTime.Now:dd_MM_yyyy_HH_mm_ss}.data"),
             $"UserId: {userId}{Environment.NewLine}{JsonConvert.SerializeObject(obj)}");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Critical error");
         App.Current.Shutdown(0);
     }
 }
示例#16
0
        private Task Select()
        {
            if (this.SelectedSessionPreference != null)
            {
                var mainViewModel = IocKernel.Get <MainViewModel>();

                var sessionViewModel = IocKernel.Get <SessionViewModel>();
                var homeViewModel    = IocKernel.Get <HomeViewModel>();

                sessionViewModel.SetPreference(this.SelectedSessionPreference);
                sessionViewModel.DialogResult += (sender, result) =>
                {
                    mainViewModel.Content = homeViewModel;
                    homeViewModel.Update().GetAwaiter().GetResult();
                };

                mainViewModel.Content = sessionViewModel;
                sessionViewModel.Update();
            }

            return(Task.CompletedTask);
        }
示例#17
0
        public async Task LoadContentAsync()
        {
            BusyStatus.IsBusy = true;
            try
            {
                await IocKernel.Get <EmployeeListViewModel>().LoadDataAsync();

                await IocKernel.Get <CompanyListViewModel>().LoadDataAsync();

                await IocKernel.Get <IncomingDocListViewModel>().LoadDataAsync();

                await IocKernel.Get <OutgoingDocListViewModel>().LoadDataAsync();

                await IocKernel.Get <InternalDocListViewModel>().LoadDataAsync();
            }
            catch (Exception e)
            {
                Logger.Debug(e.StackTrace);
            }
            finally
            {
                BusyStatus.IsBusy = false;
            }
        }
示例#18
0
 private void App_OnExit(object sender, ExitEventArgs e)
 {
     IocKernel.Get <SettingsService>().SaveAsync(SettingsPath);
 }
 public MainWindow()
 {
     InitializeComponent();
     DataContext = IocKernel.Get <MasterViewModel>();
     Navigate_ContentViewPort(new Dashboard());
 }
示例#20
0
 public ResultView()
 {
     CurrentPresenter = IocKernel.Get <ResultPresenter>();
     InitializeComponent();
     InitializeListeners();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BasicCacheService"/> class.
 /// </summary>
 public BasicCacheService()
 {
     _fileClient = IocKernel.Get <ServerFileClient>();
 }
示例#22
0
文件: Ball.cs 项目: CZlovek/Breakout
 /// <summary>
 ///     Vytvoreni micku.
 /// </summary>
 /// <param name="view">
 ///     UI prototyp
 /// </param>
 /// <param name="player">
 ///     Objekt hrace. Pred zacatkem hry, musi micek kopirovat pohyb hrace
 /// </param>
 public Ball(Ellipse view, IPlayer player) : base(view)
 {
     _gameManager = IocKernel.Get <IGameManager>();
     _player      = player;
 }
示例#23
0
 public MainWindowView()
 {
     InitializeComponent();
     InitializeListeners();
     CurrentPresenter = IocKernel.Get <MainPresenter>();
 }
示例#24
0
        public IEnumerable <Driver> GetDrivers()
        {
            var sql = IocKernel.Get <SqlRepository>();

            return(sql.Drivers.Local);
        }
示例#25
0
 /// <summary>
 ///     Vytvoreni bloku obsahujiciho cihly
 /// </summary>
 /// <param name="view"></param>
 /// <param name="brickPrototypeView"></param>
 public Block(Rectangle view, Rectangle brickPrototypeView) : base(view)
 {
     _gameManager        = IocKernel.Get <IGameManager>();
     _brickPrototypeView = brickPrototypeView;
 }
 public ReportsView()
 {
     InitializeComponent();
     DataContext = IocKernel.Get <ReportsViewModel>();
 }
示例#27
0
 private static IUserSettings GetUserSettings()
 {
     return(IocKernel.Get <IUserSettings>());
 }
示例#28
0
 private static IExceptionHandlingService GetExceptionHandler()
 {
     return(IocKernel.Get <IExceptionHandlingService>());
 }
示例#29
0
 private static ILoggingService GetLogger()
 {
     return(IocKernel.Get <ILoggingService>());
 }
示例#30
0
        private void FixPreferences()
        {
            var service = IocKernel.Get <SettingsService>();
            var minTime = TimeSpan.FromMinutes(29);

            foreach (var sessionPreference in service.Settings.SessionPreferences)
            {
                if (sessionPreference.WorkTime < minTime)
                {
                    SendBugReport("Время сессии менее 29 минут");
                }
            }

            //if (service.Settings.SessionPreferences.Count != 5)
            //{
            service.Settings.SessionPreferences.Clear();
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "0",
                Name           = "Default (disabled)",
                WorkTime       = TimeSpan.FromMinutes(55),
                WithBan        = true,
                WithReport     = false,
                WithSpam       = true,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "0",
                Name           = "Default (enabled)",
                WorkTime       = TimeSpan.FromMinutes(55),
                WithBan        = true,
                WithReport     = false,
                WithSpam       = true,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "0",
                Name           = "Default (experimental)",
                WorkTime       = TimeSpan.FromMinutes(55),
                WithBan        = true,
                WithReport     = false,
                WithSpam       = true,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "0",
                Name           = "Default (experimental highscore)",
                WorkTime       = TimeSpan.FromMinutes(55),
                WithBan        = true,
                WithReport     = false,
                WithSpam       = true,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "0",
                Name           = "Default (without random)",
                WorkTime       = TimeSpan.FromMinutes(55),
                WithBan        = true,
                WithReport     = false,
                WithSpam       = true,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "-1",
                Name           = "User Perspective (Disabled)",
                WorkTime       = TimeSpan.FromMinutes(30),
                WithBan        = false,
                WithReport     = false,
                WithSpam       = false,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.Cp,
                    ChatConnectionResultEnum.Blanket,
                    ChatConnectionResultEnum.Performer,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "-1",
                Name           = "User Perspective (Enabled)",
                WorkTime       = TimeSpan.FromMinutes(30),
                WithBan        = false,
                WithReport     = false,
                WithSpam       = false,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.Cp,
                    ChatConnectionResultEnum.Blanket,
                    ChatConnectionResultEnum.Performer,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "-1",
                Name           = "User Perspective (experimental)",
                WorkTime       = TimeSpan.FromMinutes(30),
                WithBan        = false,
                WithReport     = false,
                WithSpam       = false,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.Cp,
                    ChatConnectionResultEnum.Blanket,
                    ChatConnectionResultEnum.Performer,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "-1",
                Name           = "User Perspective (experimental highscore)",
                WorkTime       = TimeSpan.FromMinutes(30),
                WithBan        = false,
                WithReport     = false,
                WithSpam       = false,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.Cp,
                    ChatConnectionResultEnum.Blanket,
                    ChatConnectionResultEnum.Performer,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            service.Settings.SessionPreferences.Add(new SessionPreference
            {
                Mod            = "0",
                Name           = "Unfiltered",
                WorkTime       = TimeSpan.FromMinutes(55),
                WithBan        = true,
                WithReport     = false,
                WithSpam       = true,
                AllowedResults = new List <ChatConnectionResultEnum>
                {
                    ChatConnectionResultEnum.Male,
                    ChatConnectionResultEnum.Female,
                    ChatConnectionResultEnum.OnePlus,
                    ChatConnectionResultEnum.Nobody,
                    ChatConnectionResultEnum.Age13,
                    ChatConnectionResultEnum.Age16,
                    ChatConnectionResultEnum.Text,
                    ChatConnectionResultEnum.Inappropriate,
                    ChatConnectionResultEnum.HiddenInappropriate,
                    ChatConnectionResultEnum.Spam1,
                    ChatConnectionResultEnum.Spam2,
                    ChatConnectionResultEnum.Spam3,
                    ChatConnectionResultEnum.Cp,
                    ChatConnectionResultEnum.Blanket,
                    ChatConnectionResultEnum.Performer,
                    ChatConnectionResultEnum.PartnerDisconnected
                },
                KeyToResultBinds = new Dictionary <Key, ChatConnectionResultEnum>
                {
                    { Key.W, ChatConnectionResultEnum.Male },
                    { Key.F, ChatConnectionResultEnum.Female },
                    { Key.A, ChatConnectionResultEnum.OnePlus },
                    { Key.S, ChatConnectionResultEnum.Nobody },
                    { Key.Space, ChatConnectionResultEnum.Inappropriate },
                    { Key.D, ChatConnectionResultEnum.HiddenInappropriate },

                    { Key.C, ChatConnectionResultEnum.Text },

                    { Key.Q, ChatConnectionResultEnum.Age13 },
                    { Key.E, ChatConnectionResultEnum.Age16 },

                    { Key.Left, ChatConnectionResultEnum.Spam1 },
                    { Key.Up, ChatConnectionResultEnum.Spam2 },
                    { Key.Right, ChatConnectionResultEnum.Spam3 },

                    { Key.D1, ChatConnectionResultEnum.Cp },
                    { Key.D2, ChatConnectionResultEnum.Blanket },
                    { Key.D3, ChatConnectionResultEnum.Performer },
                }
            });
            //}
        }