7.0.33.1 support

thread-safety
This commit is contained in:
Mark Sturgill 2013-10-17 01:48:04 -07:00
parent 699fa3bdd8
commit ae8ded4a16
7 changed files with 261 additions and 129 deletions

View file

@ -1178,11 +1178,7 @@ namespace Server
info.Free();
if( m_NetState != null && this.CanSee( attacker ) && Utility.InUpdateRange( m_Location, attacker.m_Location ) ) {
if ( m_NetState.StygianAbyss ) {
m_NetState.Send( new MobileIncoming( this, attacker ) );
} else {
m_NetState.Send( new MobileIncomingOld( this, attacker ) );
}
m_NetState.Send(MobileIncoming.Create(m_NetState, this, attacker));
}
}
}
@ -1203,11 +1199,7 @@ namespace Server
info.Free();
if( m_NetState != null && this.CanSee( defender ) && Utility.InUpdateRange( m_Location, defender.m_Location ) ) {
if ( m_NetState.StygianAbyss ) {
m_NetState.Send( new MobileIncoming( this, defender ) );
} else {
m_NetState.Send( new MobileIncomingOld( this, defender ) );
}
m_NetState.Send(MobileIncoming.Create(m_NetState, this, defender));
}
}
}
@ -2409,11 +2401,7 @@ namespace Server
m_Aggressors.Add( AggressorInfo.Create( aggressor, this, criminal ) ); // new AggressorInfo( aggressor, this, criminal, true ) );
if( this.CanSee( aggressor ) && m_NetState != null ) {
if ( m_NetState.StygianAbyss ) {
m_NetState.Send( new MobileIncoming( this, aggressor ) );
} else {
m_NetState.Send( new MobileIncomingOld( this, aggressor ) );
}
m_NetState.Send(MobileIncoming.Create(m_NetState, this, aggressor));
}
if( Combatant == null )
@ -2427,11 +2415,7 @@ namespace Server
aggressor.m_Aggressed.Add( AggressorInfo.Create( aggressor, this, criminal ) ); // new AggressorInfo( aggressor, this, criminal, false ) );
if( this.CanSee( aggressor ) && m_NetState != null ) {
if ( m_NetState.StygianAbyss ) {
m_NetState.Send( new MobileIncoming( this, aggressor ) );
} else {
m_NetState.Send( new MobileIncomingOld( this, aggressor ) );
}
m_NetState.Send(MobileIncoming.Create(m_NetState, this, aggressor));
}
if( Combatant == null )
@ -2463,11 +2447,7 @@ namespace Server
info.Free();
if( m_NetState != null && this.CanSee( aggressed ) ) {
if ( m_NetState.StygianAbyss ) {
m_NetState.Send( new MobileIncoming( this, aggressed ) );
} else {
m_NetState.Send( new MobileIncomingOld( this, aggressed ) );
}
m_NetState.Send(MobileIncoming.Create(m_NetState, this, aggressed));
}
break;
@ -2494,11 +2474,7 @@ namespace Server
info.Free();
if( m_NetState != null && this.CanSee( aggressor ) ) {
if ( m_NetState.StygianAbyss ) {
m_NetState.Send( new MobileIncoming( this, aggressor ) );
} else {
m_NetState.Send( new MobileIncomingOld( this, aggressor ) );
}
m_NetState.Send(MobileIncoming.Create(m_NetState, this, aggressor));
}
break;
@ -6820,16 +6796,14 @@ namespace Server
if( CanSee( m ) && Utility.InUpdateRange( m_Location, m.m_Location ) )
{
if ( ns.StygianAbyss ) {
ns.Send( new MobileIncoming( this, m ) );
ns.Send(MobileIncoming.Create(ns, this, m));
if ( ns.StygianAbyss ) {
if ( m.Poisoned )
ns.Send( new HealthbarPoison( m ) );
if ( m.Blessed || m.YellowHealthbar )
ns.Send( new HealthbarYellow( m ) );
} else {
ns.Send( new MobileIncomingOld( this, m ) );
}
if( m.IsDeadBondedPet )
@ -6910,21 +6884,21 @@ namespace Server
if( ns != null )
{
if( m_Map != null )
Send( new ServerChange( this, m_Map ) );
ns.Send( new ServerChange( this, m_Map ) );
ns.Sequence = 0;
ClearFastwalkStack();
ns.Send(MobileIncoming.Create(ns, this, this));
if ( ns.StygianAbyss ) {
Send( new MobileIncoming( this, this ) );
Send( new MobileUpdate( this ) );
ns.Send( new MobileUpdate( this ) );
CheckLightLevels( true );
Send( new MobileUpdate( this ) );
ns.Send( new MobileUpdate( this ) );
} else {
Send( new MobileIncomingOld( this, this ) );
Send( new MobileUpdateOld( this ) );
ns.Send( new MobileUpdateOld( this ) );
CheckLightLevels( true );
Send( new MobileUpdateOld( this ) );
ns.Send( new MobileUpdateOld( this ) );
}
}
@ -6936,16 +6910,16 @@ namespace Server
ns.Sequence = 0;
ClearFastwalkStack();
ns.Send(MobileIncoming.Create(ns, this, this));
if ( ns.StygianAbyss ) {
Send( new MobileIncoming( this, this ) );
Send( SupportedFeatures.Instantiate( ns ) );
Send( new MobileUpdate( this ) );
Send( new MobileAttributes( this ) );
ns.Send( SupportedFeatures.Instantiate( ns ) );
ns.Send( new MobileUpdate( this ) );
ns.Send( new MobileAttributes( this ) );
} else {
Send( new MobileIncomingOld( this, this ) );
Send( SupportedFeatures.Instantiate( ns ) );
Send( new MobileUpdateOld( this ) );
Send( new MobileAttributes( this ) );
ns.Send( SupportedFeatures.Instantiate( ns ) );
ns.Send( new MobileUpdateOld( this ) );
ns.Send( new MobileAttributes( this ) );
}
}
@ -7993,10 +7967,7 @@ namespace Server
if (!state.Mobile.CanSee(this)) {
state.Send(this.RemovePacket);
} else {
if (state.StygianAbyss)
state.Send(new MobileIncoming(state.Mobile, this));
else
state.Send(new MobileIncomingOld(state.Mobile, this));
state.Send(MobileIncoming.Create(state, state.Mobile, this));
if (IsDeadBondedPet)
state.Send(new BondedStatus(0, m_Serial, 1));
@ -9038,16 +9009,16 @@ namespace Server
ns.Sequence = 0;
ClearFastwalkStack();
ns.Send(MobileIncoming.Create(ns, this, this));
if ( ns.StygianAbyss ) {
Send( new MobileIncoming( this, this ) );
Send( new MobileUpdate( this ) );
ns.Send( new MobileUpdate( this ) );
CheckLightLevels( true );
Send( new MobileUpdate( this ) );
ns.Send( new MobileUpdate( this ) );
} else {
Send( new MobileIncomingOld( this, this ) );
Send( new MobileUpdateOld( this ) );
ns.Send( new MobileUpdateOld( this ) );
CheckLightLevels( true );
Send( new MobileUpdateOld( this ) );
ns.Send( new MobileUpdateOld( this ) );
}
}
@ -9059,16 +9030,16 @@ namespace Server
ns.Sequence = 0;
ClearFastwalkStack();
ns.Send(MobileIncoming.Create(ns, this, this));
if ( ns.StygianAbyss ) {
Send( new MobileIncoming( this, this ) );
Send( SupportedFeatures.Instantiate( ns ) );
Send( new MobileUpdate( this ) );
Send( new MobileAttributes( this ) );
ns.Send( SupportedFeatures.Instantiate( ns ) );
ns.Send( new MobileUpdate( this ) );
ns.Send( new MobileAttributes( this ) );
} else {
Send( new MobileIncomingOld( this, this ) );
Send( SupportedFeatures.Instantiate( ns ) );
Send( new MobileUpdateOld( this ) );
Send( new MobileAttributes( this ) );
ns.Send( SupportedFeatures.Instantiate( ns ) );
ns.Send( new MobileUpdateOld( this ) );
ns.Send( new MobileAttributes( this ) );
}
}
@ -9167,16 +9138,14 @@ namespace Server
if( m.m_NetState != null && ( ( isTeleport && ( !m.m_NetState.HighSeas || !m_NoMoveHS ) ) || !inOldRange ) && m.CanSee( this ) )
{
if ( m.m_NetState.StygianAbyss ) {
m.m_NetState.Send( new MobileIncoming( m, this ) );
m.m_NetState.Send(MobileIncoming.Create(m.m_NetState, m, this));
if ( m.m_NetState.StygianAbyss ) {
if ( m_Poison != null )
m.m_NetState.Send( new HealthbarPoison( this ) );
if ( m_Blessed || m_YellowHealthbar )
m.m_NetState.Send( new HealthbarYellow( this ) );
} else {
m.m_NetState.Send( new MobileIncomingOld( m, this ) );
}
if( IsDeadBondedPet )
@ -9193,16 +9162,14 @@ namespace Server
if( !inOldRange && CanSee( m ) )
{
if ( ourState.StygianAbyss ) {
ourState.Send( new MobileIncoming( this, m ) );
ourState.Send(MobileIncoming.Create(ourState, this, m));
if ( ourState.StygianAbyss ) {
if ( m.Poisoned )
ourState.Send( new HealthbarPoison( m ) );
if ( m.Blessed || m.YellowHealthbar )
ourState.Send( new HealthbarYellow( m ) );
} else {
ourState.Send( new MobileIncomingOld( this, m ) );
}
if( m.IsDeadBondedPet )
@ -9232,16 +9199,14 @@ namespace Server
foreach( NetState ns in eable ) {
if( ( ( isTeleport && ( !ns.HighSeas || !m_NoMoveHS ) ) || !Utility.InUpdateRange( oldLocation, ns.Mobile.Location )) && ns.Mobile.CanSee( this ) )
{
if ( ns.StygianAbyss ) {
ns.Send( new MobileIncoming( ns.Mobile, this ) );
ns.Send(MobileIncoming.Create(ns, ns.Mobile, this));
if ( ns.StygianAbyss ) {
if ( m_Poison != null )
ns.Send( new HealthbarPoison( this ) );
if ( m_Blessed || m_YellowHealthbar )
ns.Send( new HealthbarYellow( this ) );
} else {
ns.Send( new MobileIncomingOld( ns.Mobile, this ) );
}
if( IsDeadBondedPet )
@ -9570,16 +9535,14 @@ namespace Server
foreach( NetState state in eable ) {
if( state.Mobile.CanSee( this ) )
{
if ( state.StygianAbyss ) {
state.Send( new MobileIncoming( state.Mobile, this ) );
state.Send(MobileIncoming.Create(state, state.Mobile, this));
if ( state.StygianAbyss ) {
if ( m_Poison != null )
state.Send( new HealthbarPoison( this ) );
if ( m_Blessed || m_YellowHealthbar )
state.Send( new HealthbarYellow( this ) );
} else {
state.Send( new MobileIncomingOld( state.Mobile, this ) );
}
if( IsDeadBondedPet )
@ -10163,10 +10126,10 @@ namespace Server
ClearFastwalkStack();
}
if ( ourState.StygianAbyss ) {
if( sendIncoming )
ourState.Send( new MobileIncoming( m, m ) );
if (sendIncoming)
ourState.Send(MobileIncoming.Create(ourState, m, m));
if ( ourState.StygianAbyss ) {
if( sendMoving )
{
int noto = Notoriety.Compute( m, m );
@ -10179,9 +10142,6 @@ namespace Server
if ( sendHealthbarYellow )
ourState.Send( new HealthbarYellow( m ) );
} else {
if( sendIncoming )
ourState.Send( new MobileIncomingOld( m, m ) );
if( sendMoving || sendHealthbarPoison || sendHealthbarYellow )
{
int noto = Notoriety.Compute( m, m );
@ -10269,11 +10229,7 @@ namespace Server
if( sendIncoming )
{
if ( state.StygianAbyss ) {
state.Send( new MobileIncoming( beholder, m ) );
} else {
state.Send( new MobileIncomingOld( beholder, m ) );
}
state.Send(MobileIncoming.Create(state, beholder, m));
if( m.IsDeadBondedPet )
{