aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorDiva Canto2010-01-10 10:40:07 -0800
committerDiva Canto2010-01-10 10:40:07 -0800
commit1e1b2ab221851efc414678b7ea52ef2ca788ce9f (patch)
tree29b6aa80e54a9c18529ae14e7d185fe67582d151 /OpenSim/Region/Framework/Scenes
parentAdd a "LockedOut" flag to allow locking a region out via the grid server. (diff)
downloadopensim-SC-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.zip
opensim-SC-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.gz
opensim-SC-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.bz2
opensim-SC-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.xz
* OMG! All but one references to UserProfileCacheService have been rerouted!
* HG is seriously broken here * Compiles. Untested.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs77
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs14
7 files changed, 26 insertions, 117 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs
index 6f7f34f..76d7a09 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs
@@ -33,6 +33,7 @@ using OpenSim.Framework;
33using OpenSim.Framework.Communications; 33using OpenSim.Framework.Communications;
34using OpenSim.Framework.Communications.Cache; 34using OpenSim.Framework.Communications.Cache;
35using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Services.Interfaces;
36 37
37namespace OpenSim.Region.Framework.Scenes.Hypergrid 38namespace OpenSim.Region.Framework.Scenes.Hypergrid
38{ 39{
@@ -82,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
82 83
83 public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel) 84 public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel)
84 { 85 {
85 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(avatarID); 86 UserAccount userInfo = UserAccountService.GetUserAccount(RegionInfo.ScopeID, avatarID);
86 if (userInfo != null) 87 if (userInfo != null)
87 { 88 {
88 m_assMapper.Post(assetID, avatarID); 89 m_assMapper.Post(assetID, avatarID);
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs
deleted file mode 100644
index b1981b6..0000000
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
29using OpenSim.Framework;
30using OpenSim.Framework.Communications.Cache;
31using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
32using GridRegion = OpenSim.Services.Interfaces.GridRegion;
33
34namespace OpenSim.Region.Framework.Scenes.Hypergrid
35{
36 public partial class HGScene : Scene
37 {
38 /// <summary>
39 /// Teleport an avatar to their home region
40 /// </summary>
41 /// <param name="agentId"></param>
42 /// <param name="client"></param>
43 public override void TeleportClientHome(UUID agentId, IClientAPI client)
44 {
45 m_log.Debug("[HGScene]: TeleportClientHome " + client.FirstName + " " + client.LastName);
46
47 CachedUserInfo uinfo = CommsManager.UserProfileCacheService.GetUserDetails(agentId);
48 if (uinfo != null)
49 {
50 UserProfileData UserProfile = uinfo.UserProfile;
51
52 if (UserProfile != null)
53 {
54 GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID);
55 //if (regionInfo != null)
56 //{
57 // UserProfile.HomeRegionID = regionInfo.RegionID;
58 // //CommsManager.UserService.UpdateUserProfile(UserProfile);
59 //}
60 if (regionInfo == null)
61 {
62 // can't find the Home region: Tell viewer and abort
63 client.SendTeleportFailed("Your home-region could not be found.");
64 return;
65 }
66 RequestTeleportLocation(
67 client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt,
68 (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome));
69 }
70 }
71 else
72 client.SendTeleportFailed("Sorry! I lost your home-region information.");
73
74 }
75
76 }
77}
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
index f64a7a0..61419e6 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
@@ -141,13 +141,9 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
141 bool isHyperLink = (HyperlinkService.GetHyperlinkRegion(reg.RegionHandle) != null); 141 bool isHyperLink = (HyperlinkService.GetHyperlinkRegion(reg.RegionHandle) != null);
142 bool isHomeUser = true; 142 bool isHomeUser = true;
143 ulong realHandle = regionHandle; 143 ulong realHandle = regionHandle;
144 CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID); 144 isHomeUser = HyperlinkService.IsLocalUser(avatar.UUID);
145 if (uinfo != null) 145 realHandle = m_hg.FindRegionHandle(regionHandle);
146 { 146 m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString());
147 isHomeUser = HyperlinkService.IsLocalUser(uinfo.UserProfile.ID);
148 realHandle = m_hg.FindRegionHandle(regionHandle);
149 m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString());
150 }
151 /// 147 ///
152 /// Hypergrid mod stop 148 /// Hypergrid mod stop
153 /// 149 ///
@@ -352,7 +348,8 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
352 // so the userinfo in UserProfileCache is not reliable any more, delete it 348 // so the userinfo in UserProfileCache is not reliable any more, delete it
353 if (avatar.Scene.NeedSceneCacheClear(avatar.UUID) || isHyperLink) 349 if (avatar.Scene.NeedSceneCacheClear(avatar.UUID) || isHyperLink)
354 { 350 {
355 m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID); 351 // REFACTORING PROBLEM!!!!
352 //m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID);
356 m_log.DebugFormat( 353 m_log.DebugFormat(
357 "[HGSceneCommService]: User {0} is going to another region, profile cache removed", 354 "[HGSceneCommService]: User {0} is going to another region, profile cache removed",
358 avatar.UUID); 355 avatar.UUID);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 1c5c247..476873a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -744,13 +744,9 @@ namespace OpenSim.Region.Framework.Scenes
744 744
745 if (transactionID == UUID.Zero) 745 if (transactionID == UUID.Zero)
746 { 746 {
747 CachedUserInfo userInfo 747 ScenePresence presence;
748 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 748 if (TryGetAvatar(remoteClient.AgentId, out presence))
749
750 if (userInfo != null)
751 { 749 {
752 ScenePresence presence;
753 TryGetAvatar(remoteClient.AgentId, out presence);
754 byte[] data = null; 750 byte[] data = null;
755 751
756 if (invType == (sbyte)InventoryType.Landmark && presence != null) 752 if (invType == (sbyte)InventoryType.Landmark && presence != null)
@@ -772,7 +768,7 @@ namespace OpenSim.Region.Framework.Scenes
772 else 768 else
773 { 769 {
774 m_log.ErrorFormat( 770 m_log.ErrorFormat(
775 "userInfo for agent uuid {0} unexpectedly null in CreateNewInventoryItem", 771 "ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem",
776 remoteClient.AgentId); 772 remoteClient.AgentId);
777 } 773 }
778 } 774 }
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
3207 m_sceneGraph.removeUserCount(!childagentYN); 3207 m_sceneGraph.removeUserCount(!childagentYN);
3208 CapsModule.RemoveCapsHandler(agentID); 3208 CapsModule.RemoveCapsHandler(agentID);
3209 3209
3210 if (avatar.Scene.NeedSceneCacheClear(avatar.UUID)) 3210 // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever
3211 { 3211 // this method is doing is HORRIBLE!!!
3212 CommsManager.UserProfileCacheService.RemoveUser(agentID); 3212 avatar.Scene.NeedSceneCacheClear(avatar.UUID);
3213 }
3214 3213
3215 if (!avatar.IsChildAgent) 3214 if (!avatar.IsChildAgent)
3216 { 3215 {
@@ -3512,18 +3511,6 @@ namespace OpenSim.Region.Framework.Scenes
3512 3511
3513 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 3512 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
3514 3513
3515 // rewrite session_id
3516 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID);
3517 if (userinfo != null)
3518 {
3519 userinfo.SessionID = agent.SessionID;
3520 }
3521 else
3522 {
3523 m_log.WarnFormat(
3524 "[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);
3525 }
3526
3527 return true; 3514 return true;
3528 } 3515 }
3529 3516
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 8b14f61..ce3c16c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -967,9 +967,10 @@ namespace OpenSim.Region.Framework.Scenes
967 // if (teleport success) // seems to be always success here 967 // if (teleport success) // seems to be always success here
968 // the user may change their profile information in other region, 968 // the user may change their profile information in other region,
969 // so the userinfo in UserProfileCache is not reliable any more, delete it 969 // so the userinfo in UserProfileCache is not reliable any more, delete it
970
971 // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
970 if (avatar.Scene.NeedSceneCacheClear(avatar.UUID)) 972 if (avatar.Scene.NeedSceneCacheClear(avatar.UUID))
971 { 973 {
972 m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID);
973 m_log.DebugFormat( 974 m_log.DebugFormat(
974 "[SCENE COMMUNICATION SERVICE]: User {0} is going to another region, profile cache removed", 975 "[SCENE COMMUNICATION SERVICE]: User {0} is going to another region, profile cache removed",
975 avatar.UUID); 976 avatar.UUID);
@@ -1404,11 +1405,11 @@ namespace OpenSim.Region.Framework.Scenes
1404 agent.Scene.NotifyMyCoarseLocationChange(); 1405 agent.Scene.NotifyMyCoarseLocationChange();
1405 // the user may change their profile information in other region, 1406 // the user may change their profile information in other region,
1406 // so the userinfo in UserProfileCache is not reliable any more, delete it 1407 // so the userinfo in UserProfileCache is not reliable any more, delete it
1408 // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
1407 if (agent.Scene.NeedSceneCacheClear(agent.UUID)) 1409 if (agent.Scene.NeedSceneCacheClear(agent.UUID))
1408 { 1410 {
1409 agent.Scene.CommsManager.UserProfileCacheService.RemoveUser(agent.UUID);
1410 m_log.DebugFormat( 1411 m_log.DebugFormat(
1411 "[SCENE COMM]: User {0} is going to another region, profile cache removed", agent.UUID); 1412 "[SCENE COMM]: User {0} is going to another region", agent.UUID);
1412 } 1413 }
1413 } 1414 }
1414 1415
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 385a9cd..97415f4 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -39,6 +39,7 @@ using OpenSim.Region.Framework.Scenes.Animation;
39using OpenSim.Region.Framework.Scenes.Types; 39using OpenSim.Region.Framework.Scenes.Types;
40using OpenSim.Region.Physics.Manager; 40using OpenSim.Region.Physics.Manager;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion; 41using GridRegion = OpenSim.Services.Interfaces.GridRegion;
42using OpenSim.Services.Interfaces;
42 43
43namespace OpenSim.Region.Framework.Scenes 44namespace OpenSim.Region.Framework.Scenes
44{ 45{
@@ -2870,11 +2871,14 @@ namespace OpenSim.Region.Framework.Scenes
2870 // For now, assign god level 200 to anyone 2871 // For now, assign god level 200 to anyone
2871 // who is granted god powers, but has no god level set. 2872 // who is granted god powers, but has no god level set.
2872 // 2873 //
2873 CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(agentID); 2874 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, agentID);
2874 if (profile.UserProfile.GodLevel > 0) 2875 if (account != null)
2875 m_godlevel = profile.UserProfile.GodLevel; 2876 {
2876 else 2877 if (account.UserLevel > 0)
2877 m_godlevel = 200; 2878 m_godlevel = account.UserLevel;
2879 else
2880 m_godlevel = 200;
2881 }
2878 } 2882 }
2879 else 2883 else
2880 { 2884 {