take friends out of basicDOSprot (too little, too late)
parent
35f5d4449b
commit
afb1d6cdd7
|
@ -42,22 +42,27 @@ using log4net;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Avatar.Friends
|
namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
{
|
{
|
||||||
public class FriendsRequestHandler : BaseStreamHandlerBasicDOSProtector
|
|
||||||
|
// public class FriendsRequestHandler : BaseStreamHandlerBasicDOSProtector
|
||||||
|
public class FriendsRequestHandler : BaseStreamHandler
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private FriendsModule m_FriendsModule;
|
private FriendsModule m_FriendsModule;
|
||||||
|
/*
|
||||||
|
public FriendsRequestHandler(FriendsModule fmodule)
|
||||||
|
: base("POST", "/friends", new BasicDosProtectorOptions()
|
||||||
|
{
|
||||||
|
AllowXForwardedFor = true,
|
||||||
|
ForgetTimeSpan = TimeSpan.FromMinutes(2),
|
||||||
|
MaxRequestsInTimeframe = 20,
|
||||||
|
ReportingName = "FRIENDSDOSPROTECTOR",
|
||||||
|
RequestTimeSpan = TimeSpan.FromSeconds(5),
|
||||||
|
ThrottledAction = BasicDOSProtector.ThrottleAction.DoThrottledMethod
|
||||||
|
})
|
||||||
|
*/
|
||||||
public FriendsRequestHandler(FriendsModule fmodule)
|
public FriendsRequestHandler(FriendsModule fmodule)
|
||||||
: base("POST", "/friends", new BasicDosProtectorOptions()
|
: base("POST", "/friends")
|
||||||
{
|
|
||||||
AllowXForwardedFor = true,
|
|
||||||
ForgetTimeSpan = TimeSpan.FromMinutes(2),
|
|
||||||
MaxRequestsInTimeframe = 20,
|
|
||||||
ReportingName = "FRIENDSDOSPROTECTOR",
|
|
||||||
RequestTimeSpan = TimeSpan.FromSeconds(5),
|
|
||||||
ThrottledAction = BasicDOSProtector.ThrottleAction.DoThrottledMethod
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
m_FriendsModule = fmodule;
|
m_FriendsModule = fmodule;
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,6 +170,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
// we do this only for the root agent
|
// we do this only for the root agent
|
||||||
if (m_Friends[agentID].Refcount == 1)
|
if (m_Friends[agentID].Refcount == 1)
|
||||||
{
|
{
|
||||||
|
IUserManagement uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
|
||||||
|
if(uMan == null)
|
||||||
|
return true;
|
||||||
// We need to preload the user management cache with the names
|
// We need to preload the user management cache with the names
|
||||||
// of foreign friends, just like we do with SOPs' creators
|
// of foreign friends, just like we do with SOPs' creators
|
||||||
foreach (FriendInfo finfo in m_Friends[agentID].Friends)
|
foreach (FriendInfo finfo in m_Friends[agentID].Friends)
|
||||||
|
@ -182,8 +185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty;
|
string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty;
|
||||||
if (Util.ParseUniversalUserIdentifier(finfo.Friend, out id, out url, out first, out last, out tmp))
|
if (Util.ParseUniversalUserIdentifier(finfo.Friend, out id, out url, out first, out last, out tmp))
|
||||||
{
|
{
|
||||||
IUserManagement uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
|
// m_log.DebugFormat("[HGFRIENDS MODULE]: caching {0}", finfo.Friend);
|
||||||
m_log.DebugFormat("[HGFRIENDS MODULE]: caching {0}", finfo.Friend);
|
|
||||||
uMan.AddUser(id, url + ";" + first + " " + last);
|
uMan.AddUser(id, url + ";" + first + " " + last);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue