7.0.33.1 support
thread-safety
This commit is contained in:
parent
699fa3bdd8
commit
ae8ded4a16
7 changed files with 261 additions and 129 deletions
|
|
@ -120,10 +120,7 @@ namespace Server.Commands
|
|||
if ( ns != null ) {
|
||||
if ( targ.CanSee( from ) )
|
||||
{
|
||||
if ( ns.StygianAbyss )
|
||||
ns.Send( new MobileIncoming( targ, from ) );
|
||||
else
|
||||
ns.Send( new MobileIncomingOld( targ, from ) );
|
||||
ns.Send(MobileIncoming.Create(ns, targ, from));
|
||||
|
||||
if ( ObjectPropertyList.Enabled )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2492,7 +2492,7 @@ namespace Server.Mobiles
|
|||
double val = double.MinValue;
|
||||
double theirVal;
|
||||
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(m_Mobile.Location, iRange);
|
||||
IPooledEnumerable<Mobile> eable = map.GetMobilesInRange(m_Mobile.Location, iRange);
|
||||
|
||||
#if !Framework_4_0
|
||||
foreach (Mobile m in eable)
|
||||
|
|
|
|||
144
Server/Mobile.cs
144
Server/Mobile.cs
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -167,7 +167,9 @@ namespace Server.Network {
|
|||
set {
|
||||
m_Version = value;
|
||||
|
||||
if ( value >= m_Version70300 ) {
|
||||
if ( value >= m_Version70331 ) {
|
||||
_ProtocolChanges = ProtocolChanges.Version70331;
|
||||
} else if ( value >= m_Version70300 ) {
|
||||
_ProtocolChanges = ProtocolChanges.Version70300;
|
||||
} else if ( value >= m_Version70160 ) {
|
||||
_ProtocolChanges = ProtocolChanges.Version70160;
|
||||
|
|
@ -207,35 +209,38 @@ namespace Server.Network {
|
|||
private static ClientVersion m_Version70130 = new ClientVersion( "7.0.13.0" );
|
||||
private static ClientVersion m_Version70160 = new ClientVersion( "7.0.16.0" );
|
||||
private static ClientVersion m_Version70300 = new ClientVersion( "7.0.30.0" );
|
||||
private static ClientVersion m_Version70331 = new ClientVersion( "7.0.33.1" );
|
||||
|
||||
private ProtocolChanges _ProtocolChanges;
|
||||
|
||||
private enum ProtocolChanges {
|
||||
NewSpellbook = 0x00000001,
|
||||
DamagePacket = 0x00000002,
|
||||
Unpack = 0x00000004,
|
||||
BuffIcon = 0x00000008,
|
||||
NewHaven = 0x00000010,
|
||||
ContainerGridLines = 0x00000020,
|
||||
NewSpellbook = 0x00000001,
|
||||
DamagePacket = 0x00000002,
|
||||
Unpack = 0x00000004,
|
||||
BuffIcon = 0x00000008,
|
||||
NewHaven = 0x00000010,
|
||||
ContainerGridLines = 0x00000020,
|
||||
ExtendedSupportedFeatures = 0x00000040,
|
||||
StygianAbyss = 0x00000080,
|
||||
HighSeas = 0x00000100,
|
||||
NewCharacterList = 0x00000200,
|
||||
StygianAbyss = 0x00000080,
|
||||
HighSeas = 0x00000100,
|
||||
NewCharacterList = 0x00000200,
|
||||
NewCharacterCreation = 0x00000400,
|
||||
ExtendedStatus = 0x00000800,
|
||||
NewMobileIncoming = 0x00001000,
|
||||
|
||||
Version400a = NewSpellbook,
|
||||
Version407a = Version400a | DamagePacket,
|
||||
Version500a = Version407a | Unpack,
|
||||
Version502b = Version500a | BuffIcon,
|
||||
Version6000 = Version502b | NewHaven,
|
||||
Version6017 = Version6000 | ContainerGridLines,
|
||||
Version60142 = Version6017 | ExtendedSupportedFeatures,
|
||||
Version7000 = Version60142 | StygianAbyss,
|
||||
Version7090 = Version7000 | HighSeas,
|
||||
Version70130 = Version7090 | NewCharacterList,
|
||||
Version70160 = Version70130 | NewCharacterCreation,
|
||||
Version70300 = Version70160 | ExtendedStatus
|
||||
Version400a = NewSpellbook,
|
||||
Version407a = Version400a | DamagePacket,
|
||||
Version500a = Version407a | Unpack,
|
||||
Version502b = Version500a | BuffIcon,
|
||||
Version6000 = Version502b | NewHaven,
|
||||
Version6017 = Version6000 | ContainerGridLines,
|
||||
Version60142 = Version6017 | ExtendedSupportedFeatures,
|
||||
Version7000 = Version60142 | StygianAbyss,
|
||||
Version7090 = Version7000 | HighSeas,
|
||||
Version70130 = Version7090 | NewCharacterList,
|
||||
Version70160 = Version70130 | NewCharacterCreation,
|
||||
Version70300 = Version70160 | ExtendedStatus,
|
||||
Version70331 = Version70300 | NewMobileIncoming
|
||||
}
|
||||
|
||||
public bool NewSpellbook { get { return ((_ProtocolChanges & ProtocolChanges.NewSpellbook) != 0); } }
|
||||
|
|
@ -250,6 +255,7 @@ namespace Server.Network {
|
|||
public bool NewCharacterList { get { return ((_ProtocolChanges & ProtocolChanges.NewCharacterList) != 0); } }
|
||||
public bool NewCharacterCreation { get { return ((_ProtocolChanges & ProtocolChanges.NewCharacterCreation) != 0); } }
|
||||
public bool ExtendedStatus { get { return ((_ProtocolChanges & ProtocolChanges.ExtendedStatus) != 0); } }
|
||||
public bool NewMobileIncoming { get { return ((_ProtocolChanges & ProtocolChanges.NewMobileIncoming) != 0); } }
|
||||
|
||||
public bool IsUOTDClient {
|
||||
get {
|
||||
|
|
|
|||
|
|
@ -1299,12 +1299,12 @@ namespace Server.Network
|
|||
|
||||
if ( state.StygianAbyss ) {
|
||||
state.Send( new MobileUpdate( m ) );
|
||||
state.Send( new MobileIncoming( m, m ) );
|
||||
} else {
|
||||
state.Send( new MobileUpdateOld( m ) );
|
||||
state.Send( new MobileIncomingOld( m, m ) );
|
||||
}
|
||||
|
||||
state.Send(MobileIncoming.Create(state, m, m));
|
||||
|
||||
m.SendEverything();
|
||||
|
||||
state.Sequence = 0;
|
||||
|
|
@ -2110,7 +2110,28 @@ namespace Server.Network
|
|||
|
||||
state.Sequence = 0;
|
||||
|
||||
if ( state.StygianAbyss ) {
|
||||
if (state.NewMobileIncoming) {
|
||||
state.Send(new MobileUpdate(m));
|
||||
state.Send(new MobileUpdate(m));
|
||||
|
||||
m.CheckLightLevels(true);
|
||||
|
||||
state.Send(new MobileUpdate(m));
|
||||
|
||||
state.Send(new MobileIncoming(m, m));
|
||||
//state.Send( new MobileAttributes( m ) );
|
||||
state.Send(new MobileStatus(m, m));
|
||||
state.Send(Server.Network.SetWarMode.Instantiate(m.Warmode));
|
||||
|
||||
m.SendEverything();
|
||||
|
||||
state.Send(SupportedFeatures.Instantiate(state));
|
||||
state.Send(new MobileUpdate(m));
|
||||
//state.Send( new MobileAttributes( m ) );
|
||||
state.Send(new MobileStatus(m, m));
|
||||
state.Send(Server.Network.SetWarMode.Instantiate(m.Warmode));
|
||||
state.Send(new MobileIncoming(m, m));
|
||||
} else if ( state.StygianAbyss ) {
|
||||
state.Send( new MobileUpdate( m ) );
|
||||
state.Send( new MobileUpdate( m ) );
|
||||
|
||||
|
|
@ -2118,7 +2139,7 @@ namespace Server.Network
|
|||
|
||||
state.Send( new MobileUpdate( m ) );
|
||||
|
||||
state.Send( new MobileIncoming( m, m ) );
|
||||
state.Send( new MobileIncomingSA( m, m ) );
|
||||
//state.Send( new MobileAttributes( m ) );
|
||||
state.Send( new MobileStatus( m, m ) );
|
||||
state.Send( Server.Network.SetWarMode.Instantiate( m.Warmode ) );
|
||||
|
|
@ -2130,7 +2151,7 @@ namespace Server.Network
|
|||
//state.Send( new MobileAttributes( m ) );
|
||||
state.Send( new MobileStatus( m, m ) );
|
||||
state.Send( Server.Network.SetWarMode.Instantiate( m.Warmode ) );
|
||||
state.Send( new MobileIncoming( m, m ) );
|
||||
state.Send( new MobileIncomingSA( m, m ) );
|
||||
} else {
|
||||
state.Send( new MobileUpdateOld( m ) );
|
||||
state.Send( new MobileUpdateOld( m ) );
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
#if Framework_4_0
|
||||
using System.Threading;
|
||||
#endif
|
||||
using Server.Accounting;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
|
|
@ -3344,15 +3347,153 @@ namespace Server.Network
|
|||
|
||||
public sealed class MobileIncoming : Packet
|
||||
{
|
||||
public static Packet Create(NetState ns, Mobile beholder, Mobile beheld)
|
||||
{
|
||||
if (ns.NewMobileIncoming)
|
||||
return new MobileIncoming(beholder, beheld);
|
||||
else if (ns.StygianAbyss)
|
||||
return new MobileIncomingSA(beholder, beheld);
|
||||
else
|
||||
return new MobileIncomingOld(beholder, beheld);
|
||||
}
|
||||
|
||||
#if Framework_4_0
|
||||
private static ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => {return new int[256];});
|
||||
private static ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
|
||||
#else
|
||||
private static int[] m_DupedLayers = new int[256];
|
||||
private static int m_Version;
|
||||
#endif
|
||||
|
||||
public Mobile m_Beheld;
|
||||
|
||||
public MobileIncoming( Mobile beholder, Mobile beheld ) : base( 0x78 )
|
||||
public MobileIncoming(Mobile beholder, Mobile beheld) : base(0x78)
|
||||
{
|
||||
m_Beheld = beheld;
|
||||
|
||||
#if Framework_4_0
|
||||
int m_Version = ++(m_VersionTL.Value);
|
||||
int[] m_DupedLayers = m_DupedLayersTL.Value;
|
||||
#else
|
||||
++m_Version;
|
||||
#endif
|
||||
|
||||
List<Item> eq = beheld.Items;
|
||||
int count = eq.Count;
|
||||
|
||||
if (beheld.HairItemID > 0)
|
||||
count++;
|
||||
if (beheld.FacialHairItemID > 0)
|
||||
count++;
|
||||
|
||||
this.EnsureCapacity(23 + (count * 9));
|
||||
|
||||
int hue = beheld.Hue;
|
||||
|
||||
if (beheld.SolidHueOverride >= 0)
|
||||
hue = beheld.SolidHueOverride;
|
||||
|
||||
m_Stream.Write((int)beheld.Serial);
|
||||
m_Stream.Write((short)beheld.Body);
|
||||
m_Stream.Write((short)beheld.X);
|
||||
m_Stream.Write((short)beheld.Y);
|
||||
m_Stream.Write((sbyte)beheld.Z);
|
||||
m_Stream.Write((byte)beheld.Direction);
|
||||
m_Stream.Write((short)hue);
|
||||
m_Stream.Write((byte)beheld.GetPacketFlags());
|
||||
m_Stream.Write((byte)Notoriety.Compute(beholder, beheld));
|
||||
|
||||
for (int i = 0; i < eq.Count; ++i)
|
||||
{
|
||||
Item item = eq[i];
|
||||
|
||||
byte layer = (byte)item.Layer;
|
||||
|
||||
if (!item.Deleted && beholder.CanSee(item) && m_DupedLayers[layer] != m_Version)
|
||||
{
|
||||
m_DupedLayers[layer] = m_Version;
|
||||
|
||||
hue = item.Hue;
|
||||
|
||||
if (beheld.SolidHueOverride >= 0)
|
||||
hue = beheld.SolidHueOverride;
|
||||
|
||||
int itemID = item.ItemID & 0xFFFF;
|
||||
|
||||
m_Stream.Write((int)item.Serial);
|
||||
m_Stream.Write((ushort)itemID);
|
||||
m_Stream.Write((byte)layer);
|
||||
|
||||
m_Stream.Write((short)hue);
|
||||
}
|
||||
}
|
||||
|
||||
if (beheld.HairItemID > 0)
|
||||
{
|
||||
if (m_DupedLayers[(int)Layer.Hair] != m_Version)
|
||||
{
|
||||
m_DupedLayers[(int)Layer.Hair] = m_Version;
|
||||
hue = beheld.HairHue;
|
||||
|
||||
if (beheld.SolidHueOverride >= 0)
|
||||
hue = beheld.SolidHueOverride;
|
||||
|
||||
int itemID = beheld.HairItemID & 0xFFFF;
|
||||
|
||||
m_Stream.Write((int)HairInfo.FakeSerial(beheld));
|
||||
m_Stream.Write((ushort)itemID);
|
||||
m_Stream.Write((byte)Layer.Hair);
|
||||
|
||||
m_Stream.Write((short)hue);
|
||||
}
|
||||
}
|
||||
|
||||
if (beheld.FacialHairItemID > 0)
|
||||
{
|
||||
if (m_DupedLayers[(int)Layer.FacialHair] != m_Version)
|
||||
{
|
||||
m_DupedLayers[(int)Layer.FacialHair] = m_Version;
|
||||
hue = beheld.FacialHairHue;
|
||||
|
||||
if (beheld.SolidHueOverride >= 0)
|
||||
hue = beheld.SolidHueOverride;
|
||||
|
||||
int itemID = beheld.FacialHairItemID & 0xFFFF;
|
||||
|
||||
m_Stream.Write((int)FacialHairInfo.FakeSerial(beheld));
|
||||
m_Stream.Write((ushort)itemID);
|
||||
m_Stream.Write((byte)Layer.FacialHair);
|
||||
|
||||
m_Stream.Write((short)hue);
|
||||
}
|
||||
}
|
||||
|
||||
m_Stream.Write((int)0); // terminate
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MobileIncomingSA : Packet
|
||||
{
|
||||
#if Framework_4_0
|
||||
private static ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => {return new int[256];});
|
||||
private static ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
|
||||
#else
|
||||
private static int[] m_DupedLayers = new int[256];
|
||||
private static int m_Version;
|
||||
#endif
|
||||
|
||||
public Mobile m_Beheld;
|
||||
|
||||
public MobileIncomingSA(Mobile beholder, Mobile beheld) : base(0x78)
|
||||
{
|
||||
m_Beheld = beheld;
|
||||
|
||||
#if Framework_4_0
|
||||
int m_Version = ++(m_VersionTL.Value);
|
||||
int[] m_DupedLayers = m_DupedLayersTL.Value;
|
||||
#else
|
||||
++m_Version;
|
||||
#endif
|
||||
|
||||
List<Item> eq = beheld.Items;
|
||||
int count = eq.Count;
|
||||
|
|
@ -3468,15 +3609,26 @@ namespace Server.Network
|
|||
// Pre-7.0.0.0 Mobile Incoming
|
||||
public sealed class MobileIncomingOld : Packet
|
||||
{
|
||||
#if Framework_4_0
|
||||
private static ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => {return new int[256];});
|
||||
private static ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
|
||||
#else
|
||||
private static int[] m_DupedLayers = new int[256];
|
||||
private static int m_Version;
|
||||
#endif
|
||||
|
||||
public Mobile m_Beheld;
|
||||
|
||||
public MobileIncomingOld( Mobile beholder, Mobile beheld ) : base( 0x78 )
|
||||
{
|
||||
m_Beheld = beheld;
|
||||
|
||||
#if Framework_4_0
|
||||
int m_Version = ++(m_VersionTL.Value);
|
||||
int[] m_DupedLayers = m_DupedLayersTL.Value;
|
||||
#else
|
||||
++m_Version;
|
||||
#endif
|
||||
|
||||
List<Item> eq = beheld.Items;
|
||||
int count = eq.Count;
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ namespace Server
|
|||
Wall = 0x00000010,
|
||||
Damaging = 0x00000020,
|
||||
Impassable = 0x00000040,
|
||||
Wet = 0x00000080,
|
||||
Wet = 0x00000080,
|
||||
Unknown1 = 0x00000100,
|
||||
Surface = 0x00000200,
|
||||
Bridge = 0x00000400,
|
||||
|
|
@ -183,7 +183,7 @@ namespace Server
|
|||
Foliage = 0x00020000,
|
||||
PartialHue = 0x00040000,
|
||||
Unknown2 = 0x00080000,
|
||||
Map = 0x00100000,
|
||||
Map = 0x00100000,
|
||||
Container = 0x00200000,
|
||||
Wearable = 0x00400000,
|
||||
LightSource = 0x00800000,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue