diff options
author | ubit | 2012-09-06 18:58:57 +0200 |
---|---|---|
committer | ubit | 2012-09-06 18:58:57 +0200 |
commit | 402de5fb78b8115ff6e7bd1fdfe0e63e71352967 (patch) | |
tree | dc35c801311287bf27e9f8e78f36ef7bd565bf25 | |
parent | Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff) | |
parent | Merge branch 'ubitwork' into avination (diff) | |
download | opensim-SC-402de5fb78b8115ff6e7bd1fdfe0e63e71352967.zip opensim-SC-402de5fb78b8115ff6e7bd1fdfe0e63e71352967.tar.gz opensim-SC-402de5fb78b8115ff6e7bd1fdfe0e63e71352967.tar.bz2 opensim-SC-402de5fb78b8115ff6e7bd1fdfe0e63e71352967.tar.xz |
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to '')
9 files changed, 192 insertions, 173 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 86d7f83..9090f64 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
220 | /// <param name="sp"></param> | 220 | /// <param name="sp"></param> |
221 | /// <param name="position"></param> | 221 | /// <param name="position"></param> |
222 | /// <param name="lookAt"></param> | 222 | /// <param name="lookAt"></param> |
223 | /// <param name="teleportFlags"></param | 223 | /// <param name="teleportFlags"></param> |
224 | private void TeleportAgentWithinRegion(ScenePresence sp, Vector3 position, Vector3 lookAt, uint teleportFlags) | 224 | private void TeleportAgentWithinRegion(ScenePresence sp, Vector3 position, Vector3 lookAt, uint teleportFlags) |
225 | { | 225 | { |
226 | m_log.DebugFormat( | 226 | m_log.DebugFormat( |
@@ -988,7 +988,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
988 | agent.IsInTransit = true; | 988 | agent.IsInTransit = true; |
989 | 989 | ||
990 | CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync; | 990 | CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync; |
991 | d.BeginInvoke(agent, newpos, x, y, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d); | 991 | d.BeginInvoke(agent, newpos, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d); |
992 | 992 | ||
993 | return true; | 993 | return true; |
994 | } | 994 | } |
@@ -1045,42 +1045,43 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1045 | icon.EndInvoke(iar); | 1045 | icon.EndInvoke(iar); |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | public bool CrossAgentToNewRegionPrep(ScenePresence agent, GridRegion neighbourRegion) | ||
1049 | { | ||
1050 | if (neighbourRegion == null) | ||
1051 | return false; | ||
1052 | |||
1053 | m_entityTransferStateMachine.SetInTransit(agent.UUID); | ||
1054 | |||
1055 | agent.RemoveFromPhysicalScene(); | ||
1056 | |||
1057 | return true; | ||
1058 | } | ||
1059 | |||
1048 | /// <summary> | 1060 | /// <summary> |
1049 | /// This Closes child agents on neighbouring regions | 1061 | /// This Closes child agents on neighbouring regions |
1050 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | 1062 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. |
1051 | /// </summary> | 1063 | /// </summary> |
1052 | public ScenePresence CrossAgentToNewRegionAsync( | 1064 | public ScenePresence CrossAgentToNewRegionAsync( |
1053 | ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, | 1065 | ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, |
1054 | bool isFlying, string version) | 1066 | bool isFlying, string version) |
1055 | { | 1067 | { |
1056 | if (neighbourRegion == null) | 1068 | if (!CrossAgentToNewRegionPrep(agent, neighbourRegion)) |
1057 | return agent; | 1069 | return agent; |
1058 | 1070 | ||
1059 | try | 1071 | if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying)) |
1060 | { | 1072 | return agent; |
1061 | m_entityTransferStateMachine.SetInTransit(agent.UUID); | ||
1062 | |||
1063 | ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); | ||
1064 | |||
1065 | m_log.DebugFormat( | ||
1066 | "[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3} running version {4}", | ||
1067 | agent.Firstname, agent.Lastname, neighbourx, neighboury, version); | ||
1068 | |||
1069 | Scene m_scene = agent.Scene; | ||
1070 | |||
1071 | if (!agent.ValidateAttachments()) | ||
1072 | m_log.DebugFormat( | ||
1073 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", | ||
1074 | agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); | ||
1075 | |||
1076 | pos = pos + agent.Velocity; | ||
1077 | Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0); | ||
1078 | 1073 | ||
1079 | agent.RemoveFromPhysicalScene(); | 1074 | CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, version); |
1075 | return agent; | ||
1076 | } | ||
1080 | 1077 | ||
1078 | public bool CrossAgentIntoNewRegionMain(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying) | ||
1079 | { | ||
1080 | try | ||
1081 | { | ||
1081 | AgentData cAgent = new AgentData(); | 1082 | AgentData cAgent = new AgentData(); |
1082 | agent.CopyTo(cAgent); | 1083 | agent.CopyTo(cAgent); |
1083 | cAgent.Position = pos; | 1084 | cAgent.Position = pos + agent.Velocity; |
1084 | if (isFlying) | 1085 | if (isFlying) |
1085 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 1086 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
1086 | 1087 | ||
@@ -1090,7 +1091,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1090 | // Beyond this point, extra cleanup is needed beyond removing transit state | 1091 | // Beyond this point, extra cleanup is needed beyond removing transit state |
1091 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.Transferring); | 1092 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.Transferring); |
1092 | 1093 | ||
1093 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) | 1094 | if (!agent.Scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
1094 | { | 1095 | { |
1095 | // region doesn't take it | 1096 | // region doesn't take it |
1096 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); | 1097 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); |
@@ -1099,93 +1100,108 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1099 | agent.AddToPhysicalScene(isFlying); | 1100 | agent.AddToPhysicalScene(isFlying); |
1100 | m_entityTransferStateMachine.ResetFromTransit(agent.UUID); | 1101 | m_entityTransferStateMachine.ResetFromTransit(agent.UUID); |
1101 | 1102 | ||
1102 | return agent; | 1103 | return false; |
1103 | } | 1104 | } |
1104 | 1105 | ||
1105 | //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 1106 | } |
1106 | agent.ControllingClient.RequestClientInfo(); | 1107 | catch (Exception e) |
1108 | { | ||
1109 | m_log.ErrorFormat( | ||
1110 | "[ENTITY TRANSFER MODULE]: Problem crossing user {0} to new region {1} from {2}. Exception {3}{4}", | ||
1111 | agent.Name, neighbourRegion.RegionName, agent.Scene.RegionInfo.RegionName, e.Message, e.StackTrace); | ||
1107 | 1112 | ||
1108 | //m_log.Debug("BEFORE CROSS"); | 1113 | // TODO: Might be worth attempting other restoration here such as reinstantiation of scripts, etc. |
1109 | //Scene.DumpChildrenSeeds(UUID); | 1114 | return false; |
1110 | //DumpKnownRegions(); | 1115 | } |
1111 | string agentcaps; | ||
1112 | if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps)) | ||
1113 | { | ||
1114 | m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: No ENTITY TRANSFER MODULE information for region handle {0}, exiting CrossToNewRegion.", | ||
1115 | neighbourRegion.RegionHandle); | ||
1116 | return agent; | ||
1117 | } | ||
1118 | // No turning back | ||
1119 | agent.IsChildAgent = true; | ||
1120 | 1116 | ||
1121 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); | 1117 | return true; |
1118 | } | ||
1122 | 1119 | ||
1123 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 1120 | public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, |
1121 | bool isFlying, string version) | ||
1122 | { | ||
1123 | agent.ControllingClient.RequestClientInfo(); | ||
1124 | 1124 | ||
1125 | if (m_eqModule != null) | 1125 | string agentcaps; |
1126 | { | 1126 | if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps)) |
1127 | m_eqModule.CrossRegion( | 1127 | { |
1128 | neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint, | 1128 | m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: No ENTITY TRANSFER MODULE information for region handle {0}, exiting CrossToNewRegion.", |
1129 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | 1129 | neighbourRegion.RegionHandle); |
1130 | } | 1130 | return; |
1131 | else | 1131 | } |
1132 | { | ||
1133 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | ||
1134 | capsPath); | ||
1135 | } | ||
1136 | 1132 | ||
1137 | // SUCCESS! | 1133 | // No turning back |
1138 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.ReceivedAtDestination); | 1134 | agent.IsChildAgent = true; |
1139 | 1135 | ||
1140 | // Unlike a teleport, here we do not wait for the destination region to confirm the receipt. | 1136 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); |
1141 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); | ||
1142 | 1137 | ||
1143 | agent.MakeChildAgent(); | 1138 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
1144 | 1139 | ||
1145 | // FIXME: Possibly this should occur lower down after other commands to close other agents, | 1140 | Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0); |
1146 | // but not sure yet what the side effects would be. | ||
1147 | m_entityTransferStateMachine.ResetFromTransit(agent.UUID); | ||
1148 | 1141 | ||
1149 | // now we have a child agent in this region. Request all interesting data about other (root) agents | 1142 | if (m_eqModule != null) |
1150 | agent.SendOtherAgentsAvatarDataToMe(); | 1143 | { |
1151 | agent.SendOtherAgentsAppearanceToMe(); | 1144 | m_eqModule.CrossRegion( |
1145 | neighbourRegion.RegionHandle, pos + agent.Velocity, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint, | ||
1146 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | ||
1147 | } | ||
1148 | else | ||
1149 | { | ||
1150 | agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos + agent.Velocity, agent.Velocity, neighbourRegion.ExternalEndPoint, | ||
1151 | capsPath); | ||
1152 | } | ||
1152 | 1153 | ||
1153 | // Backwards compatibility. Best effort | 1154 | // SUCCESS! |
1154 | if (version == "Unknown" || version == string.Empty) | 1155 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.ReceivedAtDestination); |
1155 | { | ||
1156 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); | ||
1157 | Thread.Sleep(3000); // wait a little now that we're not waiting for the callback | ||
1158 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); | ||
1159 | } | ||
1160 | 1156 | ||
1161 | // Next, let's close the child agent connections that are too far away. | 1157 | // Unlike a teleport, here we do not wait for the destination region to confirm the receipt. |
1162 | agent.CloseChildAgents(neighbourx, neighboury); | 1158 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); |
1163 | 1159 | ||
1164 | AgentHasMovedAway(agent, false); | 1160 | agent.MakeChildAgent(); |
1165 | 1161 | ||
1166 | // the user may change their profile information in other region, | 1162 | // FIXME: Possibly this should occur lower down after other commands to close other agents, |
1167 | // so the userinfo in UserProfileCache is not reliable any more, delete it | 1163 | // but not sure yet what the side effects would be. |
1168 | // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! | 1164 | m_entityTransferStateMachine.ResetFromTransit(agent.UUID); |
1169 | if (agent.Scene.NeedSceneCacheClear(agent.UUID)) | 1165 | |
1170 | { | 1166 | // now we have a child agent in this region. Request all interesting data about other (root) agents |
1171 | m_log.DebugFormat( | 1167 | agent.SendOtherAgentsAvatarDataToMe(); |
1172 | "[ENTITY TRANSFER MODULE]: User {0} is going to another region", agent.UUID); | 1168 | agent.SendOtherAgentsAppearanceToMe(); |
1173 | } | 1169 | |
1174 | 1170 | // Backwards compatibility. Best effort | |
1175 | //m_log.Debug("AFTER CROSS"); | 1171 | if (version == "Unknown" || version == string.Empty) |
1176 | //Scene.DumpChildrenSeeds(UUID); | ||
1177 | //DumpKnownRegions(); | ||
1178 | } | ||
1179 | catch (Exception e) | ||
1180 | { | 1172 | { |
1181 | m_log.ErrorFormat( | 1173 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); |
1182 | "[ENTITY TRANSFER MODULE]: Problem crossing user {0} to new region {1} from {2}. Exception {3}{4}", | 1174 | Thread.Sleep(3000); // wait a little now that we're not waiting for the callback |
1183 | agent.Name, neighbourRegion.RegionName, agent.Scene.RegionInfo.RegionName, e.Message, e.StackTrace); | 1175 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); |
1176 | } | ||
1184 | 1177 | ||
1185 | // TODO: Might be worth attempting other restoration here such as reinstantiation of scripts, etc. | 1178 | // Next, let's close the child agent connections that are too far away. |
1179 | uint neighbourx; | ||
1180 | uint neighboury; | ||
1181 | |||
1182 | Utils.LongToUInts(neighbourRegion.RegionHandle, out neighbourx, out neighboury); | ||
1183 | |||
1184 | neighbourx /= Constants.RegionSize; | ||
1185 | neighboury /= Constants.RegionSize; | ||
1186 | |||
1187 | agent.CloseChildAgents(neighbourx, neighboury); | ||
1188 | |||
1189 | AgentHasMovedAway(agent, false); | ||
1190 | |||
1191 | // the user may change their profile information in other region, | ||
1192 | // so the userinfo in UserProfileCache is not reliable any more, delete it | ||
1193 | // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! | ||
1194 | if (agent.Scene.NeedSceneCacheClear(agent.UUID)) | ||
1195 | { | ||
1196 | m_log.DebugFormat( | ||
1197 | "[ENTITY TRANSFER MODULE]: User {0} is going to another region", agent.UUID); | ||
1186 | } | 1198 | } |
1187 | 1199 | ||
1188 | return agent; | 1200 | //m_log.Debug("AFTER CROSS"); |
1201 | //Scene.DumpChildrenSeeds(UUID); | ||
1202 | //DumpKnownRegions(); | ||
1203 | |||
1204 | return; | ||
1189 | } | 1205 | } |
1190 | 1206 | ||
1191 | private void CrossAgentToNewRegionCompleted(IAsyncResult iar) | 1207 | private void CrossAgentToNewRegionCompleted(IAsyncResult iar) |
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index e0e358a..13762f7 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -188,9 +188,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
188 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 188 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
189 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); | 189 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); |
190 | 190 | ||
191 | m_log.DebugFormat( | 191 | // m_log.DebugFormat( |
192 | "[URL MODULE]: Set up incoming request url {0} for {1} in {2} {3}", | 192 | // "[URL MODULE]: Set up incoming request url {0} for {1} in {2} {3}", |
193 | uri, itemID, host.Name, host.LocalId); | 193 | // uri, itemID, host.Name, host.LocalId); |
194 | 194 | ||
195 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); | 195 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); |
196 | } | 196 | } |
@@ -234,9 +234,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
234 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 234 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
235 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); | 235 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); |
236 | 236 | ||
237 | m_log.DebugFormat( | 237 | // m_log.DebugFormat( |
238 | "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}", | 238 | // "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}", |
239 | uri, itemID, host.Name, host.LocalId); | 239 | // uri, itemID, host.Name, host.LocalId); |
240 | 240 | ||
241 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); | 241 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); |
242 | } | 242 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs index 5bc8e51..1949a90 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs | |||
@@ -35,7 +35,7 @@ using OpenSim.Region.Framework.Scenes; | |||
35 | 35 | ||
36 | namespace OpenSim.Region.Framework.Interfaces | 36 | namespace OpenSim.Region.Framework.Interfaces |
37 | { | 37 | { |
38 | public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying, string version); | 38 | public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); |
39 | 39 | ||
40 | public interface IEntityTransferModule | 40 | public interface IEntityTransferModule |
41 | { | 41 | { |
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
76 | 76 | ||
77 | void Cross(SceneObjectGroup sog, Vector3 position, bool silent); | 77 | void Cross(SceneObjectGroup sog, Vector3 position, bool silent); |
78 | 78 | ||
79 | ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying, string version); | 79 | ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); |
80 | 80 | ||
81 | } | 81 | } |
82 | 82 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index bc0f5b6..4798481 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -581,7 +581,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
581 | av.IsInTransit = true; | 581 | av.IsInTransit = true; |
582 | 582 | ||
583 | CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; | 583 | CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; |
584 | d.BeginInvoke(av, val, x, y, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d); | 584 | d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d); |
585 | } | 585 | } |
586 | else | 586 | else |
587 | m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val); | 587 | m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 34ac7d4..433efc7 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3432,7 +3432,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3432 | /// <param name="e"></param> | 3432 | /// <param name="e"></param> |
3433 | public void PhysicsCollisionUpdate(EventArgs e) | 3433 | public void PhysicsCollisionUpdate(EventArgs e) |
3434 | { | 3434 | { |
3435 | if (IsChildAgent) | 3435 | if (IsChildAgent || Animator == null) |
3436 | return; | 3436 | return; |
3437 | 3437 | ||
3438 | //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) | 3438 | //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) |
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 20919a1..756b1f4 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -438,23 +438,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
438 | } | 438 | } |
439 | 439 | ||
440 | // Extra statistics that aren't currently sent to clients | 440 | // Extra statistics that aren't currently sent to clients |
441 | lock (m_lastReportedExtraSimStats) | 441 | if (m_scene.PhysicsScene != null) |
442 | { | 442 | { |
443 | m_lastReportedExtraSimStats[LastReportedObjectUpdateStatName] = m_objectUpdates / m_statsUpdateFactor; | 443 | lock (m_lastReportedExtraSimStats) |
444 | |||
445 | Dictionary<string, float> physicsStats = m_scene.PhysicsScene.GetStats(); | ||
446 | |||
447 | if (physicsStats != null) | ||
448 | { | 444 | { |
449 | foreach (KeyValuePair<string, float> tuple in physicsStats) | 445 | m_lastReportedExtraSimStats[LastReportedObjectUpdateStatName] = m_objectUpdates / m_statsUpdateFactor; |
446 | |||
447 | Dictionary<string, float> physicsStats = m_scene.PhysicsScene.GetStats(); | ||
448 | |||
449 | if (physicsStats != null) | ||
450 | { | 450 | { |
451 | // FIXME: An extremely dirty hack to divide MS stats per frame rather than per second | 451 | foreach (KeyValuePair<string, float> tuple in physicsStats) |
452 | // Need to change things so that stats source can indicate whether they are per second or | 452 | { |
453 | // per frame. | 453 | // FIXME: An extremely dirty hack to divide MS stats per frame rather than per second |
454 | if (tuple.Key.EndsWith("MS")) | 454 | // Need to change things so that stats source can indicate whether they are per second or |
455 | m_lastReportedExtraSimStats[tuple.Key] = tuple.Value * perframe; | 455 | // per frame. |
456 | else | 456 | if (tuple.Key.EndsWith("MS")) |
457 | m_lastReportedExtraSimStats[tuple.Key] = tuple.Value / m_statsUpdateFactor; | 457 | m_lastReportedExtraSimStats[tuple.Key] = tuple.Value * perframe; |
458 | else | ||
459 | m_lastReportedExtraSimStats[tuple.Key] = tuple.Value / m_statsUpdateFactor; | ||
460 | } | ||
458 | } | 461 | } |
459 | } | 462 | } |
460 | } | 463 | } |
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 7ad6f0b..2a3dacc 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -181,8 +181,7 @@ namespace OpenSim.Services.Connectors | |||
181 | 181 | ||
182 | public AssetBase Get(string id) | 182 | public AssetBase Get(string id) |
183 | { | 183 | { |
184 | // string uri = MapServer(id) + "/assets/" + id; | 184 | string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); |
185 | string uri = MapServer(id) + "assets/" + id; | ||
186 | 185 | ||
187 | AssetBase asset = null; | 186 | AssetBase asset = null; |
188 | if (m_Cache != null) | 187 | if (m_Cache != null) |
@@ -219,8 +218,7 @@ namespace OpenSim.Services.Connectors | |||
219 | return fullAsset.Metadata; | 218 | return fullAsset.Metadata; |
220 | } | 219 | } |
221 | 220 | ||
222 | // string uri = MapServer(id) + "/assets/" + id + "/metadata"; | 221 | string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); |
223 | string uri = MapServer(id) + "assets/" + id + "/metadata"; | ||
224 | 222 | ||
225 | AssetMetadata asset = SynchronousRestObjectRequester. | 223 | AssetMetadata asset = SynchronousRestObjectRequester. |
226 | MakeRequest<int, AssetMetadata>("GET", uri, 0); | 224 | MakeRequest<int, AssetMetadata>("GET", uri, 0); |
@@ -262,8 +260,7 @@ namespace OpenSim.Services.Connectors | |||
262 | 260 | ||
263 | public bool Get(string id, Object sender, AssetRetrieved handler) | 261 | public bool Get(string id, Object sender, AssetRetrieved handler) |
264 | { | 262 | { |
265 | // string uri = MapServer(id) + "/assets/" + id; | 263 | string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); |
266 | string uri = MapServer(id) + "assets/" + id; | ||
267 | 264 | ||
268 | AssetBase asset = null; | 265 | AssetBase asset = null; |
269 | if (m_Cache != null) | 266 | if (m_Cache != null) |
@@ -382,9 +379,9 @@ namespace OpenSim.Services.Connectors | |||
382 | return asset.ID; | 379 | return asset.ID; |
383 | } | 380 | } |
384 | 381 | ||
385 | // string uri = MapServer(asset.FullID.ToString()) + "/assets/"; | 382 | string uri = Path.Combine(MapServer(asset.FullID.ToString()), "/assets/"); |
386 | 383 | if (!uri.EndsWith("/")) | |
387 | string uri = MapServer(asset.FullID.ToString()) + "assets/"; | 384 | uri += "/"; |
388 | 385 | ||
389 | string newID = string.Empty; | 386 | string newID = string.Empty; |
390 | try | 387 | try |
@@ -461,8 +458,7 @@ namespace OpenSim.Services.Connectors | |||
461 | } | 458 | } |
462 | asset.Data = data; | 459 | asset.Data = data; |
463 | 460 | ||
464 | // string uri = MapServer(id) + "/assets/" + id; | 461 | string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); |
465 | string uri = MapServer(id) + "assets/" + id; | ||
466 | 462 | ||
467 | if (SynchronousRestObjectRequester. | 463 | if (SynchronousRestObjectRequester. |
468 | MakeRequest<AssetBase, bool>("POST", uri, asset)) | 464 | MakeRequest<AssetBase, bool>("POST", uri, asset)) |
@@ -477,8 +473,7 @@ namespace OpenSim.Services.Connectors | |||
477 | 473 | ||
478 | public bool Delete(string id) | 474 | public bool Delete(string id) |
479 | { | 475 | { |
480 | // string uri = MapServer(id) + "/assets/" + id; | 476 | string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); |
481 | string uri = MapServer(id) + "assets/" + id; | ||
482 | 477 | ||
483 | if (SynchronousRestObjectRequester. | 478 | if (SynchronousRestObjectRequester. |
484 | MakeRequest<int, bool>("DELETE", uri, 0)) | 479 | MakeRequest<int, bool>("DELETE", uri, 0)) |
diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs index 3fd0c53..6cd21d1 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs | |||
@@ -144,44 +144,48 @@ namespace OpenSim.Services.Connectors.Friends | |||
144 | 144 | ||
145 | private bool Call(GridRegion region, Dictionary<string, object> sendData) | 145 | private bool Call(GridRegion region, Dictionary<string, object> sendData) |
146 | { | 146 | { |
147 | string reqString = ServerUtils.BuildQueryString(sendData); | 147 | Util.FireAndForget(x => { |
148 | //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString); | 148 | string reqString = ServerUtils.BuildQueryString(sendData); |
149 | if (region == null) | 149 | //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString); |
150 | return false; | 150 | if (region == null) |
151 | 151 | return; | |
152 | string path = ServicePath(); | 152 | |
153 | if (!region.ServerURI.EndsWith("/")) | 153 | string path = ServicePath(); |
154 | path = "/" + path; | 154 | if (!region.ServerURI.EndsWith("/")) |
155 | string uri = region.ServerURI + path; | 155 | path = "/" + path; |
156 | m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); | 156 | string uri = region.ServerURI + path; |
157 | 157 | m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); | |
158 | try | 158 | |
159 | { | 159 | try |
160 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); | ||
161 | if (reply != string.Empty) | ||
162 | { | 160 | { |
163 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | 161 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); |
164 | 162 | if (reply != string.Empty) | |
165 | if (replyData.ContainsKey("RESULT")) | ||
166 | { | 163 | { |
167 | if (replyData["RESULT"].ToString().ToLower() == "true") | 164 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); |
168 | return true; | 165 | |
166 | if (replyData.ContainsKey("RESULT")) | ||
167 | { | ||
168 | // if (replyData["RESULT"].ToString().ToLower() == "true") | ||
169 | // return; | ||
170 | // else | ||
171 | return; | ||
172 | } | ||
169 | else | 173 | else |
170 | return false; | 174 | m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field"); |
175 | |||
171 | } | 176 | } |
172 | else | 177 | else |
173 | m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field"); | 178 | m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply"); |
174 | 179 | } | |
180 | catch (Exception e) | ||
181 | { | ||
182 | m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message); | ||
175 | } | 183 | } |
176 | else | 184 | |
177 | m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply"); | 185 | return; |
178 | } | 186 | }); |
179 | catch (Exception e) | 187 | |
180 | { | 188 | return true; |
181 | m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message); | ||
182 | } | ||
183 | |||
184 | return false; | ||
185 | } | 189 | } |
186 | } | 190 | } |
187 | } | 191 | } |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index e1c2243..508baf7 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -395,17 +395,18 @@ namespace OpenSim.Services.Connectors.Simulation | |||
395 | private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) | 395 | private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) |
396 | { | 396 | { |
397 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start"); | 397 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start"); |
398 | Util.FireAndForget(x => { | ||
399 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | ||
398 | 400 | ||
399 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | 401 | try |
400 | 402 | { | |
401 | try | 403 | WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); |
402 | { | 404 | } |
403 | WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); | 405 | catch (Exception e) |
404 | } | 406 | { |
405 | catch (Exception e) | 407 | m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString()); |
406 | { | 408 | } |
407 | m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString()); | 409 | }); |
408 | } | ||
409 | 410 | ||
410 | return true; | 411 | return true; |
411 | } | 412 | } |