- Added a new Assemblies.cfg file (Assemblies_4_0.cfg) specific for .NET 4.0, which includes System.Core.dll by default.

- Fixed cu sidhe and reptalon trade statuettes.
- Made IAccount comparable, to be able to sort by account in-game.
- Fixed item leak in ChampionSpawn and Harrower.
- Added ChampionSpawn and Harrower leaked item types to Cleanup.
- Added a helper for handling validation after deserialization, and converted classes using that technique to the new system.
- Fixed bulletin board item leak, and the core bug that caused it. Leaked items will be cleaned up on server boot.
- Fixed bulletin board message content packet to compensate for a client bug.
- Monster AI is now deactivated on the internal map, like it is on inactive sectors.
- Monster AI activity is now checked on map changes as well, not just location changes.
- Corrected hiding requirement needed to train stealth from an NPC for Core.ML.
- Fixed a SendLocalizedMessage overload calling itself.
This commit is contained in:
eos 2012-03-21 22:25:44 +00:00
parent 65536e1667
commit 9f0a67e5d7
20 changed files with 191 additions and 101 deletions

View file

@ -33,31 +33,6 @@ namespace Server.Items
writer.WriteEncodedInt( 1 ); // version
}
private static List<ArcaneCircleAddon> m_ToFix;
public static void Configure()
{
m_ToFix = new List<ArcaneCircleAddon>();
}
public static void Initialize()
{
foreach ( ArcaneCircleAddon ac in m_ToFix )
{
foreach ( AddonComponent c in ac.Components )
{
if ( c.ItemID == 0x3083 )
{
c.Offset = new Point3D( -1, -1, 0 );
c.MoveToWorld( new Point3D( ac.X + c.Offset.X, ac.Y + c.Offset.Y, ac.Z + c.Offset.Z ), ac.Map );
}
}
}
m_ToFix.Clear();
m_ToFix = null;
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
@ -65,7 +40,19 @@ namespace Server.Items
int version = reader.ReadEncodedInt();
if ( version == 0 )
m_ToFix.Add( this );
ValidationQueue<ArcaneCircleAddon>.Add( this );
}
public void Validate()
{
foreach ( AddonComponent c in Components )
{
if ( c.ItemID == 0x3083 )
{
c.Offset = new Point3D( -1, -1, 0 );
c.MoveToWorld( new Point3D( X + c.Offset.X, Y + c.Offset.Y, Z + c.Offset.Z ), Map );
}
}
}
}

View file

@ -465,7 +465,7 @@ namespace Server.Items
}
if ( version < 3 )
m_Recount.Add( this );
ValidationQueue<Aquarium>.Add( this );
}
private void RecountLiveCreatures()
@ -480,20 +480,9 @@ namespace Server.Items
}
}
private static List<Aquarium> m_Recount;
public static void Configure()
public void Validate()
{
m_Recount = new List<Aquarium>();
}
public static void Initialize()
{
foreach ( Aquarium aquarium in m_Recount )
aquarium.RecountLiveCreatures();
m_Recount.Clear();
m_Recount = null;
RecountLiveCreatures();
}
#region Members

View file

@ -403,7 +403,7 @@ namespace Server.Items
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) 1 ); // version
writer.Write( (Mobile) m_Poster );
writer.Write( (string) m_Subject );
@ -437,6 +437,7 @@ namespace Server.Items
switch ( version )
{
case 1:
case 0:
{
m_Poster = reader.ReadMobile();
@ -465,10 +466,19 @@ namespace Server.Items
if ( hasThread && m_Thread == null )
Delete();
if ( version == 0 )
ValidationQueue<BulletinMessage>.Add( this );
break;
}
}
}
public void Validate()
{
if ( !( Parent is BulletinBoard && ((BulletinBoard)Parent).Items.Contains( this ) ) )
Delete();
}
}
public class BBDisplayBoard : Packet
@ -593,20 +603,30 @@ namespace Server.Items
m_Stream.Write( (byte) len );
for ( int i = 0; i < len; ++i )
WriteString( msg.Lines[i] );
WriteString( msg.Lines[i], true );
}
public void WriteString( string v )
{
WriteString( v, false );
}
public void WriteString( string v, bool padding )
{
byte[] buffer = Utility.UTF8.GetBytes( v );
int len = buffer.Length + 1;
int tail = padding ? 2 : 1;
int len = buffer.Length + tail;
if ( len > 255 )
len = 255;
m_Stream.Write( (byte) len );
m_Stream.Write( buffer, 0, len-1 );
m_Stream.Write( (byte) 0 );
m_Stream.Write( buffer, 0, len - tail );
if ( padding )
m_Stream.Write( (short) 0 ); // padding compensates for a client bug
else
m_Stream.Write( (byte) 0 );
}
public string SafeString( string v )