aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorDr Scofield2008-05-23 16:07:47 +0000
committerDr Scofield2008-05-23 16:07:47 +0000
commit09188d5d10e279583c0e6074d38a1ac99abb7e43 (patch)
treef2bfcd205cac6657d219d9b20086d362915bf51d /OpenSim/Region/Environment/Scenes
parent*Refactor of the LandManagementModule that allows OpenSim to run without it (diff)
downloadopensim-SC-09188d5d10e279583c0e6074d38a1ac99abb7e43.zip
opensim-SC-09188d5d10e279583c0e6074d38a1ac99abb7e43.tar.gz
opensim-SC-09188d5d10e279583c0e6074d38a1ac99abb7e43.tar.bz2
opensim-SC-09188d5d10e279583c0e6074d38a1ac99abb7e43.tar.xz
IRCBridgeModule (and ChatModule before the refactoring) didn't succeed in
finding out which region a new avatar was logging in to; the same problem occurred when the client/avatar logged out. the reason was mani-fold: - Scene.AddNewClient(...) would call SubscribeToClientEvents(client) which would subscribe to all client events and then call TriggerOnNewClient(...) BEFORE the ScenePresence object had even been created and added. i've moved the TriggerOnNewClient() call to the end of Scene.AddNewClient() - Scene.AddNewClient(...) is called with child == true; a later call to ScenePresence.MakeRootAgent() will turn child to false. When OnNewClient is triggered, child is still true, causing IRCBridgeModule's FindClientRegion to ignore the ScenePresence of the new avatar. i've changed IRCBridgeModule to still use OnNewClient and also OnLogout and OnConnectionClosed but only to signal that the avatar has logged on (logged off respectively). to track whether an avatar has actually entered a region i've added EventManager.OnMakeRootAgent (complementing OnMakeChildAgent). also, i've cleaned up the internal IRCModule code a bit. currently it still uses IClientAPI.SendChatMessage() which replicates the code in ChatModule, that needs to be changed to use TriggerOnChatFromWorld().
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/EventManager.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs2
3 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs
index f8eef82..6c714f8 100644
--- a/OpenSim/Region/Environment/Scenes/EventManager.cs
+++ b/OpenSim/Region/Environment/Scenes/EventManager.cs
@@ -156,7 +156,11 @@ namespace OpenSim.Region.Environment.Scenes
156 156
157 public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; 157 public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent;
158 158
159 public event OnNewPresenceDelegate OnMakeChildAgent; 159 public delegate void OnMakeChildAgentDelegate(ScenePresence presence);
160 public event OnMakeChildAgentDelegate OnMakeChildAgent;
161
162 public delegate void OnMakeRootAgentDelegate(ScenePresence presence);
163 public event OnMakeRootAgentDelegate OnMakeRootAgent;
160 164
161 public delegate void NewInventoryItemUploadComplete(LLUUID avatarID, LLUUID assetID, string name, int userlevel); 165 public delegate void NewInventoryItemUploadComplete(LLUUID avatarID, LLUUID assetID, string name, int userlevel);
162 166
@@ -307,7 +311,8 @@ namespace OpenSim.Region.Environment.Scenes
307 private NewGridInstantMessage handlerGridInstantMessageToIM = null; //OnGridInstantMessageToIMModule; 311 private NewGridInstantMessage handlerGridInstantMessageToIM = null; //OnGridInstantMessageToIMModule;
308 private NewGridInstantMessage handlerGridInstantMessageToFriends = null; //OnGridInstantMessageToFriendsModule; 312 private NewGridInstantMessage handlerGridInstantMessageToFriends = null; //OnGridInstantMessageToFriendsModule;
309 private ClientClosed handlerClientClosed = null; //OnClientClosed; 313 private ClientClosed handlerClientClosed = null; //OnClientClosed;
310 private OnNewPresenceDelegate handlerMakeChildAgent = null; //OnMakeChildAgent; 314 private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent;
315 private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent;
311 private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick; 316 private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick;
312 private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps; 317 private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps;
313 private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps; 318 private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps;
@@ -574,6 +579,15 @@ namespace OpenSim.Region.Environment.Scenes
574 } 579 }
575 } 580 }
576 581
582 public void TriggerOnMakeRootAgent(ScenePresence presence)
583 {
584 handlerMakeRootAgent = OnMakeRootAgent;
585 if (handlerMakeRootAgent != null)
586 {
587 handlerMakeRootAgent(presence);
588 }
589 }
590
577 public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps) 591 public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps)
578 { 592 {
579 handlerRegisterCaps = OnRegisterCaps; 593 handlerRegisterCaps = OnRegisterCaps;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index fe8cada..71c5b18 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1582,6 +1582,7 @@ namespace OpenSim.Region.Environment.Scenes
1582 1582
1583 CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); 1583 CommsManager.UserProfileCacheService.AddNewUser(client.AgentId);
1584 } 1584 }
1585 EventManager.TriggerOnNewClient(client);
1585 } 1586 }
1586 1587
1587 protected virtual void SubscribeToClientEvents(IClientAPI client) 1588 protected virtual void SubscribeToClientEvents(IClientAPI client)
@@ -1660,7 +1661,7 @@ namespace OpenSim.Region.Environment.Scenes
1660 client.OnUndo += m_innerScene.HandleUndo; 1661 client.OnUndo += m_innerScene.HandleUndo;
1661 client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; 1662 client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
1662 1663
1663 EventManager.TriggerOnNewClient(client); 1664 // EventManager.TriggerOnNewClient(client);
1664 } 1665 }
1665 1666
1666 public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client) 1667 public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 103068c..a692b33 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -590,6 +590,8 @@ namespace OpenSim.Region.Environment.Scenes
590 //{ 590 //{
591 m_scene.SendAllSceneObjectsToClient(this); 591 m_scene.SendAllSceneObjectsToClient(this);
592 592
593 m_scene.EventManager.TriggerOnMakeRootAgent(this);
594
593 //m_gotAllObjectsInScene = true; 595 //m_gotAllObjectsInScene = true;
594 //} 596 //}
595 } 597 }