aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/SimClient.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/SimClient.cs98
1 files changed, 47 insertions, 51 deletions
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
125 { 125 {
126 this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout); 126 this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout);
127 this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached); 127 this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached);
128 this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate);
128 } 129 }
129 130
130 public static bool AddPacketHandler(PacketType packetType, PacketMethod handler) 131 public static bool AddPacketHandler(PacketType packetType, PacketMethod handler)
@@ -273,49 +274,6 @@ namespace OpenSim
273 } 274 }
274 } 275 }
275 break; 276 break;
276 case PacketType.MultipleObjectUpdate:
277 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)Pack;
278 for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
279 {
280 if (multipleupdate.ObjectData[i].Type == 9) //change position
281 {
282 libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
283 foreach (Entity ent in m_world.Entities.Values)
284 {
285 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
286 {
287 ((OpenSim.world.Primitive)ent).UpdatePosition(pos);
288
289 }
290 }
291 //should update stored position of the prim
292 }
293 else if (multipleupdate.ObjectData[i].Type == 10)//rotation
294 {
295 libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
296 foreach (Entity ent in m_world.Entities.Values)
297 {
298 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
299 {
300 ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
301 ((OpenSim.world.Primitive)ent).UpdateFlag = true;
302 }
303 }
304 }
305 else if (multipleupdate.ObjectData[i].Type == 13)//scale
306 {
307
308 libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
309 foreach (Entity ent in m_world.Entities.Values)
310 {
311 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
312 {
313 ((OpenSim.world.Primitive)ent).Scale = scale;
314 }
315 }
316 }
317 }
318 break;
319 case PacketType.RequestImage: 277 case PacketType.RequestImage:
320 RequestImagePacket imageRequest = (RequestImagePacket)Pack; 278 RequestImagePacket imageRequest = (RequestImagePacket)Pack;
321 for (int i = 0; i < imageRequest.RequestImage.Length; i++) 279 for (int i = 0; i < imageRequest.RequestImage.Length; i++)
@@ -433,14 +391,6 @@ namespace OpenSim
433 } 391 }
434 } 392 }
435 break; 393 break;
436 case PacketType.DeRezObject:
437 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet");
438 m_world.DeRezObject(this, Pack);
439 break;
440 case PacketType.RezObject:
441 //Console.WriteLine(Pack.ToString());
442 m_world.RezObject(this, Pack);
443 break;
444 case PacketType.RequestTaskInventory: 394 case PacketType.RequestTaskInventory:
445 // Console.WriteLine(Pack.ToString()); 395 // Console.WriteLine(Pack.ToString());
446 RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; 396 RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack;
@@ -833,6 +783,52 @@ namespace OpenSim
833 return true; 783 return true;
834 } 784 }
835 785
786 protected bool MultipleObjUpdate(SimClient simClient, Packet packet)
787 {
788 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
789 for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
790 {
791 if (multipleupdate.ObjectData[i].Type == 9) //change position
792 {
793 libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
794 foreach (Entity ent in m_world.Entities.Values)
795 {
796 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
797 {
798 ((OpenSim.world.Primitive)ent).UpdatePosition(pos);
799
800 }
801 }
802 //should update stored position of the prim
803 }
804 else if (multipleupdate.ObjectData[i].Type == 10)//rotation
805 {
806 libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
807 foreach (Entity ent in m_world.Entities.Values)
808 {
809 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
810 {
811 ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
812 ((OpenSim.world.Primitive)ent).UpdateFlag = true;
813 }
814 }
815 }
816 else if (multipleupdate.ObjectData[i].Type == 13)//scale
817 {
818
819 libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
820 foreach (Entity ent in m_world.Entities.Values)
821 {
822 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
823 {
824 ((OpenSim.world.Primitive)ent).Scale = scale;
825 }
826 }
827 }
828 }
829 return true;
830 }
831
836 #endregion 832 #endregion
837 833
838 private AgentInventory CreateInventory(LLUUID baseFolder) 834 private AgentInventory CreateInventory(LLUUID baseFolder)