mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
This commit is contained in:
@@ -145,6 +145,17 @@ namespace OpenSim.Server.Handlers.Login
|
||||
return FailedXMLRPCResponse();
|
||||
|
||||
}
|
||||
public XmlRpcResponse HandleXMLRPCLoginBlocked(XmlRpcRequest request, IPEndPoint client)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable resp = new Hashtable();
|
||||
|
||||
resp["reason"] = "presence";
|
||||
resp["message"] = "Logins are currently restricted. Please try again later.";
|
||||
resp["login"] = "false";
|
||||
response.Value = resp;
|
||||
return response;
|
||||
}
|
||||
|
||||
public XmlRpcResponse HandleXMLRPCSetLoginLevel(XmlRpcRequest request, IPEndPoint remoteClient)
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace OpenSim.Server.Handlers.Login
|
||||
|
||||
private ILoginService m_LoginService;
|
||||
private bool m_Proxy;
|
||||
private BasicDosProtectorOptions m_DosProtectionOptions;
|
||||
|
||||
public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
|
||||
base(config, server, String.Empty)
|
||||
@@ -88,6 +89,16 @@ namespace OpenSim.Server.Handlers.Login
|
||||
throw new Exception(String.Format("No LocalServiceModule for LoginService in config file"));
|
||||
|
||||
m_Proxy = serverConfig.GetBoolean("HasProxy", false);
|
||||
m_DosProtectionOptions = new BasicDosProtectorOptions();
|
||||
// Dos Protection Options
|
||||
m_DosProtectionOptions.AllowXForwardedFor = serverConfig.GetBoolean("DOSAllowXForwardedForHeader", false);
|
||||
m_DosProtectionOptions.RequestTimeSpan =
|
||||
TimeSpan.FromMilliseconds(serverConfig.GetInt("DOSRequestTimeFrameMS", 10000));
|
||||
m_DosProtectionOptions.MaxRequestsInTimeframe = serverConfig.GetInt("DOSMaxRequestsInTimeFrame", 5);
|
||||
m_DosProtectionOptions.ForgetTimeSpan =
|
||||
TimeSpan.FromMilliseconds(serverConfig.GetInt("DOSForgiveClientAfterMS", 120000));
|
||||
m_DosProtectionOptions.ReportingName = "LOGINDOSPROTECTION";
|
||||
|
||||
|
||||
return loginService;
|
||||
}
|
||||
@@ -95,7 +106,9 @@ namespace OpenSim.Server.Handlers.Login
|
||||
private void InitializeHandlers(IHttpServer server)
|
||||
{
|
||||
LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Proxy);
|
||||
server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false);
|
||||
server.AddXmlRPCHandler("login_to_simulator",
|
||||
new XmlRpcBasicDOSProtector(loginHandlers.HandleXMLRPCLogin,loginHandlers.HandleXMLRPCLoginBlocked,
|
||||
m_DosProtectionOptions).Process, false);
|
||||
server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false);
|
||||
server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin);
|
||||
server.AddWebSocketHandler("/WebSocket/GridLogin", loginHandlers.HandleWebSocketLoginEvents);
|
||||
|
||||
Reference in New Issue
Block a user