Example #1
0
        public void Login(User user)
        {
            // var users= Users.Get(u => u.IsAdmin == user.IsAdmin && u.Login == user.Login && u.Password == user.Password);
            //  var users = Users.GetWithInclude();

            VerifyLogin?.Invoke(AnyUser(user));
        }
Example #2
0
        private void GotFullChunks(MessageType messageType, List <byte[]> receivedChunks)
        {
            //1. Server send Login Verify
            //2. Server send groups
            //3. Server send test for specified group
            switch (messageType)
            {
            case MessageType.ServerLoginVerify:
            {
                var val = receivedChunks.CombineChunksInto <int>();
                LoginAnswer?.Invoke(val);
                break;
            }

            case MessageType.ServerSendGroups:
            {
                var val = receivedChunks.CombineChunksInto <Group[]>();
                GotGroups?.Invoke(val);
                break;
            }

            case MessageType.ServerSendTest:
            {
                var val = receivedChunks.CombineChunksInto <Test[]>();
                GotTests?.Invoke(val);
                break;
            }
            }
            receivedChunks.Clear();
            // messageType = null;
        }