From a8901a40f4526720f68049706cabd34cf9717172 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 31 Dec 2009 09:25:16 -0800 Subject: Simulation handlers (agents & objects) completed. --- OpenSim/Region/Framework/Scenes/Scene.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0e1e2be..7db99e1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4889,5 +4889,15 @@ namespace OpenSim.Region.Framework.Scenes if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 2000) StartTimer(); } + + public override ISceneObject DeserializeObject(string representation) + { + return SceneObjectSerializer.FromXml2Format(representation); + } + + public override bool AllowScriptCrossings + { + get { return m_allowScriptCrossings; } + } } } -- cgit v1.1 From 4240f2dec6f7348a99aea0d1b040fca6ea9d493b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 1 Jan 2010 16:54:24 -0800 Subject: New LL login service is working! -- tested in standalone only. Things still missing from response, namely Library and Friends. Appearance service is also missing. --- OpenSim/Region/Framework/Scenes/Scene.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7db99e1..418cfbf 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3483,10 +3483,18 @@ namespace OpenSim.Region.Framework.Scenes { reason = String.Empty; - bool result = CommsManager.UserService.VerifySession(agent.AgentID, agent.SessionID); - m_log.Debug("[CONNECTION BEGIN]: User authentication returned " + result); + IAuthenticationService auth = RequestModuleInterface(); + if (auth == null) + { + reason = String.Format("Failed to authenticate user {0} {1} in region {2}. Authentication service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName); + return false; + } + + bool result = auth.Verify(agent.AgentID, agent.SecureSessionID.ToString(), 30); + + m_log.Debug("[CONNECTION BEGIN]: Session authentication returned " + result); if (!result) - reason = String.Format("Failed to authenticate user {0} {1}, access denied.", agent.firstname, agent.lastname); + reason = String.Format("Failed to authenticate user {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); return result; } -- cgit v1.1 From 8a9677a5319793ff630d0761e204ae8961f375aa Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 1 Jan 2010 21:12:46 -0800 Subject: The Library Service is now working. UserProfileCacheService.LibraryRoot is obsolete. Didn't delete it yet to avoid merge conflicts later -- want to stay out of core as much as possible. --- OpenSim/Region/Framework/Scenes/Scene.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 418cfbf..ae189b5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -240,6 +240,19 @@ namespace OpenSim.Region.Framework.Scenes } } + protected ILibraryService m_LibraryService; + + public ILibraryService LibraryService + { + get + { + if (m_LibraryService == null) + m_LibraryService = RequestModuleInterface(); + + return m_LibraryService; + } + } + protected IXMLRPC m_xmlrpcModule; protected IWorldComm m_worldCommModule; protected IAvatarFactory m_AvatarFactory; -- cgit v1.1 From f11a97f12d328af8bb39b92fec5cb5780983b66a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 7 Jan 2010 15:53:55 -0800 Subject: * Finished SimulationServiceConnector * Started rerouting calls to UserService. * Compiles. May run. --- OpenSim/Region/Framework/Scenes/Scene.cs | 86 ++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 20c0622..d8874b2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -253,6 +253,49 @@ namespace OpenSim.Region.Framework.Scenes } } + protected ISimulationService m_simulationService; + public ISimulationService SimulationService + { + get + { + if (m_simulationService == null) + m_simulationService = RequestModuleInterface(); + return m_simulationService; + } + } + + protected IAuthenticationService m_AuthenticationService; + public IAuthenticationService AuthenticationService + { + get + { + if (m_AuthenticationService == null) + m_AuthenticationService = RequestModuleInterface(); + return m_AuthenticationService; + } + } + + protected IPresenceService m_PresenceService; + public IPresenceService PresenceService + { + get + { + if (m_PresenceService == null) + m_PresenceService = RequestModuleInterface(); + return m_PresenceService; + } + } + protected IUserAccountService m_UserAccountService; + public IUserAccountService UserAccountService + { + get + { + if (m_UserAccountService == null) + m_UserAccountService = RequestModuleInterface(); + return m_UserAccountService; + } + } + protected IXMLRPC m_xmlrpcModule; protected IWorldComm m_worldCommModule; protected IAvatarFactory m_AvatarFactory; @@ -262,8 +305,6 @@ namespace OpenSim.Region.Framework.Scenes } protected IConfigSource m_config; protected IRegionSerialiserModule m_serialiser; - protected IInterregionCommsOut m_interregionCommsOut; - protected IInterregionCommsIn m_interregionCommsIn; protected IDialogModule m_dialogModule; protected ITeleportModule m_teleportModule; @@ -1136,8 +1177,6 @@ namespace OpenSim.Region.Framework.Scenes XferManager = RequestModuleInterface(); m_AvatarFactory = RequestModuleInterface(); m_serialiser = RequestModuleInterface(); - m_interregionCommsOut = RequestModuleInterface(); - m_interregionCommsIn = RequestModuleInterface(); m_dialogModule = RequestModuleInterface(); m_capsModule = RequestModuleInterface(); m_teleportModule = RequestModuleInterface(); @@ -2155,7 +2194,10 @@ namespace OpenSim.Region.Framework.Scenes grp.OffsetForNewRegion(pos); // If we fail to cross the border, then reset the position of the scene object on that border. - if (!CrossPrimGroupIntoNewRegion(newRegionHandle, grp, silent)) + uint x = 0, y = 0; + Utils.LongToUInts(newRegionHandle, out x, out y); + GridRegion destination = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); + if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) { grp.OffsetForNewRegion(oldGroupPosition); grp.ScheduleGroupForFullUpdate(); @@ -2351,7 +2393,7 @@ namespace OpenSim.Region.Framework.Scenes /// true if the crossing itself was successful, false on failure /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region /// - public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp, bool silent) + public bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent) { //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); @@ -2359,7 +2401,7 @@ namespace OpenSim.Region.Framework.Scenes grp.RootPart.UpdateFlag = 0; //int primcrossingXMLmethod = 0; - if (newRegionHandle != 0) + if (destination != null) { //string objectState = grp.GetStateSnapshot(); @@ -2372,9 +2414,11 @@ namespace OpenSim.Region.Framework.Scenes // newRegionHandle, grp.UUID, objectState, 100); //} - // And the new channel... - if (m_interregionCommsOut != null) - successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); + //// And the new channel... + //if (m_interregionCommsOut != null) + // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); + if (m_simulationService != null) + successYN = m_simulationService.CreateObject(destination, grp, true); if (successYN) { @@ -2405,7 +2449,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - m_log.Error("[INTERREGION]: region handle was unexpectedly 0 in Scene.CrossPrimGroupIntoNewRegion()"); + m_log.Error("[INTERREGION]: destination was unexpectedly null in Scene.CrossPrimGroupIntoNewRegion()"); } return successYN; @@ -2598,10 +2642,9 @@ namespace OpenSim.Region.Framework.Scenes m_log.Debug(logMsg); */ - CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); + //CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); ScenePresence sp = CreateAndAddScenePresence(client); - // HERE!!! Do the initial attachments right here // first agent upon login is a root agent by design. // All other AddNewClient calls find aCircuit.child to be true @@ -2614,6 +2657,7 @@ namespace OpenSim.Region.Framework.Scenes m_LastLogin = Util.EnvironmentTickCount(); EventManager.TriggerOnNewClient(client); + } @@ -3289,14 +3333,6 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGridService.KiPrimitive += SendKillObject; m_sceneGridService.OnGetLandData += GetLandData; - if (m_interregionCommsIn != null) - { - m_log.Debug("[SCENE]: Registering with InterregionCommsIn"); - m_interregionCommsIn.OnChildAgentUpdate += IncomingChildAgentDataUpdate; - } - else - m_log.Debug("[SCENE]: Unable to register with InterregionCommsIn"); - } /// @@ -3314,9 +3350,6 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent; m_sceneGridService.OnGetLandData -= GetLandData; - if (m_interregionCommsIn != null) - m_interregionCommsIn.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; - // this does nothing; should be removed m_sceneGridService.Close(); @@ -3758,9 +3791,10 @@ namespace OpenSim.Region.Framework.Scenes return m_sceneGridService.ReleaseAgent(id); } - public void SendReleaseAgent(ulong regionHandle, UUID id, string uri) + public void SendReleaseAgent(UUID origin, UUID id, string uri) { - m_interregionCommsOut.SendReleaseAgent(regionHandle, id, uri); + //m_interregionCommsOut.SendReleaseAgent(regionHandle, id, uri); + m_simulationService.ReleaseAgent(origin, id, uri); } /// -- cgit v1.1 From b63405c1a796b44b58081857d01f726372467628 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 8 Jan 2010 10:43:34 -0800 Subject: Inching ahead... This compiles, but very likely does not run. --- OpenSim/Region/Framework/Scenes/Scene.cs | 57 ++++++++++---------------------- 1 file changed, 18 insertions(+), 39 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d8874b2..e22dd2d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -296,6 +296,17 @@ namespace OpenSim.Region.Framework.Scenes } } + protected OpenSim.Services.Interfaces.IAvatarService m_AvatarService; + public OpenSim.Services.Interfaces.IAvatarService AvatarService + { + get + { + if (m_AvatarService == null) + m_AvatarService = RequestModuleInterface(); + return m_AvatarService; + } + } + protected IXMLRPC m_xmlrpcModule; protected IWorldComm m_worldCommModule; protected IAvatarFactory m_AvatarFactory; @@ -2975,21 +2986,11 @@ namespace OpenSim.Region.Framework.Scenes /// The IClientAPI for the client public virtual void TeleportClientHome(UUID agentId, IClientAPI client) { - UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); - if (UserProfile != null) + OpenSim.Services.Interfaces.PresenceInfo pinfo = PresenceService.GetAgent(client.SessionId); + + if (pinfo != null) { - GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID); - if (regionInfo == null) - { - uint x = 0, y = 0; - Utils.LongToUInts(UserProfile.HomeRegion, out x, out y); - regionInfo = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); - if (regionInfo != null) // home region can be away temporarily, too - { - UserProfile.HomeRegionID = regionInfo.RegionID; - CommsManager.UserService.UpdateUserProfile(UserProfile); - } - } + GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, pinfo.HomeRegionID); if (regionInfo == null) { // can't find the Home region: Tell viewer and abort @@ -2997,7 +2998,7 @@ namespace OpenSim.Region.Framework.Scenes return; } RequestTeleportLocation( - client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt, + client, regionInfo.RegionHandle, pinfo.HomePosition, pinfo.HomeLookAt, (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome)); } } @@ -3089,7 +3090,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Sets the Home Point. The GridService uses this to know where to put a user when they log-in + /// Sets the Home Point. The LoginService uses this to know where to put a user when they log-in /// /// /// @@ -3098,27 +3099,11 @@ namespace OpenSim.Region.Framework.Scenes /// public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) { - UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); - if (UserProfile != null) - { - // I know I'm ignoring the regionHandle provided by the teleport location request. - // reusing the TeleportLocationRequest delegate, so regionHandle isn't valid - UserProfile.HomeRegionID = RegionInfo.RegionID; - // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around. - // TODO: The HomeRegion property can be removed then, too - UserProfile.HomeRegion = RegionInfo.RegionHandle; - - UserProfile.HomeLocation = position; - UserProfile.HomeLookAt = lookAt; - CommsManager.UserService.UpdateUserProfile(UserProfile); - + if (PresenceService.SetHomeLocation(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt)) // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. m_dialogModule.SendAlertToUser(remoteClient, "Home position set."); - } else - { m_dialogModule.SendAlertToUser(remoteClient, "Set Home request Failed."); - } } /// @@ -3254,12 +3239,6 @@ namespace OpenSim.Region.Framework.Scenes m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString()); } - // Remove client agent from profile, so new logins will work - if (!childagentYN) - { - m_sceneGridService.ClearUserAgent(agentID); - } - m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); -- cgit v1.1 From 6b60f3cce5b9dc8c005c9fdb53731dc4e3e45ee8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 8 Jan 2010 20:31:29 -0800 Subject: A few more inches... Old friends things removed. Less references to UserProfileService. --- OpenSim/Region/Framework/Scenes/Scene.cs | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e22dd2d..ef62b79 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3979,35 +3979,6 @@ namespace OpenSim.Region.Framework.Scenes objectCapacity = objects; } - public List GetFriendList(string id) - { - UUID avatarID; - if (!UUID.TryParse(id, out avatarID)) - return new List(); - - return CommsManager.GetUserFriendList(avatarID); - } - - public Dictionary GetFriendRegionInfos(List uuids) - { - return CommsManager.GetFriendRegionInfos(uuids); - } - - public virtual void StoreAddFriendship(UUID ownerID, UUID friendID, uint perms) - { - m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms); - } - - public virtual void StoreUpdateFriendship(UUID ownerID, UUID friendID, uint perms) - { - m_sceneGridService.UpdateUserFriendPerms(ownerID, friendID, perms); - } - - public virtual void StoreRemoveFriendship(UUID ownerID, UUID ExfriendID) - { - m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID); - } - #endregion public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) -- cgit v1.1 From 25fdbd6cbcfc857c444042745d7d4fa8e495a982 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 9 Jan 2010 09:09:32 -0800 Subject: Less refs to UserProfileCacheService. Compiles but likely doesn't run. --- OpenSim/Region/Framework/Scenes/Scene.cs | 34 ++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ef62b79..90d476e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -841,6 +841,36 @@ namespace OpenSim.Region.Framework.Scenes return m_simulatorVersion; } + public string[] GetUserNames(UUID uuid) + { + string[] returnstring = new string[0]; + + UserAccount account = UserAccountService.GetUserAccount(RegionInfo.ScopeID, uuid); + + if (account != null) + { + returnstring = new string[2]; + returnstring[0] = account.FirstName; + returnstring[1] = account.LastName; + } + + return returnstring; + } + + public string GetUserName(UUID uuid) + { + string[] names = GetUserNames(uuid); + if (names.Length == 2) + { + string firstname = names[0]; + string lastname = names[1]; + + return firstname + " " + lastname; + + } + return "(hippos)"; + } + /// /// Another region is up. /// @@ -2804,7 +2834,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual void SubscribeToClientGridEvents(IClientAPI client) { - client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest; + client.OnNameFromUUIDRequest += HandleUUIDNameRequest; client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; client.OnSetStartLocationRequest += SetHomeRezPoint; @@ -2959,7 +2989,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual void UnSubscribeToClientGridEvents(IClientAPI client) { - client.OnNameFromUUIDRequest -= CommsManager.HandleUUIDNameRequest; + client.OnNameFromUUIDRequest -= HandleUUIDNameRequest; client.OnMoneyTransferRequest -= ProcessMoneyTransferRequest; client.OnAvatarPickerRequest -= ProcessAvatarPickerRequest; client.OnSetStartLocationRequest -= SetHomeRezPoint; -- cgit v1.1 From 1e1b2ab221851efc414678b7ea52ef2ca788ce9f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 10:40:07 -0800 Subject: * OMG! All but one references to UserProfileCacheService have been rerouted! * HG is seriously broken here * Compiles. Untested. --- OpenSim/Region/Framework/Scenes/Scene.cs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 90d476e..53c51e6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3207,10 +3207,9 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGraph.removeUserCount(!childagentYN); CapsModule.RemoveCapsHandler(agentID); - if (avatar.Scene.NeedSceneCacheClear(avatar.UUID)) - { - CommsManager.UserProfileCacheService.RemoveUser(agentID); - } + // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever + // this method is doing is HORRIBLE!!! + avatar.Scene.NeedSceneCacheClear(avatar.UUID); if (!avatar.IsChildAgent) { @@ -3512,18 +3511,6 @@ namespace OpenSim.Region.Framework.Scenes m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); - // rewrite session_id - CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID); - if (userinfo != null) - { - userinfo.SessionID = agent.SessionID; - } - else - { - m_log.WarnFormat( - "[CONNECTION BEGIN]: We couldn't find a User Info record for {0}. This is usually an indication that the UUID we're looking up is invalid", agent.AgentID); - } - return true; } -- cgit v1.1 From 4dd523b45d1e635c66eb4e556764fabe29dbfc58 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 15:34:56 -0800 Subject: * Changed IPresenceService Logout, so that it takes a position and a lookat * CommsManager.AvatarService rerouted --- OpenSim/Region/Framework/Scenes/Scene.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 53c51e6..6d6f0b1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3213,7 +3213,6 @@ namespace OpenSim.Region.Framework.Scenes if (!avatar.IsChildAgent) { - m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, avatar.AbsolutePosition, avatar.Lookat); //List childknownRegions = new List(); //List ckn = avatar.KnownChildRegionHandles; //for (int i = 0; i < ckn.Count; i++) -- cgit v1.1 From dc4bbf6065ad4cb914c9d44f2e6496a2e3d99814 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 20:29:09 -0800 Subject: All Framework.Communications.Clients and Framework.Communications.Services deleted, including old LoginService. --- OpenSim/Region/Framework/Scenes/Scene.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6d6f0b1..0493b4c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -42,7 +42,6 @@ using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; -using OpenSim.Framework.Communications.Clients; using OpenSim.Framework.Console; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; -- cgit v1.1 From 001d3695683d9511446d194feeb763c437170028 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 07:45:47 -0800 Subject: CommunicationsManager deleted. --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0493b4c..618e153 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -140,7 +140,6 @@ namespace OpenSim.Region.Framework.Scenes protected ModuleLoader m_moduleLoader; protected StorageManager m_storageManager; protected AgentCircuitManager m_authenticateHandler; - public CommunicationsManager CommsManager; protected SceneCommunicationService m_sceneGridService; public bool loginsdisabled = true; @@ -547,7 +546,7 @@ namespace OpenSim.Region.Framework.Scenes #region Constructors public Scene(RegionInfo regInfo, AgentCircuitManager authen, - CommunicationsManager commsMan, SceneCommunicationService sceneGridService, + SceneCommunicationService sceneGridService, StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) @@ -583,7 +582,6 @@ namespace OpenSim.Region.Framework.Scenes m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue/2))+(uint)(uint.MaxValue/4); m_moduleLoader = moduleLoader; m_authenticateHandler = authen; - CommsManager = commsMan; m_sceneGridService = sceneGridService; m_storageManager = storeManager; m_regInfo = regInfo; -- cgit v1.1 From c5ea783526611a968400a1936e4c6764ee1c7013 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 07:51:33 -0800 Subject: OpenSim/Framework/Communications/Cache deleted. LibraryRootFolder deleted. --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 618e153..db0da34 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -41,7 +41,7 @@ using OpenMetaverse.Imaging; using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; + using OpenSim.Framework.Console; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; -- cgit v1.1 From 77e43f480154b0a950d9d5f54df5c225fc64e77a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 17:30:05 -0800 Subject: Fixed a couple of bugs with Appearance. Appearance is all good now. --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index db0da34..db7b3ff 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -300,7 +300,7 @@ namespace OpenSim.Region.Framework.Scenes get { if (m_AvatarService == null) - m_AvatarService = RequestModuleInterface(); + m_AvatarService = RequestModuleInterface(); return m_AvatarService; } } -- cgit v1.1 From 66920a9047b54db947d02f252e17409b7fc32ef0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 12 Jan 2010 09:22:58 -0800 Subject: Fixed more appearance woes that showed up using remote connectors. Appearance is now being passed with AgentCircuitData, as it should be. --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index db7b3ff..6c8068c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3708,8 +3708,8 @@ namespace OpenSim.Region.Framework.Scenes /// true if we handled it. public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) { -// m_log.DebugFormat( -// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); + m_log.DebugFormat( + "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); // We have to wait until the viewer contacts this region after receiving EAC. // That calls AddNewClient, which finally creates the ScenePresence -- cgit v1.1 From 011a1b3798016af355ffa352dc93667429749341 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 12 Jan 2010 09:49:27 -0800 Subject: More appearance woes fixed, this time for child agents. Tested on a grid with 2 simulators. Everything seems to be working, including border crosses. TPs (prim crossing) need love now. --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6c8068c..4bbea16 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2683,6 +2683,8 @@ namespace OpenSim.Region.Framework.Scenes //CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); ScenePresence sp = CreateAndAddScenePresence(client); + sp.Appearance = aCircuit.Appearance; + // HERE!!! Do the initial attachments right here // first agent upon login is a root agent by design. // All other AddNewClient calls find aCircuit.child to be true -- cgit v1.1 From 7356860b487febd12c2e0de2f009a6df9ea0aeec Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 13 Jan 2010 09:17:30 -0800 Subject: Several more buglets removed. --- OpenSim/Region/Framework/Scenes/Scene.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4bbea16..206e2f8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2553,6 +2553,9 @@ namespace OpenSim.Region.Framework.Scenes return false; } + + sceneObject.SetScene(this); + // Force allocation of new LocalId // foreach (SceneObjectPart p in sceneObject.Children.Values) -- cgit v1.1 From daa9866a9adf591c6b32f992d189f6a1189a1677 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 13 Jan 2010 19:25:33 -0800 Subject: Omit AuthorizationService from the default configurations, because the service doesn't exist in the distribution. --- OpenSim/Region/Framework/Scenes/Scene.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 206e2f8..ecbd7e3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -187,11 +187,11 @@ namespace OpenSim.Region.Framework.Scenes { m_AuthorizationService = RequestModuleInterface(); - if (m_AuthorizationService == null) - { - // don't throw an exception if no authorization service is set for the time being - m_log.InfoFormat("[SCENE]: No Authorization service is configured"); - } + //if (m_AuthorizationService == null) + //{ + // // don't throw an exception if no authorization service is set for the time being + // m_log.InfoFormat("[SCENE]: No Authorization service is configured"); + //} } return m_AuthorizationService; -- cgit v1.1 From e90a5895ada61aab7fc27ab6f67b13a20676e07b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 13 Jan 2010 21:32:48 -0800 Subject: Bug fix in releasing agent. In Scene, always use SimulatonService, and not m_SimulationService, because it may be null... --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ecbd7e3..48f0331 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3791,7 +3791,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendReleaseAgent(UUID origin, UUID id, string uri) { //m_interregionCommsOut.SendReleaseAgent(regionHandle, id, uri); - m_simulationService.ReleaseAgent(origin, id, uri); + SimulationService.ReleaseAgent(origin, id, uri); } /// -- cgit v1.1 From f1c30784ac767bf5f62e81748984b76d85d71f6a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 15 Jan 2010 15:11:58 -0800 Subject: * General cleanup of Teleports, Crossings and Child agents. They are now in the new AgentTransferModule, in line with what MW started implementing back in May -- ITeleportModule. This has been renamed IAgentTransferModule, to be more generic. * HGSceneCommunicationService has been deleted * SceneCommunicationService will likely be deleted soon too --- OpenSim/Region/Framework/Scenes/Scene.cs | 67 ++++++++------------------------ 1 file changed, 17 insertions(+), 50 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 48f0331..dcbbe08 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -315,7 +315,7 @@ namespace OpenSim.Region.Framework.Scenes protected IConfigSource m_config; protected IRegionSerialiserModule m_serialiser; protected IDialogModule m_dialogModule; - protected ITeleportModule m_teleportModule; + protected IAgentTransferModule m_teleportModule; protected ICapabilitiesModule m_capsModule; public ICapabilitiesModule CapsModule @@ -901,7 +901,7 @@ namespace OpenSim.Region.Framework.Scenes regInfo.RegionName = otherRegion.RegionName; regInfo.ScopeID = otherRegion.ScopeID; regInfo.ExternalHostName = otherRegion.ExternalHostName; - + GridRegion r = new GridRegion(regInfo); try { ForEachScenePresence(delegate(ScenePresence agent) @@ -915,7 +915,8 @@ namespace OpenSim.Region.Framework.Scenes List old = new List(); old.Add(otherRegion.RegionHandle); agent.DropOldNeighbours(old); - InformClientOfNeighbor(agent, regInfo); + if (m_teleportModule != null) + m_teleportModule.EnableChildAgent(agent, r); } } ); @@ -1063,6 +1064,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach (RegionInfo region in m_regionRestartNotifyList) { + GridRegion r = new GridRegion(region); try { ForEachScenePresence(delegate(ScenePresence agent) @@ -1070,9 +1072,8 @@ namespace OpenSim.Region.Framework.Scenes // If agent is a root agent. if (!agent.IsChildAgent) { - //agent.ControllingClient.new - //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); - InformClientOfNeighbor(agent, region); + if (m_teleportModule != null) + m_teleportModule.EnableChildAgent(agent, r); } } ); @@ -1217,7 +1218,7 @@ namespace OpenSim.Region.Framework.Scenes m_serialiser = RequestModuleInterface(); m_dialogModule = RequestModuleInterface(); m_capsModule = RequestModuleInterface(); - m_teleportModule = RequestModuleInterface(); + m_teleportModule = RequestModuleInterface(); } #endregion @@ -3783,17 +3784,6 @@ namespace OpenSim.Region.Framework.Scenes return false; } - public virtual bool IncomingReleaseAgent(UUID id) - { - return m_sceneGridService.ReleaseAgent(id); - } - - public void SendReleaseAgent(UUID origin, UUID id, string uri) - { - //m_interregionCommsOut.SendReleaseAgent(regionHandle, id, uri); - SimulationService.ReleaseAgent(origin, id, uri); - } - /// /// Tell a single agent to disconnect from the region. /// @@ -3838,30 +3828,6 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Tell neighboring regions about this agent - /// When the regions respond with a true value, - /// tell the agents about the region. - /// - /// We have to tell the regions about the agents first otherwise it'll deny them access - /// - /// - /// - public void InformClientOfNeighbours(ScenePresence presence) - { - m_sceneGridService.EnableNeighbourChildAgents(presence, m_neighbours); - } - - /// - /// Tell a neighboring region about this agent - /// - /// - /// - public void InformClientOfNeighbor(ScenePresence presence, RegionInfo region) - { - m_sceneGridService.EnableNeighbourChildAgents(presence, m_neighbours); - } - - /// /// Tries to teleport agent to other region. /// /// @@ -3936,16 +3902,12 @@ namespace OpenSim.Region.Framework.Scenes } if (m_teleportModule != null) - { - m_teleportModule.RequestTeleportToLocation(sp, regionHandle, - position, lookAt, teleportFlags); - } + m_teleportModule.Teleport(sp, regionHandle, position, lookAt, teleportFlags); else { - m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, - position, lookAt, teleportFlags); + m_log.DebugFormat("[SCENE]: Unable to perform teleports: no AgentTransferModule is active"); + sp.ControllingClient.SendTeleportFailed("Unable to perform teleports on this simulator."); } - } } @@ -3971,7 +3933,12 @@ namespace OpenSim.Region.Framework.Scenes public void CrossAgentToNewRegion(ScenePresence agent, bool isFlying) { - m_sceneGridService.CrossAgentToNewRegion(this, agent, isFlying); + if (m_teleportModule != null) + m_teleportModule.Cross(agent, isFlying); + else + { + m_log.DebugFormat("[SCENE]: Unable to cross agent to neighbouring region, because there is no AgentTransferModule"); + } } public void SendOutChildAgentUpdates(AgentPosition cadu, ScenePresence presence) -- cgit v1.1 From 4ac3c0e81b8760ef31f741cd55e703eee86b93b7 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 15 Jan 2010 17:14:48 -0800 Subject: Renamed IAgentTransferModule to IEntityTransferModule -- accounts for objects too. --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index dcbbe08..62734ff 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -315,7 +315,7 @@ namespace OpenSim.Region.Framework.Scenes protected IConfigSource m_config; protected IRegionSerialiserModule m_serialiser; protected IDialogModule m_dialogModule; - protected IAgentTransferModule m_teleportModule; + protected IEntityTransferModule m_teleportModule; protected ICapabilitiesModule m_capsModule; public ICapabilitiesModule CapsModule @@ -1218,7 +1218,7 @@ namespace OpenSim.Region.Framework.Scenes m_serialiser = RequestModuleInterface(); m_dialogModule = RequestModuleInterface(); m_capsModule = RequestModuleInterface(); - m_teleportModule = RequestModuleInterface(); + m_teleportModule = RequestModuleInterface(); } #endregion -- cgit v1.1 From bd6d1a24448dafea5be7ddbcd591b352040e4412 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 16 Jan 2010 07:46:07 -0800 Subject: Moved prim crossing to EntityTransferModule. Not complete yet. --- OpenSim/Region/Framework/Scenes/Scene.cs | 353 ++++++++++++++++--------------- 1 file changed, 179 insertions(+), 174 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7b582a9..bd753cc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1655,7 +1655,9 @@ namespace OpenSim.Region.Framework.Scenes GridRegion region = new GridRegion(RegionInfo); string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); if (error != String.Empty) + { throw new Exception(error); + } m_sceneGridService.SetScene(this); m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface(), RegionInfo); @@ -2049,202 +2051,205 @@ namespace OpenSim.Region.Framework.Scenes if (grp.IsDeleted) return; - if (grp.RootPart.DIE_AT_EDGE) - { - // We remove the object here - try - { - DeleteSceneObject(grp, false); - } - catch (Exception) - { - m_log.Warn("[DATABASE]: exception when trying to remove the prim that crossed the border."); - } - return; - } + if (m_teleportModule != null) + m_teleportModule.Cross(grp, attemptedPosition, silent); + + //if (grp.RootPart.DIE_AT_EDGE) + //{ + // // We remove the object here + // try + // { + // DeleteSceneObject(grp, false); + // } + // catch (Exception) + // { + // m_log.Warn("[DATABASE]: exception when trying to remove the prim that crossed the border."); + // } + // return; + //} - int thisx = (int)RegionInfo.RegionLocX; - int thisy = (int)RegionInfo.RegionLocY; - Vector3 EastCross = new Vector3(0.1f,0,0); - Vector3 WestCross = new Vector3(-0.1f, 0, 0); - Vector3 NorthCross = new Vector3(0, 0.1f, 0); - Vector3 SouthCross = new Vector3(0, -0.1f, 0); + //int thisx = (int)RegionInfo.RegionLocX; + //int thisy = (int)RegionInfo.RegionLocY; + //Vector3 EastCross = new Vector3(0.1f,0,0); + //Vector3 WestCross = new Vector3(-0.1f, 0, 0); + //Vector3 NorthCross = new Vector3(0, 0.1f, 0); + //Vector3 SouthCross = new Vector3(0, -0.1f, 0); - // use this if no borders were crossed! - ulong newRegionHandle - = Util.UIntsToLong((uint)((thisx) * Constants.RegionSize), - (uint)((thisy) * Constants.RegionSize)); + //// use this if no borders were crossed! + //ulong newRegionHandle + // = Util.UIntsToLong((uint)((thisx) * Constants.RegionSize), + // (uint)((thisy) * Constants.RegionSize)); - Vector3 pos = attemptedPosition; + //Vector3 pos = attemptedPosition; - int changeX = 1; - int changeY = 1; + //int changeX = 1; + //int changeY = 1; - if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W)) - { - if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) - { + //if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W)) + //{ + // if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) + // { - Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); + // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); - if (crossedBorderx.BorderLine.Z > 0) - { - pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); - changeX = (int)(crossedBorderx.BorderLine.Z /(int) Constants.RegionSize); - } - else - pos.X = ((pos.X + Constants.RegionSize)); + // if (crossedBorderx.BorderLine.Z > 0) + // { + // pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); + // changeX = (int)(crossedBorderx.BorderLine.Z /(int) Constants.RegionSize); + // } + // else + // pos.X = ((pos.X + Constants.RegionSize)); - Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); - //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) + // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); + // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - if (crossedBordery.BorderLine.Z > 0) - { - pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - } - else - pos.Y = ((pos.Y + Constants.RegionSize)); + // if (crossedBordery.BorderLine.Z > 0) + // { + // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); + // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); + // } + // else + // pos.Y = ((pos.Y + Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), - (uint)((thisy - changeY) * Constants.RegionSize)); - // x - 1 - // y - 1 - } - else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) - { - Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); - - if (crossedBorderx.BorderLine.Z > 0) - { - pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); - changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize); - } - else - pos.X = ((pos.X + Constants.RegionSize)); - - - Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); - //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - - if (crossedBordery.BorderLine.Z > 0) - { - pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - } - else - pos.Y = ((pos.Y + Constants.RegionSize)); - - newRegionHandle - = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), - (uint)((thisy + changeY) * Constants.RegionSize)); - // x - 1 - // y + 1 - } - else - { - Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); - - if (crossedBorderx.BorderLine.Z > 0) - { - pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); - changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize); - } - else - pos.X = ((pos.X + Constants.RegionSize)); + // newRegionHandle + // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), + // (uint)((thisy - changeY) * Constants.RegionSize)); + // // x - 1 + // // y - 1 + // } + // else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) + // { + // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); + + // if (crossedBorderx.BorderLine.Z > 0) + // { + // pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); + // changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize); + // } + // else + // pos.X = ((pos.X + Constants.RegionSize)); + + + // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); + // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) + + // if (crossedBordery.BorderLine.Z > 0) + // { + // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); + // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); + // } + // else + // pos.Y = ((pos.Y + Constants.RegionSize)); + + // newRegionHandle + // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), + // (uint)((thisy + changeY) * Constants.RegionSize)); + // // x - 1 + // // y + 1 + // } + // else + // { + // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); + + // if (crossedBorderx.BorderLine.Z > 0) + // { + // pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); + // changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize); + // } + // else + // pos.X = ((pos.X + Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), - (uint) (thisy*Constants.RegionSize)); - // x - 1 - } - } - else if (TestBorderCross(attemptedPosition + EastCross, Cardinals.E)) - { - if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) - { + // newRegionHandle + // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), + // (uint) (thisy*Constants.RegionSize)); + // // x - 1 + // } + //} + //else if (TestBorderCross(attemptedPosition + EastCross, Cardinals.E)) + //{ + // if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) + // { - pos.X = ((pos.X - Constants.RegionSize)); - Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); - //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - - if (crossedBordery.BorderLine.Z > 0) - { - pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - } - else - pos.Y = ((pos.Y + Constants.RegionSize)); + // pos.X = ((pos.X - Constants.RegionSize)); + // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); + // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) + + // if (crossedBordery.BorderLine.Z > 0) + // { + // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); + // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); + // } + // else + // pos.Y = ((pos.Y + Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), - (uint)((thisy - changeY) * Constants.RegionSize)); - // x + 1 - // y - 1 - } - else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) - { - pos.X = ((pos.X - Constants.RegionSize)); - pos.Y = ((pos.Y - Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), - (uint)((thisy + changeY) * Constants.RegionSize)); - // x + 1 - // y + 1 - } - else - { - pos.X = ((pos.X - Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), - (uint) (thisy*Constants.RegionSize)); - // x + 1 - } - } - else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) - { - Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); - //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) + // newRegionHandle + // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), + // (uint)((thisy - changeY) * Constants.RegionSize)); + // // x + 1 + // // y - 1 + // } + // else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) + // { + // pos.X = ((pos.X - Constants.RegionSize)); + // pos.Y = ((pos.Y - Constants.RegionSize)); + // newRegionHandle + // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), + // (uint)((thisy + changeY) * Constants.RegionSize)); + // // x + 1 + // // y + 1 + // } + // else + // { + // pos.X = ((pos.X - Constants.RegionSize)); + // newRegionHandle + // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), + // (uint) (thisy*Constants.RegionSize)); + // // x + 1 + // } + //} + //else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) + //{ + // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); + // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - if (crossedBordery.BorderLine.Z > 0) - { - pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - } - else - pos.Y = ((pos.Y + Constants.RegionSize)); + // if (crossedBordery.BorderLine.Z > 0) + // { + // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); + // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); + // } + // else + // pos.Y = ((pos.Y + Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - changeY) * Constants.RegionSize)); - // y - 1 - } - else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) - { + // newRegionHandle + // = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - changeY) * Constants.RegionSize)); + // // y - 1 + //} + //else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) + //{ - pos.Y = ((pos.Y - Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + changeY) * Constants.RegionSize)); - // y + 1 - } + // pos.Y = ((pos.Y - Constants.RegionSize)); + // newRegionHandle + // = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + changeY) * Constants.RegionSize)); + // // y + 1 + //} - // Offset the positions for the new region across the border - Vector3 oldGroupPosition = grp.RootPart.GroupPosition; - grp.OffsetForNewRegion(pos); + //// Offset the positions for the new region across the border + //Vector3 oldGroupPosition = grp.RootPart.GroupPosition; + //grp.OffsetForNewRegion(pos); - // If we fail to cross the border, then reset the position of the scene object on that border. - uint x = 0, y = 0; - Utils.LongToUInts(newRegionHandle, out x, out y); - GridRegion destination = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); - if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) - { - grp.OffsetForNewRegion(oldGroupPosition); - grp.ScheduleGroupForFullUpdate(); - } + //// If we fail to cross the border, then reset the position of the scene object on that border. + //uint x = 0, y = 0; + //Utils.LongToUInts(newRegionHandle, out x, out y); + //GridRegion destination = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); + //if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) + //{ + // grp.OffsetForNewRegion(oldGroupPosition); + // grp.ScheduleGroupForFullUpdate(); + //} } public Border GetCrossedBorder(Vector3 position, Cardinals gridline) -- cgit v1.1 From ee1fb81376041f6eef27bbb3e84b56ae6e2357b3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 16 Jan 2010 08:42:20 -0800 Subject: Finished moving object crossings into EntityTransferModule --- OpenSim/Region/Framework/Scenes/Scene.cs | 268 ------------------------------- 1 file changed, 268 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index bd753cc..5654f67 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2040,7 +2040,6 @@ namespace OpenSim.Region.Framework.Scenes /// Move the given scene object into a new region depending on which region its absolute position has moved /// into. /// - /// This method locates the new region handle and offsets the prim position for the new region /// /// the attempted out of region position of the scene object /// the scene object that we're crossing @@ -2054,202 +2053,6 @@ namespace OpenSim.Region.Framework.Scenes if (m_teleportModule != null) m_teleportModule.Cross(grp, attemptedPosition, silent); - //if (grp.RootPart.DIE_AT_EDGE) - //{ - // // We remove the object here - // try - // { - // DeleteSceneObject(grp, false); - // } - // catch (Exception) - // { - // m_log.Warn("[DATABASE]: exception when trying to remove the prim that crossed the border."); - // } - // return; - //} - - //int thisx = (int)RegionInfo.RegionLocX; - //int thisy = (int)RegionInfo.RegionLocY; - //Vector3 EastCross = new Vector3(0.1f,0,0); - //Vector3 WestCross = new Vector3(-0.1f, 0, 0); - //Vector3 NorthCross = new Vector3(0, 0.1f, 0); - //Vector3 SouthCross = new Vector3(0, -0.1f, 0); - - - //// use this if no borders were crossed! - //ulong newRegionHandle - // = Util.UIntsToLong((uint)((thisx) * Constants.RegionSize), - // (uint)((thisy) * Constants.RegionSize)); - - //Vector3 pos = attemptedPosition; - - //int changeX = 1; - //int changeY = 1; - - //if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W)) - //{ - // if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) - // { - - // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); - - // if (crossedBorderx.BorderLine.Z > 0) - // { - // pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); - // changeX = (int)(crossedBorderx.BorderLine.Z /(int) Constants.RegionSize); - // } - // else - // pos.X = ((pos.X + Constants.RegionSize)); - - // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); - // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - - // if (crossedBordery.BorderLine.Z > 0) - // { - // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - // } - // else - // pos.Y = ((pos.Y + Constants.RegionSize)); - - - - // newRegionHandle - // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), - // (uint)((thisy - changeY) * Constants.RegionSize)); - // // x - 1 - // // y - 1 - // } - // else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) - // { - // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); - - // if (crossedBorderx.BorderLine.Z > 0) - // { - // pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); - // changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize); - // } - // else - // pos.X = ((pos.X + Constants.RegionSize)); - - - // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); - // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - - // if (crossedBordery.BorderLine.Z > 0) - // { - // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - // } - // else - // pos.Y = ((pos.Y + Constants.RegionSize)); - - // newRegionHandle - // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), - // (uint)((thisy + changeY) * Constants.RegionSize)); - // // x - 1 - // // y + 1 - // } - // else - // { - // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); - - // if (crossedBorderx.BorderLine.Z > 0) - // { - // pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); - // changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize); - // } - // else - // pos.X = ((pos.X + Constants.RegionSize)); - - // newRegionHandle - // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), - // (uint) (thisy*Constants.RegionSize)); - // // x - 1 - // } - //} - //else if (TestBorderCross(attemptedPosition + EastCross, Cardinals.E)) - //{ - // if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) - // { - - // pos.X = ((pos.X - Constants.RegionSize)); - // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); - // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - - // if (crossedBordery.BorderLine.Z > 0) - // { - // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - // } - // else - // pos.Y = ((pos.Y + Constants.RegionSize)); - - - // newRegionHandle - // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), - // (uint)((thisy - changeY) * Constants.RegionSize)); - // // x + 1 - // // y - 1 - // } - // else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) - // { - // pos.X = ((pos.X - Constants.RegionSize)); - // pos.Y = ((pos.Y - Constants.RegionSize)); - // newRegionHandle - // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), - // (uint)((thisy + changeY) * Constants.RegionSize)); - // // x + 1 - // // y + 1 - // } - // else - // { - // pos.X = ((pos.X - Constants.RegionSize)); - // newRegionHandle - // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), - // (uint) (thisy*Constants.RegionSize)); - // // x + 1 - // } - //} - //else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) - //{ - // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); - // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - - // if (crossedBordery.BorderLine.Z > 0) - // { - // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - // } - // else - // pos.Y = ((pos.Y + Constants.RegionSize)); - - // newRegionHandle - // = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - changeY) * Constants.RegionSize)); - // // y - 1 - //} - //else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) - //{ - - // pos.Y = ((pos.Y - Constants.RegionSize)); - // newRegionHandle - // = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + changeY) * Constants.RegionSize)); - // // y + 1 - //} - - //// Offset the positions for the new region across the border - //Vector3 oldGroupPosition = grp.RootPart.GroupPosition; - //grp.OffsetForNewRegion(pos); - - //// If we fail to cross the border, then reset the position of the scene object on that border. - //uint x = 0, y = 0; - //Utils.LongToUInts(newRegionHandle, out x, out y); - //GridRegion destination = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); - //if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) - //{ - // grp.OffsetForNewRegion(oldGroupPosition); - // grp.ScheduleGroupForFullUpdate(); - //} } public Border GetCrossedBorder(Vector3 position, Cardinals gridline) @@ -2432,77 +2235,6 @@ namespace OpenSim.Region.Framework.Scenes } - /// - /// Move the given scene object into a new region - /// - /// - /// Scene Object Group that we're crossing - /// - /// true if the crossing itself was successful, false on failure - /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region - /// - public bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent) - { - //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); - - bool successYN = false; - grp.RootPart.UpdateFlag = 0; - //int primcrossingXMLmethod = 0; - - if (destination != null) - { - //string objectState = grp.GetStateSnapshot(); - - //successYN - // = m_sceneGridService.PrimCrossToNeighboringRegion( - // newRegionHandle, grp.UUID, m_serialiser.SaveGroupToXml2(grp), primcrossingXMLmethod); - //if (successYN && (objectState != "") && m_allowScriptCrossings) - //{ - // successYN = m_sceneGridService.PrimCrossToNeighboringRegion( - // newRegionHandle, grp.UUID, objectState, 100); - //} - - //// And the new channel... - //if (m_interregionCommsOut != null) - // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); - if (m_simulationService != null) - successYN = m_simulationService.CreateObject(destination, grp, true); - - if (successYN) - { - // We remove the object here - try - { - DeleteSceneObject(grp, silent); - } - catch (Exception e) - { - m_log.ErrorFormat( - "[INTERREGION]: Exception deleting the old object left behind on a border crossing for {0}, {1}", - grp, e); - } - } - else - { - if (!grp.IsDeleted) - { - if (grp.RootPart.PhysActor != null) - { - grp.RootPart.PhysActor.CrossingFailure(); - } - } - - m_log.ErrorFormat("[INTERREGION]: Prim crossing failed for {0}", grp); - } - } - else - { - m_log.Error("[INTERREGION]: destination was unexpectedly null in Scene.CrossPrimGroupIntoNewRegion()"); - } - - return successYN; - } - public bool IncomingCreateObject(ISceneObject sog) { //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); -- cgit v1.1 From 04e29c1bacbc1e2df980ae15896a847ce7535da2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 16 Jan 2010 21:42:44 -0800 Subject: Beginning of rewriting HG. Compiles, and runs, but HG functions not restored yet. --- OpenSim/Region/Framework/Scenes/Scene.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5654f67..5730b56 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3157,7 +3157,7 @@ namespace OpenSim.Region.Framework.Scenes agent.AgentID, agent.circuitcode, teleportFlags); reason = String.Empty; - if (!AuthenticateUser(agent, out reason)) + if (!VerifyUserPresence(agent, out reason)) return false; if (!AuthorizeUser(agent, out reason)) @@ -3258,30 +3258,32 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Verifies that the user has a session on the Grid + /// Verifies that the user has a presence on the Grid /// /// Circuit Data of the Agent we're verifying /// Outputs the reason for the false response on this string /// True if the user has a session on the grid. False if it does not. False will /// also return a reason. - public virtual bool AuthenticateUser(AgentCircuitData agent, out string reason) + public virtual bool VerifyUserPresence(AgentCircuitData agent, out string reason) { reason = String.Empty; - IAuthenticationService auth = RequestModuleInterface(); - if (auth == null) + IPresenceService presence = RequestModuleInterface(); + if (presence == null) { - reason = String.Format("Failed to authenticate user {0} {1} in region {2}. Authentication service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName); + reason = String.Format("Failed to verify user {0} {1} in region {2}. Presence service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName); return false; } - bool result = auth.Verify(agent.AgentID, agent.SecureSessionID.ToString(), 30); + OpenSim.Services.Interfaces.PresenceInfo pinfo = presence.GetAgent(agent.SessionID); - m_log.Debug("[CONNECTION BEGIN]: Session authentication returned " + result); - if (!result) - reason = String.Format("Failed to authenticate user {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); + if (pinfo == null || (pinfo != null && pinfo.Online == false)) + { + reason = String.Format("Failed to verify user {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); + return false; + } - return result; + return true; } /// -- cgit v1.1 From bbbe9e73cca2a0ed5d35db1b054b8ed4cd23bfea Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 18 Jan 2010 09:14:19 -0800 Subject: * Fixed misspelling of field in GridService * Moved TeleportClientHome to EntityTransferModule --- OpenSim/Region/Framework/Scenes/Scene.cs | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5730b56..3cfb236 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2558,7 +2558,6 @@ namespace OpenSim.Region.Framework.Scenes { client.OnTeleportLocationRequest += RequestTeleportLocation; client.OnTeleportLandmarkRequest += RequestTeleportLandmark; - client.OnTeleportHomeRequest += TeleportClientHome; } public virtual void SubscribeToClientScriptEvents(IClientAPI client) @@ -2713,7 +2712,7 @@ namespace OpenSim.Region.Framework.Scenes { client.OnTeleportLocationRequest -= RequestTeleportLocation; client.OnTeleportLandmarkRequest -= RequestTeleportLandmark; - client.OnTeleportHomeRequest -= TeleportClientHome; + //client.OnTeleportHomeRequest -= TeleportClientHome; } public virtual void UnSubscribeToClientScriptEvents(IClientAPI client) @@ -2760,20 +2759,12 @@ namespace OpenSim.Region.Framework.Scenes /// The IClientAPI for the client public virtual void TeleportClientHome(UUID agentId, IClientAPI client) { - OpenSim.Services.Interfaces.PresenceInfo pinfo = PresenceService.GetAgent(client.SessionId); - - if (pinfo != null) + if (m_teleportModule != null) + m_teleportModule.TeleportHome(agentId, client); + else { - GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, pinfo.HomeRegionID); - if (regionInfo == null) - { - // can't find the Home region: Tell viewer and abort - client.SendTeleportFailed("Your home-region could not be found."); - return; - } - RequestTeleportLocation( - client, regionInfo.RegionHandle, pinfo.HomePosition, pinfo.HomeLookAt, - (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome)); + m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active"); + client.SendTeleportFailed("Unable to perform teleports on this simulator."); } } -- cgit v1.1 From 00f7d622cbc2c2e61d2efaacd8275da3f9821d8b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 28 Jan 2010 19:19:42 -0800 Subject: HG 1.5 is in place. Tested in standalone only. --- OpenSim/Region/Framework/Scenes/Scene.cs | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3cfb236..f800d5f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2416,6 +2416,37 @@ namespace OpenSim.Region.Framework.Scenes { AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); + // Do the verification here + System.Net.EndPoint ep = client.GetClientEP(); + if (aCircuit != null) + { + if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) + { + m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + IUserAgentVerificationModule userVerification = RequestModuleInterface(); + if (userVerification != null) + { + if (!userVerification.VerifyClient(aCircuit, ep.ToString())) + { + // uh-oh, this is fishy + m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", + client.AgentId, client.SessionId, ep.ToString()); + try + { + client.Close(); + } + catch (Exception e) + { + m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace); + } + return; + } + else + m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} returned true", aCircuit.firstname, aCircuit.lastname); + } + } + } + m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); /* string logMsg = string.Format("[SCENE]: Adding new {0} agent for {1} in {2}", @@ -2426,7 +2457,6 @@ namespace OpenSim.Region.Framework.Scenes */ //CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); - ScenePresence sp = CreateAndAddScenePresence(client); sp.Appearance = aCircuit.Appearance; @@ -3243,6 +3273,7 @@ namespace OpenSim.Region.Framework.Scenes } } + agent.teleportFlags = teleportFlags; m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); return true; -- cgit v1.1 From 9821c4f566e11c75c8d87721777480c5b2e2bd4e Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 14 Feb 2010 15:41:57 -0600 Subject: Revolution is on the roll again! :) Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events). Direct flames and kudos to Revolution, please Signed-off-by: Melanie --- OpenSim/Region/Framework/Scenes/Scene.cs | 47 ++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2909311..c7fb32a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1976,6 +1976,23 @@ namespace OpenSim.Region.Framework.Scenes return; } + if (grp.RootPart.RETURN_AT_EDGE) + { + // We remove the object here + try + { + List objects = new List(); + objects.Add(grp); + SceneObjectGroup[] objectsArray = objects.ToArray(); + returnObjects(objectsArray, UUID.Zero); + } + catch (Exception) + { + m_log.Warn("[DATABASE]: exception when trying to return the prim that crossed the border."); + } + return; + } + int thisx = (int)RegionInfo.RegionLocX; int thisy = (int)RegionInfo.RegionLocY; Vector3 EastCross = new Vector3(0.1f,0,0); @@ -2044,19 +2061,25 @@ namespace OpenSim.Region.Framework.Scenes Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - if (crossedBordery.BorderLine.Z > 0) + try { - pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - } - else - pos.Y = ((pos.Y + Constants.RegionSize)); + if (crossedBordery.BorderLine.Z > 0) + { + pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); + changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); + } + else + pos.Y = ((pos.Y + Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), - (uint)((thisy + changeY) * Constants.RegionSize)); - // x - 1 - // y + 1 + newRegionHandle + = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), + (uint)((thisy + changeY) * Constants.RegionSize)); + // x - 1 + // y + 1 + } + catch (Exception ex) + { + } } else { @@ -2684,6 +2707,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnGrabUpdate += ProcessObjectGrabUpdate; client.OnDeGrabObject += ProcessObjectDeGrab; client.OnUndo += m_sceneGraph.HandleUndo; + client.OnRedo += m_sceneGraph.HandleRedo; client.OnObjectDescription += m_sceneGraph.PrimDescription; client.OnObjectDrop += m_sceneGraph.DropObject; client.OnObjectSaleInfo += ObjectSaleInfo; @@ -2838,6 +2862,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnGrabObject -= ProcessObjectGrab; client.OnDeGrabObject -= ProcessObjectDeGrab; client.OnUndo -= m_sceneGraph.HandleUndo; + client.OnRedo -= m_sceneGraph.HandleRedo; client.OnObjectDescription -= m_sceneGraph.PrimDescription; client.OnObjectDrop -= m_sceneGraph.DropObject; client.OnObjectSaleInfo -= ObjectSaleInfo; -- cgit v1.1 From af265e001d3bf043590e480cd6574a14193f6de0 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 15 Feb 2010 19:15:03 +0900 Subject: Formatting cleanup. --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c7fb32a..41fd1e1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2541,7 +2541,7 @@ namespace OpenSim.Region.Framework.Scenes AttachObject( sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); RootPrim.RemFlag(PrimFlags.TemporaryOnRez); - grp.SendGroupFullUpdate(); + grp.SendGroupFullUpdate(); } else { -- cgit v1.1 From 7665aad002ef066fc31fa9497225d2668641c769 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 22 Feb 2010 13:27:17 -0800 Subject: * Adds CreatorID to asset metadata. This is just the plumbing to support CreatorID, it doesn't modify database backends or OAR files to support storing/loading it --- OpenSim/Region/Framework/Scenes/Scene.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 72ece10..d5ceda8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4389,7 +4389,8 @@ namespace OpenSim.Region.Framework.Scenes group.GetPartName(localID), group.GetPartDescription(localID), (sbyte)AssetType.Object, - Utils.StringToBytes(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml), + group.OwnerID); AssetService.Store(asset); InventoryItemBase item = new InventoryItemBase(); -- cgit v1.1 From 5c5966545d14de43500b95109e8ce81058ebe2c3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 28 Feb 2010 12:07:38 -0800 Subject: Initial Online friends notification seems to be working reliably now. All this needs more testing, but everything is there. --- OpenSim/Region/Framework/Scenes/Scene.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b9b16ad..d00c990 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2422,6 +2422,8 @@ namespace OpenSim.Region.Framework.Scenes /// public override void AddNewClient(IClientAPI client) { + bool vialogin = false; + m_clientManager.Add(client); CheckHeartbeat(); @@ -2463,6 +2465,7 @@ namespace OpenSim.Region.Framework.Scenes if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) { m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + vialogin = true; IUserAgentVerificationModule userVerification = RequestModuleInterface(); if (userVerification != null) { @@ -2512,7 +2515,8 @@ namespace OpenSim.Region.Framework.Scenes m_LastLogin = Util.EnvironmentTickCount(); EventManager.TriggerOnNewClient(client); - + if (vialogin) + EventManager.TriggerOnClientLogin(client); } -- cgit v1.1 From 14073831d26172575655dbbfa7fd45c6366e9f60 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 2 Mar 2010 07:53:52 -0800 Subject: Fixes Region.Framework tests. Although these tests don't fail, they need to be rewritten, because they are doing agent manipulations in the wrong way, so they're fairly meaningless. --- OpenSim/Region/Framework/Scenes/Scene.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d00c990..5e5a52e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2467,7 +2467,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); vialogin = true; IUserAgentVerificationModule userVerification = RequestModuleInterface(); - if (userVerification != null) + if (userVerification != null && ep != null) { if (!userVerification.VerifyClient(aCircuit, ep.ToString())) { @@ -2491,22 +2491,15 @@ namespace OpenSim.Region.Framework.Scenes } m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); - /* - string logMsg = string.Format("[SCENE]: Adding new {0} agent for {1} in {2}", - ((aCircuit.child == true) ? "child" : "root"), client.Name, - RegionInfo.RegionName); - m_log.Debug(logMsg); - */ - - //CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); ScenePresence sp = CreateAndAddScenePresence(client); - sp.Appearance = aCircuit.Appearance; + if (aCircuit != null) + sp.Appearance = aCircuit.Appearance; // HERE!!! Do the initial attachments right here // first agent upon login is a root agent by design. // All other AddNewClient calls find aCircuit.child to be true - if (aCircuit == null || aCircuit.child == false) + if (aCircuit == null || (aCircuit != null && aCircuit.child == false)) { sp.IsChildAgent = false; Util.FireAndForget(delegate(object o) { sp.RezAttachments(); }); -- cgit v1.1