コード例 #1
0
ファイル: World.DBC.cs プロジェクト: NecroSharper/WCell
        public override void Convert(byte[] rawData)
        {
            var worldMapOverlayEntry = new WorldMapOverlayEntry();

            worldMapOverlayEntry.WorldMapOverlayId = (WorldMapOverlayId)GetUInt32(rawData, 0);

            for (var i = 0; i < worldMapOverlayEntry.ZoneTemplateId.Length; i++)
            {
                var zoneId = (ZoneId)GetUInt32(rawData, 2 + i);
                if (zoneId == 0)
                {
                    // We reached to the last ZoneId reference.
                    break;
                }

                worldMapOverlayEntry.ZoneTemplateId[i] = zoneId;
                var zoneTemplate = World.s_ZoneTemplates[(int)zoneId];
                if (zoneTemplate == null)
                {
                    LogManager.GetCurrentClassLogger().Warn(string.Format(
                                                                "Invalid ZoneId #{0} found at WorldMapOverlay #{1} during the DBC loading.", zoneId, worldMapOverlayEntry.WorldMapOverlayId));
                    continue;
                }
                zoneTemplate.WorldMapOverlays.Add(worldMapOverlayEntry.WorldMapOverlayId);
            }

            ArrayUtil.Set(ref World.s_WorldMapOverlayEntries, (uint)worldMapOverlayEntry.WorldMapOverlayId,
                          worldMapOverlayEntry);
        }
コード例 #2
0
        public override void Convert(byte[] rawData)
        {
            WorldMapOverlayEntry val = new WorldMapOverlayEntry();

            val.WorldMapOverlayId = (WorldMapOverlayId)DBCRecordConverter.GetUInt32(rawData, 0);
            for (int index = 0; index < val.ZoneTemplateId.Length; ++index)
            {
                ZoneId uint32 = (ZoneId)DBCRecordConverter.GetUInt32(rawData, 2 + index);
                if (uint32 != ZoneId.None)
                {
                    val.ZoneTemplateId[index] = uint32;
                    ZoneTemplate zoneTemplate = WCell.RealmServer.Global.World.s_ZoneTemplates[(int)uint32];
                    if (zoneTemplate == null)
                    {
                        LogManager.GetCurrentClassLogger().Warn(string.Format(
                                                                    "Invalid ZoneId #{0} found at WorldMapOverlay #{1} during the DBC loading.",
                                                                    (object)uint32, (object)val.WorldMapOverlayId));
                    }
                    else
                    {
                        zoneTemplate.WorldMapOverlays.Add(val.WorldMapOverlayId);
                    }
                }
                else
                {
                    break;
                }
            }

            ArrayUtil.Set <WorldMapOverlayEntry>(ref WCell.RealmServer.Global.World.s_WorldMapOverlayEntries,
                                                 (uint)val.WorldMapOverlayId, val);
        }
コード例 #3
0
ファイル: World.DBC.cs プロジェクト: ebakkedahl/WCell
        public override void Convert(byte[] rawData)
        {
            var worldMapOverlayEntry = new WorldMapOverlayEntry();
            worldMapOverlayEntry.WorldMapOverlayId = (WorldMapOverlayId)GetUInt32(rawData, 0);

            for (var i = 0; i < worldMapOverlayEntry.ZoneTemplateId.Length; i++)
            {
                var zoneId = (ZoneId)GetUInt32(rawData, 2 + i);
                if (zoneId == 0)
                    // We reached to the last ZoneId reference.
                    break;

                worldMapOverlayEntry.ZoneTemplateId[i] = zoneId;
                var zoneTemplate = World.s_ZoneTemplates[(int)zoneId];
                if (zoneTemplate == null)
                {
                    LogManager.GetCurrentClassLogger().Warn(string.Format(
                        "Invalid ZoneId #{0} found at WorldMapOverlay #{1} during the DBC loading.", zoneId, worldMapOverlayEntry.WorldMapOverlayId));
                    continue;
                }
                zoneTemplate.WorldMapOverlays.Add(worldMapOverlayEntry.WorldMapOverlayId);
            }

            ArrayUtil.Set(ref World.s_WorldMapOverlayEntries, (uint)worldMapOverlayEntry.WorldMapOverlayId,
                          worldMapOverlayEntry);
        }