示例#1
0
        public void Handle(GetAllUserCommand getAllUserCommand)
        {
            var data     = _connectStore.GetAllUser();
            var response = new GetAllUserResponseCommand
            {
                UserInfos = data
            };

            Send(response, getAllUserCommand.FromPublic);
            _serverFront.ShowMsg($"发送全部用户数据{data.Count}条,到{getAllUserCommand.FromPublic}");
        }
示例#2
0
        public void Handle(ConnectServerCommand connectServerCommand)
        {
            _serverFront.ShowMsg($"客户端连接成功:{connectServerCommand.UserName},fromPrivate:{connectServerCommand.FromPrivate},frompublic:{connectServerCommand.FromPublic}");
            var response = new GetAllUserResponseCommand
            {
                UserInfos = _connectStore.GetAllUser()
            };

            foreach (var item in _connectStore.GetAllUser())
            {
                Send(response, item.FromPublic);
            }
        }
示例#3
0
 public void Handle(GetAllUserResponseCommand getAllUserCommand)
 {
     _connectStore.Update(getAllUserCommand.UserInfos);
     _clientFront.UpdateUserList(getAllUserCommand.UserInfos);
 }
示例#4
0
 public void Send(GetAllUserResponseCommand getAllUserResponseCommand, EndPoint endPoint)
 {
     _socket.SendTo(getAllUserResponseCommand.Serialize(), endPoint);
 }