mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
* OMG! All but one references to UserProfileCacheService have been rerouted!
* HG is seriously broken here * Compiles. Untested.
This commit is contained in:
@@ -33,6 +33,7 @@ using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||
{
|
||||
@@ -82,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||
|
||||
public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel)
|
||||
{
|
||||
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(avatarID);
|
||||
UserAccount userInfo = UserAccountService.GetUserAccount(RegionInfo.ScopeID, avatarID);
|
||||
if (userInfo != null)
|
||||
{
|
||||
m_assMapper.Post(assetID, avatarID);
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||
{
|
||||
public partial class HGScene : Scene
|
||||
{
|
||||
/// <summary>
|
||||
/// Teleport an avatar to their home region
|
||||
/// </summary>
|
||||
/// <param name="agentId"></param>
|
||||
/// <param name="client"></param>
|
||||
public override void TeleportClientHome(UUID agentId, IClientAPI client)
|
||||
{
|
||||
m_log.Debug("[HGScene]: TeleportClientHome " + client.FirstName + " " + client.LastName);
|
||||
|
||||
CachedUserInfo uinfo = CommsManager.UserProfileCacheService.GetUserDetails(agentId);
|
||||
if (uinfo != null)
|
||||
{
|
||||
UserProfileData UserProfile = uinfo.UserProfile;
|
||||
|
||||
if (UserProfile != null)
|
||||
{
|
||||
GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID);
|
||||
//if (regionInfo != null)
|
||||
//{
|
||||
// UserProfile.HomeRegionID = regionInfo.RegionID;
|
||||
// //CommsManager.UserService.UpdateUserProfile(UserProfile);
|
||||
//}
|
||||
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, UserProfile.HomeLocation, UserProfile.HomeLookAt,
|
||||
(uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome));
|
||||
}
|
||||
}
|
||||
else
|
||||
client.SendTeleportFailed("Sorry! I lost your home-region information.");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -141,13 +141,9 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||
bool isHyperLink = (HyperlinkService.GetHyperlinkRegion(reg.RegionHandle) != null);
|
||||
bool isHomeUser = true;
|
||||
ulong realHandle = regionHandle;
|
||||
CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID);
|
||||
if (uinfo != null)
|
||||
{
|
||||
isHomeUser = HyperlinkService.IsLocalUser(uinfo.UserProfile.ID);
|
||||
realHandle = m_hg.FindRegionHandle(regionHandle);
|
||||
m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString());
|
||||
}
|
||||
isHomeUser = HyperlinkService.IsLocalUser(avatar.UUID);
|
||||
realHandle = m_hg.FindRegionHandle(regionHandle);
|
||||
m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString());
|
||||
///
|
||||
/// Hypergrid mod stop
|
||||
///
|
||||
@@ -352,7 +348,8 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||
// so the userinfo in UserProfileCache is not reliable any more, delete it
|
||||
if (avatar.Scene.NeedSceneCacheClear(avatar.UUID) || isHyperLink)
|
||||
{
|
||||
m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID);
|
||||
// REFACTORING PROBLEM!!!!
|
||||
//m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID);
|
||||
m_log.DebugFormat(
|
||||
"[HGSceneCommService]: User {0} is going to another region, profile cache removed",
|
||||
avatar.UUID);
|
||||
|
||||
@@ -744,13 +744,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (transactionID == UUID.Zero)
|
||||
{
|
||||
CachedUserInfo userInfo
|
||||
= CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
||||
|
||||
if (userInfo != null)
|
||||
ScenePresence presence;
|
||||
if (TryGetAvatar(remoteClient.AgentId, out presence))
|
||||
{
|
||||
ScenePresence presence;
|
||||
TryGetAvatar(remoteClient.AgentId, out presence);
|
||||
byte[] data = null;
|
||||
|
||||
if (invType == (sbyte)InventoryType.Landmark && presence != null)
|
||||
@@ -772,7 +768,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"userInfo for agent uuid {0} unexpectedly null in CreateNewInventoryItem",
|
||||
"ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem",
|
||||
remoteClient.AgentId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -967,9 +967,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// if (teleport success) // seems to be always success here
|
||||
// the user may change their profile information in other region,
|
||||
// so the userinfo in UserProfileCache is not reliable any more, delete it
|
||||
|
||||
// REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
|
||||
if (avatar.Scene.NeedSceneCacheClear(avatar.UUID))
|
||||
{
|
||||
m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID);
|
||||
m_log.DebugFormat(
|
||||
"[SCENE COMMUNICATION SERVICE]: User {0} is going to another region, profile cache removed",
|
||||
avatar.UUID);
|
||||
@@ -1404,11 +1405,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agent.Scene.NotifyMyCoarseLocationChange();
|
||||
// the user may change their profile information in other region,
|
||||
// so the userinfo in UserProfileCache is not reliable any more, delete it
|
||||
// REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
|
||||
if (agent.Scene.NeedSceneCacheClear(agent.UUID))
|
||||
{
|
||||
agent.Scene.CommsManager.UserProfileCacheService.RemoveUser(agent.UUID);
|
||||
m_log.DebugFormat(
|
||||
"[SCENE COMM]: User {0} is going to another region, profile cache removed", agent.UUID);
|
||||
"[SCENE COMM]: User {0} is going to another region", agent.UUID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ using OpenSim.Region.Framework.Scenes.Animation;
|
||||
using OpenSim.Region.Framework.Scenes.Types;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
@@ -2870,11 +2871,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// For now, assign god level 200 to anyone
|
||||
// who is granted god powers, but has no god level set.
|
||||
//
|
||||
CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(agentID);
|
||||
if (profile.UserProfile.GodLevel > 0)
|
||||
m_godlevel = profile.UserProfile.GodLevel;
|
||||
else
|
||||
m_godlevel = 200;
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, agentID);
|
||||
if (account != null)
|
||||
{
|
||||
if (account.UserLevel > 0)
|
||||
m_godlevel = account.UserLevel;
|
||||
else
|
||||
m_godlevel = 200;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user