diff options
author | MW | 2007-03-31 15:54:16 +0000 |
---|---|---|
committer | MW | 2007-03-31 15:54:16 +0000 |
commit | af93263a3bf033188a18f0f49050393a612d2831 (patch) | |
tree | 74c0e035bd10d2dc5a0695038a7c329078c9c7d9 /OpenSim.RegionServer/SimClient.cs | |
parent | * fixed some Framework refs (diff) | |
download | opensim-SC-af93263a3bf033188a18f0f49050393a612d2831.zip opensim-SC-af93263a3bf033188a18f0f49050393a612d2831.tar.gz opensim-SC-af93263a3bf033188a18f0f49050393a612d2831.tar.bz2 opensim-SC-af93263a3bf033188a18f0f49050393a612d2831.tar.xz |
Can now Rez and DeRez objects (take to and from inventory).
Very much a work in progress and likely to be a number of bugs.
Diffstat (limited to 'OpenSim.RegionServer/SimClient.cs')
-rw-r--r-- | OpenSim.RegionServer/SimClient.cs | 64 |
1 files changed, 62 insertions, 2 deletions
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index f8affb9..52cb067 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs | |||
@@ -112,6 +112,7 @@ namespace OpenSim | |||
112 | protected virtual void ProcessInPacket(Packet Pack) | 112 | protected virtual void ProcessInPacket(Packet Pack) |
113 | { | 113 | { |
114 | ack_pack(Pack); | 114 | ack_pack(Pack); |
115 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | ||
115 | if (debug) | 116 | if (debug) |
116 | { | 117 | { |
117 | if (Pack.Type != PacketType.AgentUpdate) | 118 | if (Pack.Type != PacketType.AgentUpdate) |
@@ -166,7 +167,6 @@ namespace OpenSim | |||
166 | cachedresp.WearableData[i].TextureID = LLUUID.Zero; | 167 | cachedresp.WearableData[i].TextureID = LLUUID.Zero; |
167 | cachedresp.WearableData[i].HostName = new byte[0]; | 168 | cachedresp.WearableData[i].HostName = new byte[0]; |
168 | } | 169 | } |
169 | |||
170 | this.OutPacket(cachedresp); | 170 | this.OutPacket(cachedresp); |
171 | break; | 171 | break; |
172 | case PacketType.ObjectAdd: | 172 | case PacketType.ObjectAdd: |
@@ -293,7 +293,7 @@ namespace OpenSim | |||
293 | ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; | 293 | ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; |
294 | if (Helpers.FieldToString(inchatpack.ChatData.Message) == "") break; | 294 | if (Helpers.FieldToString(inchatpack.ChatData.Message) == "") break; |
295 | 295 | ||
296 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | 296 | |
297 | libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); | 297 | libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); |
298 | reply.ChatData.Audible = 1; | 298 | reply.ChatData.Audible = 1; |
299 | reply.ChatData.Message = inchatpack.ChatData.Message; | 299 | reply.ChatData.Message = inchatpack.ChatData.Message; |
@@ -363,6 +363,7 @@ namespace OpenSim | |||
363 | } | 363 | } |
364 | else | 364 | else |
365 | { | 365 | { |
366 | Console.Write(Pack.ToString()); | ||
366 | this.CreateInventoryItem(createItem); | 367 | this.CreateInventoryItem(createItem); |
367 | } | 368 | } |
368 | break; | 369 | break; |
@@ -424,6 +425,10 @@ namespace OpenSim | |||
424 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); | 425 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); |
425 | m_world.DeRezObject((DeRezObjectPacket)Pack, this); | 426 | m_world.DeRezObject((DeRezObjectPacket)Pack, this); |
426 | break; | 427 | break; |
428 | case PacketType.RezObject: | ||
429 | //Console.WriteLine(Pack.ToString()); | ||
430 | m_world.RezObject(this, (RezObjectPacket)Pack); | ||
431 | break; | ||
427 | case PacketType.ModifyLand: | 432 | case PacketType.ModifyLand: |
428 | ModifyLandPacket modify = (ModifyLandPacket)Pack; | 433 | ModifyLandPacket modify = (ModifyLandPacket)Pack; |
429 | //Console.WriteLine("terraform: number of parcel data blocks" + modify.ParcelData.Length); | 434 | //Console.WriteLine("terraform: number of parcel data blocks" + modify.ParcelData.Length); |
@@ -464,6 +469,61 @@ namespace OpenSim | |||
464 | break; | 469 | break; |
465 | } | 470 | } |
466 | break; | 471 | break; |
472 | case PacketType.RequestTaskInventory: | ||
473 | // Console.WriteLine(Pack.ToString()); | ||
474 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; | ||
475 | ReplyTaskInventoryPacket replytask = new ReplyTaskInventoryPacket(); | ||
476 | bool foundent = false; | ||
477 | foreach (Entity ent in m_world.Entities.Values) | ||
478 | { | ||
479 | if (ent.localid == requesttask.InventoryData.LocalID) | ||
480 | { | ||
481 | replytask.InventoryData.TaskID = ent.uuid; | ||
482 | replytask.InventoryData.Serial = 0; | ||
483 | replytask.InventoryData.Filename = new byte[0]; | ||
484 | foundent = true; | ||
485 | } | ||
486 | } | ||
487 | if (foundent) | ||
488 | { | ||
489 | this.OutPacket(replytask); | ||
490 | } | ||
491 | break; | ||
492 | case PacketType.UUIDNameRequest: | ||
493 | //System.Text.Encoding _enc = System.Text.Encoding.ASCII; | ||
494 | Console.WriteLine(Pack.ToString()); | ||
495 | UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)Pack; | ||
496 | UUIDNameReplyPacket nameReply = new UUIDNameReplyPacket(); | ||
497 | nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length]; | ||
498 | |||
499 | for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++) | ||
500 | { | ||
501 | nameReply.UUIDNameBlock[i] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); | ||
502 | nameReply.UUIDNameBlock[i].ID = nameRequest.UUIDNameBlock[i].ID; | ||
503 | nameReply.UUIDNameBlock[i].FirstName = _enc.GetBytes("Who\0"); //for now send any name | ||
504 | nameReply.UUIDNameBlock[i].LastName = _enc.GetBytes("Knows\0"); //in future need to look it up | ||
505 | } | ||
506 | this.OutPacket(nameReply); | ||
507 | break; | ||
508 | case PacketType.AgentAnimation: | ||
509 | //Console.WriteLine(Pack.ToString()); | ||
510 | break; | ||
511 | case PacketType.ObjectSelect: | ||
512 | ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; | ||
513 | for (int i = 0; i < incomingselect.ObjectData.Length; i++) | ||
514 | { | ||
515 | foreach (Entity ent in m_world.Entities.Values) | ||
516 | { | ||
517 | if (ent.localid == incomingselect.ObjectData[i].ObjectLocalID) | ||
518 | { | ||
519 | ((OpenSim.world.Primitive)ent).GetProperites(this); | ||
520 | break; | ||
521 | } | ||
522 | } | ||
523 | } | ||
524 | break; | ||
525 | |||
526 | |||
467 | } | 527 | } |
468 | } | 528 | } |
469 | 529 | ||