RunUO and Mondain's Legacy workaround.
Posted: 2006-05-10 12:12:31
Hi.
Since RunUO sends diffrent damage packets to clients above or equal to "4.0.7a" than old ones (which are causing Injection powered clients to hang), it is easy to avoid it by setting your client version to older one. Problem when your shard demands new client, but it's kind of workaround for most people.
From RunUO code:
and
Since RunUO sends diffrent damage packets to clients above or equal to "4.0.7a" than old ones (which are causing Injection powered clients to hang), it is easy to avoid it by setting your client version to older one. Problem when your shard demands new client, but it's kind of workaround for most people.
From RunUO code:
Code: Select all
public sealed class DamagePacketOld : Packet
{
public DamagePacketOld( Mobile m, int amount ) : base( 0xBF )
{
EnsureCapacity( 11 );
m_Stream.Write( (short) 0x22 );
m_Stream.Write( (byte) 1 );
m_Stream.Write( (int) m.Serial );
if ( amount > 255 )
amount = 255;
else if ( amount < 0 )
amount = 0;
m_Stream.Write( (byte)amount );
}
}
public sealed class DamagePacket : Packet
{
public static readonly ClientVersion Version = new ClientVersion( "4.0.7a" );
public DamagePacket( Mobile m, int amount ) : base( 0x0B, 7 )
{
m_Stream.Write( (int) m.Serial );
if ( amount > 0xFFFF )
amount = 0xFFFF;
else if ( amount < 0 )
amount = 0;
m_Stream.Write( (ushort) amount );
}
/*public DamagePacket( Mobile m, int amount ) : base( 0xBF )
{
EnsureCapacity( 11 );
m_Stream.Write( (short) 0x22 );
m_Stream.Write( (byte) 1 );
m_Stream.Write( (int) m.Serial );
if ( amount > 255 )
amount = 255;
else if ( amount < 0 )
amount = 0;
m_Stream.Write( (byte)amount );
}*/
}
and
Code: Select all
if ( amount > 0 && (ourState != null || theirState != null) )
{
Packet p = null;// = new DamagePacket( this, amount );
if ( ourState != null )
{
bool newPacket = ( ourState.Version != null && ourState.Version >= DamagePacket.Version );
if ( newPacket )
p = new DamagePacket( this, amount );
else
p = new DamagePacketOld( this, amount );
ourState.Send( p );
}
if ( theirState != null && theirState != ourState )
{
bool newPacket = ( theirState.Version != null && theirState.x >= DamagePacket.Version );
if ( newPacket && ( p == null || !(p is DamagePacket) ) )
p = new DamagePacket( this, amount );
else if ( !newPacket && ( p == null || !(p is DamagePacketOld) ) )
p = new DamagePacketOld( this, amount );
theirState.Send( p );
}