aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authormorphw2007-05-11 21:03:11 +0000
committermorphw2007-05-11 21:03:11 +0000
commit0d52bc723d7545a71509e2f7b93c5ac13cf009bd (patch)
treec0570376eafafc74efd66fb831f3c57ee1c2672d
parentMW is a debugging wiz (regionx/y updated) (diff)
downloadopensim-SC_OLD-0d52bc723d7545a71509e2f7b93c5ac13cf009bd.zip
opensim-SC_OLD-0d52bc723d7545a71509e2f7b93c5ac13cf009bd.tar.gz
opensim-SC_OLD-0d52bc723d7545a71509e2f7b93c5ac13cf009bd.tar.bz2
opensim-SC_OLD-0d52bc723d7545a71509e2f7b93c5ac13cf009bd.tar.xz
Added landmark asset creation.
-rw-r--r--OpenSim.RegionServer/SimClient.cs48
1 files changed, 36 insertions, 12 deletions
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index c5108ac..856909c 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -642,6 +642,7 @@ namespace OpenSim
642 } 642 }
643 } 643 }
644 break; 644 break;
645
645 } 646 }
646 } 647 }
647 } 648 }
@@ -1077,20 +1078,43 @@ namespace OpenSim
1077 1078
1078 private void CreateInventoryItem(CreateInventoryItemPacket packet) 1079 private void CreateInventoryItem(CreateInventoryItemPacket packet)
1079 { 1080 {
1080 if (packet.InventoryBlock.Type == 7) 1081 if (!(packet.InventoryBlock.Type == 3 || packet.InventoryBlock.Type == 7))
1082 {
1083 System.Console.WriteLine("Attempted to create " + Util.FieldToString(packet.InventoryBlock.Name) + " in inventory. Unsupported type");
1084 return;
1085 }
1086
1087 //lets try this out with creating a notecard
1088 AssetBase asset = new AssetBase();
1089
1090 asset.Name = Util.FieldToString(packet.InventoryBlock.Name);
1091 asset.Description = Util.FieldToString(packet.InventoryBlock.Description);
1092 asset.InvType = packet.InventoryBlock.InvType;
1093 asset.Type = packet.InventoryBlock.Type;
1094 asset.FullID = LLUUID.Random();
1095
1096 switch (packet.InventoryBlock.Type)
1081 { 1097 {
1082 //lets try this out with creating a notecard 1098 case 7: // Notecard
1083 AssetBase asset = new AssetBase(); 1099 asset.Data = new byte[0];
1084 asset.Name = Util.FieldToString(packet.InventoryBlock.Name); 1100 break;
1085 asset.Description = Util.FieldToString(packet.InventoryBlock.Description); 1101
1086 asset.InvType = packet.InventoryBlock.InvType; 1102 case 3: // Landmark
1087 asset.Type = packet.InventoryBlock.Type; 1103 String content;
1088 asset.FullID = LLUUID.Random(); 1104 content = "Landmark version 2\n";
1089 asset.Data = new byte[0]; 1105 content += "region_id " + m_regionData.SimUUID + "\n";
1090 1106 String strPos = String.Format("%.2f %.2f %.2f>",
1091 m_assetCache.AddAsset(asset); 1107 this.ClientAvatar.Pos.X,
1092 m_inventoryCache.AddNewInventoryItem(this, packet.InventoryBlock.FolderID, asset); 1108 this.ClientAvatar.Pos.Y,
1109 this.ClientAvatar.Pos.Z);
1110 content += "local_pos " + strPos + "\n";
1111 asset.Data = (new System.Text.ASCIIEncoding()).GetBytes(content);
1112 break;
1113 default:
1114 break;
1093 } 1115 }
1116 m_assetCache.AddAsset(asset);
1117 m_inventoryCache.AddNewInventoryItem(this, packet.InventoryBlock.FolderID, asset);
1094 } 1118 }
1095 } 1119 }
1096} 1120}