mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
- moving banned check and public/private check to
Scene.NewUserConnection() - adding reason reporting this enforces estate bans very early on and prevents us from circulating client objects that we'd then have to retract once we realize that the client is not allowed into the region
This commit is contained in:
@@ -208,21 +208,22 @@ namespace OpenSim.Client.Linden
|
||||
{
|
||||
denyMess = "User is banned from this region";
|
||||
m_log.InfoFormat(
|
||||
"[CLIENT]: Denying access for user {0} {1} because user is banned",
|
||||
agentData.firstname, agentData.lastname);
|
||||
"[CLIENT]: Denying access for user {0} {1} because user is banned",
|
||||
agentData.firstname, agentData.lastname);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (scene.NewUserConnection(agentData))
|
||||
string reason;
|
||||
if (scene.NewUserConnection(agentData, out reason))
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
denyMess = "Login refused by region";
|
||||
denyMess = String.Format("Login refused by region: {0}", reason);
|
||||
m_log.InfoFormat(
|
||||
"[CLIENT]: Denying access for user {0} {1} because user connection was refused by the region",
|
||||
agentData.firstname, agentData.lastname);
|
||||
"[CLIENT]: Denying access for user {0} {1} because user connection was refused by the region",
|
||||
agentData.firstname, agentData.lastname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,13 +154,14 @@ namespace OpenSim.Client.Linden
|
||||
}
|
||||
}
|
||||
|
||||
public bool NewUserConnection(ulong regionHandle, AgentCircuitData agent)
|
||||
public bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason)
|
||||
{
|
||||
Scene scene;
|
||||
if (TryGetRegion(regionHandle, out scene))
|
||||
{
|
||||
return scene.NewUserConnection(agent);
|
||||
return scene.NewUserConnection(agent, out reason);
|
||||
}
|
||||
reason = "Region not found.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,15 @@ namespace OpenSim.Client.Linden
|
||||
|
||||
if (m_regionsConnector.RegionLoginsEnabled)
|
||||
{
|
||||
return m_regionsConnector.NewUserConnection(regionInfo.RegionHandle, agent);
|
||||
string reason;
|
||||
bool success = m_regionsConnector.NewUserConnection(regionInfo.RegionHandle, agent, out reason);
|
||||
if (!success)
|
||||
{
|
||||
response.ErrorReason = "key";
|
||||
response.ErrorMessage = reason;
|
||||
}
|
||||
return success;
|
||||
// return m_regionsConnector.NewUserConnection(regionInfo.RegionHandle, agent, out reason);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user