diff options
author | Diva Canto | 2013-08-09 08:31:30 -0700 |
---|---|---|
committer | Diva Canto | 2013-08-09 08:31:30 -0700 |
commit | 2cdcf62b48fde64d1ad11a4db46afeddff1a0770 (patch) | |
tree | 76d2f53def5e6cd05b9b9e5f3e3e1e759c29e87e /OpenSim/Region/CoreModules | |
parent | Go easy on enforcing session ids in position updates (diff) | |
parent | BulletSim: adjust avatar position when the avatar's size is changed. (diff) | |
download | opensim-SC-2cdcf62b48fde64d1ad11a4db46afeddff1a0770.zip opensim-SC-2cdcf62b48fde64d1ad11a4db46afeddff1a0770.tar.gz opensim-SC-2cdcf62b48fde64d1ad11a4db46afeddff1a0770.tar.bz2 opensim-SC-2cdcf62b48fde64d1ad11a4db46afeddff1a0770.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
3 files changed, 73 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 96cd6b9..01ef710 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -688,8 +688,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
688 | if (version.Equals("SIMULATION/0.2")) | 688 | if (version.Equals("SIMULATION/0.2")) |
689 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 689 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
690 | else | 690 | else |
691 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 691 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
692 | |||
693 | } | 692 | } |
694 | 693 | ||
695 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, | 694 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, |
@@ -698,7 +697,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
698 | ulong destinationHandle = finalDestination.RegionHandle; | 697 | ulong destinationHandle = finalDestination.RegionHandle; |
699 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 698 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
700 | 699 | ||
701 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Using TP V1"); | 700 | m_log.DebugFormat( |
701 | "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}", | ||
702 | sp.Name, Scene.Name, finalDestination.RegionName); | ||
703 | |||
702 | // Let's create an agent there if one doesn't exist yet. | 704 | // Let's create an agent there if one doesn't exist yet. |
703 | // NOTE: logout will always be false for a non-HG teleport. | 705 | // NOTE: logout will always be false for a non-HG teleport. |
704 | bool logout = false; | 706 | bool logout = false; |
@@ -956,6 +958,27 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
956 | return; | 958 | return; |
957 | } | 959 | } |
958 | 960 | ||
961 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) | ||
962 | { | ||
963 | m_interRegionTeleportCancels.Value++; | ||
964 | |||
965 | m_log.DebugFormat( | ||
966 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after CreateAgent on client request", | ||
967 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | ||
968 | |||
969 | return; | ||
970 | } | ||
971 | else if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | ||
972 | { | ||
973 | m_interRegionTeleportAborts.Value++; | ||
974 | |||
975 | m_log.DebugFormat( | ||
976 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after CreateAgent due to previous client close.", | ||
977 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | ||
978 | |||
979 | return; | ||
980 | } | ||
981 | |||
959 | // Past this point we have to attempt clean up if the teleport fails, so update transfer state. | 982 | // Past this point we have to attempt clean up if the teleport fails, so update transfer state. |
960 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); | 983 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); |
961 | 984 | ||
@@ -1058,20 +1081,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1058 | if (!sp.DoNotCloseAfterTeleport) | 1081 | if (!sp.DoNotCloseAfterTeleport) |
1059 | { | 1082 | { |
1060 | // OK, it got this agent. Let's close everything | 1083 | // OK, it got this agent. Let's close everything |
1061 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.RegionInfo.RegionName); | 1084 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.Name); |
1062 | sp.CloseChildAgents(newRegionX, newRegionY); | 1085 | sp.CloseChildAgents(newRegionX, newRegionY); |
1063 | sp.Scene.IncomingCloseAgent(sp.UUID, false); | 1086 | sp.Scene.IncomingCloseAgent(sp.UUID, false); |
1064 | 1087 | ||
1065 | } | 1088 | } |
1066 | else | 1089 | else |
1067 | { | 1090 | { |
1068 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.RegionInfo.RegionName); | 1091 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.Name); |
1069 | sp.DoNotCloseAfterTeleport = false; | 1092 | sp.DoNotCloseAfterTeleport = false; |
1070 | } | 1093 | } |
1071 | } | 1094 | } |
1072 | else | 1095 | else |
1096 | { | ||
1073 | // now we have a child agent in this region. | 1097 | // now we have a child agent in this region. |
1074 | sp.Reset(); | 1098 | sp.Reset(); |
1099 | } | ||
1075 | } | 1100 | } |
1076 | 1101 | ||
1077 | /// <summary> | 1102 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index a515346..6da2222 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]; |