aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/EventQueue
diff options
context:
space:
mode:
authorBlueWall2012-11-25 17:03:14 -0500
committerBlueWall2012-11-25 17:03:14 -0500
commitc754003944d0166bf50b4f94b0c0eea642503bb0 (patch)
treedfa1c2020d5500d510519d5b2b3236600692f277 /OpenSim/Region/ClientStack/Linden/Caps/EventQueue
parentMerge branch 'master' into connector_plugin (diff)
parentCombine TestDeleteSceneObjectAsync() with TestDeRezSceneObject() as they are ... (diff)
downloadopensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.zip
opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.gz
opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.bz2
opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.xz
Merge branch 'master' into connector_plugin
Conflicts: OpenSim/Server/Base/ServicesServerBase.cs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/EventQueue')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs91
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs2
2 files changed, 39 insertions, 54 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 47cb049..4d2c0f2 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -55,8 +55,8 @@ namespace OpenSim.Region.ClientStack.Linden
55 public OSDMap body; 55 public OSDMap body;
56 } 56 }
57 57
58 //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 58 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EventQueueGetModule")]
59 public class EventQueueGetModule : IEventQueue, IRegionModule 59 public class EventQueueGetModule : IEventQueue, INonSharedRegionModule
60 { 60 {
61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
62 62
@@ -66,8 +66,6 @@ namespace OpenSim.Region.ClientStack.Linden
66 public int DebugLevel { get; set; } 66 public int DebugLevel { get; set; }
67 67
68 protected Scene m_scene; 68 protected Scene m_scene;
69 private IConfigSource m_gConfig;
70 bool enabledYN;
71 69
72 private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>(); 70 private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>();
73 71
@@ -75,60 +73,46 @@ namespace OpenSim.Region.ClientStack.Linden
75 private Dictionary<UUID, UUID> m_QueueUUIDAvatarMapping = new Dictionary<UUID, UUID>(); 73 private Dictionary<UUID, UUID> m_QueueUUIDAvatarMapping = new Dictionary<UUID, UUID>();
76 private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>(); 74 private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>();
77 75
78 #region IRegionModule methods 76 #region INonSharedRegionModule methods
79 public virtual void Initialise(Scene scene, IConfigSource config) 77 public virtual void Initialise(IConfigSource config)
80 { 78 {
81 m_gConfig = config; 79 }
82
83 IConfig startupConfig = m_gConfig.Configs["Startup"];
84
85 ReadConfigAndPopulate(scene, startupConfig, "Startup");
86
87 if (enabledYN)
88 {
89 m_scene = scene;
90 scene.RegisterModuleInterface<IEventQueue>(this);
91
92 // Register fallback handler
93 // Why does EQG Fail on region crossings!
94
95 //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack);
96
97// scene.EventManager.OnNewClient += OnNewClient;
98
99 // TODO: Leaving these open, or closing them when we
100 // become a child is incorrect. It messes up TP in a big
101 // way. CAPS/EQ need to be active as long as the UDP
102 // circuit is there.
103 80
104 scene.EventManager.OnClientClosed += ClientClosed; 81 public void AddRegion(Scene scene)
105 82 {
106 scene.EventManager.OnMakeChildAgent += MakeChildAgent; 83 m_scene = scene;
107 scene.EventManager.OnRegisterCaps += OnRegisterCaps; 84 scene.RegisterModuleInterface<IEventQueue>(this);
108 85
109 MainConsole.Instance.Commands.AddCommand( 86 scene.EventManager.OnClientClosed += ClientClosed;
110 "Debug", 87 scene.EventManager.OnMakeChildAgent += MakeChildAgent;
111 false, 88 scene.EventManager.OnRegisterCaps += OnRegisterCaps;
112 "debug eq", 89
113 "debug eq [0|1|2]", 90 MainConsole.Instance.Commands.AddCommand(
114 "Turn on event queue debugging\n" 91 "Debug",
115 + " <= 0 - turns off all event queue logging\n" 92 false,
116 + " >= 1 - turns on outgoing event logging\n" 93 "debug eq",
117 + " >= 2 - turns on poll notification", 94 "debug eq [0|1|2]",
118 HandleDebugEq); 95 "Turn on event queue debugging\n"
119 } 96 + " <= 0 - turns off all event queue logging\n"
120 else 97 + " >= 1 - turns on outgoing event logging\n"
121 { 98 + " >= 2 - turns on poll notification",
122 m_gConfig = null; 99 HandleDebugEq);
123 }
124 } 100 }
125 101
126 private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) 102 public void RemoveRegion(Scene scene)
127 { 103 {
128 enabledYN = startupConfig.GetBoolean("EventQueue", true); 104 if (m_scene != scene)
105 return;
106
107 scene.EventManager.OnClientClosed -= ClientClosed;
108 scene.EventManager.OnMakeChildAgent -= MakeChildAgent;
109 scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
110
111 scene.UnregisterModuleInterface<IEventQueue>(this);
112 m_scene = null;
129 } 113 }
130 114
131 public void PostInitialise() 115 public void RegionLoaded(Scene scene)
132 { 116 {
133 } 117 }
134 118
@@ -141,10 +125,11 @@ namespace OpenSim.Region.ClientStack.Linden
141 get { return "EventQueueGetModule"; } 125 get { return "EventQueueGetModule"; }
142 } 126 }
143 127
144 public bool IsSharedModule 128 public Type ReplaceableInterface
145 { 129 {
146 get { return false; } 130 get { return null; }
147 } 131 }
132
148 #endregion 133 #endregion
149 134
150 protected void HandleDebugEq(string module, string[] args) 135 protected void HandleDebugEq(string module, string[] args)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
index d604cf6..ed8ec16 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
@@ -44,7 +44,7 @@ using OpenSim.Tests.Common.Mock;
44namespace OpenSim.Region.ClientStack.Linden.Tests 44namespace OpenSim.Region.ClientStack.Linden.Tests
45{ 45{
46 [TestFixture] 46 [TestFixture]
47 public class EventQueueTests 47 public class EventQueueTests : OpenSimTestCase
48 { 48 {
49 private TestScene m_scene; 49 private TestScene m_scene;
50 50