From 09188d5d10e279583c0e6074d38a1ac99abb7e43 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 23 May 2008 16:07:47 +0000 Subject: 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(). --- OpenSim/Region/Environment/Scenes/Scene.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') 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 CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); } + EventManager.TriggerOnNewClient(client); } protected virtual void SubscribeToClientEvents(IClientAPI client) @@ -1660,7 +1661,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnUndo += m_innerScene.HandleUndo; client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; - EventManager.TriggerOnNewClient(client); + // EventManager.TriggerOnNewClient(client); } public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client) -- cgit v1.1