Прилагаю кусок кода из упомянутого в названии темы метода в стандартном RunUO. По-моему, пакетов тут существенно больше, чем нужно.
Может быть, кто-то уже приводил этот алгоритм в порядок и может поделиться результатами?
Код
if( m_Map != null )
{
m_Map.OnEnter( this );
UpdateRegion();
if( ns != null && m_Map != null )
{
ns.Sequence = 0;
ns.Send( new MapChange( this ) );
ns.Send( new MapPatches() );
ns.Send( SeasonChange.Instantiate( GetSeason(), true ) );
if ( ns.StygianAbyss )
ns.Send( new MobileUpdate( this ) );
else
ns.Send( new MobileUpdateOld( this ) );
ClearFastwalkStack();
}
}
else
{
UpdateRegion();
}
if( ns != null )
{
if( m_Map != null )
Send( new ServerChange( this, m_Map ) );
ns.Sequence = 0;
ClearFastwalkStack();
if ( ns.StygianAbyss ) {
Send( new MobileIncoming( this, this ) );
Send( new MobileUpdate( this ) );
CheckLightLevels( true );
Send( new MobileUpdate( this ) );
} else {
Send( new MobileIncomingOld( this, this ) );
Send( new MobileUpdateOld( this ) );
CheckLightLevels( true );
Send( new MobileUpdateOld( this ) );
}
}
SendEverything();
SendIncomingPacket();
if( ns != null )
{
ns.Sequence = 0;
ClearFastwalkStack();
if ( ns.StygianAbyss ) {
Send( new MobileIncoming( this, this ) );
Send( SupportedFeatures.Instantiate( ns ) );
Send( new MobileUpdate( this ) );
Send( new MobileAttributes( this ) );
} else {
Send( new MobileIncomingOld( this, this ) );
Send( SupportedFeatures.Instantiate( ns ) );
Send( new MobileUpdateOld( this ) );
Send( new MobileAttributes( this ) );
}
}