From dabbdec2cdf2c1056e4ebb8aec38302a1fa9eba4 Mon Sep 17 00:00:00 2001
From: MW
Date: Sat, 3 Nov 2007 19:14:22 +0000
Subject: First part of Scene refactoring: Started the move of some of the
methods from scene into a inner class (currently called InnerScene.cs), the
idea being that the code related to the 3d scene (primitive/entities/Avatars
etc) will be in this inner class, then what is now Scene.cs will be left as a
kind of wrapper class around it. And once the spilt is complete can be
renamed to something like RegionInstance (or any name that sounds good and
ids it as the Region layer class that "has" a scene). Added
SceneCommunicationService which at the moment is a kind of high level wrapper
around commsManager. The idea being that it has a higher level API for the
Region/Scene to send messages to the other regions on the grid. a Example of
the API is that instead of having sendXmessage methods, it has more
functional level method like PassAvatarToNeighbour. Hopefully this will allow
more freedom to do changes in communications that doesn't break other things.
---
.../Environment/Scenes/Scene.PacketHandlers.cs | 367 ---------------------
1 file changed, 367 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 73d317a..a9f6991 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -92,129 +92,6 @@ namespace OpenSim.Region.Environment.Scenes
///
///
///
- ///
- ///
- ///
- public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags)
- {
- SceneObjectGroup originPrim = null;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- if (((SceneObjectGroup) ent).LocalId == originalPrim)
- {
- originPrim = (SceneObjectGroup) ent;
- break;
- }
- }
- }
-
- if (originPrim != null)
- {
- SceneObjectGroup copy = originPrim.Copy();
- copy.AbsolutePosition = copy.AbsolutePosition + offset;
- Entities.Add(copy.UUID, copy);
-
- copy.ScheduleGroupForFullUpdate();
- /* List avatars = this.GetScenePresences();
- for (int i = 0; i < avatars.Count; i++)
- {
- // copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
- }*/
- }
- else
- {
- MainLog.Instance.Warn("client", "Attempted to duplicate nonexistant prim");
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- public void LinkObjects(uint parentPrim, List childPrims)
- {
- SceneObjectGroup parenPrim = null;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- if (((SceneObjectGroup) ent).LocalId == parentPrim)
- {
- parenPrim = (SceneObjectGroup) ent;
- break;
- }
- }
- }
-
- List children = new List();
- if (parenPrim != null)
- {
- for (int i = 0; i < childPrims.Count; i++)
- {
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- if (((SceneObjectGroup) ent).LocalId == childPrims[i])
- {
- children.Add((SceneObjectGroup) ent);
- }
- }
- }
- }
- }
-
- foreach (SceneObjectGroup sceneObj in children)
- {
- parenPrim.LinkToGroup(sceneObj);
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).UpdateShape(shapeBlock, primLocalID);
- break;
- }
- }
- }
- }
-
- public void UpdateExtraParam(uint primLocalID, ushort type, bool inUse, byte[] data)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).UpdateExtraParam(primLocalID, type, inUse, data);
- break;
- }
- }
- }
- }
-
- ///
- ///
- ///
///
///
public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
@@ -255,250 +132,6 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- ///
- ///
- ///
- ///
- ///
- public void PrimDescription(uint primLocalID, string description)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).SetPartDescription(description, primLocalID);
- break;
- }
- }
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- public void PrimName(uint primLocalID, string name)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).SetPartName(name, primLocalID);
- break;
- }
- }
- }
- }
-
- public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
- {
- if (PermissionsMngr.CanEditObject(remoteClient.AgentId, objectID))
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(objectID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).GrabMovement(offset, pos, remoteClient);
- break;
- }
- }
- }
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient)
- {
- bool hasprim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasprim = ((SceneObjectGroup) ent).HasChildPrim(localID);
- if (hasprim != false)
- {
- ((SceneObjectGroup) ent).UpdatePrimFlags(localID, (ushort) packet.Type, true, packet.ToBytes());
- }
- }
- }
-
- //System.Console.WriteLine("Got primupdate packet: " + packet.UsePhysics.ToString());
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).UpdateTextureEntry(localID, texture);
- break;
- }
- }
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).UpdateGroupPosition(pos);
- break;
- }
- }
- }
- }
-
- public void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).UpdateSinglePosition(pos, localID);
- break;
- }
- }
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public void UpdatePrimRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).UpdateGroupRotation(pos, rot);
- break;
- }
- }
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).UpdateGroupRotation(rot);
- break;
- }
- }
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).UpdateSingleRotation(rot, localID);
- break;
- }
- }
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
- {
- bool hasPrim = false;
- foreach (EntityBase ent in Entities.Values)
- {
- if (ent is SceneObjectGroup)
- {
- hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
- if (hasPrim != false)
- {
- ((SceneObjectGroup) ent).Resize(scale, localID);
- break;
- }
- }
- }
- }
-
public void StartAnimation(LLUUID animID, int seq, LLUUID agentId)
{
Broadcast(delegate(IClientAPI client) { client.SendAnimation(animID, seq, agentId); });
--
cgit v1.1