Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="client"></param>
        public static void Autorize(Message msg, Client client)
        {
            AutorizationMessage message = (AutorizationMessage)msg;

            if (DatabaseMaster.HasPassword(message))
            {
                Send(client, ServerResponse.SR_AUTORIZATION_SUCCESS);
                Log.Info("Авторизация пользователя. Логин - ", message.userLogin);
            }
            else
            {
                Send(client, ServerResponse.SR_AUTORIZATION_FAILED);
                Log.Info("Неудачная авторизация пользователя. Запрашиваемый логин - ", message.userPassword);
            }
        }
Exemple #2
0
        public MainWindow()
        {
            InitializeComponent();
            Alarmus.Log.WriteToComponent component = new Alarmus.Log.WriteToComponent(AddInfoToListBox);
            Alarmus.Log.LinkComponentMethod(AddInfoToListBox);

            DatabaseMaster.Initialize();
            Alarmus.RequestMessage msg = new Alarmus.RequestMessage("Test trouble Data", "Test trouble type");
            // DatabaseMaster.AddRequest(msg);
            // DatabaseMaster.AddRequest(msg);

            List <Alarmus.RequestMessage> list = DatabaseMaster.GetAllRequests();

            list.ForEach(x => Alarmus.Log.Debug(x.troubleData, x.typeOfTrouble));

            portBox.Text = "8888";
            countOfConnectionsBox.Text = "1000";
        }