- 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:
Dr Scofield
2009-05-05 16:17:52 +00:00
parent b6ae8b7ba7
commit e0a06f6416
19 changed files with 186 additions and 131 deletions

View File

@@ -312,6 +312,8 @@ namespace OpenSim.Client.MXP.PacketHandler
{
Scene scene = m_scenes[sceneId];
UUID mxpSessionID = UUID.Random();
string reason;
m_log.Debug("[MXP ClientStack]: Session join request success: " + session.SessionId + " (" +
(session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" +
@@ -321,7 +323,13 @@ namespace OpenSim.Client.MXP.PacketHandler
AttachUserAgentToUserProfile(session, mxpSessionID, sceneId, user);
m_log.Debug("[MXP ClientStack]: Attached UserAgent to UserProfile.");
m_log.Debug("[MXP ClientStack]: Preparing Scene to Connection...");
PrepareSceneForConnection(mxpSessionID, sceneId, user);
if (!PrepareSceneForConnection(mxpSessionID, sceneId, user, out reason))
{
m_log.DebugFormat("[MXP ClientStack]: Scene refused connection: {0}", reason);
DeclineConnection(session, joinRequestMessage);
tmpRemove.Add(session);
continue;
}
m_log.Debug("[MXP ClientStack]: Prepared Scene to Connection.");
m_log.Debug("[MXP ClientStack]: Accepting connection...");
AcceptConnection(session, joinRequestMessage, mxpSessionID, userId);
@@ -579,7 +587,7 @@ namespace OpenSim.Client.MXP.PacketHandler
//userService.CommitAgent(ref userProfile);
}
private void PrepareSceneForConnection(UUID sessionId, UUID sceneId, UserProfileData userProfile)
private bool PrepareSceneForConnection(UUID sessionId, UUID sceneId, UserProfileData userProfile, out string reason)
{
Scene scene = m_scenes[sceneId];
CommunicationsManager commsManager = m_scenes[sceneId].CommsManager;
@@ -603,9 +611,8 @@ namespace OpenSim.Client.MXP.PacketHandler
m_log.WarnFormat("[INTER]: Appearance not found for {0} {1}. Creating default.", agent.firstname, agent.lastname);
agent.Appearance = new AvatarAppearance();
}
scene.NewUserConnection(agent);
return scene.NewUserConnection(agent, out reason);
}
public void PrintDebugInformation()