diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs | 55 |
2 files changed, 75 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs index 8fd8e52..b0fe12a 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs | |||
@@ -19,7 +19,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
19 | protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>(); | 19 | protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>(); |
20 | 20 | ||
21 | protected ulong m_regionHandle; | 21 | protected ulong m_regionHandle; |
22 | protected Scene m_scene; | ||
23 | 22 | ||
24 | public event PrimCountTaintedDelegate OnPrimCountTainted; | 23 | public event PrimCountTaintedDelegate OnPrimCountTainted; |
25 | 24 | ||
@@ -54,8 +53,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
54 | m_scene = world; | 53 | m_scene = world; |
55 | 54 | ||
56 | this.Pos = pos; | 55 | this.Pos = pos; |
57 | this.m_rootPart = new AllNewSceneObjectPart2(m_regionHandle, this, ownerID, localID, shape, pos); | 56 | LLVector3 rootOffset = new LLVector3(0, 0, 0); |
58 | this.m_parts.Add(this.m_rootPart.UUID, this.m_rootPart); | 57 | AllNewSceneObjectPart2 newPart = new AllNewSceneObjectPart2(m_regionHandle, this, ownerID, localID, shape, rootOffset); |
58 | this.m_parts.Add(newPart.UUID, newPart); | ||
59 | this.SetPartAsRoot(newPart); | ||
59 | } | 60 | } |
60 | 61 | ||
61 | /// <summary> | 62 | /// <summary> |
@@ -63,7 +64,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
63 | /// </summary> | 64 | /// </summary> |
64 | public void FlagGroupForFullUpdate() | 65 | public void FlagGroupForFullUpdate() |
65 | { | 66 | { |
66 | 67 | foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) | |
68 | { | ||
69 | part.SendFullUpdateToAllClients(); | ||
70 | } | ||
67 | } | 71 | } |
68 | 72 | ||
69 | /// <summary> | 73 | /// <summary> |
@@ -71,7 +75,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
71 | /// </summary> | 75 | /// </summary> |
72 | public void FlagGroupForTerseUpdate() | 76 | public void FlagGroupForTerseUpdate() |
73 | { | 77 | { |
74 | 78 | foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) | |
79 | { | ||
80 | part.SendTerseUpdateToALLClients(); | ||
81 | } | ||
75 | } | 82 | } |
76 | 83 | ||
77 | /// <summary> | 84 | /// <summary> |
@@ -413,5 +420,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
413 | { | 420 | { |
414 | 421 | ||
415 | } | 422 | } |
423 | |||
424 | /// <summary> | ||
425 | /// | ||
426 | /// </summary> | ||
427 | /// <returns></returns> | ||
428 | public List<ScenePresence> RequestSceneAvatars() | ||
429 | { | ||
430 | return m_scene.RequestAvatarList(); | ||
431 | } | ||
416 | } | 432 | } |
417 | } | 433 | } |
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs index 62f9b93..b0303a3 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs | |||
@@ -316,16 +316,25 @@ namespace OpenSim.Region.Environment.Scenes | |||
316 | #endregion | 316 | #endregion |
317 | 317 | ||
318 | #region Update Scheduling | 318 | #region Update Scheduling |
319 | /// <summary> | ||
320 | /// | ||
321 | /// </summary> | ||
319 | private void ClearUpdateSchedule() | 322 | private void ClearUpdateSchedule() |
320 | { | 323 | { |
321 | m_updateFlag = 0; | 324 | m_updateFlag = 0; |
322 | } | 325 | } |
323 | 326 | ||
327 | /// <summary> | ||
328 | /// | ||
329 | /// </summary> | ||
324 | private void ScheduleFullUpdate() | 330 | private void ScheduleFullUpdate() |
325 | { | 331 | { |
326 | m_updateFlag = 2; | 332 | m_updateFlag = 2; |
327 | } | 333 | } |
328 | 334 | ||
335 | /// <summary> | ||
336 | /// | ||
337 | /// </summary> | ||
329 | private void ScheduleTerseUpdate() | 338 | private void ScheduleTerseUpdate() |
330 | { | 339 | { |
331 | if (m_updateFlag < 1) | 340 | if (m_updateFlag < 1) |
@@ -333,6 +342,26 @@ namespace OpenSim.Region.Environment.Scenes | |||
333 | m_updateFlag = 1; | 342 | m_updateFlag = 1; |
334 | } | 343 | } |
335 | } | 344 | } |
345 | |||
346 | /// <summary> | ||
347 | /// | ||
348 | /// </summary> | ||
349 | public void SendScheduledUpdates() | ||
350 | { | ||
351 | if (m_updateFlag == 1) //some change has been made so update the clients | ||
352 | { | ||
353 | SendTerseUpdateToALLClients(); | ||
354 | ClearUpdateSchedule(); | ||
355 | } | ||
356 | else | ||
357 | { | ||
358 | if (m_updateFlag == 2) // is a new prim just been created/reloaded or has major changes | ||
359 | { | ||
360 | SendFullUpdateToAllClients(); | ||
361 | ClearUpdateSchedule(); | ||
362 | } | ||
363 | } | ||
364 | } | ||
336 | #endregion | 365 | #endregion |
337 | 366 | ||
338 | #region Shape | 367 | #region Shape |
@@ -389,7 +418,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
389 | this.m_Shape.ExtraParams[i++] = (byte)((length >> 24) % 256); | 418 | this.m_Shape.ExtraParams[i++] = (byte)((length >> 24) % 256); |
390 | Array.Copy(data, 0, this.m_Shape.ExtraParams, i, data.Length); | 419 | Array.Copy(data, 0, this.m_Shape.ExtraParams, i, data.Length); |
391 | 420 | ||
392 | //this.ScheduleFullUpdate(); | 421 | this.ScheduleFullUpdate(); |
393 | } | 422 | } |
394 | #endregion | 423 | #endregion |
395 | 424 | ||
@@ -445,6 +474,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
445 | /// <summary> | 474 | /// <summary> |
446 | /// | 475 | /// |
447 | /// </summary> | 476 | /// </summary> |
477 | public void SendFullUpdateToAllClients() | ||
478 | { | ||
479 | List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars(); | ||
480 | for (int i = 0; i < avatars.Count; i++) | ||
481 | { | ||
482 | SendFullUpdateToClient(avatars[i].ControllingClient); | ||
483 | } | ||
484 | } | ||
485 | |||
486 | /// <summary> | ||
487 | /// | ||
488 | /// </summary> | ||
448 | /// <param name="remoteClient"></param> | 489 | /// <param name="remoteClient"></param> |
449 | public void SendFullUpdateToClient(IClientAPI remoteClient) | 490 | public void SendFullUpdateToClient(IClientAPI remoteClient) |
450 | { | 491 | { |
@@ -460,6 +501,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
460 | /// <summary> | 501 | /// <summary> |
461 | /// | 502 | /// |
462 | /// </summary> | 503 | /// </summary> |
504 | public void SendTerseUpdateToALLClients() | ||
505 | { | ||
506 | List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars(); | ||
507 | for (int i = 0; i < avatars.Count; i++) | ||
508 | { | ||
509 | SendTerseUpdateToClient(avatars[i].ControllingClient); | ||
510 | } | ||
511 | } | ||
512 | |||
513 | /// <summary> | ||
514 | /// | ||
515 | /// </summary> | ||
463 | /// <param name="RemoteClient"></param> | 516 | /// <param name="RemoteClient"></param> |
464 | public void SendTerseUpdateToClient(IClientAPI remoteClient) | 517 | public void SendTerseUpdateToClient(IClientAPI remoteClient) |
465 | { | 518 | { |