diff options
author | lbsa71 | 2008-09-08 14:30:35 +0000 |
---|---|---|
committer | lbsa71 | 2008-09-08 14:30:35 +0000 |
commit | 8388fe0669f9d140028d1925284491b21a09a1bf (patch) | |
tree | 80c7729bef9b88a371c3f561322a97faf262ade6 | |
parent | Mantis #2144 (diff) | |
download | opensim-SC-8388fe0669f9d140028d1925284491b21a09a1bf.zip opensim-SC-8388fe0669f9d140028d1925284491b21a09a1bf.tar.gz opensim-SC-8388fe0669f9d140028d1925284491b21a09a1bf.tar.bz2 opensim-SC-8388fe0669f9d140028d1925284491b21a09a1bf.tar.xz |
* some if inversions and added {}'s for readability
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 36 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/RegionApplicationBase.cs | 25 | ||||
-rw-r--r-- | ThirdParty/3Di/LoadBalancer/TcpServer.cs | 8 | ||||
-rw-r--r-- | ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs | 60 |
7 files changed, 91 insertions, 60 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 7803d92..9451f00 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -71,8 +71,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
71 | m_configSource = openSim.ConfigSource.Source; | 71 | m_configSource = openSim.ConfigSource.Source; |
72 | try | 72 | try |
73 | { | 73 | { |
74 | if (m_configSource.Configs["RemoteAdmin"] != null && | 74 | if (m_configSource.Configs["RemoteAdmin"] == null || |
75 | m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false)) | 75 | !m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false)) |
76 | { | ||
77 | // No config or disabled | ||
78 | } | ||
79 | else | ||
76 | { | 80 | { |
77 | m_config = m_configSource.Configs["RemoteAdmin"]; | 81 | m_config = m_configSource.Configs["RemoteAdmin"]; |
78 | m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); | 82 | m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); |
@@ -110,8 +114,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
110 | checkStringParameters(request, new string[] { "password", "regionID" }); | 114 | checkStringParameters(request, new string[] { "password", "regionID" }); |
111 | 115 | ||
112 | if (requiredPassword != String.Empty && | 116 | if (requiredPassword != String.Empty && |
113 | (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) | 117 | (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword)) |
118 | { | ||
114 | throw new Exception("wrong password"); | 119 | throw new Exception("wrong password"); |
120 | } | ||
115 | 121 | ||
116 | UUID regionID = new UUID((string) requestData["regionID"]); | 122 | UUID regionID = new UUID((string) requestData["regionID"]); |
117 | 123 | ||
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 59ac161..8d2ce55 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -117,7 +117,9 @@ namespace OpenSim | |||
117 | msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n"; | 117 | msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n"; |
118 | Exception ex = (Exception)e.ExceptionObject; | 118 | Exception ex = (Exception)e.ExceptionObject; |
119 | if (ex.InnerException != null) | 119 | if (ex.InnerException != null) |
120 | { | ||
120 | msg += "InnerException: " + ex.InnerException.ToString() + "\r\n"; | 121 | msg += "InnerException: " + ex.InnerException.ToString() + "\r\n"; |
122 | } | ||
121 | 123 | ||
122 | msg += "\r\n"; | 124 | msg += "\r\n"; |
123 | msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n"; | 125 | msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n"; |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index edb29db..43c1d26 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -77,6 +77,7 @@ namespace OpenSim | |||
77 | 77 | ||
78 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); | 78 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); |
79 | } | 79 | } |
80 | |||
80 | base.ReadConfigSettings(); | 81 | base.ReadConfigSettings(); |
81 | } | 82 | } |
82 | 83 | ||
@@ -96,13 +97,13 @@ namespace OpenSim | |||
96 | base.Startup(); | 97 | base.Startup(); |
97 | 98 | ||
98 | //Run Startup Commands | 99 | //Run Startup Commands |
99 | if (m_startupCommandsFile != String.Empty) | 100 | if (String.IsNullOrEmpty( m_startupCommandsFile )) |
100 | { | 101 | { |
101 | RunCommandScript(m_startupCommandsFile); | 102 | m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); |
102 | } | 103 | } |
103 | else | 104 | else |
104 | { | 105 | { |
105 | m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); | 106 | RunCommandScript(m_startupCommandsFile); |
106 | } | 107 | } |
107 | 108 | ||
108 | // Start timer script (run a script every xx seconds) | 109 | // Start timer script (run a script every xx seconds) |
@@ -365,6 +366,7 @@ namespace OpenSim | |||
365 | { | 366 | { |
366 | m_sceneManager.TrySetCurrentScene(".."); | 367 | m_sceneManager.TrySetCurrentScene(".."); |
367 | } | 368 | } |
369 | |||
368 | m_regionData.Remove(killScene.RegionInfo); | 370 | m_regionData.Remove(killScene.RegionInfo); |
369 | m_sceneManager.CloseScene(killScene); | 371 | m_sceneManager.CloseScene(killScene); |
370 | } | 372 | } |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index e2b2bbc..156d022 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -205,7 +205,10 @@ namespace OpenSim | |||
205 | { | 205 | { |
206 | IConfigSource DefaultConfig = new IniConfigSource(); | 206 | IConfigSource DefaultConfig = new IniConfigSource(); |
207 | if (DefaultConfig.Configs["Startup"] == null) | 207 | if (DefaultConfig.Configs["Startup"] == null) |
208 | { | ||
208 | DefaultConfig.AddConfig("Startup"); | 209 | DefaultConfig.AddConfig("Startup"); |
210 | } | ||
211 | |||
209 | IConfig config = DefaultConfig.Configs["Startup"]; | 212 | IConfig config = DefaultConfig.Configs["Startup"]; |
210 | if (config != null) | 213 | if (config != null) |
211 | { | 214 | { |
@@ -225,7 +228,9 @@ namespace OpenSim | |||
225 | } | 228 | } |
226 | 229 | ||
227 | if (DefaultConfig.Configs["StandAlone"] == null) | 230 | if (DefaultConfig.Configs["StandAlone"] == null) |
231 | { | ||
228 | DefaultConfig.AddConfig("StandAlone"); | 232 | DefaultConfig.AddConfig("StandAlone"); |
233 | } | ||
229 | 234 | ||
230 | config = DefaultConfig.Configs["StandAlone"]; | 235 | config = DefaultConfig.Configs["StandAlone"]; |
231 | if (config != null) | 236 | if (config != null) |
@@ -242,7 +247,10 @@ namespace OpenSim | |||
242 | } | 247 | } |
243 | 248 | ||
244 | if (DefaultConfig.Configs["Network"] == null) | 249 | if (DefaultConfig.Configs["Network"] == null) |
250 | { | ||
245 | DefaultConfig.AddConfig("Network"); | 251 | DefaultConfig.AddConfig("Network"); |
252 | } | ||
253 | |||
246 | config = DefaultConfig.Configs["Network"]; | 254 | config = DefaultConfig.Configs["Network"]; |
247 | if (config != null) | 255 | if (config != null) |
248 | { | 256 | { |
@@ -262,7 +270,10 @@ namespace OpenSim | |||
262 | } | 270 | } |
263 | 271 | ||
264 | if (DefaultConfig.Configs["RemoteAdmin"] == null) | 272 | if (DefaultConfig.Configs["RemoteAdmin"] == null) |
273 | { | ||
265 | DefaultConfig.AddConfig("RemoteAdmin"); | 274 | DefaultConfig.AddConfig("RemoteAdmin"); |
275 | } | ||
276 | |||
266 | config = DefaultConfig.Configs["RemoteAdmin"]; | 277 | config = DefaultConfig.Configs["RemoteAdmin"]; |
267 | if (config != null) | 278 | if (config != null) |
268 | { | 279 | { |
@@ -270,12 +281,16 @@ namespace OpenSim | |||
270 | } | 281 | } |
271 | 282 | ||
272 | if (DefaultConfig.Configs["Voice"] == null) | 283 | if (DefaultConfig.Configs["Voice"] == null) |
284 | { | ||
273 | DefaultConfig.AddConfig("Voice"); | 285 | DefaultConfig.AddConfig("Voice"); |
286 | } | ||
287 | |||
274 | config = DefaultConfig.Configs["Voice"]; | 288 | config = DefaultConfig.Configs["Voice"]; |
275 | if (config != null) | 289 | if (config != null) |
276 | { | 290 | { |
277 | config.Set("enabled", "false"); | 291 | config.Set("enabled", "false"); |
278 | } | 292 | } |
293 | |||
279 | return DefaultConfig; | 294 | return DefaultConfig; |
280 | 295 | ||
281 | } | 296 | } |
@@ -741,18 +756,23 @@ namespace OpenSim | |||
741 | return; | 756 | return; |
742 | } | 757 | } |
743 | 758 | ||
744 | if (null != inventoryFolder) | 759 | if (null == inventoryFolder) |
745 | { | 760 | { |
746 | m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); | 761 | if (null == inventoryItem) |
747 | } | 762 | { |
748 | else if (null != inventoryItem) | 763 | m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); |
749 | { | 764 | return; |
750 | m_log.InfoFormat("[CONSOLE]: Found item {0} {1} at {2}", inventoryItem.Name, inventoryItem.ID, invPath); | 765 | } |
766 | else | ||
767 | { | ||
768 | m_log.InfoFormat("[CONSOLE]: Found item {0} {1} at {2}", inventoryItem.Name, inventoryItem.ID, | ||
769 | invPath); | ||
770 | } | ||
751 | } | 771 | } |
752 | else | 772 | else |
753 | { | 773 | { |
754 | m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); | 774 | m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, |
755 | return; | 775 | invPath); |
756 | } | 776 | } |
757 | } | 777 | } |
758 | 778 | ||
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index d1572fd..dfe922b 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs | |||
@@ -138,30 +138,31 @@ namespace OpenSim.Region.ClientStack | |||
138 | // TODO: Remove this cruft once MasterAvatar is fully deprecated | 138 | // TODO: Remove this cruft once MasterAvatar is fully deprecated |
139 | //Master Avatar Setup | 139 | //Master Avatar Setup |
140 | UserProfileData masterAvatar; | 140 | UserProfileData masterAvatar; |
141 | if (scene.RegionInfo.MasterAvatarAssignedUUID != UUID.Zero) | 141 | if (scene.RegionInfo.MasterAvatarAssignedUUID == UUID.Zero) |
142 | { | ||
143 | masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID); | ||
144 | scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName; | ||
145 | scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName; | ||
146 | } | ||
147 | else | ||
148 | { | 142 | { |
149 | masterAvatar = | 143 | masterAvatar = |
150 | m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, | 144 | m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, |
151 | scene.RegionInfo.MasterAvatarLastName, | 145 | scene.RegionInfo.MasterAvatarLastName, |
152 | scene.RegionInfo.MasterAvatarSandboxPassword); | 146 | scene.RegionInfo.MasterAvatarSandboxPassword); |
153 | } | 147 | } |
154 | 148 | else | |
155 | if (masterAvatar != null) | ||
156 | { | 149 | { |
157 | m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]", scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName); | 150 | masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID); |
158 | scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID; | 151 | scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName; |
152 | scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName; | ||
159 | } | 153 | } |
160 | else | 154 | |
155 | if (masterAvatar == null) | ||
161 | { | 156 | { |
162 | m_log.Info("[PARCEL]: No master avatar found, using null."); | 157 | m_log.Info("[PARCEL]: No master avatar found, using null."); |
163 | scene.RegionInfo.MasterAvatarAssignedUUID = UUID.Zero; | 158 | scene.RegionInfo.MasterAvatarAssignedUUID = UUID.Zero; |
164 | } | 159 | } |
160 | else | ||
161 | { | ||
162 | m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]", | ||
163 | scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName); | ||
164 | scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID; | ||
165 | } | ||
165 | 166 | ||
166 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); | 167 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); |
167 | scene.StartTimer(); | 168 | scene.StartTimer(); |
diff --git a/ThirdParty/3Di/LoadBalancer/TcpServer.cs b/ThirdParty/3Di/LoadBalancer/TcpServer.cs index fd5e9e2..376c0a5 100644 --- a/ThirdParty/3Di/LoadBalancer/TcpServer.cs +++ b/ThirdParty/3Di/LoadBalancer/TcpServer.cs | |||
@@ -159,14 +159,14 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer | |||
159 | 159 | ||
160 | state.ms_ptr.Seek(0, SeekOrigin.End); | 160 | state.ms_ptr.Seek(0, SeekOrigin.End); |
161 | // call loadbarancer function | 161 | // call loadbarancer function |
162 | if (PacketHandler != null) | 162 | if (PacketHandler == null) |
163 | { | 163 | { |
164 | //MainLog.Instance.Verbose("TCPSERVER", "calling PacketHandler"); | 164 | //MainLog.Instance.Verbose("TCPSERVER", "PacketHandler not found"); |
165 | PacketHandler(state.header, packet); | ||
166 | } | 165 | } |
167 | else | 166 | else |
168 | { | 167 | { |
169 | //MainLog.Instance.Verbose("TCPSERVER", "PacketHandler not found"); | 168 | //MainLog.Instance.Verbose("TCPSERVER", "calling PacketHandler"); |
169 | PacketHandler(state.header, packet); | ||
170 | } | 170 | } |
171 | 171 | ||
172 | int read_size = state.header.numbytes + TcpClient.internalPacketHeaderSize; | 172 | int read_size = state.header.numbytes + TcpClient.internalPacketHeaderSize; |
diff --git a/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs b/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs index e65e7e5..a1476fa 100644 --- a/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs +++ b/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs | |||
@@ -396,36 +396,7 @@ namespace OpenSim.ApplicationPlugins.RegionProxy | |||
396 | //m_log.ErrorFormat("[PROXY] Got message from {0} in thread {1}, size {2}", senderEP, sd.clientEP, numBytes); | 396 | //m_log.ErrorFormat("[PROXY] Got message from {0} in thread {1}, size {2}", senderEP, sd.clientEP, numBytes); |
397 | EndPoint client = proxy_map.GetClient(senderEP); | 397 | EndPoint client = proxy_map.GetClient(senderEP); |
398 | 398 | ||
399 | if (client != null) | 399 | if (client == null) |
400 | { | ||
401 | try | ||
402 | { | ||
403 | client = ProxyCodec.DecodeProxyMessage(buffer, ref numBytes); | ||
404 | try | ||
405 | { | ||
406 | // This message comes from a region object, forward it to the its client | ||
407 | sd.server.SendTo(buffer, numBytes, SocketFlags.None, client); | ||
408 | //m_log.InfoFormat("[PROXY] Sending region message from {0} to {1}, size {2}", senderEP, client, numBytes); | ||
409 | } | ||
410 | catch (Exception e) | ||
411 | { | ||
412 | OpenPort(sd); // reopen the port just in case | ||
413 | m_log.ErrorFormat("[PROXY] Failed sending region message from {0} to {1}", senderEP, client); | ||
414 | m_log.Error("[PROXY]" + e.Message); | ||
415 | m_log.Error("[PROXY]" + e.StackTrace); | ||
416 | return; | ||
417 | } | ||
418 | } | ||
419 | catch (Exception e) | ||
420 | { | ||
421 | OpenPort(sd); // reopen the port just in case | ||
422 | m_log.ErrorFormat("[PROXY] Failed decoding region message from {0}", senderEP); | ||
423 | m_log.Error("[PROXY]" + e.Message); | ||
424 | m_log.Error("[PROXY]" + e.StackTrace); | ||
425 | return; | ||
426 | } | ||
427 | } | ||
428 | else | ||
429 | { | 400 | { |
430 | // This message comes from a client object, forward it to the the region(s) | 401 | // This message comes from a client object, forward it to the the region(s) |
431 | ProxyCodec.EncodeProxyMessage(buffer, ref numBytes, senderEP); | 402 | ProxyCodec.EncodeProxyMessage(buffer, ref numBytes, senderEP); |
@@ -454,6 +425,35 @@ namespace OpenSim.ApplicationPlugins.RegionProxy | |||
454 | } | 425 | } |
455 | } | 426 | } |
456 | } | 427 | } |
428 | else | ||
429 | { | ||
430 | try | ||
431 | { | ||
432 | client = ProxyCodec.DecodeProxyMessage(buffer, ref numBytes); | ||
433 | try | ||
434 | { | ||
435 | // This message comes from a region object, forward it to the its client | ||
436 | sd.server.SendTo(buffer, numBytes, SocketFlags.None, client); | ||
437 | //m_log.InfoFormat("[PROXY] Sending region message from {0} to {1}, size {2}", senderEP, client, numBytes); | ||
438 | } | ||
439 | catch (Exception e) | ||
440 | { | ||
441 | OpenPort(sd); // reopen the port just in case | ||
442 | m_log.ErrorFormat("[PROXY] Failed sending region message from {0} to {1}", senderEP, client); | ||
443 | m_log.Error("[PROXY]" + e.Message); | ||
444 | m_log.Error("[PROXY]" + e.StackTrace); | ||
445 | return; | ||
446 | } | ||
447 | } | ||
448 | catch (Exception e) | ||
449 | { | ||
450 | OpenPort(sd); // reopen the port just in case | ||
451 | m_log.ErrorFormat("[PROXY] Failed decoding region message from {0}", senderEP); | ||
452 | m_log.Error("[PROXY]" + e.Message); | ||
453 | m_log.Error("[PROXY]" + e.StackTrace); | ||
454 | return; | ||
455 | } | ||
456 | } | ||
457 | } | 457 | } |
458 | 458 | ||
459 | #region Nested type: ProxyMap | 459 | #region Nested type: ProxyMap |