private static Tuple <PvPSerial, PvPBattle> DeserializeBattle(GenericReader reader) { PvPSerial key = null; PvPBattle val = null; int version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(() => key = reader.ReadTypeCreate <PvPSerial>(reader)); reader.ReadBlock(() => val = reader.ReadTypeCreate <PvPBattle>(reader)); } break; } if (key == null) { if (val != null && val.Serial != null) { key = val.Serial; } else { return(null); } } return(new Tuple <PvPSerial, PvPBattle>(key, val)); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 1: Missions = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleMissions>(r)) ?? new PvPBattleMissions(); goto case 0; case 0: { Broadcasts = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleBroadcasts>(r)) ?? new PvPBattleBroadcasts(); Locations = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleLocations>(r)) ?? new PvPBattleLocations(); Restrictions = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleRestrictions>(r)) ?? new PvPBattleRestrictions(); Rewards = reader.ReadBlock(r => r.ReadTypeCreate <PvPRewards>(r)) ?? new PvPRewards(); Rules = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleRules>(r)) ?? new PvPBattleRules(); Sounds = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleSounds>(r)) ?? new PvPBattleSounds(); SuddenDeath = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleSuddenDeath>(r)) ?? new PvPBattleSuddenDeath(); Timing = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleTiming>(r)) ?? new PvPBattleTiming(); Weather = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleWeather>(r)) ?? new PvPBattleWeather(); } break; } if (version < 1) { Missions = new PvPBattleMissions(); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.GetVersion(); switch (version) { case 1: { SkipTicks = reader.ReadInt(); SkippedTicks = reader.ReadInt(); } goto case 0; case 0: { reader.ReadBlock( r => { CurrentSeason = r.ReadInt(); TopListCount = r.ReadInt(); RunnersUpCount = r.ReadInt(); ScheduleInfo = r.ReadTypeCreate <ScheduleInfo>(r) ?? new ScheduleInfo(r); AutoPvP.SeasonSchedule.Enabled = r.ReadBool(); }); reader.ReadBlock(r => Rewards = reader.ReadTypeCreate <PvPRewards>(r) ?? new PvPRewards(r)); } break; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.GetVersion(); switch (version) { case 1: { reader.ReadBlock(() => { Misc = reader.ReadTypeCreate <AutoPvPMiscOptions>(reader) ?? new AutoPvPMiscOptions(reader); }); } goto case 0; case 0: { if (version == 0) { Misc = new AutoPvPMiscOptions(); } reader.ReadBlock( () => { Commands = reader.ReadTypeCreate <AutoPvPCommandOptions>(reader) ?? new AutoPvPCommandOptions(reader); }); reader.ReadBlock( () => { Profiles = reader.ReadTypeCreate <AutoPvPProfileOptions>(reader) ?? new AutoPvPProfileOptions(reader); }); reader.ReadBlock( () => { Seasons = reader.ReadTypeCreate <AutoPvPSeasonOptions>(reader) ?? new AutoPvPSeasonOptions(reader); }); } break; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock( () => { Items = reader.ReadTypeCreate <PvPBattleItemRestrictions>(reader) ?? new PvPBattleItemRestrictions(reader); }); reader.ReadBlock( () => { Pets = reader.ReadTypeCreate <PvPBattlePetRestrictions>(reader) ?? new PvPBattlePetRestrictions(reader); }); reader.ReadBlock( () => { Skills = reader.ReadTypeCreate <PvPBattleSkillRestrictions>(reader) ?? new PvPBattleSkillRestrictions(reader); }); reader.ReadBlock( () => { Spells = reader.ReadTypeCreate <PvPBattleSpellRestrictions>(reader) ?? new PvPBattleSpellRestrictions(reader); }); } break; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 1: reader.ReadBlock(r => Misc = r.ReadTypeCreate <AutoPvPMiscOptions>(r) ?? new AutoPvPMiscOptions()); goto case 0; case 0: { reader.ReadBlock(r => Commands = r.ReadTypeCreate <AutoPvPCommandOptions>(r) ?? new AutoPvPCommandOptions()); reader.ReadBlock(r => Profiles = r.ReadTypeCreate <AutoPvPProfileOptions>(r) ?? new AutoPvPProfileOptions()); reader.ReadBlock(r => Seasons = r.ReadTypeCreate <AutoPvPSeasonOptions>(r) ?? new AutoPvPSeasonOptions()); } break; } if (Misc == null) { Misc = new AutoPvPMiscOptions(); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock( () => { Broadcasts = reader.ReadTypeCreate <PvPBattleBroadcasts>(reader) ?? new PvPBattleBroadcasts(reader); }); reader.ReadBlock( () => { Locations = reader.ReadTypeCreate <PvPBattleLocations>(reader) ?? new PvPBattleLocations(reader); }); reader.ReadBlock( () => { Restrictions = reader.ReadTypeCreate <PvPBattleRestrictions>(reader) ?? new PvPBattleRestrictions(reader); }); reader.ReadBlock(() => { Rewards = reader.ReadTypeCreate <PvPRewards>(reader) ?? new PvPRewards(reader); }); reader.ReadBlock(() => { Rules = reader.ReadTypeCreate <PvPBattleRules>(reader) ?? new PvPBattleRules(reader); }); reader.ReadBlock(() => { Sounds = reader.ReadTypeCreate <PvPBattleSounds>(reader) ?? new PvPBattleSounds(reader); }); reader.ReadBlock( () => { SuddenDeath = reader.ReadTypeCreate <PvPBattleSuddenDeath>(reader) ?? new PvPBattleSuddenDeath(reader); }); reader.ReadBlock(() => { Timing = reader.ReadTypeCreate <PvPBattleTiming>(reader) ?? new PvPBattleTiming(reader); }); reader.ReadBlock(() => { Weather = reader.ReadTypeCreate <PvPBattleWeather>(reader) ?? new PvPBattleWeather(reader); }); } break; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); reader.GetVersion(); Enabled = reader.ReadBool(); Team = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleObjectives>(r)) ?? new PvPBattleObjectives(); Player = reader.ReadBlock(r => r.ReadTypeCreate <PvPBattleObjectives>(r)) ?? new PvPBattleObjectives(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.GetVersion(); switch (version) { case 1: { Access = reader.ReadFlag <AccessLevel>(); LoginPopup = reader.ReadBool(); } goto case 0; case 0: { DefaultWidth = reader.ReadInt(); DefaultHeight = reader.ReadInt(); PositionCommand = reader.ReadString(); PopupCommand = reader.ReadString(); reader.ReadBlock(() => Toolbars.DefaultEntries.Deserialize(reader)); } break; } if (version < 1) { Access = Toolbars.Access; } }
public void Deserialize(GenericReader reader) { var version = reader.ReadInt(); Deleted = reader.ReadBool(); Owner = reader.ReadMobile <PlayerMobile>(); switch (version) { case 0: { _Points = reader.ReadLong(); History = reader.ReadBlock(r => r.ReadTypeCreate <PvPProfileHistory>(this, r)) ?? new PvPProfileHistory(this); Subscriptions = reader.ReadBlockList( r => { var serial = r.ReadTypeCreate <PvPSerial>(r) ?? new PvPSerial(r); return(AutoPvP.FindBattleByID(serial)); }, Subscriptions); } break; } }
private static Tuple <IAccount, DonationProfile> DeserializeProfiles(GenericReader reader) { IAccount key = null; DonationProfile val = null; int version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock( r => { key = r.ReadAccount(); val = r.ReadTypeCreate <DonationProfile>(r); }); } break; } if (key == null) { if (val != null && val.Account != null) { key = val.Account; } else { return(null); } } return(new Tuple <IAccount, DonationProfile>(key, val)); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(r => Loser = r.ReadTypeCreate <PvPReward>(r) ?? new PvPReward()); reader.ReadBlock(r => Winner = r.ReadTypeCreate <PvPReward>(r) ?? new PvPReward()); } break; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(r => Local = r.ReadTypeCreate <PvPBattleLocalBroadcasts>(r) ?? new PvPBattleLocalBroadcasts()); reader.ReadBlock(r => World = r.ReadTypeCreate <PvPBattleWorldBroadcasts>(r) ?? new PvPBattleWorldBroadcasts()); } break; } }
private static void LoadRestore(GenericReader reader) { var version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(r => { var count = r.ReadInt(); while (--count >= 0) { r.ReadBlockDictionary(r1 => { var m = r1.ReadMobile <PlayerMobile>(); var p = r1.ReadLocation(); return(new KeyValuePair <PlayerMobile, MapPoint>(m, p)); }, _BounceRestore); r.ReadBlockDictionary(r1 => { var i = r1.ReadItem(); var p = r1.ReadEntity(); return(new KeyValuePair <Item, IEntity>(i, p)); }, _ItemRestore); } }); } break; } }
private static Tuple <IAccount, DonationProfile> DeserializeProfile(GenericReader reader) { var version = reader.GetVersion(); return(reader.ReadBlock( r => { var key = r.ReadAccount(); DonationProfile val = null; switch (version) { case 1: val = new DonationProfile(r); break; case 0: val = r.ReadTypeCreate <DonationProfile>(r); break; } if (key == null && val != null && val.Account != null) { key = val.Account; } return Tuple.Create(key, val); })); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(r => Advanced = r.ReadTypeCreate <AutoPvPAdvancedOptions>(r) ?? new AutoPvPAdvancedOptions(r)); reader.ReadBlock(r => Statistics = r.ReadTypeCreate <AutoPvPStatistics>(r) ?? new AutoPvPStatistics(r)); reader.ReadBlock( r => ExecuteCommands = r.ReadTypeCreate <AutoPvPExecuteCommands>(r) ?? new AutoPvPExecuteCommands(r)); } break; } }
public virtual void Deserialize(GenericReader reader) { var version = reader.GetVersion(); if (version > 2) { UID = new CryptoHashCode(reader); } else { UID = new CryptoHashCode(CryptoHashType.MD5, TimeStamp.Now + "+" + Utility.RandomDouble()); } switch (version) { case 3: case 2: case 1: case 0: { if (version < 2) { _Info = reader.ReadTypeCreate <ScheduleInfo>(reader) ?? new ScheduleInfo(); } else { _Info = reader.ReadBlock(r => r.ReadTypeCreate <ScheduleInfo>(r)) ?? new ScheduleInfo(); } _Enabled = reader.ReadBool(); _Name = reader.ReadString(); _DefaultPriority = reader.ReadFlag <TimerPriority>(); if (reader.ReadBool()) { _LastGlobalTick = reader.ReadDateTime(); } if (reader.ReadBool()) { _NextGlobalTick = reader.ReadDateTime(); } Delay = reader.ReadTimeSpan(); Interval = reader.ReadTimeSpan(); } break; } InvalidateNextTick(); if (version > 0) { Running = reader.ReadBool(); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 1: { PetGiveDamageScalar = reader.ReadDouble(); PetTakeDamageScalar = reader.ReadDouble(); } goto case 0; case 0: { reader.ReadBlock(r => Restrictions = r.ReadTypeCreate <DungeonRestrictions>(r)); reader.ReadBlock(r => Rules = r.ReadTypeCreate <DungeonRules>(r)); reader.ReadBlock(r => Sounds = r.ReadTypeCreate <DungeonSounds>(r)); } break; } if (Restrictions == null) { Restrictions = new DungeonRestrictions(); } if (Rules == null) { Rules = new DungeonRules(); } if (Sounds == null) { Sounds = new DungeonSounds(); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(r => Items = r.ReadTypeCreate <DungeonItemRestrictions>(r)); reader.ReadBlock(r => Pets = r.ReadTypeCreate <DungeonPetRestrictions>(r)); reader.ReadBlock(r => Skills = r.ReadTypeCreate <DungeonSkillRestrictions>(r)); reader.ReadBlock(r => Spells = r.ReadTypeCreate <DungeonSpellRestrictions>(r)); } break; } if (Items == null) { Items = new DungeonItemRestrictions(); } if (Pets == null) { Pets = new DungeonPetRestrictions(); } if (Skills == null) { Skills = new DungeonSkillRestrictions(); } if (Spells == null) { Spells = new DungeonSpellRestrictions(); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 2: { DefaultTheme = reader.ReadFlag <ToolbarTheme>(); DefaultX = reader.ReadInt(); DefaultY = reader.ReadInt(); } goto case 1; case 1: { Access = reader.ReadFlag <AccessLevel>(); LoginPopup = reader.ReadBool(); } goto case 0; case 0: { DefaultWidth = reader.ReadInt(); DefaultHeight = reader.ReadInt(); PositionCommand = reader.ReadString(); PopupCommand = reader.ReadString(); reader.ReadBlock(Toolbars.DefaultEntries.Deserialize); } break; } if (version < 2) { DefaultTheme = ToolbarTheme.Default; DefaultX = 0; DefaultY = 28; } if (version < 1) { Access = Toolbars.Access; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(r => Broadcasts = r.ReadTypeCreate <PvPBattleBroadcasts>(r) ?? new PvPBattleBroadcasts()); reader.ReadBlock(r => Locations = r.ReadTypeCreate <PvPBattleLocations>(r) ?? new PvPBattleLocations()); reader.ReadBlock(r => Restrictions = r.ReadTypeCreate <PvPBattleRestrictions>(r) ?? new PvPBattleRestrictions()); reader.ReadBlock(r => Rewards = r.ReadTypeCreate <PvPRewards>(r) ?? new PvPRewards()); reader.ReadBlock(r => Rules = r.ReadTypeCreate <PvPBattleRules>(r) ?? new PvPBattleRules()); reader.ReadBlock(r => Sounds = r.ReadTypeCreate <PvPBattleSounds>(r) ?? new PvPBattleSounds()); reader.ReadBlock(r => SuddenDeath = r.ReadTypeCreate <PvPBattleSuddenDeath>(r) ?? new PvPBattleSuddenDeath()); reader.ReadBlock(r => Timing = r.ReadTypeCreate <PvPBattleTiming>(r) ?? new PvPBattleTiming()); reader.ReadBlock(r => Weather = r.ReadTypeCreate <PvPBattleWeather>(r) ?? new PvPBattleWeather()); } break; } }
public virtual void Deserialize(GenericReader reader) { var version = reader.GetVersion(); switch (version) { case 2: case 1: case 0: { if (version < 2) { _Info = reader.ReadTypeCreate <ScheduleInfo>(reader) ?? new ScheduleInfo(); } else { reader.ReadBlock(r => _Info = r.ReadTypeCreate <ScheduleInfo>(r) ?? new ScheduleInfo()); } _Enabled = reader.ReadBool(); _Name = reader.ReadString(); _DefaultPriority = reader.ReadFlag <TimerPriority>(); if (reader.ReadBool()) { _LastGlobalTick = reader.ReadDateTime(); } if (reader.ReadBool()) { _NextGlobalTick = reader.ReadDateTime(); } Delay = reader.ReadTimeSpan(); Interval = reader.ReadTimeSpan(); } break; } if (version > 0) { Running = reader.ReadBool(); } }
private static Tuple <InstanceMapSerial, InstanceMap> DeserializeMap(GenericReader reader) { Tuple <InstanceMapSerial, InstanceMap> value = null; var version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(r => { var map = ReadInstanceMap(r); map.Deserialize(r); value = Tuple.Create(map.Serial, map); }); } break; } return(value); }
private static Tuple <DungeonSerial, Dungeon> DeserializeDungeon(GenericReader reader) { Tuple <DungeonSerial, Dungeon> value = null; var version = reader.GetVersion(); switch (version) { case 0: { reader.ReadBlock(r => { var dungeon = ReadDungeon(r); dungeon.Deserialize(r); value = Tuple.Create(dungeon.Serial, dungeon); }); } break; } return(value); }
public virtual void Deserialize(GenericReader reader) { var version = reader.GetVersion(); if (version > 4) { reader.ReadBlock( r => { if (version > 5) { Serial = new PvPSerial(r); } else { Serial = r.ReadTypeCreate <PvPSerial>(r); Serial = new PvPSerial(); } }); } else { Serial = new PvPSerial(); } switch (version) { case 7: { RespawnRangeMin = reader.ReadInt(); RespawnRangeMax = reader.ReadInt(); } goto case 6; case 6: case 5: case 4: case 3: RespawnOnStart = reader.ReadBool(); goto case 2; case 2: KickOnDeath = reader.ReadBool(); goto case 1; case 1: { GateLocation = new MapPoint(reader); Gate = reader.ReadItem <PvPTeamGate>(); } goto case 0; case 0: { _Name = reader.ReadString(); _MinCapacity = reader.ReadInt(); _MaxCapacity = reader.ReadInt(); _Color = reader.ReadInt(); _HomeBase = reader.ReadPoint3D(); _SpawnPoint = reader.ReadPoint3D(); RespawnOnDeath = reader.ReadBool(); RespawnDelay = reader.ReadTimeSpan(); reader.ReadBlock(r => Statistics = r.ReadTypeCreate <PvPTeamStatistics>(this) ?? new PvPTeamStatistics(this)); } break; } if (version < 4) { RespawnOnStart = true; } if (version < 1) { GateLocation = MapPoint.Empty; } if (Gate != null) { Gate.Team = this; } if (Battle == null) { Timer.DelayCall(Delete); } }
public virtual void Deserialize(GenericReader reader) { var version = reader.GetVersion(); if (version > 5) { reader.ReadBlock( r => { if (version > 6) { Serial = new PvPSerial(r); } else { Serial = r.ReadTypeCreate <PvPSerial>(r) ?? new PvPSerial(r); } }); } switch (version) { case 7: case 6: case 5: Hidden = reader.ReadBool(); goto case 4; case 4: _FloorItemDelete = reader.ReadBool(); goto case 3; case 3: case 2: { Gate = reader.ReadItem <PvPSpectatorGate>(); if (Gate != null) { Gate.Battle = this; } } goto case 1; case 1: { Category = reader.ReadString(); Ranked = reader.ReadBool(); InviteWhileRunning = reader.ReadBool(); } goto case 0; case 0: { if (version < 6) { reader.ReadBlock(r => Serial = r.ReadTypeCreate <PvPSerial>(r) ?? new PvPSerial(r)); } DebugMode = reader.ReadBool(); _State = reader.ReadFlag <PvPBattleState>(); _Name = reader.ReadString(); Description = reader.ReadString(); AutoAssign = reader.ReadBool(); UseTeamColors = reader.ReadBool(); IgnoreCapacity = reader.ReadBool(); _SubCommandPrefix = reader.ReadChar(); QueueAllowed = reader.ReadBool(); SpectateAllowed = reader.ReadBool(); KillPoints = version < 3 ? (reader.ReadBool() ? 1 : 0) : reader.ReadInt(); PointsBase = reader.ReadInt(); PointsRankFactor = reader.ReadDouble(); IdleKick = reader.ReadBool(); IdleThreshold = reader.ReadTimeSpan(); LastState = reader.ReadFlag <PvPBattleState>(); LastStateChange = reader.ReadDateTime(); _LightLevel = reader.ReadInt(); LogoutDelay = reader.ReadTimeSpan(); Doors.AddRange(reader.ReadStrongItemList <BaseDoor>()); reader.ReadBlock(r => Options = r.ReadTypeCreate <PvPBattleOptions>(r) ?? new PvPBattleOptions()); if (Schedule != null && Schedule.Running) { Schedule.Stop(); } reader.ReadBlock(r => Schedule = r.ReadTypeCreate <Schedule>(r) ?? new Schedule("Battle " + Serial.Value, false)); reader.ReadBlock(r => _BattleRegion = r.ReadTypeCreate <PvPBattleRegion>(this, r) ?? new PvPBattleRegion(this)); reader.ReadBlock( r => _SpectateRegion = r.ReadTypeCreate <PvPSpectateRegion>(this, r) ?? new PvPSpectateRegion(this)); reader.ReadBlockList(r => r.ReadTypeCreate <PvPTeam>(this, r) ?? new PvPTeam(this), Teams); } break; } }