Beispiel #1
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);
            }
        }
Beispiel #2
0
 public void Send(ConnectServerCommand connectServerCommand)
 {
     _socket.SendTo(connectServerCommand.Serialize(), _serverEndPoint);
 }