/// <summary>
        /// 
        /// </summary>
        /// <param name="baseMobile"></param>
        public void OnLeave( BaseCharacter character )
        {
            if ( m_MapSpaceNodeState != null )
                m_MapSpaceNodeState.OnLeavingMapSpaceNode( character, this );

            m_Players.Remove( character );

            if ( this.PlayersCount == 0 && m_SpaceNodeState != SpaceNodeState.Deactivate)
            {
                // 如果游戏玩家的列表是空的话,则无效区域点,说明此区域点玩家不存在
                m_LockSpaceNodeState.Enter();
                {
                    if ( this.PlayersCount == 0 && m_SpaceNodeState != SpaceNodeState.Deactivate )
                    {
                        m_SpaceNodeState = SpaceNodeState.Deactivate;
                        this.OnDeactivate();
                    }
                }
                m_LockSpaceNodeState.Exit();
            }

            if ( m_MapSpaceNodeState != null )
                m_MapSpaceNodeState.OnLeavedMapSpaceNode( character, this );
        }
 /// <summary>
 /// 初始化构造
 /// </summary>
 /// <param AccessLevel="baseCharacter"></param>
 public UpdatingAccessLevelEventArgs( AccessLevel newAccessLevel, BaseCharacter character ) :
     base( character )
 {
     m_NewAccessLevel = newAccessLevel;
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="baseMobile"></param>
        public void OnEnter( BaseCharacter character )
        {
            if ( m_MapSpaceNodeState != null )
                m_MapSpaceNodeState.OnEnteringMapSpaceNode( character, this );

            m_Players.Add( character, character );

            if ( m_SpaceNodeState != SpaceNodeState.Activate )
            {
                // 如果游戏玩家的列表是空的话,则激活区域点,说明此区域点有玩家存在
                m_LockSpaceNodeState.Enter();
                {
                    if ( this.PlayersCount > 0 && m_SpaceNodeState != SpaceNodeState.Activate )
                    {
                        m_SpaceNodeState = SpaceNodeState.Activate;
                        this.OnActivate();
                    }
                }
                m_LockSpaceNodeState.Exit();
            }

            if ( m_MapSpaceNodeState != null )
                m_MapSpaceNodeState.OnEnteredMapSpaceNode( character, this );
        }
 /// <summary>
 /// 初始化构造
 /// </summary>
 /// <param AccessLevel="baseCharacter"></param>
 public UpdatedNetStateEventArgs( NetState oldNetState, BaseCharacter character ) :
     base( character )
 {
     m_OldNetState = oldNetState;
 }
 /// <summary>
 /// 初始化构造
 /// </summary>
 /// <param AccessLevel="baseCharacter"></param>
 public BaseCharacterEventArgs( BaseCharacter character )
 {
     m_Character = character;
 }
 /// <summary>
 /// 
 /// </summary>
 internal void OnUpdatedAccessLevel( AccessLevel accessLevel, BaseCharacter creature )
 {
     EventHandler<UpdatedAccessLevelEventArgs> tempAfterEventArgs = m_EventUpdatedAccessLevel;
     if ( tempAfterEventArgs != null )
     {
         UpdatedAccessLevelEventArgs eventArgs = new UpdatedAccessLevelEventArgs( accessLevel, creature );
         tempAfterEventArgs( this, eventArgs );
     }
 }
 /// <summary>
 /// 初始化构造
 /// </summary>
 /// <param AccessLevel="baseCharacter"></param>
 public UpdatingNetStateEventArgs( NetState newNetState, BaseCharacter character ) :
     base( character )
 {
     m_NewNetState = newNetState;
 }
 /// <summary>
 /// 
 /// </summary>
 internal void OnMoved( Point3D oldLocation, BaseCharacter character, BaseMap map )
 {
     EventHandler<CharacterMovedInMapEventArgs> tempAfterEventArgs = m_EventCharacterMovedInMap;
     if ( tempAfterEventArgs != null )
     {
         CharacterMovedInMapEventArgs eventArgs = new CharacterMovedInMapEventArgs( oldLocation, character, map );
         tempAfterEventArgs( this, eventArgs );
     }
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="baseCharacter"></param>
 public BaseGuildMember( BaseCharacter baseCharacter )
 {
     m_Owner = baseCharacter;
 }
 /// <summary>
 /// 
 /// </summary>
 internal void OnLeavedMap( BaseCharacter character, BaseMap map )
 {
     EventHandler<CharacterLeavedMapEventArgs> tempAfterEventArgs = m_EventCharacterLeavedMap;
     if ( tempAfterEventArgs != null )
     {
         CharacterLeavedMapEventArgs eventArgs = new CharacterLeavedMapEventArgs( character, map );
         tempAfterEventArgs( this, eventArgs );
     }
 }
        /// <summary>
        /// 
        /// </summary>
        internal bool OnMoving( Point3D oldLocation, BaseCharacter character, BaseMap map )
        {
            EventHandler<CharacterMovingInMapEventArgs> tempBeforeEventArgs = m_EventCharacterMovingInMap;
            if ( tempBeforeEventArgs != null )
            {
                CharacterMovingInMapEventArgs eventArgs = new CharacterMovingInMapEventArgs( oldLocation, character, map );
                tempBeforeEventArgs( this, eventArgs );

                return eventArgs.IsCancel;
            }

            return false;
        }
        /// <summary>
        /// 
        /// </summary>
        internal bool OnLeavingMap( BaseCharacter character, BaseMap map )
        {
            EventHandler<CharacterLeavingMapEventArgs> tempBeforeEventArgs = m_EventCharacterLeavingMap;
            if ( tempBeforeEventArgs != null )
            {
                CharacterLeavingMapEventArgs eventArgs = new CharacterLeavingMapEventArgs( character, map );
                tempBeforeEventArgs( this, eventArgs );

                return eventArgs.IsCancel;
            }

            return false;
        }
 /// <summary>
 /// 
 /// </summary>
 internal void OnUpdatedNetState( NetState netState, BaseCharacter creature )
 {
     EventHandler<UpdatedNetStateEventArgs> tempAfterEventArgs = m_EventUpdatedNetState;
     if ( tempAfterEventArgs != null )
     {
         UpdatedNetStateEventArgs eventArgs = new UpdatedNetStateEventArgs( netState, creature );
         tempAfterEventArgs( this, eventArgs );
     }
 }
        /// <summary>
        /// 
        /// </summary>
        internal bool OnUpdatingNetState( NetState netState, BaseCharacter creature )
        {
            EventHandler<UpdatingNetStateEventArgs> tempBeforeEventArgs = m_EventUpdatingNetState;
            if ( tempBeforeEventArgs != null )
            {
                UpdatingNetStateEventArgs eventArgs = new UpdatingNetStateEventArgs( netState, creature );
                tempBeforeEventArgs( this, eventArgs );

                return eventArgs.IsCancel;
            }

            return false;
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="character"></param>
 public void SendDestroyToPlayer( BaseCharacter character )
 {
     character.NetState.Send( this.GetDestroyPacket() );
 }
Beispiel #16
0
 /// <summary>
 /// 初始化构造
 /// </summary>
 /// <param AccessLevel="baseCharacter"></param>
 public UpdatedAccessLevelEventArgs( AccessLevel oldAccessLevel, BaseCharacter character ) :
     base( character )
 {
     m_OldAccessLevel = oldAccessLevel;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="character"></param>
 public void SendDestroyToPlayer( BaseCharacter character )
 {
 }
        /// <summary>
        /// 
        /// </summary>
        internal bool OnUpdatingAccessLevel( AccessLevel accessLevel, BaseCharacter creature )
        {
            EventHandler<UpdatingAccessLevelEventArgs> tempBeforeEventArgs = m_EventUpdatingAccessLevel;
            if ( tempBeforeEventArgs != null )
            {
                UpdatingAccessLevelEventArgs eventArgs = new UpdatingAccessLevelEventArgs( accessLevel, creature );
                tempBeforeEventArgs( this, eventArgs );

                return eventArgs.IsCancel;
            }

            return false;
        }