diff options
author | Dr Scofield | 2008-05-23 16:07:47 +0000 |
---|---|---|
committer | Dr Scofield | 2008-05-23 16:07:47 +0000 |
commit | 09188d5d10e279583c0e6074d38a1ac99abb7e43 (patch) | |
tree | f2bfcd205cac6657d219d9b20086d362915bf51d /OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs | |
parent | *Refactor of the LandManagementModule that allows OpenSim to run without it (diff) | |
download | opensim-SC_OLD-09188d5d10e279583c0e6074d38a1ac99abb7e43.zip opensim-SC_OLD-09188d5d10e279583c0e6074d38a1ac99abb7e43.tar.gz opensim-SC_OLD-09188d5d10e279583c0e6074d38a1ac99abb7e43.tar.bz2 opensim-SC_OLD-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/Modules/Avatar/Chat/ChatModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs index 37cf328..8216222 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs | |||
@@ -65,7 +65,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
65 | m_scenes.Add(scene); | 65 | m_scenes.Add(scene); |
66 | scene.EventManager.OnNewClient += NewClient; | 66 | scene.EventManager.OnNewClient += NewClient; |
67 | scene.EventManager.OnChatFromWorld += SimChat; | 67 | scene.EventManager.OnChatFromWorld += SimChat; |
68 | // scene.RegisterModuleInterface<ISimChat>(this); | ||
69 | } | 68 | } |
70 | 69 | ||
71 | // wrap this in a try block so that defaults will work if | 70 | // wrap this in a try block so that defaults will work if |
@@ -108,8 +107,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
108 | public void SimChat(Object sender, ChatFromViewerArgs e) | 107 | public void SimChat(Object sender, ChatFromViewerArgs e) |
109 | { | 108 | { |
110 | ScenePresence avatar = null; | 109 | ScenePresence avatar = null; |
111 | |||
112 | //TODO: Move ForEachScenePresence and others into IScene. | ||
113 | Scene scene = (Scene) e.Scene; | 110 | Scene scene = (Scene) e.Scene; |
114 | 111 | ||
115 | //TODO: Remove the need for this check | 112 | //TODO: Remove the need for this check |