diff options
author | Melanie | 2009-12-30 22:24:14 +0000 |
---|---|---|
committer | Melanie | 2009-12-30 22:24:14 +0000 |
commit | a21ce9151b22c75117c4ea4d2a300c302ff78d6a (patch) | |
tree | 8875cc8058a18645fa94ef055367046d23340e84 /OpenSim | |
parent | Merge branch 'presence-refactor' of melanie@opensimulator.org:/var/git/opensi... (diff) | |
parent | * Fixes Sitting on the ground. (diff) | |
download | opensim-SC-a21ce9151b22c75117c4ea4d2a300c302ff78d6a.zip opensim-SC-a21ce9151b22c75117c4ea4d2a300c302ff78d6a.tar.gz opensim-SC-a21ce9151b22c75117c4ea4d2a300c302ff78d6a.tar.bz2 opensim-SC-a21ce9151b22c75117c4ea4d2a300c302ff78d6a.tar.xz |
Merge branch 'master' into presence-refactor
Diffstat (limited to 'OpenSim')
16 files changed, 173 insertions, 37 deletions
diff --git a/OpenSim/Client/Linden/LLProxyLoginModule.cs b/OpenSim/Client/Linden/LLProxyLoginModule.cs index efae234..9075f15 100644 --- a/OpenSim/Client/Linden/LLProxyLoginModule.cs +++ b/OpenSim/Client/Linden/LLProxyLoginModule.cs | |||
@@ -268,7 +268,7 @@ namespace OpenSim.Client.Linden | |||
268 | else | 268 | else |
269 | { | 269 | { |
270 | string reason; | 270 | string reason; |
271 | if (scene.NewUserConnection(agentData, out reason)) | 271 | if (scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason)) |
272 | { | 272 | { |
273 | success = true; | 273 | success = true; |
274 | } | 274 | } |
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs index 8739ce5..8047f74 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs | |||
@@ -199,7 +199,7 @@ namespace OpenSim.Client.Linden | |||
199 | Scene scene; | 199 | Scene scene; |
200 | if (TryGetRegion(regionHandle, out scene)) | 200 | if (TryGetRegion(regionHandle, out scene)) |
201 | { | 201 | { |
202 | return scene.NewUserConnection(agent, out reason); | 202 | return scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason); |
203 | } | 203 | } |
204 | reason = "Region not found."; | 204 | reason = "Region not found."; |
205 | return false; | 205 | return false; |
diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs index 63381a4..7d71f18 100644 --- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs +++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs | |||
@@ -609,7 +609,7 @@ namespace OpenSim.Client.MXP.PacketHandler | |||
609 | agent.Appearance = new AvatarAppearance(); | 609 | agent.Appearance = new AvatarAppearance(); |
610 | } | 610 | } |
611 | 611 | ||
612 | return scene.NewUserConnection(agent, out reason); | 612 | return scene.NewUserConnection(agent, 0, out reason); |
613 | } | 613 | } |
614 | 614 | ||
615 | public void PrintDebugInformation() | 615 | public void PrintDebugInformation() |
diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs index 297b046..5ceaf39 100644 --- a/OpenSim/Framework/Communications/Clients/RegionClient.cs +++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
45 | { | 45 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | public bool DoCreateChildAgentCall(GridRegion region, AgentCircuitData aCircuit, string authKey, out string reason) | 48 | public bool DoCreateChildAgentCall(GridRegion region, AgentCircuitData aCircuit, string authKey, uint teleportFlags, out string reason) |
49 | { | 49 | { |
50 | reason = String.Empty; | 50 | reason = String.Empty; |
51 | 51 | ||
@@ -83,7 +83,8 @@ namespace OpenSim.Framework.Communications.Clients | |||
83 | } | 83 | } |
84 | // Add the regionhandle of the destination region | 84 | // Add the regionhandle of the destination region |
85 | ulong regionHandle = GetRegionHandle(region.RegionHandle); | 85 | ulong regionHandle = GetRegionHandle(region.RegionHandle); |
86 | args["destination_handle"] = OSD.FromString(regionHandle.ToString()); | 86 | args["destination_handle"] = OSD.FromString(regionHandle.ToString()); |
87 | args["teleport_flags"] = OSD.FromString(teleportFlags.ToString()); | ||
87 | 88 | ||
88 | string strBuffer = ""; | 89 | string strBuffer = ""; |
89 | byte[] buffer = new byte[1]; | 90 | byte[] buffer = new byte[1]; |
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index c727cec..10a3232 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs | |||
@@ -557,7 +557,7 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
557 | 557 | ||
558 | // Call 'new user' event handler | 558 | // Call 'new user' event handler |
559 | string reason; | 559 | string reason; |
560 | if (!homeScene.NewUserConnection(agentData, out reason)) | 560 | if (!homeScene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason)) |
561 | { | 561 | { |
562 | responseMap["connect"] = OSD.FromBoolean(false); | 562 | responseMap["connect"] = OSD.FromBoolean(false); |
563 | responseMap["message"] = OSD.FromString(String.Format("Connection refused: {0}", reason)); | 563 | responseMap["message"] = OSD.FromString(String.Format("Connection refused: {0}", reason)); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs index bdfe3b1..d68c683 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs | |||
@@ -144,7 +144,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
144 | * Agent-related communications | 144 | * Agent-related communications |
145 | */ | 145 | */ |
146 | 146 | ||
147 | public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, out string reason) | 147 | public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, uint teleportFlags, out string reason) |
148 | { | 148 | { |
149 | 149 | ||
150 | foreach (Scene s in m_sceneList) | 150 | foreach (Scene s in m_sceneList) |
@@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
152 | if (s.RegionInfo.RegionHandle == regionHandle) | 152 | if (s.RegionInfo.RegionHandle == regionHandle) |
153 | { | 153 | { |
154 | // m_log.DebugFormat("[LOCAL COMMS]: Found region {0} to send SendCreateChildAgent", regionHandle); | 154 | // m_log.DebugFormat("[LOCAL COMMS]: Found region {0} to send SendCreateChildAgent", regionHandle); |
155 | return s.NewUserConnection(aCircuit, out reason); | 155 | return s.NewUserConnection(aCircuit, teleportFlags, out reason); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 710e3ca..44458d1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs | |||
@@ -157,10 +157,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
157 | * Agent-related communications | 157 | * Agent-related communications |
158 | */ | 158 | */ |
159 | 159 | ||
160 | public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, out string reason) | 160 | public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, uint teleportFlags, out string reason) |
161 | { | 161 | { |
162 | // Try local first | 162 | // Try local first |
163 | if (m_localBackend.SendCreateChildAgent(regionHandle, aCircuit, out reason)) | 163 | if (m_localBackend.SendCreateChildAgent(regionHandle, aCircuit, teleportFlags, out reason)) |
164 | return true; | 164 | return true; |
165 | 165 | ||
166 | // else do the remote thing | 166 | // else do the remote thing |
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
173 | { | 173 | { |
174 | m_regionClient.SendUserInformation(regInfo, aCircuit); | 174 | m_regionClient.SendUserInformation(regInfo, aCircuit); |
175 | 175 | ||
176 | return m_regionClient.DoCreateChildAgentCall(regInfo, aCircuit, "None", out reason); | 176 | return m_regionClient.DoCreateChildAgentCall(regInfo, aCircuit, "None", teleportFlags, out reason); |
177 | } | 177 | } |
178 | //else | 178 | //else |
179 | // m_log.Warn("[REST COMMS]: Region not found " + regionHandle); | 179 | // m_log.Warn("[REST COMMS]: Region not found " + regionHandle); |
@@ -436,11 +436,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
436 | } | 436 | } |
437 | 437 | ||
438 | OSDMap resp = new OSDMap(2); | 438 | OSDMap resp = new OSDMap(2); |
439 | string reason = String.Empty; | 439 | string reason = String.Empty; |
440 | 440 | uint teleportFlags = 0; | |
441 | if (args.ContainsKey("teleport_flags")) | ||
442 | { | ||
443 | teleportFlags = args["teleport_flags"].AsUInteger(); | ||
444 | } | ||
445 | |||
441 | // This is the meaning of POST agent | 446 | // This is the meaning of POST agent |
442 | m_regionClient.AdjustUserInformation(aCircuit); | 447 | m_regionClient.AdjustUserInformation(aCircuit); |
443 | bool result = m_localBackend.SendCreateChildAgent(regionhandle, aCircuit, out reason); | 448 | bool result = m_localBackend.SendCreateChildAgent(regionhandle, aCircuit, teleportFlags, out reason); |
444 | 449 | ||
445 | resp["reason"] = OSD.FromString(reason); | 450 | resp["reason"] = OSD.FromString(reason); |
446 | resp["success"] = OSD.FromBoolean(result); | 451 | resp["success"] = OSD.FromBoolean(result); |
diff --git a/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs b/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs index 8f4d3d5..2d6287f 100644 --- a/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs | |||
@@ -37,7 +37,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
37 | { | 37 | { |
38 | #region Agents | 38 | #region Agents |
39 | 39 | ||
40 | bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, out string reason); | 40 | bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, uint teleportFlags, out string reason); |
41 | 41 | ||
42 | /// <summary> | 42 | /// <summary> |
43 | /// Full child agent update. | 43 | /// Full child agent update. |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index c314596..fd526eb 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -146,7 +146,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
146 | const float PREJUMP_DELAY = 0.25f; | 146 | const float PREJUMP_DELAY = 0.25f; |
147 | 147 | ||
148 | #region Inputs | 148 | #region Inputs |
149 | 149 | if (m_scenePresence.SitGround) | |
150 | { | ||
151 | return "SIT_GROUND_CONSTRAINED"; | ||
152 | } | ||
150 | AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags; | 153 | AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags; |
151 | PhysicsActor actor = m_scenePresence.PhysicsActor; | 154 | PhysicsActor actor = m_scenePresence.PhysicsActor; |
152 | 155 | ||
@@ -156,7 +159,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
156 | Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix); | 159 | Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix); |
157 | 160 | ||
158 | // Check control flags | 161 | // Check control flags |
159 | bool heldForward = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS; | 162 | bool heldForward = |
163 | (((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) || ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS)); | ||
160 | bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG; | 164 | bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG; |
161 | bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS; | 165 | bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS; |
162 | bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG; | 166 | bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG; |
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index 0f9c190..416826c 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -203,7 +203,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
203 | string reason = String.Empty; | 203 | string reason = String.Empty; |
204 | 204 | ||
205 | //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit)) | 205 | //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit)) |
206 | if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, out reason)) | 206 | if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, teleportFlags, out reason)) |
207 | { | 207 | { |
208 | avatar.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}", | 208 | avatar.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}", |
209 | reason)); | 209 | reason)); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f79eb5d..0e1e2be 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3316,12 +3316,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3316 | /// Use NewUserConnection() directly if possible so the return type can refuse connections. | 3316 | /// Use NewUserConnection() directly if possible so the return type can refuse connections. |
3317 | /// At the moment nothing actually seems to use this event, | 3317 | /// At the moment nothing actually seems to use this event, |
3318 | /// as everything is switching to calling the NewUserConnection method directly. | 3318 | /// as everything is switching to calling the NewUserConnection method directly. |
3319 | /// | ||
3320 | /// Now obsoleting this because it doesn't handle teleportFlags propertly | ||
3321 | /// | ||
3319 | /// </summary> | 3322 | /// </summary> |
3320 | /// <param name="agent"></param> | 3323 | /// <param name="agent"></param> |
3324 | [Obsolete("Please call NewUserConnection directly.")] | ||
3321 | public void HandleNewUserConnection(AgentCircuitData agent) | 3325 | public void HandleNewUserConnection(AgentCircuitData agent) |
3322 | { | 3326 | { |
3323 | string reason; | 3327 | string reason; |
3324 | NewUserConnection(agent, out reason); | 3328 | NewUserConnection(agent, 0, out reason); |
3325 | } | 3329 | } |
3326 | 3330 | ||
3327 | /// <summary> | 3331 | /// <summary> |
@@ -3334,8 +3338,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3334 | /// <param name="reason">Outputs the reason for the false response on this string</param> | 3338 | /// <param name="reason">Outputs the reason for the false response on this string</param> |
3335 | /// <returns>True if the region accepts this agent. False if it does not. False will | 3339 | /// <returns>True if the region accepts this agent. False if it does not. False will |
3336 | /// also return a reason.</returns> | 3340 | /// also return a reason.</returns> |
3337 | public bool NewUserConnection(AgentCircuitData agent, out string reason) | 3341 | public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) |
3338 | { | 3342 | { |
3343 | //Teleport flags: | ||
3344 | // | ||
3345 | // TeleportFlags.ViaGodlikeLure - Border Crossing | ||
3346 | // TeleportFlags.ViaLogin - Login | ||
3347 | // TeleportFlags.TeleportFlags.ViaLure - Teleport request sent by another user | ||
3348 | // TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport | ||
3349 | |||
3350 | |||
3339 | if (loginsdisabled) | 3351 | if (loginsdisabled) |
3340 | { | 3352 | { |
3341 | reason = "Logins Disabled"; | 3353 | reason = "Logins Disabled"; |
@@ -3343,9 +3355,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3343 | } | 3355 | } |
3344 | // Don't disable this log message - it's too helpful | 3356 | // Don't disable this log message - it's too helpful |
3345 | m_log.InfoFormat( | 3357 | m_log.InfoFormat( |
3346 | "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5})", | 3358 | "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6})", |
3347 | RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, | 3359 | RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, |
3348 | agent.AgentID, agent.circuitcode); | 3360 | agent.AgentID, agent.circuitcode, teleportFlags); |
3349 | 3361 | ||
3350 | reason = String.Empty; | 3362 | reason = String.Empty; |
3351 | if (!AuthenticateUser(agent, out reason)) | 3363 | if (!AuthenticateUser(agent, out reason)) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index e649139..f49d072 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
286 | string reason = String.Empty; | 286 | string reason = String.Empty; |
287 | 287 | ||
288 | 288 | ||
289 | bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason); | 289 | bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, 0, out reason); |
290 | 290 | ||
291 | if (regionAccepted && newAgent) | 291 | if (regionAccepted && newAgent) |
292 | { | 292 | { |
@@ -810,7 +810,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
810 | 810 | ||
811 | // Let's create an agent there if one doesn't exist yet. | 811 | // Let's create an agent there if one doesn't exist yet. |
812 | //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit)) | 812 | //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit)) |
813 | if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, out reason)) | 813 | if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, teleportFlags, out reason)) |
814 | { | 814 | { |
815 | avatar.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}", | 815 | avatar.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}", |
816 | reason)); | 816 | reason)); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 289ba47..277081a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
124 | private Vector3? m_forceToApply; | 124 | private Vector3? m_forceToApply; |
125 | private uint m_requestedSitTargetID; | 125 | private uint m_requestedSitTargetID; |
126 | private UUID m_requestedSitTargetUUID; | 126 | private UUID m_requestedSitTargetUUID; |
127 | public bool SitGround = false; | ||
127 | 128 | ||
128 | private SendCourseLocationsMethod m_sendCourseLocationsMethod; | 129 | private SendCourseLocationsMethod m_sendCourseLocationsMethod; |
129 | 130 | ||
@@ -169,7 +170,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
169 | protected RegionInfo m_regionInfo; | 170 | protected RegionInfo m_regionInfo; |
170 | protected ulong crossingFromRegion; | 171 | protected ulong crossingFromRegion; |
171 | 172 | ||
172 | private readonly Vector3[] Dir_Vectors = new Vector3[6]; | 173 | private readonly Vector3[] Dir_Vectors = new Vector3[9]; |
173 | 174 | ||
174 | // Position of agent's camera in world (region cordinates) | 175 | // Position of agent's camera in world (region cordinates) |
175 | protected Vector3 m_CameraCenter; | 176 | protected Vector3 m_CameraCenter; |
@@ -233,6 +234,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
233 | DIR_CONTROL_FLAG_RIGHT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG, | 234 | DIR_CONTROL_FLAG_RIGHT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG, |
234 | DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, | 235 | DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, |
235 | DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, | 236 | DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, |
237 | DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS, | ||
238 | DIR_CONTROL_FLAG_BACKWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, | ||
236 | DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG | 239 | DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG |
237 | } | 240 | } |
238 | 241 | ||
@@ -717,19 +720,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
717 | Dir_Vectors[3] = -Vector3.UnitY; //RIGHT | 720 | Dir_Vectors[3] = -Vector3.UnitY; //RIGHT |
718 | Dir_Vectors[4] = Vector3.UnitZ; //UP | 721 | Dir_Vectors[4] = Vector3.UnitZ; //UP |
719 | Dir_Vectors[5] = -Vector3.UnitZ; //DOWN | 722 | Dir_Vectors[5] = -Vector3.UnitZ; //DOWN |
720 | Dir_Vectors[5] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge | 723 | Dir_Vectors[8] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge |
724 | Dir_Vectors[6] = Vector3.UnitX*2; //FORWARD | ||
725 | Dir_Vectors[7] = -Vector3.UnitX; //BACK | ||
721 | } | 726 | } |
722 | 727 | ||
723 | private Vector3[] GetWalkDirectionVectors() | 728 | private Vector3[] GetWalkDirectionVectors() |
724 | { | 729 | { |
725 | Vector3[] vector = new Vector3[6]; | 730 | Vector3[] vector = new Vector3[9]; |
726 | vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD | 731 | vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD |
727 | vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK | 732 | vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK |
728 | vector[2] = Vector3.UnitY; //LEFT | 733 | vector[2] = Vector3.UnitY; //LEFT |
729 | vector[3] = -Vector3.UnitY; //RIGHT | 734 | vector[3] = -Vector3.UnitY; //RIGHT |
730 | vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP | 735 | vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP |
731 | vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN | 736 | vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN |
732 | vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_Nudge | 737 | vector[8] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_Nudge |
738 | vector[6] = (new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z) * 2); //FORWARD Nudge | ||
739 | vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK Nudge | ||
733 | return vector; | 740 | return vector; |
734 | } | 741 | } |
735 | 742 | ||
@@ -1248,7 +1255,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1248 | // TODO: This doesn't prevent the user from walking yet. | 1255 | // TODO: This doesn't prevent the user from walking yet. |
1249 | // Setting parent ID would fix this, if we knew what value | 1256 | // Setting parent ID would fix this, if we knew what value |
1250 | // to use. Or we could add a m_isSitting variable. | 1257 | // to use. Or we could add a m_isSitting variable. |
1251 | Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); | 1258 | //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); |
1259 | SitGround = true; | ||
1260 | |||
1252 | } | 1261 | } |
1253 | 1262 | ||
1254 | // In the future, these values might need to go global. | 1263 | // In the future, these values might need to go global. |
@@ -1306,6 +1315,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1306 | else | 1315 | else |
1307 | dirVectors = Dir_Vectors; | 1316 | dirVectors = Dir_Vectors; |
1308 | 1317 | ||
1318 | // The fact that m_movementflag is a byte needs to be fixed | ||
1319 | // it really should be a uint | ||
1320 | uint nudgehack = 250; | ||
1309 | foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) | 1321 | foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) |
1310 | { | 1322 | { |
1311 | if (((uint)flags & (uint)DCF) != 0) | 1323 | if (((uint)flags & (uint)DCF) != 0) |
@@ -1315,24 +1327,40 @@ namespace OpenSim.Region.Framework.Scenes | |||
1315 | try | 1327 | try |
1316 | { | 1328 | { |
1317 | agent_control_v3 += dirVectors[i]; | 1329 | agent_control_v3 += dirVectors[i]; |
1330 | //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); | ||
1318 | } | 1331 | } |
1319 | catch (IndexOutOfRangeException) | 1332 | catch (IndexOutOfRangeException) |
1320 | { | 1333 | { |
1321 | // Why did I get this? | 1334 | // Why did I get this? |
1322 | } | 1335 | } |
1323 | 1336 | ||
1324 | if ((m_movementflag & (uint)DCF) == 0) | 1337 | if ((m_movementflag & (byte)(uint)DCF) == 0) |
1325 | { | 1338 | { |
1339 | if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) | ||
1340 | { | ||
1341 | m_movementflag |= (byte)nudgehack; | ||
1342 | } | ||
1326 | m_movementflag += (byte)(uint)DCF; | 1343 | m_movementflag += (byte)(uint)DCF; |
1327 | update_movementflag = true; | 1344 | update_movementflag = true; |
1328 | } | 1345 | } |
1329 | } | 1346 | } |
1330 | else | 1347 | else |
1331 | { | 1348 | { |
1332 | if ((m_movementflag & (uint)DCF) != 0) | 1349 | if ((m_movementflag & (byte)(uint)DCF) != 0 || |
1350 | ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) | ||
1351 | && ((m_movementflag & (byte)nudgehack) == nudgehack)) | ||
1352 | ) // This or is for Nudge forward | ||
1333 | { | 1353 | { |
1334 | m_movementflag -= (byte)(uint)DCF; | 1354 | m_movementflag -= ((byte)(uint)DCF); |
1355 | |||
1335 | update_movementflag = true; | 1356 | update_movementflag = true; |
1357 | /* | ||
1358 | if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) | ||
1359 | && ((m_movementflag & (byte)nudgehack) == nudgehack)) | ||
1360 | { | ||
1361 | m_log.Debug("Removed Hack flag"); | ||
1362 | } | ||
1363 | */ | ||
1336 | } | 1364 | } |
1337 | else | 1365 | else |
1338 | { | 1366 | { |
@@ -1470,7 +1498,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1470 | } | 1498 | } |
1471 | } | 1499 | } |
1472 | 1500 | ||
1473 | if (update_movementflag) | 1501 | if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0) && !SitGround) |
1474 | Animator.UpdateMovementAnimations(); | 1502 | Animator.UpdateMovementAnimations(); |
1475 | 1503 | ||
1476 | m_scene.EventManager.TriggerOnClientMovement(this); | 1504 | m_scene.EventManager.TriggerOnClientMovement(this); |
@@ -1582,8 +1610,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1582 | /// </summary> | 1610 | /// </summary> |
1583 | public void StandUp() | 1611 | public void StandUp() |
1584 | { | 1612 | { |
1613 | if (SitGround) | ||
1614 | SitGround = false; | ||
1615 | |||
1585 | if (m_parentID != 0) | 1616 | if (m_parentID != 0) |
1586 | { | 1617 | { |
1618 | m_log.Debug("StandupCode Executed"); | ||
1587 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); | 1619 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); |
1588 | if (part != null) | 1620 | if (part != null) |
1589 | { | 1621 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index f495022..f00dd66 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
117 | agent.child = true; | 117 | agent.child = true; |
118 | 118 | ||
119 | string reason; | 119 | string reason; |
120 | scene.NewUserConnection(agent, out reason); | 120 | scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason); |
121 | testclient = new TestClient(agent, scene); | 121 | testclient = new TestClient(agent, scene); |
122 | scene.AddNewClient(testclient); | 122 | scene.AddNewClient(testclient); |
123 | 123 | ||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
153 | if (acd1 == null) | 153 | if (acd1 == null) |
154 | fixNullPresence(); | 154 | fixNullPresence(); |
155 | 155 | ||
156 | scene.NewUserConnection(acd1, out reason); | 156 | scene.NewUserConnection(acd1, 0, out reason); |
157 | if (testclient == null) | 157 | if (testclient == null) |
158 | testclient = new TestClient(acd1, scene); | 158 | testclient = new TestClient(acd1, scene); |
159 | scene.AddNewClient(testclient); | 159 | scene.AddNewClient(testclient); |
@@ -242,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
242 | 242 | ||
243 | // Adding child agent to region 1001 | 243 | // Adding child agent to region 1001 |
244 | string reason; | 244 | string reason; |
245 | scene2.NewUserConnection(acd1, out reason); | 245 | scene2.NewUserConnection(acd1,0, out reason); |
246 | scene2.AddNewClient(testclient); | 246 | scene2.AddNewClient(testclient); |
247 | 247 | ||
248 | ScenePresence presence = scene.GetScenePresence(agent1); | 248 | ScenePresence presence = scene.GetScenePresence(agent1); |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 92f060b..1a99c83 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | |||
@@ -88,7 +88,89 @@ namespace OpenSim.Region.RegionCombinerModule | |||
88 | public void RegionLoaded(Scene scene) | 88 | public void RegionLoaded(Scene scene) |
89 | { | 89 | { |
90 | if (enabledYN) | 90 | if (enabledYN) |
91 | { | ||
91 | RegionLoadedDoWork(scene); | 92 | RegionLoadedDoWork(scene); |
93 | |||
94 | scene.EventManager.OnNewPresence += NewPresence; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | private void NewPresence(ScenePresence presence) | ||
99 | { | ||
100 | if (presence.IsChildAgent) | ||
101 | { | ||
102 | byte[] throttleData; | ||
103 | |||
104 | try | ||
105 | { | ||
106 | throttleData = presence.ControllingClient.GetThrottlesPacked(1); | ||
107 | } | ||
108 | catch (NotImplementedException) | ||
109 | { | ||
110 | return; | ||
111 | } | ||
112 | |||
113 | if (throttleData == null) | ||
114 | return; | ||
115 | |||
116 | if (throttleData.Length == 0) | ||
117 | return; | ||
118 | |||
119 | if (throttleData.Length != 28) | ||
120 | return; | ||
121 | |||
122 | byte[] adjData; | ||
123 | int pos = 0; | ||
124 | |||
125 | if (!BitConverter.IsLittleEndian) | ||
126 | { | ||
127 | byte[] newData = new byte[7 * 4]; | ||
128 | Buffer.BlockCopy(throttleData, 0, newData, 0, 7 * 4); | ||
129 | |||
130 | for (int i = 0; i < 7; i++) | ||
131 | Array.Reverse(newData, i * 4, 4); | ||
132 | |||
133 | adjData = newData; | ||
134 | } | ||
135 | else | ||
136 | { | ||
137 | adjData = throttleData; | ||
138 | } | ||
139 | |||
140 | // 0.125f converts from bits to bytes | ||
141 | int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
142 | int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
143 | int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
144 | int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
145 | int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
146 | int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
147 | int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
148 | // State is a subcategory of task that we allocate a percentage to | ||
149 | |||
150 | |||
151 | //int total = resend + land + wind + cloud + task + texture + asset; | ||
152 | |||
153 | byte[] data = new byte[7 * 4]; | ||
154 | int ii = 0; | ||
155 | |||
156 | Buffer.BlockCopy(Utils.FloatToBytes(resend), 0, data, ii, 4); ii += 4; | ||
157 | Buffer.BlockCopy(Utils.FloatToBytes(land * 50), 0, data, ii, 4); ii += 4; | ||
158 | Buffer.BlockCopy(Utils.FloatToBytes(wind), 0, data, ii, 4); ii += 4; | ||
159 | Buffer.BlockCopy(Utils.FloatToBytes(cloud), 0, data, ii, 4); ii += 4; | ||
160 | Buffer.BlockCopy(Utils.FloatToBytes(task), 0, data, ii, 4); ii += 4; | ||
161 | Buffer.BlockCopy(Utils.FloatToBytes(texture), 0, data, ii, 4); ii += 4; | ||
162 | Buffer.BlockCopy(Utils.FloatToBytes(asset), 0, data, ii, 4); | ||
163 | |||
164 | try | ||
165 | { | ||
166 | presence.ControllingClient.SetChildAgentThrottle(data); | ||
167 | } | ||
168 | catch (NotImplementedException) | ||
169 | { | ||
170 | return; | ||
171 | } | ||
172 | |||
173 | } | ||
92 | } | 174 | } |
93 | 175 | ||
94 | private void RegionLoadedDoWork(Scene scene) | 176 | private void RegionLoadedDoWork(Scene scene) |
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 8b18d07..b13e8dd 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -382,7 +382,7 @@ namespace OpenSim.Tests.Common.Setup | |||
382 | 382 | ||
383 | // We emulate the proper login sequence here by doing things in three stages | 383 | // We emulate the proper login sequence here by doing things in three stages |
384 | // Stage 1: simulate login by telling the scene to expect a new user connection | 384 | // Stage 1: simulate login by telling the scene to expect a new user connection |
385 | scene.NewUserConnection(agentData, out reason); | 385 | scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason); |
386 | 386 | ||
387 | // Stage 2: add the new client as a child agent to the scene | 387 | // Stage 2: add the new client as a child agent to the scene |
388 | TestClient client = new TestClient(agentData, scene); | 388 | TestClient client = new TestClient(agentData, scene); |