aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs8
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs6
8 files changed, 47 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
index f9cd90f..131febd 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
@@ -200,7 +200,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
200 200
201 #region IGridService 201 #region IGridService
202 202
203 public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) 203 public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
204 { 204 {
205 // Region doesn't exist here. Trying to link remote region 205 // Region doesn't exist here. Trying to link remote region
206 if (regionInfo.RegionID.Equals(UUID.Zero)) 206 if (regionInfo.RegionID.Equals(UUID.Zero))
@@ -215,12 +215,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
215 215
216 // Try get the map image 216 // Try get the map image
217 m_HypergridServiceConnector.GetMapImage(regionInfo); 217 m_HypergridServiceConnector.GetMapImage(regionInfo);
218 return true; 218 return String.Empty;
219 } 219 }
220 else 220 else
221 { 221 {
222 m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")"); 222 m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")");
223 return false; 223 return "No such region";
224 } 224 }
225 // Note that these remote regions aren't registered in localBackend, so return null, no local listeners 225 // Note that these remote regions aren't registered in localBackend, so return null, no local listeners
226 } 226 }
@@ -469,7 +469,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
469 } 469 }
470 470
471 // Finally, link it 471 // Finally, link it
472 if (!RegisterRegion(UUID.Zero, regInfo)) 472 if (RegisterRegion(UUID.Zero, regInfo) != String.Empty)
473 { 473 {
474 m_log.Warn("[HGrid]: Unable to link region"); 474 m_log.Warn("[HGrid]: Unable to link region");
475 return false; 475 return false;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index 1c72488..144b5a4 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
169 169
170 #region IGridService 170 #region IGridService
171 171
172 public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) 172 public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
173 { 173 {
174 return m_GridService.RegisterRegion(scopeID, regionInfo); 174 return m_GridService.RegisterRegion(scopeID, regionInfo);
175 } 175 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index 72c00fc..391e7c8 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -135,12 +135,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
135 135
136 #region IGridService 136 #region IGridService
137 137
138 public override bool RegisterRegion(UUID scopeID, GridRegion regionInfo) 138 public override string RegisterRegion(UUID scopeID, GridRegion regionInfo)
139 { 139 {
140 if (m_LocalGridService.RegisterRegion(scopeID, regionInfo)) 140 string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo);
141
142 if (msg == String.Empty)
141 return base.RegisterRegion(scopeID, regionInfo); 143 return base.RegisterRegion(scopeID, regionInfo);
142 144
143 return false; 145 return msg;
144 } 146 }
145 147
146 public override bool DeregisterRegion(UUID regionID) 148 public override bool DeregisterRegion(UUID regionID)
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
index 5cdf191..d7fa316 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
@@ -32,13 +32,29 @@ namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public delegate void ScriptCommand(UUID script, string id, string module, string command, string k); 33 public delegate void ScriptCommand(UUID script, string id, string module, string command, string k);
34 34
35 /// <summary>
36 /// Interface for communication between OpenSim modules and in-world scripts
37 /// </summary>
38 ///
39 /// See OpenSim.Region.ScriptEngine.Shared.Api.MOD_Api.modSendCommand() for information on receiving messages
40 /// from scripts in OpenSim modules.
35 public interface IScriptModuleComms 41 public interface IScriptModuleComms
36 { 42 {
43 /// <summary>
44 /// Modules can subscribe to this event to receive command invocations from in-world scripts
45 /// </summary>
37 event ScriptCommand OnScriptCommand; 46 event ScriptCommand OnScriptCommand;
38 47
39 void DispatchReply(UUID script, int code, string text, string k); 48 /// <summary>
49 /// Send a link_message event to an in-world script
50 /// </summary>
51 /// <param name="scriptId"></param>
52 /// <param name="code"></param>
53 /// <param name="text"></param>
54 /// <param name="key"></param>
55 void DispatchReply(UUID scriptId, int code, string text, string key);
40 56
41 // For use ONLY by the script API 57 // For use ONLY by the script API
42 void RaiseEvent(UUID script, string id, string module, string command, string k); 58 void RaiseEvent(UUID script, string id, string module, string command, string key);
43 } 59 }
44} 60}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 8ac4bc4..db21bf9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1589,9 +1589,9 @@ namespace OpenSim.Region.Framework.Scenes
1589 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); 1589 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo);
1590 1590
1591 GridRegion region = new GridRegion(RegionInfo); 1591 GridRegion region = new GridRegion(RegionInfo);
1592 bool success = GridService.RegisterRegion(RegionInfo.ScopeID, region); 1592 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
1593 if (!success) 1593 if (error != String.Empty)
1594 throw new Exception("Can't register with grid"); 1594 throw new Exception(error);
1595 1595
1596 m_sceneGridService.SetScene(this); 1596 m_sceneGridService.SetScene(this);
1597 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); 1597 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
index 3c5e8c9..b3fa07f 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
@@ -220,8 +220,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
220 220
221 // Fail if fundamental information is still missing 221 // Fail if fundamental information is still missing
222 222
223 if (cs.Server == null || cs.IrcChannel == null || cs.BaseNickname == null || cs.User == null) 223 if (cs.Server == null)
224 throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}", cs.idn, rs.Region)); 224 throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: server missing", cs.idn, rs.Region));
225 else if (cs.IrcChannel == null)
226 throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: channel missing", cs.idn, rs.Region));
227 else if (cs.BaseNickname == null)
228 throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: nick missing", cs.idn, rs.Region));
229 else if (cs.User == null)
230 throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: user missing", cs.idn, rs.Region));
225 231
226 m_log.InfoFormat("[IRC-Channel-{0}] Configuration for Region {1} is valid", cs.idn, rs.Region); 232 m_log.InfoFormat("[IRC-Channel-{0}] Configuration for Region {1} is valid", cs.idn, rs.Region);
227 m_log.InfoFormat("[IRC-Channel-{0}] Server = {1}", cs.idn, cs.Server); 233 m_log.InfoFormat("[IRC-Channel-{0}] Server = {1}", cs.idn, cs.Server);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 42c52dd..085d61f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7456,23 +7456,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7456 public LSL_Integer llGetNumberOfPrims() 7456 public LSL_Integer llGetNumberOfPrims()
7457 { 7457 {
7458 m_host.AddScriptLPS(1); 7458 m_host.AddScriptLPS(1);
7459 ScenePresence[] presences = World.GetScenePresences();
7460 if (presences.Length == 0)
7461 return 0;
7462
7463 int avatarCount = 0; 7459 int avatarCount = 0;
7464 for (int i = 0; i < presences.Length; i++) 7460 World.ForEachScenePresence(delegate(ScenePresence presence)
7465 { 7461 {
7466 ScenePresence presence = presences[i]; 7462 if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
7467
7468 if (!presence.IsChildAgent && presence.ParentID != 0)
7469 {
7470 if (m_host.ParentGroup.HasChildPrim(presence.ParentID))
7471 {
7472 avatarCount++; 7463 avatarCount++;
7473 } 7464 });
7474 }
7475 }
7476 7465
7477 return m_host.ParentGroup.PrimCount + avatarCount; 7466 return m_host.ParentGroup.PrimCount + avatarCount;
7478 } 7467 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index a5be251..1ddba1e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1987,6 +1987,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1987 1987
1988 return (int)pws; 1988 return (int)pws;
1989 } 1989 }
1990
1990 public void osSetSpeed(string UUID, float SpeedModifier) 1991 public void osSetSpeed(string UUID, float SpeedModifier)
1991 { 1992 {
1992 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); 1993 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
@@ -1994,6 +1995,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1994 ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); 1995 ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
1995 avatar.SpeedModifier = SpeedModifier; 1996 avatar.SpeedModifier = SpeedModifier;
1996 } 1997 }
1998
1997 public void osKickAvatar(string FirstName,string SurName,string alert) 1999 public void osKickAvatar(string FirstName,string SurName,string alert)
1998 { 2000 {
1999 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); 2001 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
@@ -2014,6 +2016,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2014 } 2016 }
2015 } 2017 }
2016 } 2018 }
2019
2017 public void osCauseDamage(string avatar, double damage) 2020 public void osCauseDamage(string avatar, double damage)
2018 { 2021 {
2019 CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); 2022 CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
@@ -2041,6 +2044,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2041 } 2044 }
2042 } 2045 }
2043 } 2046 }
2047
2044 public void osCauseHealing(string avatar, double healing) 2048 public void osCauseHealing(string avatar, double healing)
2045 { 2049 {
2046 CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); 2050 CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
@@ -2065,4 +2069,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2065 } 2069 }
2066 } 2070 }
2067 } 2071 }
2068} 2072} \ No newline at end of file