Esempio n. 1
1
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch (version)
			{
				case 1:
					reader.ReadBlock(r => Misc = r.ReadTypeCreate<AutoPvPMiscOptions>(r) ?? new AutoPvPMiscOptions(r));
					goto case 0;
				case 0:
					{
						if (version == 0)
						{
							Misc = new AutoPvPMiscOptions();
						}

						reader.ReadBlock(r => Commands = r.ReadTypeCreate<AutoPvPCommandOptions>(r) ?? new AutoPvPCommandOptions(r));
						reader.ReadBlock(r => Profiles = r.ReadTypeCreate<AutoPvPProfileOptions>(r) ?? new AutoPvPProfileOptions(r));
						reader.ReadBlock(r => Seasons = r.ReadTypeCreate<AutoPvPSeasonOptions>(r) ?? new AutoPvPSeasonOptions(r));
					}
					break;
			}
		}
Esempio n. 2
0
		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;
			}
		}
Esempio n. 3
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			var version = reader.GetVersion();

			switch (version)
			{
				case 0:
				{
					reader.ReadBlock(r => Local = reader.ReadTypeCreate<PvPBattleLocalBroadcasts>(r) ?? new PvPBattleLocalBroadcasts());
					reader.ReadBlock(r => World = reader.ReadTypeCreate<PvPBattleWorldBroadcasts>(r) ?? new PvPBattleWorldBroadcasts());
				}
					break;
			}
		}
Esempio n. 4
0
		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);
		}
Esempio n. 5
0
		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;
			}
		}
Esempio n. 6
0
		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);
					}
					break;
			}

			if (version < 1)
			{
				Access = Toolbars.Access;
			}
		}
Esempio n. 7
0
		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();
			}
		}
Esempio n. 8
0
		private static Tuple<PvPSerial, PvPBattle> DeserializeBattle(GenericReader reader)
		{
			PvPSerial key = null;
			PvPBattle val = null;

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlock(r => key = r.ReadTypeCreate<PvPSerial>(r));
						reader.ReadBlock(r => val = r.ReadTypeCreate<PvPBattle>(r));
					}
					break;
			}

			if (key == null)
			{
				if (val != null && val.Serial != null)
				{
					key = val.Serial;
				}
				else
				{
					return null;
				}
			}

			return new Tuple<PvPSerial, PvPBattle>(key, val);
		}
Esempio n. 9
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlock(
							r => Items = reader.ReadTypeCreate<PvPBattleItemRestrictions>(r) ?? new PvPBattleItemRestrictions(r));
						reader.ReadBlock(
							r => Pets = reader.ReadTypeCreate<PvPBattlePetRestrictions>(r) ?? new PvPBattlePetRestrictions(r));
						reader.ReadBlock(
							r => Skills = reader.ReadTypeCreate<PvPBattleSkillRestrictions>(r) ?? new PvPBattleSkillRestrictions(r));
						reader.ReadBlock(
							r => Spells = reader.ReadTypeCreate<PvPBattleSpellRestrictions>(r) ?? new PvPBattleSpellRestrictions(r));
					}
					break;
			}
		}
Esempio n. 10
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlock(
							() => { Advanced = reader.ReadTypeCreate<AutoPvPAdvancedOptions>(reader) ?? new AutoPvPAdvancedOptions(reader); });

						reader.ReadBlock(
							() => { Statistics = reader.ReadTypeCreate<AutoPvPStatistics>(reader) ?? new AutoPvPStatistics(reader); });

						reader.ReadBlock(
							() =>
							{ ExecuteCommands = reader.ReadTypeCreate<AutoPvPExecuteCommands>(reader) ?? new AutoPvPExecuteCommands(reader); });
					}
					break;
			}
		}
Esempio n. 11
0
		public virtual void Deserialize(GenericReader reader)
		{
			int 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(r));

						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, r));
						reader.ReadBlock(
							r => SpectateRegion = r.ReadTypeCreate<PvPSpectateRegion>(this, r) ?? new PvPSpectateRegion(this, r));

						reader.ReadBlockList(r => r.ReadTypeCreate<PvPTeam>(this, r) ?? new PvPTeam(this, r), Teams);
					}
					break;
			}
		}
Esempio n. 12
0
		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;
			}
		}
Esempio n. 13
0
		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;
			}
		}