Example #1
0
 internal void ConvertServerHeroInfo(ref ActorServerData serverData, COMDT_CHOICEHERO serverHeroInfo)
 {
     serverData.SymbolID = new uint[30];
     serverData.m_customRecommendEquips = new ushort[6];
     if (serverHeroInfo == null)
     {
         Debug.Log(string.Format("COMDT_CHOICEHERO is null when try to use hero Id {0}, playerId is {1}", serverData.TheActorMeta.ConfigId, serverData.TheActorMeta.PlayerId));
         DictionaryView <uint, ListView <COMDT_CHOICEHERO> > .Enumerator enumerator = this._serverCachedInfo.GetEnumerator();
         while (enumerator.MoveNext())
         {
             KeyValuePair <uint, ListView <COMDT_CHOICEHERO> > current = enumerator.get_Current();
             uint key = current.get_Key();
             KeyValuePair <uint, ListView <COMDT_CHOICEHERO> > current2 = enumerator.get_Current();
             ListView <COMDT_CHOICEHERO> value = current2.get_Value();
             if (value.get_Count() > 0)
             {
                 Debug.Log(string.Format("_serverCachedInfo key {0} value {1}", key, value.get_Item(0).stBaseInfo.stCommonInfo.dwHeroID));
             }
             else
             {
                 Debug.Log(string.Format("_serverCachedInfo key {0} value empty", key));
             }
         }
         return;
     }
     if (serverHeroInfo.stBaseInfo != null && serverHeroInfo.stBaseInfo.stCommonInfo != null)
     {
         serverData.Exp   = serverHeroInfo.stBaseInfo.stCommonInfo.dwExp;
         serverData.Level = (uint)serverHeroInfo.stBaseInfo.stCommonInfo.wLevel;
         serverData.Star  = (uint)serverHeroInfo.stBaseInfo.stCommonInfo.wStar;
         if (serverHeroInfo.stBaseInfo.stCommonInfo.stQuality != null)
         {
             serverData.TheQualityInfo.Quality    = (uint)serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wQuality;
             serverData.TheQualityInfo.SubQuality = (uint)serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wSubQuality;
         }
         if (serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency != null)
         {
             serverData.TheProficiencyInfo.Level       = (uint)serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.bLv;
             serverData.TheProficiencyInfo.Proficiency = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.dwProficiency;
         }
         serverData.SkinId = (uint)serverHeroInfo.stBaseInfo.stCommonInfo.wSkinID;
     }
     if (serverHeroInfo.stBurningInfo != null)
     {
         serverData.TheBurnInfo.HeroRemainingHp = serverHeroInfo.stBurningInfo.dwBloodTTH;
         serverData.TheBurnInfo.IsDead          = (serverHeroInfo.stBurningInfo.bIsDead != 0);
     }
     if (serverHeroInfo.stHeroExtral != null)
     {
         serverData.TheExtraInfo.BornPointIndex = serverHeroInfo.stHeroExtral.iHeroPos;
     }
     for (int i = 0; i < serverHeroInfo.SymbolID.Length; i++)
     {
         serverData.SymbolID[i] = serverHeroInfo.SymbolID[i];
     }
     for (int j = 0; j < serverHeroInfo.HeroEquipList.Length; j++)
     {
         serverData.m_customRecommendEquips[j] = (ushort)serverHeroInfo.HeroEquipList[j];
     }
 }
Example #2
0
        public override bool GetActorServerData(ref ActorMeta actorMeta, ref ActorServerData actorData)
        {
            actorData.TheActorMeta = actorMeta;
            ListView <COMDT_CHOICEHERO> inSearchList = null;

            if (!this._serverCachedInfo.TryGetValue(actorMeta.PlayerId, ref inSearchList))
            {
                return(false);
            }
            int configId = actorMeta.ConfigId;

            this.ConvertServerHeroInfo(ref actorData, this.Find(inSearchList, (COMDT_CHOICEHERO hero) => (ulong)hero.stBaseInfo.stCommonInfo.dwHeroID == (ulong)((long)configId)));
            return(true);
        }
 internal void ConvertServerHeroInfo(ref ActorServerData serverData, COMDT_CHOICEHERO serverHeroInfo)
 {
     if (serverHeroInfo != null)
     {
         if ((serverHeroInfo.stBaseInfo != null) && (serverHeroInfo.stBaseInfo.stCommonInfo != null))
         {
             serverData.Exp   = serverHeroInfo.stBaseInfo.stCommonInfo.dwExp;
             serverData.Level = serverHeroInfo.stBaseInfo.stCommonInfo.wLevel;
             serverData.Star  = serverHeroInfo.stBaseInfo.stCommonInfo.wStar;
             if (serverHeroInfo.stBaseInfo.stCommonInfo.stQuality != null)
             {
                 serverData.TheQualityInfo.Quality    = serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wQuality;
                 serverData.TheQualityInfo.SubQuality = serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wSubQuality;
             }
             if (serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency != null)
             {
                 serverData.TheProficiencyInfo.Level       = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.bLv;
                 serverData.TheProficiencyInfo.Proficiency = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.dwProficiency;
             }
             serverData.SkinId = serverHeroInfo.stBaseInfo.stCommonInfo.wSkinID;
         }
         if (serverHeroInfo.stBurningInfo != null)
         {
             serverData.TheBurnInfo.HeroRemainingHp = serverHeroInfo.stBurningInfo.dwBloodTTH;
             serverData.TheBurnInfo.IsDead          = serverHeroInfo.stBurningInfo.bIsDead != 0;
         }
         if (serverHeroInfo.stHeroExtral != null)
         {
             serverData.TheExtraInfo.BornPointIndex = serverHeroInfo.stHeroExtral.iHeroPos;
         }
         serverData.SymbolID = new uint[serverHeroInfo.SymbolID.Length];
         for (int i = 0; i < serverHeroInfo.SymbolID.Length; i++)
         {
             serverData.SymbolID[i] = serverHeroInfo.SymbolID[i];
         }
         serverData.m_customRecommendEquips = new ushort[serverHeroInfo.HeroEquipList.Length];
         for (int j = 0; j < serverHeroInfo.HeroEquipList.Length; j++)
         {
             serverData.m_customRecommendEquips[j] = (ushort)serverHeroInfo.HeroEquipList[j];
         }
     }
 }
 public virtual bool GetActorServerData(ref ActorMeta actorMeta, ref ActorServerData actorData)
 {
     return(false);
 }