aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2013-08-11 17:31:25 +0100
committerMelanie2013-08-11 17:31:25 +0100
commitad1b2902f247a998f23e0d677ee50b10ab306396 (patch)
tree34dadb17811f2fba2f41595ce040e8a9352acc18 /OpenSim/Region/CoreModules
parentMerge branch 'master' into careminster (diff)
parentStats treaking. Update ToOSDMap for Stat and PercentageStat to return (diff)
downloadopensim-SC_OLD-ad1b2902f247a998f23e0d677ee50b10ab306396.zip
opensim-SC_OLD-ad1b2902f247a998f23e0d677ee50b10ab306396.tar.gz
opensim-SC_OLD-ad1b2902f247a998f23e0d677ee50b10ab306396.tar.bz2
opensim-SC_OLD-ad1b2902f247a998f23e0d677ee50b10ab306396.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Application/OpenSimBase.cs OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs30
-rw-r--r--OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs31
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs6
4 files changed, 65 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 4286eef..711167f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1069,8 +1069,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1069 // Now let's make it officially a child agent 1069 // Now let's make it officially a child agent
1070 sp.MakeChildAgent(); 1070 sp.MakeChildAgent();
1071 1071
1072 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 1072 // May still need to signal neighbours whether child agents may need closing irrespective of whether this
1073 // one needed closing. Neighbour regions also contain logic to prevent a close if a subsequent move or
1074 // teleport re-established the child connection.
1075 //
1076 // It may be possible to also close child agents after a pause but one needs to be very careful about
1077 // race conditions between different regions on rapid teleporting (e.g. from A1 to a non-neighbour B, back
1078 // to a neighbour A2 then off to a non-neighbour C. Also, closing child agents early may be more compatible
1079 // with complicated scenarios where there a mixture of V1 and V2 teleports, though this is conjecture. It's
1080 // easier to close immediately and greatly reduce the scope of race conditions if possible.
1081 sp.CloseChildAgents(newRegionX, newRegionY);
1073 1082
1083 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
1074 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 1084 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
1075 { 1085 {
1076 sp.DoNotCloseAfterTeleport = false; 1086 sp.DoNotCloseAfterTeleport = false;
@@ -1086,14 +1096,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1086 if (!sp.DoNotCloseAfterTeleport) 1096 if (!sp.DoNotCloseAfterTeleport)
1087 { 1097 {
1088 // OK, it got this agent. Let's close everything 1098 // OK, it got this agent. Let's close everything
1089 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.Name); 1099 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing agent {0} in {1}", sp.Name, Scene.Name);
1090 sp.CloseChildAgents(newRegionX, newRegionY);
1091 sp.Scene.IncomingCloseAgent(sp.UUID, false); 1100 sp.Scene.IncomingCloseAgent(sp.UUID, false);
1092
1093 } 1101 }
1094 else 1102 else
1095 { 1103 {
1096 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.Name); 1104 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {1}", sp.Name, Scene.Name);
1097 sp.DoNotCloseAfterTeleport = false; 1105 sp.DoNotCloseAfterTeleport = false;
1098 } 1106 }
1099 } 1107 }
@@ -1836,10 +1844,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1836 List<ulong> newRegions = NewNeighbours(neighbourHandles, previousRegionNeighbourHandles); 1844 List<ulong> newRegions = NewNeighbours(neighbourHandles, previousRegionNeighbourHandles);
1837 List<ulong> oldRegions = OldNeighbours(neighbourHandles, previousRegionNeighbourHandles); 1845 List<ulong> oldRegions = OldNeighbours(neighbourHandles, previousRegionNeighbourHandles);
1838 1846
1839 //Dump("Current Neighbors", neighbourHandles); 1847// Dump("Current Neighbors", neighbourHandles);
1840 //Dump("Previous Neighbours", previousRegionNeighbourHandles); 1848// Dump("Previous Neighbours", previousRegionNeighbourHandles);
1841 //Dump("New Neighbours", newRegions); 1849// Dump("New Neighbours", newRegions);
1842 //Dump("Old Neighbours", oldRegions); 1850// Dump("Old Neighbours", oldRegions);
1843 1851
1844 /// Update the scene presence's known regions here on this region 1852 /// Update the scene presence's known regions here on this region
1845 sp.DropOldNeighbours(oldRegions); 1853 sp.DropOldNeighbours(oldRegions);
@@ -1847,8 +1855,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1847 /// Collect as many seeds as possible 1855 /// Collect as many seeds as possible
1848 Dictionary<ulong, string> seeds; 1856 Dictionary<ulong, string> seeds;
1849 if (sp.Scene.CapsModule != null) 1857 if (sp.Scene.CapsModule != null)
1850 seeds 1858 seeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
1851 = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
1852 else 1859 else
1853 seeds = new Dictionary<ulong, string>(); 1860 seeds = new Dictionary<ulong, string>();
1854 1861
@@ -1918,6 +1925,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1918 newAgent = true; 1925 newAgent = true;
1919 else 1926 else
1920 newAgent = false; 1927 newAgent = false;
1928// continue;
1921 1929
1922 if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle) 1930 if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle)
1923 { 1931 {
diff --git a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
index bb304df..ad33f23 100644
--- a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
@@ -45,6 +45,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 private static string LogHeader = "[MODULE COMMS]";
48 49
49 private Dictionary<string,object> m_constants = new Dictionary<string,object>(); 50 private Dictionary<string,object> m_constants = new Dictionary<string,object>();
50 51
@@ -148,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
148 MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true); 149 MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true);
149 if (mi == null) 150 if (mi == null)
150 { 151 {
151 m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", meth); 152 m_log.WarnFormat("{0} Failed to register method {1}", LogHeader, meth);
152 return; 153 return;
153 } 154 }
154 155
@@ -165,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
165 { 166 {
166// m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name); 167// m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name);
167 168
168 Type delegateType; 169 Type delegateType = typeof(void);
169 List<Type> typeArgs = mi.GetParameters() 170 List<Type> typeArgs = mi.GetParameters()
170 .Select(p => p.ParameterType) 171 .Select(p => p.ParameterType)
171 .ToList(); 172 .ToList();
@@ -176,8 +177,16 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
176 } 177 }
177 else 178 else
178 { 179 {
179 typeArgs.Add(mi.ReturnType); 180 try
180 delegateType = Expression.GetFuncType(typeArgs.ToArray()); 181 {
182 typeArgs.Add(mi.ReturnType);
183 delegateType = Expression.GetFuncType(typeArgs.ToArray());
184 }
185 catch (Exception e)
186 {
187 m_log.ErrorFormat("{0} Failed to create function signature. Most likely more than 5 parameters. Method={1}. Error={2}",
188 LogHeader, mi.Name, e);
189 }
181 } 190 }
182 191
183 Delegate fcall; 192 Delegate fcall;
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
index 4d49794..173b603 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
@@ -76,6 +76,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3, all corners = -1.", 76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3, all corners = -1.",
77 consoleSetTerrainHeights); 77 consoleSetTerrainHeights);
78 78
79 m_module.Scene.AddCommand("Regions", m_module, "set water height",
80 "set water height <height> [<x>] [<y>]",
81 "Sets the water height in meters. If <x> and <y> are specified, it will only set it on regions with a matching coordinate. " +
82 "Specify -1 in <x> or <y> to wildcard that coordinate.",
83 consoleSetWaterHeight);
84
85
79 m_module.Scene.AddCommand( 86 m_module.Scene.AddCommand(
80 "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand); 87 "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand);
81 } 88 }
@@ -121,7 +128,29 @@ namespace OpenSim.Region.CoreModules.World.Estate
121 } 128 }
122 } 129 }
123 } 130 }
124 131 protected void consoleSetWaterHeight(string module, string[] args)
132 {
133 string heightstring = args[3];
134
135 int x = (args.Length > 4 ? int.Parse(args[4]) : -1);
136 int y = (args.Length > 5 ? int.Parse(args[5]) : -1);
137
138 if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x)
139 {
140 if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y)
141 {
142 double selectedheight = double.Parse(heightstring);
143
144 m_log.Debug("[ESTATEMODULE]: Setting water height in " + m_module.Scene.RegionInfo.RegionName + " to " +
145 string.Format(" {0}", selectedheight));
146 m_module.Scene.RegionInfo.RegionSettings.WaterHeight = selectedheight;
147
148 m_module.Scene.RegionInfo.RegionSettings.Save();
149 m_module.TriggerRegionInfoChange();
150 m_module.sendRegionHandshakeToAll();
151 }
152 }
153 }
125 protected void consoleSetTerrainHeights(string module, string[] args) 154 protected void consoleSetTerrainHeights(string module, string[] args)
126 { 155 {
127 string num = args[3]; 156 string num = args[3];
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index a5f5749..1808fdd 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -572,7 +572,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
572 if (!Scene.TeleportClientHome(user, s.ControllingClient)) 572 if (!Scene.TeleportClientHome(user, s.ControllingClient))
573 { 573 {
574 s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out."); 574 s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out.");
575 s.ControllingClient.Close(); 575 Scene.IncomingCloseAgent(s.UUID, false);
576 } 576 }
577 } 577 }
578 } 578 }
@@ -807,7 +807,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
807 if (!Scene.TeleportClientHome(prey, s.ControllingClient)) 807 if (!Scene.TeleportClientHome(prey, s.ControllingClient))
808 { 808 {
809 s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); 809 s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
810 s.ControllingClient.Close(); 810 Scene.IncomingCloseAgent(s.UUID, false);
811 } 811 }
812 } 812 }
813 } 813 }
@@ -830,7 +830,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
830 if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient)) 830 if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient))
831 { 831 {
832 p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); 832 p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
833 p.ControllingClient.Close(); 833 Scene.IncomingCloseAgent(p.UUID, false);
834 } 834 }
835 } 835 }
836 } 836 }