本文整理汇总了C#中Server.GenericReader.ReadBlock方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadBlock方法的具体用法?C# GenericReader.ReadBlock怎么用?C# GenericReader.ReadBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadBlock方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
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;
}
}
示例2: Deserialize
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;
}
}
示例3: Deserialize
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;
}
}
示例4: DeserializeProfiles
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);
}
示例5: Deserialize
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;
}
}
示例6: Deserialize
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;
}
}
示例7: Deserialize
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();
}
}
示例8: DeserializeBattle
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);
}
示例9: Deserialize
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;
}
}
示例10: Deserialize
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;
}
}
示例11: Deserialize
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;
}
}
示例12: Deserialize
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;
}
}
示例13: Deserialize
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;
}
}