aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs76
1 files changed, 4 insertions, 72 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 10be283..537ab8c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -180,8 +180,6 @@ namespace OpenSim.Region.Environment.Scenes
180 ScenePresence.LoadAnims(); 180 ScenePresence.LoadAnims();
181 181
182 httpListener = httpServer; 182 httpListener = httpServer;
183
184
185 } 183 }
186 184
187 #endregion 185 #endregion
@@ -486,7 +484,7 @@ namespace OpenSim.Region.Environment.Scenes
486 asset.Data = data; 484 asset.Data = data;
487 asset.Name = "terrainImage"; 485 asset.Name = "terrainImage";
488 asset.Type = 0; 486 asset.Type = 0;
489 assetCache.AddAsset(asset); 487 commsManager.AssetCache.AddAsset(asset);
490 } 488 }
491 489
492 #endregion 490 #endregion
@@ -707,6 +705,7 @@ namespace OpenSim.Region.Environment.Scenes
707 client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; 705 client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents;
708 client.OnRequestTaskInventory += RequestTaskInventory; 706 client.OnRequestTaskInventory += RequestTaskInventory;
709 client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory; 707 client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory;
708 client.OnUpdateInventoryItem += UDPUpdateInventoryItemAsset;
710 client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest; 709 client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest;
711 client.OnXferReceive += commsManager.TransactionsManager.HandleXfer; 710 client.OnXferReceive += commsManager.TransactionsManager.HandleXfer;
712 // client.OnRequestXfer += RequestXfer; 711 // client.OnRequestXfer += RequestXfer;
@@ -921,11 +920,11 @@ namespace OpenSim.Region.Environment.Scenes
921 if (agent.CapsPath != "") 920 if (agent.CapsPath != "")
922 { 921 {
923 //Console.WriteLine("new user, so creating caps handler for it"); 922 //Console.WriteLine("new user, so creating caps handler for it");
924 Caps cap = new Caps(assetCache, httpListener, m_regInfo.ExternalHostName, m_regInfo.ExternalEndPoint.Port, agent.CapsPath, agent.AgentID); 923 Caps cap = new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, m_regInfo.ExternalEndPoint.Port, agent.CapsPath, agent.AgentID);
925 Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + "/CAPS/" + agent.CapsPath + "0000/"); 924 Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + "/CAPS/" + agent.CapsPath + "0000/");
926 cap.RegisterHandlers(); 925 cap.RegisterHandlers();
927 cap.AddNewInventoryItem = this.AddInventoryItem; 926 cap.AddNewInventoryItem = this.AddInventoryItem;
928 cap.ItemUpdatedCall = this.UpdateInventoryItemAsset; 927 cap.ItemUpdatedCall = this.CapsUpdateInventoryItemAsset;
929 if (capsHandlers.ContainsKey(agent.AgentID)) 928 if (capsHandlers.ContainsKey(agent.AgentID))
930 { 929 {
931 MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " + 930 MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +
@@ -1149,72 +1148,5 @@ namespace OpenSim.Region.Environment.Scenes
1149 } 1148 }
1150 return LLUUID.Zero; 1149 return LLUUID.Zero;
1151 } 1150 }
1152
1153 public void AddInventoryItem(LLUUID userID, InventoryItemBase item)
1154 {
1155 if (this.Avatars.ContainsKey(userID))
1156 {
1157 this.AddInventoryItem(this.Avatars[userID].ControllingClient, item);
1158 }
1159 }
1160
1161 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
1162 {
1163 CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId);
1164 if (userInfo != null)
1165 {
1166 userInfo.AddItem(remoteClient.AgentId, item);
1167 remoteClient.SendInventoryItemUpdate(item);
1168 }
1169 }
1170
1171 public LLUUID UpdateInventoryItemAsset(LLUUID userID, LLUUID itemID, byte[] data)
1172 {
1173 if (this.Avatars.ContainsKey(userID))
1174 {
1175 return this.UpdateInventoryItemAsset(this.Avatars[userID].ControllingClient, itemID, data);
1176 }
1177 return LLUUID.Zero;
1178 }
1179
1180 public LLUUID UpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data)
1181 {
1182 CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId);
1183 if (userInfo != null)
1184 {
1185 if (userInfo.RootFolder != null)
1186 {
1187 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
1188 if (item != null)
1189 {
1190 AssetBase asset;
1191 asset = new AssetBase();
1192 asset.FullID = LLUUID.Random();
1193 asset.Type = (sbyte)item.assetType;
1194 asset.InvType = (sbyte)item.invType;
1195 asset.Name = item.inventoryName;
1196 asset.Data = data;
1197 this.assetCache.AddAsset(asset);
1198
1199 item.assetID = asset.FullID;
1200 userInfo.UpdateItem(remoteClient.AgentId, item);
1201
1202 // remoteClient.SendInventoryItemUpdate(item);
1203 if (item.invType == 7)
1204 {
1205 //do we want to know about updated note cards?
1206 }
1207 else if (item.invType == 10)
1208 {
1209 // do we want to know about updated scripts
1210 }
1211
1212 return (asset.FullID);
1213 }
1214 }
1215 }
1216 return LLUUID.Zero;
1217 }
1218
1219 } 1151 }
1220} 1152}