Ejemplo n.º 1
0
 private EntityVo GetVo(PvePlayerInfo info)
 {
     if (info == null)
     {
         throw new ArgumentException("info is null");
     }
     if (info.heroInfo == null)
     {
         throw new ArgumentException("heroinfo is null");
     }
     return(new EntityVo(EntityType.Hero, info.heroInfo.heroId, CharacterDataMgr.instance.GetLevel(info.heroInfo.exp), info.heroInfo.star, info.heroInfo.quality, 0f, 0f, 0, 0));
 }
Ejemplo n.º 2
0
        protected override void OnConnectServer(MobaPeerType type)
        {
            string curLevelId = LevelManager.CurLevelId;

            base.OnConnectServer(type);
            if (type == MobaPeerType.C2PvpServer)
            {
                List <EntityVo>      heroes   = LevelManager.GetHeroes(TeamType.LM);
                int                  battleId = int.Parse(curLevelId);
                List <PvePlayerInfo> list     = new List <PvePlayerInfo>();
                foreach (EntityVo current in heroes)
                {
                    HeroInfoData hero = new HeroInfoData
                    {
                        EpMagic   = string.Empty,
                        ModelId   = current.npc_id,
                        SkillList = null,
                        Skins     = string.Empty
                    };
                    HeroInfo heroInfo = new HeroInfo
                    {
                        heroId = current.npc_id,
                        Hero   = hero
                    };
                    PvePlayerInfo item = new PvePlayerInfo
                    {
                        heroInfo       = heroInfo,
                        heroSkinId     = string.Empty,
                        selfDefSkillId = string.Empty,
                        talentInfo     = null,
                        userName       = current.npc_id
                    };
                    list.Add(item);
                }
                SendMsgManager.Instance.SendPvpLoginMsgBase <C2PLoginPve>(PvpCode.C2P_LoginPve, new C2PLoginPve
                {
                    battleId  = battleId,
                    pvePlayer = list,
                    roomId    = this._roomId
                }, this._roomId);
            }
        }