Merge branch 'master' into lickx
This commit is contained in:
@@ -64,7 +64,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
readonly Dictionary<UUID, UUID> m_classifiedCache = new();
|
readonly Dictionary<UUID, UUID> m_classifiedCache = new();
|
||||||
readonly Dictionary<UUID, int> m_classifiedInterest = new();
|
readonly Dictionary<UUID, int> m_classifiedInterest = new();
|
||||||
readonly ExpiringCacheOS<UUID, UserProfileCacheEntry> m_profilesCache = new(60000);
|
readonly ExpiringCacheOS<UUID, UserProfileCacheEntry> m_profilesCache = new(60000);
|
||||||
|
|
||||||
IGroupsModule m_groupsModule = null;
|
IGroupsModule m_groupsModule = null;
|
||||||
|
IUserManagement m_userManagementModule = null;
|
||||||
|
|
||||||
private readonly JsonRpcRequestManager rpc = new();
|
private readonly JsonRpcRequestManager rpc = new();
|
||||||
private bool m_allowUserProfileWebURLs = true;
|
private bool m_allowUserProfileWebURLs = true;
|
||||||
@@ -231,16 +233,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
IProfileModule ProfileModule
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
IUserManagement UserManagementModule
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this
|
/// Gets or sets a value indicating whether this
|
||||||
/// <see cref="OpenSim.Region.Coremodules.UserProfiles.UserProfileModule"/> is enabled.
|
/// <see cref="OpenSim.Region.Coremodules.UserProfiles.UserProfileModule"/> is enabled.
|
||||||
@@ -318,10 +310,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
Scene = scene;
|
Scene = scene;
|
||||||
m_thisGridInfo ??= scene.SceneGridInfo;
|
m_thisGridInfo ??= scene.SceneGridInfo;
|
||||||
Scene.RegisterModuleInterface<IProfileModule>(this);
|
Scene.RegisterModuleInterface<IProfileModule>(this);
|
||||||
Scene.EventManager.OnNewClient += OnNewClient;
|
|
||||||
Scene.EventManager.OnClientClosed += OnClientClosed;
|
|
||||||
|
|
||||||
UserManagementModule = Scene.RequestModuleInterface<IUserManagement>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -353,7 +341,19 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
{
|
{
|
||||||
if(!Enabled)
|
if(!Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_groupsModule = Scene.RequestModuleInterface<IGroupsModule>();
|
m_groupsModule = Scene.RequestModuleInterface<IGroupsModule>();
|
||||||
|
|
||||||
|
m_userManagementModule = Scene.RequestModuleInterface<IUserManagement>();
|
||||||
|
if(m_userManagementModule is null)
|
||||||
|
{
|
||||||
|
m_log.Error("[UserProfileModule]: UserManagementModule not loaded. Profiles Disabled");
|
||||||
|
Enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Scene.EventManager.OnNewClient += OnNewClient;
|
||||||
|
Scene.EventManager.OnClientClosed += OnClientClosed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -429,7 +429,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
|
|
||||||
void OnClientClosed(UUID AgentId, Scene scene)
|
void OnClientClosed(UUID AgentId, Scene scene)
|
||||||
{
|
{
|
||||||
ScenePresence sp = scene.GetScenePresence(AgentId);
|
if(!scene.TryGetScenePresence(AgentId, out ScenePresence sp))
|
||||||
|
return;
|
||||||
|
|
||||||
IClientAPI client = sp.ControllingClient;
|
IClientAPI client = sp.ControllingClient;
|
||||||
if (client is null)
|
if (client is null)
|
||||||
return;
|
return;
|
||||||
@@ -1219,9 +1221,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
|
|
||||||
UserProfilePick pick = null;
|
UserProfilePick pick = null;
|
||||||
Dictionary<UUID, string> curpicks = GetPicks(creatorID);
|
Dictionary<UUID, string> curpicks = GetPicks(creatorID);
|
||||||
if(!curpicks.ContainsKey(pickID))
|
if(curpicks is not null && !curpicks.ContainsKey(pickID))
|
||||||
{
|
{
|
||||||
if(curpicks is not null && curpicks.Count >= Constants.MaxProfilePicks)
|
if(curpicks.Count >= Constants.MaxProfilePicks)
|
||||||
{
|
{
|
||||||
remoteClient.SendAvatarPicksReply(remoteClient.AgentId, curpicks);
|
remoteClient.SendAvatarPicksReply(remoteClient.AgentId, curpicks);
|
||||||
return;
|
return;
|
||||||
@@ -1643,17 +1645,23 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
agent = avatarID,
|
agent = avatarID,
|
||||||
reqtype = 0
|
reqtype = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
m_asyncRequests.Push(req);
|
m_asyncRequests.Push(req);
|
||||||
|
|
||||||
if (Monitor.TryEnter(m_asyncRequestsLock))
|
if (Monitor.TryEnter(m_asyncRequestsLock))
|
||||||
{
|
{
|
||||||
if (!m_asyncRequestsRunning)
|
try
|
||||||
{
|
{
|
||||||
m_asyncRequestsRunning = true;
|
if (!m_asyncRequestsRunning)
|
||||||
Util.FireAndForget(x => ProcessRequests());
|
{
|
||||||
|
m_asyncRequestsRunning = true;
|
||||||
|
Util.FireAndForget(x => ProcessRequests());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Monitor.Exit(m_asyncRequestsLock);
|
||||||
}
|
}
|
||||||
Monitor.Exit(m_asyncRequestsLock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1877,7 +1885,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
bool GetUserAccountData(UUID userID, out UserAccount account)
|
bool GetUserAccountData(UUID userID, out UserAccount account)
|
||||||
{
|
{
|
||||||
account = null;
|
account = null;
|
||||||
if (UserManagementModule.IsLocalGridUser(userID))
|
if (m_userManagementModule.IsLocalGridUser(userID))
|
||||||
{
|
{
|
||||||
// Is local
|
// Is local
|
||||||
IUserAccountService uas = Scene.UserAccountService;
|
IUserAccountService uas = Scene.UserAccountService;
|
||||||
@@ -1887,7 +1895,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Is Foreign
|
// Is Foreign
|
||||||
string home_url = UserManagementModule.GetUserServerURL(userID, "HomeURI", out bool recentFailedWeb);
|
string home_url = m_userManagementModule.GetUserServerURL(userID, "HomeURI", out bool recentFailedWeb);
|
||||||
if (recentFailedWeb || string.IsNullOrEmpty(home_url))
|
if (recentFailedWeb || string.IsNullOrEmpty(home_url))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -1901,7 +1909,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.Debug("[PROFILES]: GetUserInfo call failed ", e);
|
m_log.Debug("[PROFILES]: GetUserInfo call failed ", e);
|
||||||
UserManagementModule.UserWebFailed(userID);
|
m_userManagementModule.UserWebFailed(userID);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1937,9 +1945,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
/// </param>
|
/// </param>
|
||||||
bool GetUserProfileServerURI(UUID userID, out string serverURI)
|
bool GetUserProfileServerURI(UUID userID, out string serverURI)
|
||||||
{
|
{
|
||||||
if (!UserManagementModule.IsLocalGridUser(userID))
|
if (!m_userManagementModule.IsLocalGridUser(userID))
|
||||||
{
|
{
|
||||||
serverURI = UserManagementModule.GetUserServerURL(userID, "ProfileServerURI", out bool failed);
|
serverURI = m_userManagementModule.GetUserServerURL(userID, "ProfileServerURI", out bool failed);
|
||||||
if(failed)
|
if(failed)
|
||||||
serverURI = string.Empty;
|
serverURI = string.Empty;
|
||||||
// Is Foreign
|
// Is Foreign
|
||||||
@@ -1958,7 +1966,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
if(imageID.IsZero())
|
if(imageID.IsZero())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string assetServerURI = UserManagementModule.GetUserServerURL(agent, "AssetServerURI");
|
string assetServerURI = m_userManagementModule.GetUserServerURL(agent, "AssetServerURI");
|
||||||
if(string.IsNullOrWhiteSpace(assetServerURI))
|
if(string.IsNullOrWhiteSpace(assetServerURI))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1996,7 +2004,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||||||
|
|
||||||
if(client.SceneAgent is ScenePresence sp && sp.IsViewerUIGod)
|
if(client.SceneAgent is ScenePresence sp && sp.IsViewerUIGod)
|
||||||
{
|
{
|
||||||
Services.Interfaces.PresenceInfo[] pi = Scene.PresenceService?.GetAgents(new string[] { agent.ToString() });
|
Services.Interfaces.PresenceInfo[] pi = Scene.PresenceService?.GetAgents([agent.ToString()]);
|
||||||
return pi is not null && pi.Length > 0;
|
return pi is not null && pi.Length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user