From 86f6a33bc8cc88c2e883d6741e6c02810d655960 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 1 Apr 2007 15:30:27 +0000 Subject: More cleaning up of SimClient and packet handling --- OpenSim.RegionServer/SimClient.cs | 98 +++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 51 deletions(-) (limited to 'OpenSim.RegionServer/SimClient.cs') diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index e9bfd56..ea70d02 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs @@ -125,6 +125,7 @@ namespace OpenSim { this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout); this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached); + this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate); } public static bool AddPacketHandler(PacketType packetType, PacketMethod handler) @@ -273,49 +274,6 @@ namespace OpenSim } } break; - case PacketType.MultipleObjectUpdate: - MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)Pack; - for (int i = 0; i < multipleupdate.ObjectData.Length; i++) - { - if (multipleupdate.ObjectData[i].Type == 9) //change position - { - libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); - foreach (Entity ent in m_world.Entities.Values) - { - if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) - { - ((OpenSim.world.Primitive)ent).UpdatePosition(pos); - - } - } - //should update stored position of the prim - } - else if (multipleupdate.ObjectData[i].Type == 10)//rotation - { - libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); - foreach (Entity ent in m_world.Entities.Values) - { - if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) - { - ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z); - ((OpenSim.world.Primitive)ent).UpdateFlag = true; - } - } - } - else if (multipleupdate.ObjectData[i].Type == 13)//scale - { - - libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); - foreach (Entity ent in m_world.Entities.Values) - { - if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) - { - ((OpenSim.world.Primitive)ent).Scale = scale; - } - } - } - } - break; case PacketType.RequestImage: RequestImagePacket imageRequest = (RequestImagePacket)Pack; for (int i = 0; i < imageRequest.RequestImage.Length; i++) @@ -433,14 +391,6 @@ namespace OpenSim } } break; - case PacketType.DeRezObject: - //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); - m_world.DeRezObject(this, Pack); - break; - case PacketType.RezObject: - //Console.WriteLine(Pack.ToString()); - m_world.RezObject(this, Pack); - break; case PacketType.RequestTaskInventory: // Console.WriteLine(Pack.ToString()); RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; @@ -833,6 +783,52 @@ namespace OpenSim return true; } + protected bool MultipleObjUpdate(SimClient simClient, Packet packet) + { + MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; + for (int i = 0; i < multipleupdate.ObjectData.Length; i++) + { + if (multipleupdate.ObjectData[i].Type == 9) //change position + { + libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); + foreach (Entity ent in m_world.Entities.Values) + { + if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) + { + ((OpenSim.world.Primitive)ent).UpdatePosition(pos); + + } + } + //should update stored position of the prim + } + else if (multipleupdate.ObjectData[i].Type == 10)//rotation + { + libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); + foreach (Entity ent in m_world.Entities.Values) + { + if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) + { + ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z); + ((OpenSim.world.Primitive)ent).UpdateFlag = true; + } + } + } + else if (multipleupdate.ObjectData[i].Type == 13)//scale + { + + libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); + foreach (Entity ent in m_world.Entities.Values) + { + if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) + { + ((OpenSim.world.Primitive)ent).Scale = scale; + } + } + } + } + return true; + } + #endregion private AgentInventory CreateInventory(LLUUID baseFolder) -- cgit v1.1