diff options
author | diva | 2009-01-03 02:29:49 +0000 |
---|---|---|
committer | diva | 2009-01-03 02:29:49 +0000 |
commit | 4144fd0eb2ea93b9bb83b7ab81780fd00c999c82 (patch) | |
tree | 601fbe1847eda7cfa828ac0532175af6ea040bc3 | |
parent | Plumb in dwell in a couple of places (diff) | |
download | opensim-SC-4144fd0eb2ea93b9bb83b7ab81780fd00c999c82.zip opensim-SC-4144fd0eb2ea93b9bb83b7ab81780fd00c999c82.tar.gz opensim-SC-4144fd0eb2ea93b9bb83b7ab81780fd00c999c82.tar.bz2 opensim-SC-4144fd0eb2ea93b9bb83b7ab81780fd00c999c82.tar.xz |
Split agent updates into two messages: full update and position+camera update. They're both sent over HTTP PUT. The full update is sent on TPs, for now; later it will also be sent on region crossings.
8 files changed, 223 insertions, 51 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index dd505ad..34f2866 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -88,14 +88,28 @@ namespace OpenSim.Framework | |||
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | public interface IAgentData | ||
92 | { | ||
93 | UUID AgentID { get; set; } | ||
94 | |||
95 | OSDMap PackUpdateMessage(); | ||
96 | void UnpackUpdateMessage(OSDMap map); | ||
97 | } | ||
98 | |||
91 | /// <summary> | 99 | /// <summary> |
92 | /// Replacement for ChildAgentDataUpdate. Used over RESTComms and LocalComms. | 100 | /// Replacement for ChildAgentDataUpdate. Used over RESTComms and LocalComms. |
93 | /// </summary> | 101 | /// </summary> |
94 | public class AgentPosition | 102 | public class AgentPosition : IAgentData |
95 | { | 103 | { |
104 | private UUID m_id; | ||
105 | public UUID AgentID | ||
106 | { | ||
107 | get { return m_id; } | ||
108 | set { m_id = value; } | ||
109 | } | ||
110 | |||
96 | public ulong RegionHandle; | 111 | public ulong RegionHandle; |
97 | public uint CircuitCode; | 112 | public uint CircuitCode; |
98 | public UUID AgentID; | ||
99 | public UUID SessionID; | 113 | public UUID SessionID; |
100 | 114 | ||
101 | public float Far; | 115 | public float Far; |
@@ -272,12 +286,16 @@ namespace OpenSim.Framework | |||
272 | } | 286 | } |
273 | } | 287 | } |
274 | 288 | ||
275 | public class AgentData | 289 | public class AgentData : IAgentData |
276 | { | 290 | { |
291 | private UUID m_id; | ||
292 | public UUID AgentID | ||
293 | { | ||
294 | get { return m_id; } | ||
295 | set { m_id = value; } | ||
296 | } | ||
277 | public ulong RegionHandle; | 297 | public ulong RegionHandle; |
278 | public uint CircuitCode; | 298 | public uint CircuitCode; |
279 | |||
280 | public UUID AgentID; | ||
281 | public UUID SessionID; | 299 | public UUID SessionID; |
282 | 300 | ||
283 | public Vector3 Position; | 301 | public Vector3 Position; |
diff --git a/OpenSim/Region/Environment/Interfaces/IInterregionComms.cs b/OpenSim/Region/Environment/Interfaces/IInterregionComms.cs index e197622..aa618a7 100644 --- a/OpenSim/Region/Environment/Interfaces/IInterregionComms.cs +++ b/OpenSim/Region/Environment/Interfaces/IInterregionComms.cs | |||
@@ -35,8 +35,38 @@ namespace OpenSim.Region.Environment.Interfaces | |||
35 | 35 | ||
36 | public interface IInterregionCommsOut | 36 | public interface IInterregionCommsOut |
37 | { | 37 | { |
38 | /// <summary> | ||
39 | /// Full child agent update. | ||
40 | /// </summary> | ||
41 | /// <param name="regionHandle"></param> | ||
42 | /// <param name="data"></param> | ||
43 | /// <returns></returns> | ||
38 | bool SendChildAgentUpdate(ulong regionHandle, AgentData data); | 44 | bool SendChildAgentUpdate(ulong regionHandle, AgentData data); |
45 | |||
46 | /// <summary> | ||
47 | /// Short child agent update, mostly for position. | ||
48 | /// </summary> | ||
49 | /// <param name="regionHandle"></param> | ||
50 | /// <param name="data"></param> | ||
51 | /// <returns></returns> | ||
52 | bool SendChildAgentUpdate(ulong regionHandle, AgentPosition data); | ||
53 | |||
54 | /// <summary> | ||
55 | /// Message from receiving region to departing region, telling it got contacted by the client. | ||
56 | /// When sent over REST, it invokes the opaque uri. | ||
57 | /// </summary> | ||
58 | /// <param name="regionHandle"></param> | ||
59 | /// <param name="id"></param> | ||
60 | /// <param name="uri"></param> | ||
61 | /// <returns></returns> | ||
39 | bool SendReleaseAgent(ulong regionHandle, UUID id, string uri); | 62 | bool SendReleaseAgent(ulong regionHandle, UUID id, string uri); |
63 | |||
64 | /// <summary> | ||
65 | /// Close agent. | ||
66 | /// </summary> | ||
67 | /// <param name="regionHandle"></param> | ||
68 | /// <param name="id"></param> | ||
69 | /// <returns></returns> | ||
40 | bool SendCloseAgent(ulong regionHandle, UUID id); | 70 | bool SendCloseAgent(ulong regionHandle, UUID id); |
41 | } | 71 | } |
42 | 72 | ||
diff --git a/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs b/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs index 9f547a2..135a05e 100644 --- a/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs +++ b/OpenSim/Region/Environment/Modules/Communications/Local/LocalInterregionComms.cs | |||
@@ -133,6 +133,21 @@ namespace OpenSim.Region.Environment.Modules.Communications.Local | |||
133 | return false; | 133 | return false; |
134 | } | 134 | } |
135 | 135 | ||
136 | public bool SendChildAgentUpdate(ulong regionHandle, AgentPosition cAgentData) | ||
137 | { | ||
138 | foreach (Scene s in m_sceneList) | ||
139 | { | ||
140 | if (s.RegionInfo.RegionHandle == regionHandle) | ||
141 | { | ||
142 | //m_log.Debug("[LOCAL COMMS]: Found region to send ChildAgentUpdate"); | ||
143 | s.IncomingChildAgentDataUpdate(cAgentData); | ||
144 | return true; | ||
145 | } | ||
146 | } | ||
147 | //m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate"); | ||
148 | return false; | ||
149 | } | ||
150 | |||
136 | public bool SendReleaseAgent(ulong regionHandle, UUID id, string uri) | 151 | public bool SendReleaseAgent(ulong regionHandle, UUID id, string uri) |
137 | { | 152 | { |
138 | //uint x, y; | 153 | //uint x, y; |
diff --git a/OpenSim/Region/Environment/Modules/Communications/REST/RESTInterregionComms.cs b/OpenSim/Region/Environment/Modules/Communications/REST/RESTInterregionComms.cs index f48e474..bff8316 100644 --- a/OpenSim/Region/Environment/Modules/Communications/REST/RESTInterregionComms.cs +++ b/OpenSim/Region/Environment/Modules/Communications/REST/RESTInterregionComms.cs | |||
@@ -146,6 +146,23 @@ namespace OpenSim.Region.Environment.Modules.Communications.REST | |||
146 | 146 | ||
147 | } | 147 | } |
148 | 148 | ||
149 | public bool SendChildAgentUpdate(ulong regionHandle, AgentPosition cAgentData) | ||
150 | { | ||
151 | // Try local first | ||
152 | if (m_localBackend.SendChildAgentUpdate(regionHandle, cAgentData)) | ||
153 | return true; | ||
154 | |||
155 | // else do the remote thing | ||
156 | RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle); | ||
157 | if (regInfo != null) | ||
158 | { | ||
159 | return DoChildAgentUpdateCall(regInfo, cAgentData); | ||
160 | } | ||
161 | //else | ||
162 | // m_log.Warn("[REST COMMS]: Region not found " + regionHandle); | ||
163 | return false; | ||
164 | |||
165 | } | ||
149 | public bool SendReleaseAgent(ulong regionHandle, UUID id, string uri) | 166 | public bool SendReleaseAgent(ulong regionHandle, UUID id, string uri) |
150 | { | 167 | { |
151 | // Try local first | 168 | // Try local first |
@@ -180,7 +197,7 @@ namespace OpenSim.Region.Environment.Modules.Communications.REST | |||
180 | // Internal functions for the above public interface | 197 | // Internal functions for the above public interface |
181 | //------------------------------------------------------------------- | 198 | //------------------------------------------------------------------- |
182 | 199 | ||
183 | protected bool DoChildAgentUpdateCall(RegionInfo region, AgentData cAgentData) | 200 | protected bool DoChildAgentUpdateCall(RegionInfo region, IAgentData cAgentData) |
184 | { | 201 | { |
185 | // Eventually, we want to use a caps url instead of the agentID | 202 | // Eventually, we want to use a caps url instead of the agentID |
186 | string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + cAgentData.AgentID + "/"; | 203 | string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + cAgentData.AgentID + "/"; |
@@ -436,20 +453,51 @@ namespace OpenSim.Region.Environment.Modules.Communications.REST | |||
436 | if (args["destination_handle"] != null) | 453 | if (args["destination_handle"] != null) |
437 | UInt64.TryParse(args["destination_handle"].AsString(), out regionhandle); | 454 | UInt64.TryParse(args["destination_handle"].AsString(), out regionhandle); |
438 | 455 | ||
439 | AgentData agent = new AgentData(); | 456 | string messageType; |
440 | try | 457 | if (args["message_type"] != null) |
458 | messageType = args["message_type"].AsString(); | ||
459 | else | ||
441 | { | 460 | { |
442 | agent.UnpackUpdateMessage(args); | 461 | m_log.Warn("[REST COMMS]: Agent Put Message Type not found. "); |
462 | messageType = "AgentData"; | ||
443 | } | 463 | } |
444 | catch (Exception ex) | 464 | |
465 | bool result = true; | ||
466 | if ("AgentData".Equals(messageType)) | ||
445 | { | 467 | { |
446 | m_log.InfoFormat("[REST COMMS]: exception on unpacking ChildAgentUpdate message {0}", ex.Message); | 468 | AgentData agent = new AgentData(); |
447 | return; | 469 | try |
470 | { | ||
471 | agent.UnpackUpdateMessage(args); | ||
472 | } | ||
473 | catch (Exception ex) | ||
474 | { | ||
475 | m_log.InfoFormat("[REST COMMS]: exception on unpacking ChildAgentUpdate message {0}", ex.Message); | ||
476 | return; | ||
477 | } | ||
478 | //agent.Dump(); | ||
479 | // This is one of the meanings of PUT agent | ||
480 | result = m_localBackend.SendChildAgentUpdate(regionhandle, agent); | ||
481 | |||
482 | } | ||
483 | else if ("AgentPosition".Equals(messageType)) | ||
484 | { | ||
485 | AgentPosition agent = new AgentPosition(); | ||
486 | try | ||
487 | { | ||
488 | agent.UnpackUpdateMessage(args); | ||
489 | } | ||
490 | catch (Exception ex) | ||
491 | { | ||
492 | m_log.InfoFormat("[REST COMMS]: exception on unpacking ChildAgentUpdate message {0}", ex.Message); | ||
493 | return; | ||
494 | } | ||
495 | //agent.Dump(); | ||
496 | // This is one of the meanings of PUT agent | ||
497 | result = m_localBackend.SendChildAgentUpdate(regionhandle, agent); | ||
498 | |||
448 | } | 499 | } |
449 | //agent.Dump(); | ||
450 | 500 | ||
451 | // This is the meaning of PUT agent | ||
452 | bool result = m_localBackend.SendChildAgentUpdate(regionhandle, agent); | ||
453 | 501 | ||
454 | 502 | ||
455 | responsedata["int_response_code"] = 200; | 503 | responsedata["int_response_code"] = 200; |
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs index abf4065..5e1621b 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
260 | // Let's send a full update of the agent. This is a synchronous call. | 260 | // Let's send a full update of the agent. This is a synchronous call. |
261 | AgentData agent = new AgentData(); | 261 | AgentData agent = new AgentData(); |
262 | avatar.CopyTo(agent); | 262 | avatar.CopyTo(agent); |
263 | agent.Position = new Vector3(-1, -1, -1); // this means ignore position info; UGH!!!! | 263 | agent.Position = position; |
264 | agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + | 264 | agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + |
265 | "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; | 265 | "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; |
266 | 266 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f652e21..408f100 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2970,7 +2970,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
2970 | 2970 | ||
2971 | public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) | 2971 | public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) |
2972 | { | 2972 | { |
2973 | //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate in " + RegionInfo.RegionName); | 2973 | //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate FULL in " + RegionInfo.RegionName); |
2974 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); | ||
2975 | if (childAgentUpdate != null) | ||
2976 | { | ||
2977 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); | ||
2978 | return true; | ||
2979 | } | ||
2980 | return false; | ||
2981 | } | ||
2982 | |||
2983 | public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) | ||
2984 | { | ||
2985 | //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); | ||
2974 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); | 2986 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); |
2975 | if (childAgentUpdate != null) | 2987 | if (childAgentUpdate != null) |
2976 | { | 2988 | { |
@@ -3174,7 +3186,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
3174 | return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); | 3186 | return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); |
3175 | } | 3187 | } |
3176 | 3188 | ||
3177 | public void SendOutChildAgentUpdates(AgentData cadu, ScenePresence presence) | 3189 | public void SendOutChildAgentUpdates(AgentPosition cadu, ScenePresence presence) |
3178 | { | 3190 | { |
3179 | m_sceneGridService.SendChildAgentDataUpdate(cadu, presence); | 3191 | m_sceneGridService.SendChildAgentDataUpdate(cadu, presence); |
3180 | } | 3192 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index da3a9d3..8b3ac4f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -538,7 +538,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
538 | //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region)); | 538 | //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region)); |
539 | } | 539 | } |
540 | 540 | ||
541 | public delegate void SendChildAgentDataUpdateDelegate(AgentData cAgentData, ulong regionHandle); | 541 | public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); |
542 | 542 | ||
543 | /// <summary> | 543 | /// <summary> |
544 | /// This informs all neighboring regions about the settings of it's child agent. | 544 | /// This informs all neighboring regions about the settings of it's child agent. |
@@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
547 | /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. | 547 | /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. |
548 | /// | 548 | /// |
549 | /// </summary> | 549 | /// </summary> |
550 | private void SendChildAgentDataUpdateAsync(AgentData cAgentData, ulong regionHandle) | 550 | private void SendChildAgentDataUpdateAsync(AgentPosition cAgentData, ulong regionHandle) |
551 | { | 551 | { |
552 | //m_log.Info("[INTERGRID]: Informing neighbors about my agent in " + m_regionInfo.RegionName); | 552 | //m_log.Info("[INTERGRID]: Informing neighbors about my agent in " + m_regionInfo.RegionName); |
553 | try | 553 | try |
@@ -577,7 +577,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
577 | icon.EndInvoke(iar); | 577 | icon.EndInvoke(iar); |
578 | } | 578 | } |
579 | 579 | ||
580 | public void SendChildAgentDataUpdate(AgentData cAgentData, ScenePresence presence) | 580 | public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence) |
581 | { | 581 | { |
582 | // This assumes that we know what our neighbors are. | 582 | // This assumes that we know what our neighbors are. |
583 | try | 583 | try |
@@ -847,7 +847,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
847 | // Let's send a full update of the agent. This is a synchronous call. | 847 | // Let's send a full update of the agent. This is a synchronous call. |
848 | AgentData agent = new AgentData(); | 848 | AgentData agent = new AgentData(); |
849 | avatar.CopyTo(agent); | 849 | avatar.CopyTo(agent); |
850 | agent.Position = new Vector3(-1, -1, -1); // this means ignore position info; UGH!!!! | 850 | agent.Position = position; |
851 | agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + | 851 | agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + |
852 | "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; | 852 | "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; |
853 | 853 | ||
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 205d5cc..073457b 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -2338,10 +2338,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2338 | cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); | 2338 | cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); |
2339 | cadu.Velocity = new sLLVector3(Velocity); | 2339 | cadu.Velocity = new sLLVector3(Velocity); |
2340 | 2340 | ||
2341 | AgentData agent = new AgentData(); | 2341 | AgentPosition agentpos = new AgentPosition(); |
2342 | agent.CopyFrom(cadu); | 2342 | agentpos.CopyFrom(cadu); |
2343 | 2343 | ||
2344 | m_scene.SendOutChildAgentUpdates(agent, this); | 2344 | m_scene.SendOutChildAgentUpdates(agentpos, this); |
2345 | 2345 | ||
2346 | m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; | 2346 | m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; |
2347 | m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; | 2347 | m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; |
@@ -2583,17 +2583,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
2583 | } | 2583 | } |
2584 | 2584 | ||
2585 | #region Child Agent Updates | 2585 | #region Child Agent Updates |
2586 | |||
2587 | public void ChildAgentDataUpdate(AgentData cAgentData) | ||
2588 | { | ||
2589 | //Console.WriteLine(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); | ||
2590 | if (!IsChildAgent) | ||
2591 | return; | ||
2592 | |||
2593 | CopyFrom(cAgentData); | ||
2594 | } | ||
2595 | |||
2586 | /// <summary> | 2596 | /// <summary> |
2587 | /// This updates important decision making data about a child agent | 2597 | /// This updates important decision making data about a child agent |
2588 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region | 2598 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region |
2589 | /// </summary> | 2599 | /// </summary> |
2590 | public void ChildAgentDataUpdate(AgentData cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) | 2600 | public void ChildAgentDataUpdate(AgentPosition cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) |
2591 | { | 2601 | { |
2592 | // | 2602 | // |
2593 | if (!IsChildAgent) | 2603 | if (!IsChildAgent) |
2594 | return; | 2604 | return; |
2595 | 2605 | ||
2596 | //Console.WriteLine(" >>> ChildAgentDataUpdate <<< " + rRegionX + "-" + rRegionY); | 2606 | //Console.WriteLine(" >>> ChildAgentPositionUpdate <<< " + rRegionX + "-" + rRegionY); |
2597 | int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; | 2607 | int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; |
2598 | int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; | 2608 | int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; |
2599 | 2609 | ||
@@ -2602,33 +2612,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
2602 | m_pos = new Vector3(cAgentData.Position.X + shiftx, cAgentData.Position.Y + shifty, cAgentData.Position.Z); | 2612 | m_pos = new Vector3(cAgentData.Position.X + shiftx, cAgentData.Position.Y + shifty, cAgentData.Position.Z); |
2603 | 2613 | ||
2604 | // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region | 2614 | // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region |
2605 | if (cAgentData.Center!= new Vector3(-1, -1, -1)) // UGH! | 2615 | m_CameraCenter = cAgentData.Center; |
2606 | m_CameraCenter = cAgentData.Center; | ||
2607 | // new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); | ||
2608 | |||
2609 | 2616 | ||
2610 | m_godlevel = cAgentData.GodLevel; | 2617 | m_avHeight = cAgentData.Size.Z; |
2611 | if (cAgentData.Center != new Vector3(-1, -1, -1)) | ||
2612 | m_avHeight = cAgentData.Size.Z; | ||
2613 | //SetHeight(cAgentData.AVHeight); | 2618 | //SetHeight(cAgentData.AVHeight); |
2614 | 2619 | ||
2615 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) | 2620 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) |
2616 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); | 2621 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); |
2617 | 2622 | ||
2618 | // ugh!!! | ||
2619 | m_AgentControlFlags = cAgentData.ControlFlags; | ||
2620 | if (m_physicsActor != null) | ||
2621 | { | ||
2622 | m_physicsActor.Flying = ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | ||
2623 | } | ||
2624 | 2623 | ||
2625 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. | 2624 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. |
2626 | if (m_scene.m_seeIntoRegionFromNeighbor) | 2625 | if (m_scene.m_seeIntoRegionFromNeighbor) |
2627 | m_pendingObjects = null; | 2626 | m_pendingObjects = null; |
2628 | 2627 | ||
2629 | m_callbackURI = cAgentData.CallbackURI; | ||
2630 | m_rootRegionHandle = Util.UIntsToLong(rRegionX * Constants.RegionSize, rRegionY * Constants.RegionSize); | ||
2631 | |||
2632 | //cAgentData.AVHeight; | 2628 | //cAgentData.AVHeight; |
2633 | //cAgentData.regionHandle; | 2629 | //cAgentData.regionHandle; |
2634 | //m_velocity = cAgentData.Velocity; | 2630 | //m_velocity = cAgentData.Velocity; |
@@ -2638,13 +2634,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
2638 | { | 2634 | { |
2639 | cAgent.AgentID = UUID; | 2635 | cAgent.AgentID = UUID; |
2640 | cAgent.RegionHandle = m_scene.RegionInfo.RegionHandle; | 2636 | cAgent.RegionHandle = m_scene.RegionInfo.RegionHandle; |
2641 | cAgent.AlwaysRun = m_setAlwaysRun; | 2637 | |
2642 | cAgent.Size = new Vector3(0, 0, m_avHeight); | 2638 | cAgent.Position = m_pos; |
2639 | cAgent.Velocity = m_velocity; | ||
2643 | cAgent.Center = m_CameraCenter; | 2640 | cAgent.Center = m_CameraCenter; |
2641 | cAgent.Size = new Vector3(0, 0, m_avHeight); | ||
2642 | cAgent.AtAxis = m_CameraAtAxis; | ||
2643 | cAgent.LeftAxis = m_CameraLeftAxis; | ||
2644 | cAgent.UpAxis = m_CameraUpAxis; | ||
2645 | |||
2644 | cAgent.Far = m_DrawDistance; | 2646 | cAgent.Far = m_DrawDistance; |
2645 | cAgent.GodLevel = (byte)m_godlevel; | 2647 | |
2646 | cAgent.Position = AbsolutePosition; | ||
2647 | cAgent.Velocity = Velocity; | ||
2648 | // Throttles | 2648 | // Throttles |
2649 | float multiplier = 1; | 2649 | float multiplier = 1; |
2650 | int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); | 2650 | int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); |
@@ -2659,15 +2659,64 @@ namespace OpenSim.Region.Environment.Scenes | |||
2659 | //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); | 2659 | //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); |
2660 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); | 2660 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); |
2661 | 2661 | ||
2662 | cAgent.HeadRotation = m_headrotation; | ||
2663 | cAgent.BodyRotation = m_bodyRot; | ||
2664 | cAgent.ControlFlags = m_AgentControlFlags; | ||
2662 | if ((m_physicsActor != null) && (m_physicsActor.Flying)) | 2665 | if ((m_physicsActor != null) && (m_physicsActor.Flying)) |
2663 | { | 2666 | { |
2664 | m_AgentControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 2667 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
2665 | } | 2668 | } |
2666 | cAgent.ControlFlags = m_AgentControlFlags; | ||
2667 | 2669 | ||
2670 | |||
2671 | cAgent.GodLevel = (byte)m_godlevel; | ||
2672 | cAgent.AlwaysRun = m_setAlwaysRun; | ||
2673 | |||
2674 | //cAgent.AgentTextures = ??? | ||
2675 | //cAgent.GroupID = ?? | ||
2668 | // Groups??? | 2676 | // Groups??? |
2669 | // Visual Params??? | 2677 | |
2678 | // Animations??? | ||
2679 | |||
2680 | cAgent.VisualParams = m_appearance.VisualParams; | ||
2681 | } | ||
2682 | |||
2683 | public void CopyFrom(AgentData cAgent) | ||
2684 | { | ||
2685 | m_rootRegionHandle= cAgent.RegionHandle; | ||
2686 | m_callbackURI = cAgent.CallbackURI; | ||
2687 | |||
2688 | m_pos = cAgent.Position; | ||
2689 | m_velocity = cAgent.Velocity; | ||
2690 | m_CameraCenter = cAgent.Center; | ||
2691 | m_avHeight = cAgent.Size.Z; | ||
2692 | m_CameraAtAxis = cAgent.AtAxis; | ||
2693 | m_CameraLeftAxis = cAgent.LeftAxis; | ||
2694 | m_CameraUpAxis = cAgent.UpAxis; | ||
2695 | |||
2696 | m_DrawDistance = cAgent.Far; | ||
2697 | |||
2698 | if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0) | ||
2699 | ControllingClient.SetChildAgentThrottle(cAgent.Throttles); | ||
2700 | |||
2701 | m_headrotation = cAgent.HeadRotation; | ||
2702 | m_bodyRot = cAgent.BodyRotation; | ||
2703 | m_AgentControlFlags = cAgent.ControlFlags; // We need more flags! | ||
2704 | if (m_physicsActor != null) | ||
2705 | { | ||
2706 | m_physicsActor.Flying = ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | ||
2707 | } | ||
2708 | |||
2709 | m_godlevel = cAgent.GodLevel; | ||
2710 | m_setAlwaysRun = cAgent.AlwaysRun; | ||
2711 | |||
2712 | //cAgent.AgentTextures = ??? | ||
2713 | |||
2714 | //cAgent.GroupID = ?? | ||
2715 | //Groups??? | ||
2716 | |||
2670 | // Animations??? | 2717 | // Animations??? |
2718 | |||
2719 | m_appearance.VisualParams = cAgent.VisualParams; | ||
2671 | } | 2720 | } |
2672 | 2721 | ||
2673 | #endregion Child Agent Updates | 2722 | #endregion Child Agent Updates |