aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Client/MXP/PacketHandler
diff options
context:
space:
mode:
authorDr Scofield2009-05-05 16:17:52 +0000
committerDr Scofield2009-05-05 16:17:52 +0000
commite0a06f641668cd5c25a7854af2faf8a61c4053ee (patch)
treec2a4620c4bdc0e479ca16528cd9e0524529a7998 /OpenSim/Client/MXP/PacketHandler
parent* Fix http://opensimulator.org/mantis/view.php?id=3585 (diff)
downloadopensim-SC_OLD-e0a06f641668cd5c25a7854af2faf8a61c4053ee.zip
opensim-SC_OLD-e0a06f641668cd5c25a7854af2faf8a61c4053ee.tar.gz
opensim-SC_OLD-e0a06f641668cd5c25a7854af2faf8a61c4053ee.tar.bz2
opensim-SC_OLD-e0a06f641668cd5c25a7854af2faf8a61c4053ee.tar.xz
- 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
Diffstat (limited to 'OpenSim/Client/MXP/PacketHandler')
-rw-r--r--OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
index 5167f42..2f60810 100644
--- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
+++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
@@ -312,6 +312,8 @@ namespace OpenSim.Client.MXP.PacketHandler
312 { 312 {
313 Scene scene = m_scenes[sceneId]; 313 Scene scene = m_scenes[sceneId];
314 UUID mxpSessionID = UUID.Random(); 314 UUID mxpSessionID = UUID.Random();
315
316 string reason;
315 317
316 m_log.Debug("[MXP ClientStack]: Session join request success: " + session.SessionId + " (" + 318 m_log.Debug("[MXP ClientStack]: Session join request success: " + session.SessionId + " (" +
317 (session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" + 319 (session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" +
@@ -321,7 +323,13 @@ namespace OpenSim.Client.MXP.PacketHandler
321 AttachUserAgentToUserProfile(session, mxpSessionID, sceneId, user); 323 AttachUserAgentToUserProfile(session, mxpSessionID, sceneId, user);
322 m_log.Debug("[MXP ClientStack]: Attached UserAgent to UserProfile."); 324 m_log.Debug("[MXP ClientStack]: Attached UserAgent to UserProfile.");
323 m_log.Debug("[MXP ClientStack]: Preparing Scene to Connection..."); 325 m_log.Debug("[MXP ClientStack]: Preparing Scene to Connection...");
324 PrepareSceneForConnection(mxpSessionID, sceneId, user); 326 if (!PrepareSceneForConnection(mxpSessionID, sceneId, user, out reason))
327 {
328 m_log.DebugFormat("[MXP ClientStack]: Scene refused connection: {0}", reason);
329 DeclineConnection(session, joinRequestMessage);
330 tmpRemove.Add(session);
331 continue;
332 }
325 m_log.Debug("[MXP ClientStack]: Prepared Scene to Connection."); 333 m_log.Debug("[MXP ClientStack]: Prepared Scene to Connection.");
326 m_log.Debug("[MXP ClientStack]: Accepting connection..."); 334 m_log.Debug("[MXP ClientStack]: Accepting connection...");
327 AcceptConnection(session, joinRequestMessage, mxpSessionID, userId); 335 AcceptConnection(session, joinRequestMessage, mxpSessionID, userId);
@@ -579,7 +587,7 @@ namespace OpenSim.Client.MXP.PacketHandler
579 //userService.CommitAgent(ref userProfile); 587 //userService.CommitAgent(ref userProfile);
580 } 588 }
581 589
582 private void PrepareSceneForConnection(UUID sessionId, UUID sceneId, UserProfileData userProfile) 590 private bool PrepareSceneForConnection(UUID sessionId, UUID sceneId, UserProfileData userProfile, out string reason)
583 { 591 {
584 Scene scene = m_scenes[sceneId]; 592 Scene scene = m_scenes[sceneId];
585 CommunicationsManager commsManager = m_scenes[sceneId].CommsManager; 593 CommunicationsManager commsManager = m_scenes[sceneId].CommsManager;
@@ -603,9 +611,8 @@ namespace OpenSim.Client.MXP.PacketHandler
603 m_log.WarnFormat("[INTER]: Appearance not found for {0} {1}. Creating default.", agent.firstname, agent.lastname); 611 m_log.WarnFormat("[INTER]: Appearance not found for {0} {1}. Creating default.", agent.firstname, agent.lastname);
604 agent.Appearance = new AvatarAppearance(); 612 agent.Appearance = new AvatarAppearance();
605 } 613 }
606 614
607 scene.NewUserConnection(agent); 615 return scene.NewUserConnection(agent, out reason);
608
609 } 616 }
610 617
611 public void PrintDebugInformation() 618 public void PrintDebugInformation()