GetName() public static method

public static GetName ( StoreNameType type, int entry, bool withEntry = true ) : string
type StoreNameType
entry int
withEntry bool
return string
示例#1
0
        public int ReadEntryWithName <T>(StoreNameType type, string name, params int[] values)
        {
            var val = (int)ReadValue(Type.GetTypeCode(typeof(T)));

            Writer.WriteLine("{0}{1}: {2}{3}", GetIndexString(values), name, StoreGetters.GetName(type, val), (debug ? " (0x" + val.ToString("X4") + ")" : ""));
            return(val);
        }
示例#2
0
        private uint ReadEntry(StoreNameType type, string name, int bits, params object[] indexes)
        {
            var val = ReadBits(bits);

            AddValue(name, FormatInteger(val, StoreGetters.GetName(type, (int)val, false)), indexes);
            return(val);
        }
示例#3
0
        private T ReadEntry <T>(StoreNameType type, string name, params object[] indexes) where T : struct
        {
            var val = ReadValue <T>();
            int val32;

            if (val > Int32.MaxValue)
            {
                val32 = unchecked ((int)Convert.ToUInt32(val));
            }
            else
            {
                val32 = Convert.ToInt32(val);
            }

            if (type == StoreNameType.Spell && Settings.ParseSpellInfos)
            {
                ReadSpellEntry((uint)val32, name, indexes);
            }
            else
            {
                AddValue(name, FormatInteger(val32, StoreGetters.GetName(type, val32, false)), indexes);
            }

            return((T)Convert.ChangeType(val, typeof(T)));
        }
示例#4
0
        public override string ToString()
        {
            if (Low == 0 && High == 0)
            {
                return("Full: 0x0");
            }

            if (HasEntry())
            {
                StoreNameType type = Utilities.ObjectTypeToStore(GetObjectType());

                // ReSharper disable once UseStringInterpolation
                return(string.Format("Full: 0x{0}{1} {2}/{3} R{4}/S{5} Map: {6} Entry: {7} Low: {8}", High.ToString("X16"), Low.ToString("X16"),
                                     GetHighType(), GetSubType(), GetRealmId(), GetServerId(), StoreGetters.GetName(StoreNameType.Map, GetMapId()),
                                     StoreGetters.GetName(type, (int)GetEntry()), GetLow()));
            }

            // TODO: Implement extra format for battleground, see WowGuid64.ToString()

            string name = StoreGetters.GetName(this);

            // ReSharper disable once UseStringInterpolation
            return(string.Format("Full: 0x{0}{1} {2}/{3} R{4}/S{5} Map: {6} Low: {7}", High.ToString("X16"), Low.ToString("X16"),
                                 GetHighType(), GetSubType(), GetRealmId(), GetServerId(), StoreGetters.GetName(StoreNameType.Map, GetMapId()),
                                 GetLow() + (String.IsNullOrEmpty(name) ? String.Empty : (" Name: " + name))));
        }
示例#5
0
        private T ReadEntry <T>(StoreNameType type, string name, params object[] indexes) where T : struct
        {
            var val   = ReadValue <T>();
            var val32 = Convert.ToInt32(val);

            AddValue(name, FormatInteger(val32, StoreGetters.GetName(type, val32, false)), indexes);
            return((T)Convert.ChangeType(val, typeof(T)));
        }
示例#6
0
        public T ReadEntry <T>(StoreNameType type, string name, params object[] indexes) where T : struct
        {
            var val   = ReadStruct <T>();
            var val32 = Convert.ToInt32(val);

            AddValue(name, StoreGetters.GetName(type, val32) + (Settings.DebugReads ? " (0x" + val32.ToString("X4") + ")" : String.Empty), indexes);
            return(val);
        }
示例#7
0
        public int ReadEntryWithName <T>(StoreNameType type, string name, params int[] values)
        {
            var val = (int)ReadValue(Type.GetTypeCode(typeof(T)));

            WriteLine("{0}{1}: {2}{3}", GetIndexString(values), name, StoreGetters.GetName(type, val), (Settings.DebugReads ? " (0x" + val.ToString("X4") + ")" : String.Empty));
            if (WriteToFile)
            {
                WriteToFile = Filters.CheckFilter(type, val);
            }
            return(val);
        }
示例#8
0
        public override string ToString()
        {
            if (Full == 0)
            {
                return("0x0");
            }

            // If our guid has an entry and it is an unit or a GO, print its
            // name next to the entry (from a database, if enabled)
            if (HasEntry())
            {
                var type = Utilities.ObjectTypeToStore(GetObjectType());

                return("Full: 0x" + Full.ToString("X8") + " Type: " + GetHighType()
                       + " Entry: " + StoreGetters.GetName(type, (int)GetEntry()) + " Low: " + GetLow());
            }

            switch (GetHighType())
            {
            case HighGuidType.BattleGround1:
            {
                var bgType = Full & 0x00000000000000FF;
                return("Full: 0x" + Full.ToString("X8") + " Type: " + GetHighType()
                       + " BgType: " + StoreGetters.GetName(StoreNameType.Battleground, (int)bgType));
            }

            case HighGuidType.BattleGround2:
            {
                var bgType    = (Full & 0x00FF0000) >> 16;
                var unkId     = (Full & 0x0000FF00) >> 8;
                var arenaType = (Full & 0x000000FF) >> 0;
                return("Full: 0x" + Full.ToString("X8") + " Type: " + GetHighType()
                       + " BgType: " + StoreGetters.GetName(StoreNameType.Battleground, (int)bgType)
                       + " Unk: " + unkId + (arenaType > 0 ? (" ArenaType: " + arenaType) : String.Empty));
            }

            case HighGuidType.Player:
            {
                return("Full: 0x" + Full.ToString("X8") + " Type: " + GetHighType()
                       + " Low: " + StoreGetters.GetName(StoreNameType.Player, (int)GetLow()));
            }
            }

            return("Full: 0x" + Full.ToString("X8") + " Type: " + GetHighType()
                   + " Low: " + GetLow());
        }
示例#9
0
        public override string ToString()
        {
            if (Full == 0)
            {
                return("0x0");
            }

            // If our guid has an entry and it is an unit or a GO, print its
            // name next to the entry (from a database, if enabled)
            if (HasEntry())
            {
                StoreNameType type = StoreNameType.None;
                if (GetObjectType() == ObjectType.Unit)
                {
                    type = StoreNameType.Unit;
                }
                if (GetObjectType() == ObjectType.GameObject)
                {
                    type = StoreNameType.GameObject;
                }

                return("Full: 0x" + Full.ToString("X8") + " Type: " + GetHighType()
                       + " Entry: " + StoreGetters.GetName(type, (int)GetEntry()) + " Low: " + GetLow());
            }

            if (GetHighType() == HighGuidType.BattleGround)
            {
                var bgType    = (Full & 0x00FF0000) >> 16;
                var UnkId     = (Full & 0x0000FF00) >> 8;
                var arenaType = (Full & 0x000000FF) >> 0;
                return("Full: 0x" + Full.ToString("X8") + " Type: " + GetHighType()
                       + " BgType: " + StoreGetters.GetName(StoreNameType.Battleground, (int)bgType)
                       + " Unk: " + UnkId + (arenaType > 0 ? (" ArenaType: " + arenaType) : ""));
            }

            return("Full: 0x" + Full.ToString("X8") + " Type: " + GetHighType()
                   + " Low: " + GetLow());
        }
示例#10
0
        public string ReadSpellEntry(uint spellID, string name, params object[] indexes)
        {
            AddValue(name, FormatInteger(spellID, StoreGetters.GetName(StoreNameType.Spell, (int)spellID, false)), indexes);

            string spellInfo = string.Empty;

            for (uint idx = 0; idx < 32; idx++)
            {
                var tuple = Tuple.Create(spellID, idx);
                if (DBC.DBC.SpellEffectStores.ContainsKey(tuple))
                {
                    spellInfo += Environment.NewLine;
                    var effect     = DBC.DBC.SpellEffectStores[tuple];
                    var difficulty = DBC.DBC.Difficulty.ContainsKey((int)effect.DifficultyID) ? DBC.DBC.Difficulty[(int)effect.DifficultyID].Name : "DIFFICULTY_NONE";
                    var aura       = (AuraTypeLegion)effect.EffectAura;
                    var misc       = effect.EffectMiscValue[0];

                    AddValue("SpellInfo", $"Effect { effect.EffectIndex }: Id { effect.Effect  } ({ (SpellEffects)effect.Effect  }) { difficulty }", indexes);
                    AddValue("SpellInfo", $"Targets ({  effect.ImplicitTarget[0] }, { effect.ImplicitTarget[1] }) ({ (Targets)effect.ImplicitTarget[0] }, { (Targets)effect.ImplicitTarget[1] })", indexes);

                    if (effect.EffectAura == 0)
                    {
                        AddValue("SpellInfo", $"EffectMiscValueA = { effect.EffectMiscValue[0] }", indexes);
                        AddValue("SpellInfo", $"EffectMiscValueB = { effect.EffectMiscValue[1] }", indexes);
                        AddValue("SpellInfo", $"EffectAmplitude = { effect.EffectAmplitude }", indexes);
                        continue;
                    }

                    string auraInfo = string.Empty;
                    auraInfo += $"Aura Id {aura:D} ({ aura })";
                    auraInfo += $", value = { effect.EffectBasePoints }";
                    auraInfo += $", misc = { misc } (";

                    switch (aura)
                    {
                    case AuraTypeLegion.SPELL_AURA_MOD_STAT:
                        spellInfo += $"{ (UnitMods)misc }";
                        break;

                    case AuraTypeLegion.SPELL_AURA_MOD_RATING:
                    case AuraTypeLegion.SPELL_AURA_MOD_RATING_PCT:
                        spellInfo += $"{ (CombatRating)misc }";
                        break;

                    case AuraTypeLegion.SPELL_AURA_ADD_FLAT_MODIFIER:
                    case AuraTypeLegion.SPELL_AURA_ADD_PCT_MODIFIER:
                        spellInfo += $"{ (SpellModOp)misc }";
                        break;

                    default:
                        spellInfo += $"{ misc }";
                        break;
                    }

                    auraInfo += $"), miscB = { effect.EffectMiscValue[1] } , amplitude = { effect.EffectAmplitude }, periodic = { effect.EffectAuraPeriod }";

                    AddValue("SpellInfo", auraInfo, indexes);
                }
            }

            return(spellInfo);
        }
示例#11
0
 public override string ToString()
 {
     return("Full: 0x" + Full.ToString("X4") + " Type: " + GetLfgType() + " Instance: " +
            StoreGetters.GetName(StoreNameType.LFGDungeon, GetInstanceId()));
 }