コード例 #1
0
        public void Register(ParsedLine line)
        {
            // Problem lines:
            // "13:07:02:13:48:18.1::Kallista Hellbourne,P[200674407@288107 Kallista Hellbourne@tonyleon],,,Sentry,C[1150404 Frost_Goblin_Sentry],Storm Spell,Pn.Zh5vu,Lightning,ShowPowerDisplayName,580.333,0"
            // "13:07:03:11:47:12.6::Grizzard,P[200743305@6022049 Grizzard@shamedy],Cutter,C[9395 Winterforge_Frost_Goblin_Cutter],Grizzard,P[200743305@6022049 Grizzard@shamedy],Guard Break,Pn.Jy04um1,Power,,-23.1135,0"
            // "13:07:09:11:01:08.4::Correk,P[201028460@1546238 Correk@Gleyvien],Target Dummy,C[265291 Entity_Targetdummy],,*,Doom!,Pn.F1j0yx1,Radiant,Critical,10557.2,8445.78"
            // "13:07:09:11:01:59.5::Nasus king,P[201132249@7587600 Nasus king@portazorras],SerGay,C[265715 Pet_Clericdisciple],Target Dummy,C[265291 Entity_Targetdummy],Sacred Flame,Pn.Tegils,Physical,Flank,59.7605,0"

            bool add = false;
            OwnerInfo OwnerInfo = null;

            // Record owner of all pets we see.
            if (line.srcEntityType == EntityType.Pet)
            {
                if (petPlayerCache.TryGetValue(line.srcInt, out OwnerInfo))
                {
                    if (OwnerInfo.ownerInt != line.ownInt)
                    {
                        // Pet Owner changed...  Not sure if possible... but just in case.
                        petPlayerCache.Remove(OwnerInfo.petInt);
                        playerPetCache.Remove(OwnerInfo.ownerInt);
                        add = true;
                    }
                }
                else
                {
                    // Check if this player had another pet registered and clean up.
                    // Only one pet is allowed.
                    if (playerPetCache.TryGetValue(line.ownInt, out OwnerInfo))
                    {
                        playerPetCache.Remove(line.ownInt);
                        petPlayerCache.Remove(OwnerInfo.petInt);
                    }

                    add = true;
                }

                if (add)
                {
                    OwnerInfo = new OwnerInfo();
                    OwnerInfo.ownerDsp = line.ownDsp;
                    OwnerInfo.ownerInt = line.ownInt;
                    OwnerInfo.ownerEntityType = line.ownEntityType;
                    OwnerInfo.petDsp = line.srcDsp;
                    OwnerInfo.petInt = line.srcInt;

                    petPlayerCache.Add(line.srcInt, OwnerInfo);
                    playerPetCache.Add(line.ownInt, OwnerInfo);
                }
            }
        }
コード例 #2
0
        public void Register(ParsedLine line)
        {
            bool add = false;
            OwnerInfo OwnerInfo = null;

            // Record owner of all entities we see.
            if (line.srcEntityType == EntityType.Entity)
            {
                if (entityPlayerCache.TryGetValue(line.srcInt, out OwnerInfo))
                {
                    if (OwnerInfo.ownerInt != line.ownInt)
                    {
                        // Pet Owner changed...  Not sure if possible... but just in case.
                        entityPlayerCache.Remove(OwnerInfo.petInt);
                        add = true;
                    }
                }
                else
                {
                    // Multiple entities may be owned by same owner.
                    add = true;
                }

                if (add)
                {
                    OwnerInfo = new OwnerInfo();
                    OwnerInfo.ownerDsp = line.ownDsp;
                    OwnerInfo.ownerInt = line.ownInt;
                    OwnerInfo.ownerEntityType = line.ownEntityType;
                    OwnerInfo.petDsp = line.srcDsp;
                    OwnerInfo.petInt = line.srcInt;

                    entityPlayerCache.Add(line.srcInt, OwnerInfo);
                }
            }
        }