Exemplo n.º 1
0
 public void Initialize(OpenSim.Framework.IOpenSimBase openSim)
 {
     m_log.Info("[AURORADATA]: Setting up the data service");
     OpenSimBase = openSim;
     Aurora.Services.DataService.LocalDataService service = new Aurora.Services.DataService.LocalDataService();
     service.Initialise(openSim.ConfigSource);
 }
Exemplo n.º 2
0
        //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        public RegionStatsHandler(OpenSim.Framework.RegionInfo region_info)
        {
            regionInfo = region_info;
            osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret);
            osXStatsURI = Util.SHA1Hash(regionInfo.osSecret);
  
        }
Exemplo n.º 3
0
        public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
        {
            m_log.Error("[SCENEIMPORT]: Add Region: ");
            m_scenes.Add(scene);
            m_scene = scene;

             //           scene.EventManager.OnClientConnect += new EventManager.OnClientConnectCoreDelegate(HandleOnClientConnect);
        }
Exemplo n.º 4
0
        void client_OnChatFromClient(object sender, OpenSim.Framework.OSChatMessage e)
        {
            if (e.Message != "")
            {
                switch (e.Message.Split(' ')[0])
                {
                    case "fog":
                        if (e.Sender is RexClientViewBase)
                        {
                            ((RexClientViewBase)e.Sender).SendRexFog(0, 50, 50, 50, 50);
                        }
                        break;
                    case "water":
                        if (e.Sender is RexClientViewBase)
                        {
                            if (e.Message.Split(' ').Length > 1)
                            {
                                ((RexClientViewBase)e.Sender).SendRexWaterHeight(Convert.ToSingle(e.Message.Split(' ')[1]));
                            }
                            else
                            {
                                ((RexClientViewBase)e.Sender).SendRexWaterHeight(50);
                            }
                        }
                        break;
                    case "postp":
                        if (e.Sender is RexClientViewBase)
                        {
                            if (e.Message.Split(' ').Length > 2)
                            {
                                bool toggle = Convert.ToBoolean(e.Message.Split(' ')[2]);
                                int id = Convert.ToInt32(e.Message.Split(' ')[1]);
                                ((RexClientViewBase)e.Sender).SendRexPostProcess(id, toggle);
                            }
                        }
                        break;
                    case "wind":
                        if (e.Sender is RexClientViewBase)
                        {
                            ((RexClientViewBase)e.Sender).SendRexToggleWindSound(!this.windToggle);
                            windToggle = !windToggle;
                            //((RexClientView)e.Sender).SendRexScriptCommand("hud", "ShowInventoryMessage(\"wind ="+windToggle.ToString()+" \")", "");
                        }
                        break;
                    default:

                        //Test code. Not to any relese.
                        //e.Sender.SendAlertMessage("Hello there");

                        //if (e.Sender is RexClientView)
                        //{
                        //    ((RexClientView)e.Sender).SendRexScriptCommand("hud", "ShowInventoryMessage(\"Test\")", "");
                        //}
                        break;
                }
            }
        }
Exemplo n.º 5
0
 public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
 {
     if (windConfig != null)
     {
         if (windConfig.Contains("strength"))
         {
             m_strength = windConfig.GetFloat("strength", 1.0F);
         }
     }
 }
Exemplo n.º 6
0
        public byte[] SerializeGroupToBytes(OpenSim.Region.Framework.Scenes.SceneObjectGroup group, SerializationFlags flags)
        {
            Serialization.SceneObjectGroupSnapshot snap = Serialization.SceneObjectGroupSnapshot.FromSceneObjectGroup(group, flags);

            using (MemoryStream ms = new MemoryStream())
            {
                ProtoBuf.Serializer.Serialize<Serialization.SceneObjectGroupSnapshot>(ms, snap);
                return ms.ToArray();
            }
        }
Exemplo n.º 7
0
        public byte[] SerializeObjectToBytes(OpenSim.Region.Framework.Scenes.CoalescedObject csog, SerializationFlags flags)
        {
            Serialization.CoalescedObjectSnapshot snap = Serialization.CoalescedObjectSnapshot.FromCoalescedObject(csog, flags);

            using (MemoryStream ms = new MemoryStream())
            {
                ProtoBuf.Serializer.Serialize<Serialization.CoalescedObjectSnapshot>(ms, snap);

                return ms.ToArray();
            }
        }
Exemplo n.º 8
0
 internal static ItemPermissionBlockSnapshot FromItemPermissionBlock(OpenSim.Framework.ItemPermissionBlock itemPermissionBlock)
 {
     return new ItemPermissionBlockSnapshot
     {
         BasePermissions = itemPermissionBlock.BasePermissions,
         NextPermissions = itemPermissionBlock.NextPermissions,
         EveryonePermissions = itemPermissionBlock.EveryOnePermissions,
         GroupPermissions = itemPermissionBlock.GroupPermissions,
         CurrentPermissions = itemPermissionBlock.CurrentPermissions
     };
 }
Exemplo n.º 9
0
        /// <summary>
        /// Serializes a group into a byte array suitable for storage and retrieval from inventory
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        public byte[] SerializeGroupToInventoryBytes(OpenSim.Region.Framework.Scenes.SceneObjectGroup group, SerializationFlags flags)
        {
            Serialization.SceneObjectGroupSnapshot snap = Serialization.SceneObjectGroupSnapshot.FromSceneObjectGroup(group, flags);

            using (MemoryStream ms = new MemoryStream())
            {
                ms.Write(GROUP_HEADER, 0, GROUP_HEADER.Length);
                snap.SerializeToStream(ms);

                return ms.ToArray();
            }
        }
Exemplo n.º 10
0
 private void HandleAgentUpdate(OpenSim.Framework.IClientAPI remoteClient, OpenSim.Framework.AgentUpdateArgs agentData)
 {
     if (m_maxHeight != 0)
     {
         ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId);
         if (sp.AbsolutePosition.Z > m_maxHeight)
         {
             Vector3 newPos = sp.AbsolutePosition;
             newPos.Z = m_maxHeight;
             sp.Teleport(newPos);
         }
     }
 }
Exemplo n.º 11
0
    public override void link(OpenSim.Region.PhysicsModules.SharedBase.PhysicsActor obj)
    {
        BSPrimLinkable parent = obj as BSPrimLinkable;
        if (parent != null)
        {
            BSPhysObject parentBefore = Linkset.LinksetRoot;    // DEBUG
            int childrenBefore = Linkset.NumberOfChildren;      // DEBUG

            Linkset = parent.Linkset.AddMeToLinkset(this);

            DetailLog("{0},BSPrimLinkable.link,call,parentBefore={1}, childrenBefore=={2}, parentAfter={3}, childrenAfter={4}",
                LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren);
        }
        return;
    }
        public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
        {
            if (windConfig != null)
            {
                // Uses strength value if avg_strength not specified
                m_avgStrength = windConfig.GetFloat("strength", 5.0F);
                m_avgStrength = windConfig.GetFloat("avg_strength", 5.0F);

                m_avgDirection = windConfig.GetFloat("avg_direction", 0.0F);
                m_varStrength  = windConfig.GetFloat("var_strength", 5.0F);
                m_varDirection = windConfig.GetFloat("var_direction", 30.0F);
                m_rateChange   = windConfig.GetFloat("rate_change", 1.0F);

                LogSettings();
            }
        }
Exemplo n.º 13
0
 public CreateObjectCmd(PhysxPrim parent, string primName, OpenSim.Framework.PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position,
     OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation, OpenMetaverse.Vector3 velocity, OpenMetaverse.Vector3 angularVelocity,
     float lod, PhysicsScene.AddPrimShapeFlags flags, Material material, byte[] serializedPhysicsProperties, byte[] serializedPhysicsShapes,
     ulong interpolateTime)
 {
     _parent = parent;
     _primName = primName;
     _pbs = pbs;
     _position = position;
     _size = size;
     _rotation = rotation;
     _velocity = velocity;
     _angularVelocity = angularVelocity;
     _lod = lod;
     _flags = flags;
     _material = material;
     _serializedPhysicsProperties = serializedPhysicsProperties;
     _serializedPhysicsShapes = serializedPhysicsShapes;
     _interpolateTime = interpolateTime;
 }
Exemplo n.º 14
0
        public static KeyframeAnimationSnapshot FromKeyframeAnimation(OpenSim.Framework.KeyframeAnimation keyframeAnimation)
        {
            if (keyframeAnimation == null)
                return null;

            return new KeyframeAnimationSnapshot()
            {
                CurrentAnimationPosition = keyframeAnimation.CurrentAnimationPosition,
                CurrentMode = (int)keyframeAnimation.CurrentMode,
                CurrentCommand = (int)keyframeAnimation.CurrentCommand,
                InitialPosition = keyframeAnimation.InitialPosition,
                InitialRotation = keyframeAnimation.InitialRotation,
                PingPongForwardMotion = keyframeAnimation.PingPongForwardMotion,
                PositionList = keyframeAnimation.PositionList,
                RotationList = keyframeAnimation.RotationList,
                TimeLastTick = keyframeAnimation.TimeLastTick,
                TimeElapsed = keyframeAnimation.TimeElapsed,
                TimeList = keyframeAnimation.TimeList
            };
        }
        LindenLoginData SetUpLindenLoginData(OpenSim.Grid.UserServer.Modules.RexLogin.Avatar avatar, string account,
            string welcomeMessage, UUID sessionID) 
        {
            LindenLoginData response = new LindenLoginData();

            response.AgentID = avatar.ID;
            response.BuddyList = LindenLoginHelper.GetBuddyList(avatar.ID);
            LindenLoginHelper.SetClassifiedCategories(ref response);
            response.FirstName = avatar.GetAttribute(AvatarAttributes.FIRST_NAME).AsString() + " " + avatar.GetAttribute(AvatarAttributes.LAST_NAME).AsString();
            avatar.Attributes[AvatarAttributes.FIRST_NAME] = OSD.FromString(response.FirstName);
            response.HomeLookAt = avatar.GetAttribute(AvatarAttributes.HOME_LOOKAT).AsVector3();
            response.HomePosition = avatar.GetAttribute(AvatarAttributes.HOME_POSITION).AsVector3();
            response.HomeRegionX = avatar.GetAttribute(AvatarAttributes.HOME_REGION_X).AsUInteger();
            response.HomeRegionY = avatar.GetAttribute(AvatarAttributes.HOME_REGION_Y).AsUInteger();
            response.LastName = "<" + account + ">";
            avatar.Attributes[AvatarAttributes.LAST_NAME] = OSD.FromString(response.LastName);
            response.Login = true;
            response.Message = welcomeMessage;
            response.SessionID = sessionID;
            response.SecureSessionID = UUID.Random();

            return response;
        }
        public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
        {
            if (m_connectorEnabled)
            {

                if (m_accountService == null)
                {
                    m_accountService = scene.UserAccountService;
                }


                scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
            }
        }
 public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
 {
 }
Exemplo n.º 18
0
 public UserLoginService(
     OpenSim.Framework.Communications.UserProfileManager userManager,
     LibraryRootFolder libraryRootFolder, string mapServerURI, string profileServerURI,
     UserConfig config, string welcomeMess, IRegionProfileRouter regionProfileService)
     : base(userManager, libraryRootFolder, welcomeMess, mapServerURI, profileServerURI)
 {
     m_config = config;
     m_defaultHomeX = m_config.DefaultX;
     m_defaultHomeY = m_config.DefaultY;
     m_regionProfileService = regionProfileService;
 }
Exemplo n.º 19
0
 public void Start (IConfigSource config, OpenSim.Framework.IRegistryCore registry)
 {
 }
Exemplo n.º 20
0
 public void Initialize (IConfigSource config, OpenSim.Framework.IRegistryCore registry)
 {
     MainServer.Instance.AddStreamHandler (new HeloServerGetHandler ("aurora"));
 }
Exemplo n.º 21
0
        private void Call(OpenSim.Services.Interfaces.GridRegion region, Dictionary<string, object> sendData)
        {
            Util.FireAndForget(delegate(object o)
            {
                string reqString = WebUtils.BuildQueryString(sendData);
                //MainConsole.Instance.DebugFormat("[FRIENDS CONNECTOR]: queryString = {0}", reqString);
                if (region == null)
                    return;

                try
                {
                    string url = "http://" + region.ExternalHostName + ":" + region.HttpPort;
                    string a = SynchronousRestFormsRequester.MakeRequest("POST",
                            url + "/friends",
                            reqString);
                }
                catch (Exception)
                {
                }
            });
        }
 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     if (m_connectorEnabled)
     {
         scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
     }
 }
 public void RegionLoaded(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     
 }
 public void RemoveRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     
 }
 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     scene.EventManager.OnNewClient += OnNewClient;
     m_scene = scene;
 }
 public void RegionLoaded(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     GroupsConnector = Aurora.DataManager.DataManager.RequestPlugin<IGroupsServiceConnector>();
     if (GroupsConnector == null)
     {
         m_log.Warn("[AURORA-GROUPS-CONNECTOR]: GroupsConnector is null");
         m_connectorEnabled = false;
     }
 }
Exemplo n.º 27
0
 public void AfterAttachedToConnection(OpenSim.Framework.AgentCircuitData c)
 {
 }
Exemplo n.º 28
0
 public UserTextureDownloadService(
     IClientAPI client, Scene scene, OpenSim.Framework.BlockingQueue<ITextureSender> sharedQueue)
 {
     m_client = client;
     m_scene = scene;
     m_sharedSendersQueue = sharedQueue;
 }
 public void RemoveRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     if (scene.RequestModuleInterface<IGroupsServicesConnector>() == this)
     {
         scene.UnregisterModuleInterface<IGroupsServicesConnector>(this);
     }
 }
 public void RegionLoaded(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     // TODO: May want to consider listenning for Agent Connections so we can pre-cache group info
     // scene.EventManager.OnNewClient += OnNewClient;
 }
Exemplo n.º 31
0
        //        [Test]
        public void TestLifecycle()
        {
            TestHelpers.InMethod();
            TestHelpers.EnableLogging();

            UUID estateOwnerId = TestHelpers.ParseTail(0x1);
            UUID regionId      = TestHelpers.ParseTail(0x10);

            IConfigSource configSource = new IniConfigSource();

            configSource.AddConfig("Startup");
            configSource.AddConfig("Modules");

            //            // We use this to skip estate questions
            // Turns out not to be needed is estate owner id is pre-set in region information.
            //            IConfig estateConfig = configSource.AddConfig(OpenSimBase.ESTATE_SECTION_NAME);
            //            estateConfig.Set("DefaultEstateOwnerName", "Zaphod Beeblebrox");
            //            estateConfig.Set("DefaultEstateOwnerUUID", estateOwnerId);
            //            estateConfig.Set("DefaultEstateOwnerEMail", "*****@*****.**");
            //            estateConfig.Set("DefaultEstateOwnerPassword", "two heads");

            // For grid servic
            configSource.AddConfig("GridService");
            configSource.Configs["Modules"].Set("GridServices", "RegionGridServicesConnector");
            configSource.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
            configSource.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
            configSource.Configs["GridService"].Set("ConnectionString", "!static");

            RegionGridServicesConnector gridService = new RegionGridServicesConnector();
//
            OpenSim sim = new OpenSim(configSource);

            sim.SuppressExit                    = true;
            sim.EnableInitialPluginLoad         = false;
            sim.LoadEstateDataService           = false;
            sim.NetServersInfo.HttpListenerPort = 0;

            IRegistryCore reg = sim.ApplicationRegistry;

            RegionInfo ri = new RegionInfo();

            ri.RegionID = regionId;
            ri.EstateSettings.EstateOwner = estateOwnerId;
            ri.InternalEndPoint           = new IPEndPoint(0, 0);

            MockRegionModulesControllerPlugin rmcp = new MockRegionModulesControllerPlugin();

            sim.m_plugins = new List <IApplicationPlugin>()
            {
                rmcp
            };
            reg.RegisterInterface <IRegionModulesController>(rmcp);

            // XXX: Have to initialize directly for now
            rmcp.Initialise(sim);

            rmcp.AddNode(gridService);

            TestSharedRegion tsr = new TestSharedRegion();

            rmcp.AddNode(tsr);

            // FIXME: Want to use the real one eventually but this is currently directly tied into Mono.Addins
            // which has been written in such a way that makes it impossible to use for regression tests.
            //            RegionModulesControllerPlugin rmcp = new RegionModulesControllerPlugin();
            //            rmcp.LoadModulesFromAddins = false;
            ////            reg.RegisterInterface<IRegionModulesController>(rmcp);
            //            rmcp.Initialise(sim);
            //            rmcp.PostInitialise();
            //            TypeExtensionNode node = new TypeExtensionNode();
            //            node.
            //            rmcp.AddNode(node, configSource.Configs["Modules"], new Dictionary<RuntimeAddin, IList<int>>());

            sim.Startup();
            IScene scene;

            sim.CreateRegion(ri, out scene);

            sim.Shutdown();

            List <string> co = tsr.CallOrder;
            int           expectedEventCount = 6;

            Assert.AreEqual(
                expectedEventCount,
                co.Count,
                "Expected {0} events but only got {1} ({2})",
                expectedEventCount, co.Count, string.Join(",", co));
            Assert.AreEqual("Initialise", co[0]);
            Assert.AreEqual("PostInitialise", co[1]);
            Assert.AreEqual("AddRegion", co[2]);
            Assert.AreEqual("RegionLoaded", co[3]);
            Assert.AreEqual("RemoveRegion", co[4]);
            Assert.AreEqual("Close", co[5]);
        }