本文整理汇总了C#中Server.Region.InternalEnter方法的典型用法代码示例。如果您正苦于以下问题:C# Region.InternalEnter方法的具体用法?C# Region.InternalEnter怎么用?C# Region.InternalEnter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Region
的用法示例。
在下文中一共展示了Region.InternalEnter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetLocation
//.........这里部分代码省略.........
{
if ( o is Item )
{
Item item = (Item)o;
int range = item.GetUpdateRange( this );
Point3D loc = item.Location;
if ( !Utility.InRange( oldLocation, loc, range ) && Utility.InRange( newLocation, loc, range ) && CanSee( item ) )
item.SendInfoTo( ourState );
}
else if ( o != this && o is Mobile )
{
Mobile m = (Mobile)o;
if ( !Utility.InUpdateRange( newLocation, m.m_Location ) )
continue;
bool inOldRange = Utility.InUpdateRange( oldLocation, m.m_Location );
if ( (isTeleport || !inOldRange) && m.m_NetState != null && m.CanSee( this ) )
{
m.m_NetState.Send( new MobileIncoming( m, this ) );
if ( IsDeadBondedPet )
m.m_NetState.Send( new BondedStatus( 0, m_Serial, 1 ) );
if ( ObjectPropertyList.Enabled )
{
m.m_NetState.Send( OPLPacket );
//foreach ( Item item in m_Items )
// m.m_NetState.Send( item.OPLPacket );
}
}
if ( !inOldRange && CanSee( m ) )
{
ourState.Send( new MobileIncoming( this, m ) );
if ( m.IsDeadBondedPet )
ourState.Send( new BondedStatus( 0, m.m_Serial, 1 ) );
if ( ObjectPropertyList.Enabled )
{
ourState.Send( m.OPLPacket );
//foreach ( Item item in m.m_Items )
// ourState.Send( item.OPLPacket );
}
}
}
}
eable.Free();
}
else
{
eable = map.GetClientsInRange( newLocation );
// We're not attached to a client, so simply send an Incoming
foreach ( NetState ns in eable )
{
if ( (isTeleport || !Utility.InUpdateRange( oldLocation, ns.Mobile.Location )) && ns.Mobile.CanSee( this ) )
{
ns.Send( new MobileIncoming( ns.Mobile, this ) );
if ( IsDeadBondedPet )
ns.Send( new BondedStatus( 0, m_Serial, 1 ) );
if ( ObjectPropertyList.Enabled )
{
ns.Send( OPLPacket );
//foreach ( Item item in m_Items )
// ns.Send( item.OPLPacket );
}
}
}
eable.Free();
}
}
m_Region = Region.Find( m_Location, m_Map );
if ( oldRegion != m_Region )
{
oldRegion.InternalExit( this );
m_Region.InternalEnter( this );
OnRegionChange( oldRegion, m_Region );
}
OnLocationChange( oldLocation );
CheckLightLevels( false );
m_Region.OnLocationChanged( this, oldLocation );
}
}
示例2: MoveToWorld
public virtual void MoveToWorld( Point3D newLocation, Map map )
{
if ( m_Map == map )
{
SetLocation( newLocation, true );
return;
}
BankBox box = FindBankNoCreate();
if ( box != null && box.Opened )
box.Close();
Point3D oldLocation = m_Location;
Map oldMap = m_Map;
Region oldRegion = m_Region;
if ( oldMap != null )
{
oldMap.OnLeave( this );
ClearScreen();
SendRemovePacket();
}
for ( int i = 0; i < m_Items.Count; ++i )
((Item)m_Items[i]).Map = map;
m_Map = map;
m_Region.InternalExit( this );
m_Location = newLocation;
NetState ns = m_NetState;
if ( m_Map != null )
{
m_Map.OnEnter( this );
m_Region = Region.Find( m_Location, m_Map );
OnRegionChange( oldRegion, m_Region );
m_Region.InternalEnter( this );
if ( ns != null && m_Map != null )
{
ns.Sequence = 0;
ns.Send( new MapChange( this ) );
ns.Send( new MapPatches() );
ns.Send( SeasonChange.Instantiate( GetSeason(), true ) );
ns.Send( new MobileUpdate( this ) );
ClearFastwalkStack();
}
}
if ( ns != null )
{
if ( m_Map != null )
Send( new ServerChange( this, m_Map ) );
ns.Sequence = 0;
ClearFastwalkStack();
Send( new MobileIncoming( this, this ) );
Send( new MobileUpdate( this ) );
CheckLightLevels( true );
Send( new MobileUpdate( this ) );
}
SendEverything();
SendIncomingPacket();
if ( ns != null )
{
m_NetState.Sequence = 0;
ClearFastwalkStack();
Send( new MobileIncoming( this, this ) );
Send( SupportedFeatures.Instantiate( ns.Account ) );
Send( new MobileUpdate( this ) );
Send( new MobileAttributes( this ) );
}
OnMapChange( oldMap );
OnLocationChange( oldLocation );
m_Region.OnLocationChanged( this, oldLocation );
}
示例3: Deserialize
//.........这里部分代码省略.........
m_Direction = (Direction) reader.ReadByte();
m_Hue = reader.ReadInt();
m_Str = reader.ReadInt();
m_Dex = reader.ReadInt();
m_Int = reader.ReadInt();
m_Hits = reader.ReadInt();
m_Stam = reader.ReadInt();
m_Mana = reader.ReadInt();
m_Map = reader.ReadMap();
m_Blessed = reader.ReadBool();
m_Fame = reader.ReadInt();
m_Karma = reader.ReadInt();
m_AccessLevel = (AccessLevel) reader.ReadByte();
m_Skills = new Skills( this, reader );
int itemCount = reader.ReadInt();
m_Items = new ArrayList( itemCount );
for ( int i = 0; i < itemCount; ++i )
{
Item item = reader.ReadItem();
if ( item != null )
m_Items.Add( item );
}
m_Player = reader.ReadBool();
m_Title = reader.ReadString();
if (m_Title != null)
m_Title = string.Intern(m_Title);
m_Profile = reader.ReadString();
m_ProfileLocked = reader.ReadBool();
if ( version <= 18 )
{
/*m_LightLevel =*/ reader.ReadInt();
/*m_TotalGold =*/ reader.ReadInt();
/*m_TotalWeight =*/ reader.ReadInt();
}
m_AutoPageNotify = reader.ReadBool();
m_LogoutLocation = reader.ReadPoint3D();
m_LogoutMap = reader.ReadMap();
m_StrLock = (StatLockType)reader.ReadByte();
m_DexLock = (StatLockType)reader.ReadByte();
m_IntLock = (StatLockType)reader.ReadByte();
if ( reader.ReadBool() )
{
m_StuckMenuUses = new DateTime[reader.ReadInt()];
for ( int i = 0; i < m_StuckMenuUses.Length; ++i )
{
m_StuckMenuUses[i] = reader.ReadDateTime();
}
}
else
{
m_StuckMenuUses = null;
}
if ( m_Player && m_Map != Map.Internal )
{
m_LogoutLocation = m_Location;
m_LogoutMap = m_Map;
m_Map = Map.Internal;
}
if ( m_Map != null )
m_Map.OnEnter( this );
if ( m_Criminal )
{
if ( m_ExpireCriminal == null )
m_ExpireCriminal = new ExpireCriminalTimer( this );
m_ExpireCriminal.Start();
}
if ( ShouldCheckStatTimers )
CheckStatTimers();
if ( !m_Player && m_Dex <= 100 && m_CombatTimer != null )
m_CombatTimer.Priority = TimerPriority.FiftyMS;
else if ( m_CombatTimer != null )
m_CombatTimer.Priority = TimerPriority.EveryTick;
m_Region = Region.Find( m_Location, m_Map );
m_Region.InternalEnter( this );
UpdateResistances();
break;
}
}
}
示例4: ForceRegionReEnter
public void ForceRegionReEnter( bool Exit )
{
//forces to find the region again and enter it
if ( m_Deleted )
return;
Region n = Region.Find( m_Location, m_Map );
if ( n != m_Region )
{
if ( Exit )
m_Region.InternalExit( this );
m_Region = n;
OnRegionChange( n, m_Region );
m_Region.InternalEnter( this );
CheckLightLevels( false );
}
}
示例5: Deserialize
//.........这里部分代码省略.........
}
}
m_Skills = new Skills(this, reader);
int itemCount = reader.ReadInt32();
m_Items = new ArrayList(itemCount);
for (int i = 0; i < itemCount; ++i)
{
Item item = reader.ReadItem();
if (item != null)
m_Items.Add(item);
}
m_Player = reader.ReadBool();
m_Title = reader.ReadString();
m_Profile = reader.ReadString();
m_ProfileLocked = reader.ReadBool();
if (version <= 18)
{
/*m_LightLevel =*/
reader.ReadInt();
/*m_TotalGold =*/
reader.ReadInt();
/*m_TotalWeight =*/
reader.ReadInt();
}
m_AutoPageNotify = reader.ReadBool();
m_LogoutLocation = reader.ReadPoint3D();
m_LogoutMap = reader.ReadMap();
m_StrLock = (StatLockType)reader.ReadByte();
m_DexLock = (StatLockType)reader.ReadByte();
m_IntLock = (StatLockType)reader.ReadByte();
m_StatMods = new ArrayList();
if (reader.ReadBool())
{
m_StuckMenuUses = new DateTime[reader.ReadInt32()];
for (int i = 0; i < m_StuckMenuUses.Length; ++i)
{
m_StuckMenuUses[i] = reader.ReadDateTime();
}
}
else
{
m_StuckMenuUses = null;
}
if (m_Player && m_Map != Map.Internal)
{
m_LogoutLocation = m_Location;
m_LogoutMap = m_Map;
m_Map = Map.Internal;
}
if (m_Map != null)
m_Map.OnEnter(this);
if (m_Criminal)
{
if (m_ExpireCriminal == null)
m_ExpireCriminal = new ExpireCriminalTimer(this);
m_ExpireCriminal.Start();
}
if (ShouldCheckStatTimers)
CheckStatTimers();
if (!m_Player && m_Dex <= 100 && m_CombatTimer != null)
m_CombatTimer.Priority = TimerPriority.FiftyMS;
else if (m_CombatTimer != null)
m_CombatTimer.Priority = TimerPriority.EveryTick;
m_Region = Region.Find(m_Location, m_Map);
m_Region.InternalEnter(this);
//UpdateResistances();
break;
}
}
//Pix: special logic to ensure the DefensiveSpell lock in m_Actions exists if it should
//Note protection is a different beast since there are timers that control
// BeginAction/EndAction -- protection effects aren't serialized.
if (MagicDamageAbsorb > 0 || MeleeDamageAbsorb > 0)
{
BeginAction(typeof(DefensiveSpell));
}
}