Beispiel #1
0
        public ScenePresence(
            IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
        {            
            m_scene = world;
            AttachmentsSyncLock = new Object();
            AllowMovement = true;
            IsChildAgent = true;
            IsLoggingIn = false;
            m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
            Animator = new ScenePresenceAnimator(this);
            Overrides = new MovementAnimationOverrides();
            PresenceType = type;
            DrawDistance = world.DefaultDrawDistance;
            RegionHandle = world.RegionInfo.RegionHandle;
            ControllingClient = client;
            Firstname = ControllingClient.FirstName;
            Lastname = ControllingClient.LastName;
            m_name = String.Format("{0} {1}", Firstname, Lastname);
            m_uuid = client.AgentId;
            LocalId = m_scene.AllocateLocalId();
            LegacySitOffsets = m_scene.LegacySitOffsets;

            UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
            if (account != null)
                m_userFlags = account.UserFlags;
            else
                m_userFlags = 0;

            if (account != null)
                UserLevel = account.UserLevel;

            IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
            if (gm != null)
               Grouptitle = gm.GetGroupTitle(m_uuid);

            m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
            
            AbsolutePosition = posLastSignificantMove = CameraPosition =
                m_lastCameraPosition = ControllingClient.StartPos;

            m_reprioritization_timer = new Timer(world.ReprioritizationInterval);
            m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize);
            m_reprioritization_timer.AutoReset = false;

            AdjustKnownSeeds();

            RegisterToEvents();
            SetDirectionVectors();

            Appearance = appearance;

            m_stateMachine = new ScenePresenceStateMachine(this);
        }
 public ScenePresence()
 {
     IsTainted = false;
     SitGround = false;
     CurrentParcel = null;
     m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
 }
Beispiel #3
0
 public void SetSendCoarseLocationMethod(SendCoarseLocationsMethod d)
 {
     if (d != null)
         m_sendCoarseLocationsMethod = d;
 }
        public ScenePresence(
            IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
        {
            m_scene = world;
            AttachmentsSyncLock = new Object();
            AllowMovement = true;
            IsChildAgent = true;
            IsLoggingIn = false;
            m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
            Animator = new ScenePresenceAnimator(this);
            Overrides = new MovementAnimationOverrides();
            PresenceType = type;
            DrawDistance = world.DefaultDrawDistance;
            RegionHandle = world.RegionInfo.RegionHandle;
            ControllingClient = client;
            Firstname = ControllingClient.FirstName;
            Lastname = ControllingClient.LastName;
            m_name = String.Format("{0} {1}", Firstname, Lastname);
            m_uuid = client.AgentId;
            LocalId = m_scene.AllocateLocalId();
            LegacySitOffsets = m_scene.LegacySitOffsets;

            UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
            if (account != null)
                m_userFlags = account.UserFlags;
            else
                m_userFlags = 0;

            if (account != null)
                UserLevel = account.UserLevel;

            //           IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
            //           if (gm != null)
            //              Grouptitle = gm.GetGroupTitle(m_uuid);

            m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();

            AbsolutePosition = posLastMove = posLastSignificantMove = CameraPosition =
               m_reprioritizationLastPosition = ControllingClient.StartPos;

            m_reprioritizationLastDrawDistance = DrawDistance;

            // disable updates workjobs for now
            childUpdatesBusy = true;
            m_reprioritizationBusy = true;

            AdjustKnownSeeds();

            RegisterToEvents();
            SetDirectionVectors();

            Appearance = appearance;

            m_stateMachine = new ScenePresenceStateMachine(this);

            HealRate = 0.5f;

            IConfig sconfig = m_scene.Config.Configs["EntityTransfer"];
            if (sconfig != null)
            {
                string lpb = sconfig.GetString("LandingPointBehavior", "LandingPointBehavior_OS");
                if (lpb == "LandingPointBehavior_SL")
                    m_LandingPointBehavior = LandingPointBehavior.SL;
            }

        }