Здравствуйте, гость ( Вход | Регистрация )

 
Ответить в эту темуОткрыть новую тему
> Mobile.MoveToWorld(), пакеты
Wap
сообщение 14.12.2015, 3:51
Сообщение #1


**********

Администратор Форума
Сообщений: 3.003
Регистрация: 22.12.2006
Группа: Администраторы
Наличность: 31646
Пользователь №: 9.227



Прилагаю кусок кода из упомянутого в названии темы метода в стандартном 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 ) );
                }
            }


--------------------
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения

Ответить в эту темуОткрыть новую тему
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0

 

- Текстовая версия | Версия для КПК Сейчас: 28.3.2024, 11:22
Designed by Nickostyle