예제 #1
0
 public void UpdateArenaInfo(UserInfo userinfo)
 {
     if (userinfo == null)
     {
         return;
     }
     if (m_Guid != userinfo.Guid)
     {
         return;
     }
     m_NickName      = userinfo.Nickname;
     m_Level         = userinfo.Level;
     m_FightScore    = userinfo.FightingScore;
     m_ActivePartner = userinfo.PartnerStateInfo.GetActivePartner();
     EquipInfo.Clear();
     for (int i = 0; i < Lobby.EquipInfo.c_MaxEquipmentNum; i++)
     {
         ItemInfo equip = userinfo.Equip.GetEquipmentData(i);
         if (equip != null)
         {
             EquipInfo.Add(equip);
         }
     }
     //skills
     m_SkillDataInfo.Clear();
     for (int i = 0; i < userinfo.Skill.Skills.Count; ++i)
     {
         SkillDataInfo skill_data = new SkillDataInfo();
         skill_data.ID       = userinfo.Skill.Skills[i].ID;
         skill_data.Level    = userinfo.Skill.Skills[i].Level;
         skill_data.Postions = userinfo.Skill.Skills[i].Postions;
         m_SkillDataInfo.Add(skill_data);
     }
     //xsoul
     m_XSoulInfo.Clear();
     foreach (ItemInfo item in userinfo.XSoul.GetAllXSoulPartData().Values)
     {
         ArenaXSoulInfo item_msg = new ArenaXSoulInfo();
         item_msg.ItemId     = item.ItemId;
         item_msg.Level      = item.Level;
         item_msg.Experience = item.Experience;
         item_msg.ModelLevel = item.ShowModelLevel;
         m_XSoulInfo.Add(item_msg);
     }
     //legacy
     m_LegacyInfo.Clear();
     for (int i = 0; i < userinfo.Legacy.SevenArcs.Length; i++)
     {
         ItemInfo item = userinfo.Legacy.SevenArcs[i];
         if (item != null)
         {
             ArenaItemInfo legacy = new ArenaItemInfo();
             legacy.ItemId         = item.ItemId;
             legacy.Level          = item.Level;
             legacy.AppendProperty = item.AppendProperty;
             legacy.IsUnlocked     = item.IsUnlock;
             m_LegacyInfo.Add(legacy);
         }
     }
 }
예제 #2
0
        internal void DelSkillDataByID(int id)
        {
            SkillDataInfo del_info = GetSkillDataByID(id);

            if (null != del_info)
            {
                DelSkillDataByInfo(del_info);
            }
        }
예제 #3
0
 internal void DelSkillDataByInfo(SkillDataInfo info)
 {
     lock (m_Lock)
     {
         if (null != info)
         {
             m_Skills.Remove(info);
         }
     }
 }
예제 #4
0
 internal void AddSkillData(SkillDataInfo info)
 {
     lock (m_Lock)
     {
         if (null != info)
         {
             m_Skills.Add(info);
         }
     }
 }
예제 #5
0
 internal ArenaInfo(ulong guid, ArenaRobotConfig robot_info, int max_partner_count)
 {
     m_Guid       = guid;
     m_Rank       = ArenaSystem.UNKNOWN_RANK;
     m_HeroId     = robot_info.HeroId;
     m_NickName   = robot_info.NickName;
     m_Level      = robot_info.Level;
     m_FightScore = robot_info.FightScore;
     foreach (ArenaItemInfo arena_item in robot_info.EquipInfo)
     {
         ItemInfo item = new ItemInfo(arena_item.ItemId, arena_item.Level);
         item.AppendProperty = arena_item.AppendProperty;
         m_EquipInfo.Add(item);
     }
     foreach (ArenaXSoulInfo xsoul in robot_info.XSoulInfo)
     {
         m_XSoulInfo.Add(xsoul);
     }
     foreach (ArenaPartnerInfo partner in robot_info.PartnerInfo)
     {
         PartnerConfig config = PartnerConfigProvider.Instance.GetDataById(partner.id);
         if (config == null)
         {
             continue;
         }
         PartnerInfo target = new PartnerInfo(config);
         target.CurAdditionLevel = partner.AdditionLevel;
         target.CurSkillStage    = partner.SkillStage;
         m_PartnerInfo.Add(target);
         if (m_PartnerInfo.Count == max_partner_count)
         {
             m_ActivePartner = target;
             break;
         }
     }
     foreach (ArenaSkillInfo e in robot_info.SkillInfo)
     {
         SkillDataInfo skilldata = new SkillDataInfo(e.Id, e.Level);
         skilldata.Postions.Presets[0] = (SlotPosition)e.EquipPos;
         m_SkillDataInfo.Add(skilldata);
     }
     m_IsRobot = true;
 }