Exemple #1
0
        public void Start(IScene scene)
        {
            m_scene = scene;

            m_httpServer = m_scene.Simian.GetAppModule<IHttpServer>();
            if (m_httpServer == null)
            {
                m_log.Warn("GetTexture requires an IHttpServer");
                return;
            }

            m_statsTracker = m_scene.Simian.GetAppModule<IStatsTracker>();

            m_scene.Capabilities.AddProtectedResource(m_scene.ID, "ViewerStats", ViewerStatsHandler);
            m_scene.Capabilities.AddProtectedResource(m_scene.ID, "TextureStats", TextureStatsHandler);
        }
Exemple #2
0
        public void Start(IScene scene)
        {
            m_scene = scene;

            m_primMesher = m_scene.GetSceneModule<IPrimMesher>();
            if (m_primMesher == null)
            {
                m_log.Error("Objects requires an IPrimMesher");
                return;
            }

            m_permissions = m_scene.GetSceneModule<LLPermissions>();
            if (m_permissions == null)
            {
                m_log.Error("Objects requires LLPermissions");
                return;
            }

            // Optional modules
            m_physics = m_scene.GetSceneModule<IPhysicsEngine>();
            m_lslScriptEngine = m_scene.GetSceneModule<ILSLScriptEngine>();
            m_inventory = m_scene.GetSceneModule<Inventory>();
            m_dataStore = m_scene.Simian.GetAppModule<IDataStore>();
            m_statsTracker = m_scene.Simian.GetAppModule<IStatsTracker>();

            // Collision handler
            if (m_physics != null && m_lslScriptEngine != null)
            {
                m_physics.OnEntityCollision += EntityCollisionHandler;
            }

            m_udp = m_scene.GetSceneModule<LLUDP>();
            if (m_udp != null)
            {
                m_udp.AddPacketHandler(PacketType.ObjectAdd, ObjectAddHandler);
                m_udp.AddPacketHandler(PacketType.ObjectAttach, ObjectAttachHandler);
                m_udp.AddPacketHandler(PacketType.ObjectDrop, ObjectDropHandler);
                m_udp.AddPacketHandler(PacketType.ObjectDuplicate, ObjectDuplicateHandler);
                m_udp.AddPacketHandler(PacketType.ObjectName, ObjectNameHandler);
                m_udp.AddPacketHandler(PacketType.ObjectSelect, ObjectSelectHandler);
                m_udp.AddPacketHandler(PacketType.ObjectDeselect, ObjectDeselectHandler);
                m_udp.AddPacketHandler(PacketType.ObjectGrab, ObjectGrabHandler);
                m_udp.AddPacketHandler(PacketType.ObjectGrabUpdate, ObjectGrabUpdateHandler);
                m_udp.AddPacketHandler(PacketType.ObjectDeGrab, ObjectDeGrabHandler);
                m_udp.AddPacketHandler(PacketType.ObjectLink, ObjectLinkHandler);
                m_udp.AddPacketHandler(PacketType.ObjectDelink, ObjectDelinkHandler);
                m_udp.AddPacketHandler(PacketType.ObjectShape, ObjectShapeHandler);
                m_udp.AddPacketHandler(PacketType.ObjectFlagUpdate, ObjectFlagUpdateHandler);
                m_udp.AddPacketHandler(PacketType.ObjectExtraParams, ObjectExtraParamsHandler);
                m_udp.AddPacketHandler(PacketType.ObjectImage, ObjectImageHandler);
                m_udp.AddPacketHandler(PacketType.ObjectPermissions, ObjectPermissionsHandler);
                m_udp.AddPacketHandler(PacketType.Undo, UndoHandler);
                m_udp.AddPacketHandler(PacketType.Redo, RedoHandler);
                m_udp.AddPacketHandler(PacketType.MultipleObjectUpdate, MultipleObjectUpdateHandler);
                m_udp.AddPacketHandler(PacketType.RequestObjectPropertiesFamily, RequestObjectPropertiesFamilyHandler);
                m_udp.AddPacketHandler(PacketType.RequestMultipleObjects, RequestMultipleObjectsHandler);

                m_scene.AddInterestListHandler(OBJECT_UPDATE, new InterestListEventHandler { CombineCallback = ObjectUpdateCombiner, SendCallback = SendEntityPackets });
                m_scene.AddInterestListHandler(OBJECT_REMOVE, new InterestListEventHandler { CombineCallback = ObjectUpdateCombiner, SendCallback = SendKillPacket });

                m_scene.OnEntityAddOrUpdate += EntityAddOrUpdateHandler;
                m_scene.OnEntityRemove += EntityRemoveHandler;
                m_scene.OnPresenceAdd += PresenceAddHandler;
                m_scene.OnPresenceRemove += PresenceRemoveHandler;
            }

            m_proxyPrim = new Primitive();
            m_proxyPrim.PrimData = ObjectManager.BuildBasicShape(PrimType.Box);

            DeserializeRecentAvatars();
        }