本文整理汇总了C#中Server.GenericReader.ReadDeltaTime方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadDeltaTime方法的具体用法?C# GenericReader.ReadDeltaTime怎么用?C# GenericReader.ReadDeltaTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadDeltaTime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VendorInventory
public VendorInventory( BaseHouse house, GenericReader reader )
{
m_House = house;
int version = reader.ReadEncodedInt();
m_Owner = reader.ReadMobile();
m_VendorName = reader.ReadString();
m_ShopName = reader.ReadString();
m_Items = reader.ReadStrongItemList();
m_Gold = reader.ReadInt();
m_ExpireTime = reader.ReadDeltaTime();
if ( m_Items.Count == 0 && m_Gold == 0 )
{
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) );
}
else
{
TimeSpan delay = m_ExpireTime - DateTime.UtcNow;
m_ExpireTimer = new ExpireTimer( this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero );
m_ExpireTimer.Start();
}
}
示例2: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
BeginDecay( m_DefaultDecayTime );
break;
}
case 1:
{
if ( reader.ReadBool() )
{
BeginDecay( reader.ReadDeltaTime() - DateTime.Now );
}
break;
}
}
}
示例3: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 1:
{
m_Caster = (BaseCreature)reader.ReadMobile();
goto case 0;
}
case 0:
{
m_End = reader.ReadDeltaTime();
m_Timer = new InternalTimer(this, TimeSpan.Zero, true, true);
m_Timer.Start();
break;
}
}
}
示例4: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_End = reader.ReadDeltaTime();
m_From = reader.ReadMobile();
m_To = reader.ReadMobile();
m_Timer = new InternalTimer( this, m_End - DateTime.Now, m_From, m_To );
m_Timer.Start();
}
示例5: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch( version )
{
case 0:
{
m_Owner = reader.ReadMobile();
m_Killer = reader.ReadMobile();
m_TimeOfDeath = reader.ReadDeltaTime();
break;
}
}
}
示例6: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_End = reader.ReadDeltaTime();
m_Timer = new InternalTimer( this, m_End - DateTime.Now );
m_Timer.Start();
break;
}
}
}
示例7: PlantSystem
public PlantSystem( PlantItem plant, GenericReader reader )
{
m_Plant = plant;
int version = reader.ReadInt();
m_FertileDirt = reader.ReadBool();
if ( version >= 1 )
m_NextGrowth = reader.ReadDateTime();
else
m_NextGrowth = reader.ReadDeltaTime();
m_GrowthIndicator = (PlantGrowthIndicator)reader.ReadInt();
m_Water = reader.ReadInt();
m_Hits = reader.ReadInt();
m_Infestation = reader.ReadInt();
m_Fungus = reader.ReadInt();
m_Poison = reader.ReadInt();
m_Disease = reader.ReadInt();
m_PoisonPotion = reader.ReadInt();
m_CurePotion = reader.ReadInt();
m_HealPotion = reader.ReadInt();
m_StrengthPotion = reader.ReadInt();
m_Pollinated = reader.ReadBool();
m_SeedType = (PlantType)reader.ReadInt();
m_SeedHue = (PlantHue)reader.ReadInt();
m_AvailableSeeds = reader.ReadInt();
m_LeftSeeds = reader.ReadInt();
m_AvailableResources = reader.ReadInt();
m_LeftResources = reader.ReadInt();
}
示例8: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 0:
{
m_Decays = reader.ReadBool();
if (m_Decays)
{
m_DecayTime = reader.ReadDeltaTime();
m_Timer = new InternalTimer(this, m_DecayTime);
m_Timer.Start();
}
break;
}
}
}
示例9: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
bool newVendorSystem = false;
switch ( version )
{
case 1:
{
newVendorSystem = reader.ReadBool();
m_ShopName = reader.ReadString();
m_NextPayTime = reader.ReadDeltaTime();
House = (BaseHouse) reader.ReadItem();
goto case 0;
}
case 0:
{
m_Owner = reader.ReadMobile();
m_BankAccount = reader.ReadInt();
m_HoldGold = reader.ReadInt();
m_SellItems = new Hashtable();
int count = reader.ReadInt();
for ( int i = 0; i < count; i++ )
{
Item item = reader.ReadItem();
int price = reader.ReadInt();
if ( price > 100000000 )
price = 100000000;
string description = reader.ReadString();
DateTime created = version < 1 ? DateTime.Now : reader.ReadDateTime();
if ( item != null )
{
SetVendorItem( item, version < 1 && price <= 0 ? -1 : price, description, created );
}
}
break;
}
}
bool newVendorSystemActivated = BaseHouse.NewVendorSystem && !newVendorSystem;
if ( version < 1 || newVendorSystemActivated )
{
if ( version < 1 )
{
m_ShopName = "Shop Not Yet Named";
Timer.DelayCall( TimeSpan.Zero, new TimerStateCallback( UpgradeFromVersion0 ), newVendorSystemActivated );
}
else
{
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixDresswear ) );
}
m_NextPayTime = DateTime.Now + PayTimer.GetInterval();
if ( newVendorSystemActivated )
{
m_HoldGold += m_BankAccount;
m_BankAccount = 0;
}
}
TimeSpan delay = m_NextPayTime - DateTime.Now;
m_PayTimer = new PayTimer( this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero );
m_PayTimer.Start();
Blessed = false;
if ( Core.AOS && NameHue == 0x35 )
NameHue = -1;
}
示例10: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
bool haveproximityrange = false;
bool hasnewobjectinfo = false;
int tmpSpawnListSize = 0;
ArrayList tmpSubGroup = null;
ArrayList tmpSequentialResetTime = null;
ArrayList tmpSequentialResetTo = null;
ArrayList tmpKillsNeeded = null;
ArrayList tmpRequireSurface = null;
ArrayList tmpRestrictKillsToSubgroup = null;
ArrayList tmpClearOnAdvance = null;
ArrayList tmpMinDelay = null;
ArrayList tmpMaxDelay = null;
ArrayList tmpNextSpawn = null;
ArrayList tmpDisableSpawn = null;
ArrayList tmpPackRange = null;
ArrayList tmpSpawnsPer = null;
switch( version )
{
case 30:
{
m_AllowNPCTriggering = reader.ReadBool();
goto case 29;
}
case 29:
{
tmpSpawnListSize = reader.ReadInt();
tmpSpawnsPer = new ArrayList( tmpSpawnListSize );
for( int i = 0; i < tmpSpawnListSize; ++i )
{
int spawnsper = reader.ReadInt();
tmpSpawnsPer.Add( spawnsper );
}
goto case 28;
}
case 28:
{
if( version < 29 )
tmpSpawnListSize = reader.ReadInt();
tmpPackRange = new ArrayList( tmpSpawnListSize );
for( int i = 0; i < tmpSpawnListSize; ++i )
{
int packrange = reader.ReadInt();
tmpPackRange.Add( packrange );
}
goto case 27;
}
case 27:
{
if( version < 28 )
tmpSpawnListSize = reader.ReadInt();
tmpDisableSpawn = new ArrayList( tmpSpawnListSize );
for( int i = 0; i < tmpSpawnListSize; ++i )
{
bool disablespawn = reader.ReadBool();
tmpDisableSpawn.Add( disablespawn );
}
goto case 26;
}
case 26:
{
m_SpawnOnTrigger = reader.ReadBool();
m_FirstModified = reader.ReadDateTime();
m_LastModified = reader.ReadDateTime();
goto case 25;
}
case 25:
{
goto case 24;
}
case 24:
{
if( version < 27 )
tmpSpawnListSize = reader.ReadInt();
tmpRestrictKillsToSubgroup = new ArrayList( tmpSpawnListSize );
tmpClearOnAdvance = new ArrayList( tmpSpawnListSize );
tmpMinDelay = new ArrayList( tmpSpawnListSize );
tmpMaxDelay = new ArrayList( tmpSpawnListSize );
tmpNextSpawn = new ArrayList( tmpSpawnListSize );
for( int i = 0; i < tmpSpawnListSize; ++i )
{
bool restrictkills = reader.ReadBool();
bool clearadvance = reader.ReadBool();
double mind = reader.ReadDouble();
double maxd = reader.ReadDouble();
DateTime nextspawn = reader.ReadDeltaTime();
//.........这里部分代码省略.........
示例11: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_BurntOut = reader.ReadBool();
m_Burning = reader.ReadBool();
m_Duration = reader.ReadTimeSpan();
m_Protected = reader.ReadBool();
if ( m_Burning && m_Duration != TimeSpan.Zero )
{
DoTimer( reader.ReadDeltaTime() - DateTime.Now );
}
break;
}
}
}
示例12: Deserialize
//.........这里部分代码省略.........
Type type = Type.GetType( str );
if ( type != null )
{
m_arSpellDefense.Add( type );
}
}
}
else
{
m_iRangeHome = 0;
}
if ( version >= 2 )
{
m_FightMode = ( FightMode )reader.ReadInt();
m_bControled = reader.ReadBool();
m_ControlMaster = reader.ReadMobile();
m_ControlTarget = reader.ReadMobile();
m_ControlDest = reader.ReadPoint3D();
m_ControlOrder = (OrderType) reader.ReadInt();
m_dMinTameSkill = reader.ReadDouble();
if ( version < 9 )
reader.ReadDouble();
m_bTamable = reader.ReadBool();
m_bSummoned = reader.ReadBool();
if ( m_bSummoned )
{
m_SummonEnd = reader.ReadDeltaTime();
new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
}
m_iControlSlots = reader.ReadInt();
}
else
{
m_FightMode = FightMode.Closest;
m_bControled = false;
m_ControlMaster = null;
m_ControlTarget = null;
m_ControlOrder = OrderType.None;
}
if ( version >= 3 )
m_Loyalty = (PetLoyalty)reader.ReadInt();
else
m_Loyalty = PetLoyalty.WonderfullyHappy;
if ( version >= 4 )
m_CurrentWayPoint = reader.ReadItem() as WayPoint;
if ( version >= 5 )
m_SummonMaster = reader.ReadMobile();
if ( version >= 6 )
{
m_HitsMax = reader.ReadInt();
m_StamMax = reader.ReadInt();
m_ManaMax = reader.ReadInt();
m_DamageMin = reader.ReadInt();
示例13: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 4:
{
m_WalkingRange = reader.ReadInt();
m_SpawnID = reader.ReadInt();
m_CountA = reader.ReadInt();
m_CountB = reader.ReadInt();
m_CountC = reader.ReadInt();
m_CountD = reader.ReadInt();
m_CountE = reader.ReadInt();
goto case 3;
}
case 3:
case 2:
{
m_WayPoint = reader.ReadItem() as WayPoint;
goto case 1;
}
case 1:
{
m_Group = reader.ReadBool();
goto case 0;
}
case 0:
{
m_MinDelay = reader.ReadTimeSpan();
m_MaxDelay = reader.ReadTimeSpan();
m_Count = reader.ReadInt();
m_Team = reader.ReadInt();
m_HomeRange = reader.ReadInt();
m_Running = reader.ReadBool();
TimeSpan ts = TimeSpan.Zero;
if (m_Running)
ts = reader.ReadDeltaTime() - DateTime.Now;
int size = reader.ReadInt();
m_CreaturesName = new List<string>(size);
for (int i = 0; i < size; ++i)
{
string creatureString = reader.ReadString();
m_CreaturesName.Add(creatureString);
string typeName = ParseType(creatureString);
if (ScriptCompiler.FindTypeByName(typeName) == null)
{
if (m_WarnTimer == null)
m_WarnTimer = new WarnTimer();
m_WarnTimer.Add(Location, Map, typeName);
}
}
int sizeA = reader.ReadInt();
m_CreaturesNameA = new List<string>(sizeA);
for (int i = 0; i < sizeA; ++i)
{
string creatureString = reader.ReadString();
m_CreaturesNameA.Add(creatureString);
string typeName = ParseType(creatureString);
if (ScriptCompiler.FindTypeByName(typeName) == null)
{
if (m_WarnTimer == null)
m_WarnTimer = new WarnTimer();
m_WarnTimer.Add(Location, Map, typeName);
}
}
int sizeB = reader.ReadInt();
m_CreaturesNameB = new List<string>(sizeB);
for (int i = 0; i < sizeB; ++i)
{
string creatureString = reader.ReadString();
m_CreaturesNameB.Add(creatureString);
string typeName = ParseType(creatureString);
if (ScriptCompiler.FindTypeByName(typeName) == null)
{
if (m_WarnTimer == null)
m_WarnTimer = new WarnTimer();
m_WarnTimer.Add(Location, Map, typeName);
//.........这里部分代码省略.........
示例14: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 26:
{
#region GeNova: Mondain's Legacy
m_Quests = QuestReader.Quests(reader, this);
m_Chains = QuestReader.Chains(reader);
m_Collections = new Dictionary<Collection, int>();
m_CollectionTitles = new List<object>();
for (int i = reader.ReadInt(); i > 0; i--)
m_Collections.Add((Collection)reader.ReadInt(), reader.ReadInt());
for (int i = reader.ReadInt(); i > 0; i--)
m_CollectionTitles.Add(QuestReader.Object(reader));
m_SelectedTitle = reader.ReadInt();
m_Peaced = reader.ReadDateTime();
#endregion
goto case 25;
}
case 25:
{
int recipeCount = reader.ReadInt();
if (recipeCount > 0)
{
m_AcquiredRecipes = new Dictionary<int, bool>();
for (int i = 0; i < recipeCount; i++)
{
int r = reader.ReadInt();
if (reader.ReadBool()) //Don't add in recipies which we haven't gotten or have been removed
m_AcquiredRecipes.Add(r, true);
}
}
goto case 24;
}
case 24:
{
m_LastHonorLoss = reader.ReadDeltaTime();
goto case 23;
}
case 23:
{
m_ChampionTitles = new ChampionTitleInfo(reader);
goto case 22;
}
case 22:
{
m_LastValorLoss = reader.ReadDateTime();
goto case 21;
}
case 21:
{
m_ToTItemsTurnedIn = reader.ReadEncodedInt();
m_ToTTotalMonsterFame = reader.ReadInt();
goto case 20;
}
case 20:
{
m_AllianceMessageHue = reader.ReadEncodedInt();
m_GuildMessageHue = reader.ReadEncodedInt();
goto case 19;
}
case 19:
{
int rank = reader.ReadEncodedInt();
int maxRank = Guilds.RankDefinition.Ranks.Length - 1;
if (rank > maxRank)
rank = maxRank;
m_GuildRank = Guilds.RankDefinition.Ranks[rank];
m_LastOnline = reader.ReadDateTime();
goto case 18;
}
case 18:
{
m_SolenFriendship = (SolenFriendship)reader.ReadEncodedInt();
goto case 17;
}
case 17: // changed how DoneQuests is serialized
case 16:
{
m_Quest = QuestSerializer.DeserializeQuest(reader);
if (m_Quest != null)
m_Quest.From = this;
int count = reader.ReadEncodedInt();
//.........这里部分代码省略.........
示例15: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 2:
{
m_Guardians = reader.ReadStrongMobileList();
m_Temporary = reader.ReadBool();
goto case 1;
}
case 1:
{
m_Owner = reader.ReadMobile();
goto case 0;
}
case 0:
{
m_Level = reader.ReadInt();
m_DeleteTime = reader.ReadDeltaTime();
m_Lifted = reader.ReadStrongItemList();
if ( version < 2 )
m_Guardians = new List<Mobile>();
break;
}
}
if ( !m_Temporary )
{
m_Timer = new DeleteTimer( this, m_DeleteTime );
m_Timer.Start();
}
else
{
Delete();
}
}