Пример #1
0
        public async Task <Unit> Handle(ShowMasterCommand command, CancellationToken cancellationToken)
        {
            var playerId = command.PlayerId;
            var player   = await _playerDomainService.Get(playerId);

            if (player == null)
            {
                await _bus.RaiseEvent(new DomainNotification($"角色不存在!"));

                return(Unit.Value);
            }
            var myMasterModel = new MyMasterModel
            {
            };

            var playerRelation = await _playerRelationDomainService.Get(x => x.Type == PlayerRelationTypeEnum.师父 && x.PlayerId == playerId);

            if (playerRelation != null)
            {
                var master = await _npcDomainService.Get(playerRelation.RelationId);

                if (master != null)
                {
                    myMasterModel.Master = _mapper.Map <PlayerBaseInfo>(master);
                }
            }

            await _mudProvider.ShowMaster(playerId, myMasterModel);

            return(Unit.Value);
        }