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}"); }
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); } }
public void Handle(GetAllUserResponseCommand getAllUserCommand) { _connectStore.Update(getAllUserCommand.UserInfos); _clientFront.UpdateUserList(getAllUserCommand.UserInfos); }
public void Send(GetAllUserResponseCommand getAllUserResponseCommand, EndPoint endPoint) { _socket.SendTo(getAllUserResponseCommand.Serialize(), endPoint); }