diff options
14 files changed, 249 insertions, 56 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs index f9f814a..1f5f99d 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs | |||
@@ -41,14 +41,20 @@ namespace OpenSim.Framework.Communications.Caches | |||
41 | public class AssetTransactionManager | 41 | public class AssetTransactionManager |
42 | { | 42 | { |
43 | // Fields | 43 | // Fields |
44 | public CommunicationsManager CommsManager; | ||
44 | public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = new Dictionary<LLUUID, AgentAssetTransactions>(); | 45 | public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = new Dictionary<LLUUID, AgentAssetTransactions>(); |
45 | 46 | ||
47 | public AssetTransactionManager(CommunicationsManager commsManager) | ||
48 | { | ||
49 | CommsManager = commsManager; | ||
50 | } | ||
51 | |||
46 | // Methods | 52 | // Methods |
47 | public AgentAssetTransactions AddUser(LLUUID userID) | 53 | public AgentAssetTransactions AddUser(LLUUID userID) |
48 | { | 54 | { |
49 | if (!this.AgentTransactions.ContainsKey(userID)) | 55 | if (!this.AgentTransactions.ContainsKey(userID)) |
50 | { | 56 | { |
51 | AgentAssetTransactions transactions = new AgentAssetTransactions(userID); | 57 | AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this); |
52 | this.AgentTransactions.Add(userID, transactions); | 58 | this.AgentTransactions.Add(userID, transactions); |
53 | return transactions; | 59 | return transactions; |
54 | } | 60 | } |
@@ -64,18 +70,38 @@ namespace OpenSim.Framework.Communications.Caches | |||
64 | return null; | 70 | return null; |
65 | } | 71 | } |
66 | 72 | ||
67 | public void HandleInventoryFromTransaction() | 73 | public void HandleInventoryFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) |
68 | { | 74 | { |
75 | AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); | ||
76 | if (transactions != null) | ||
77 | { | ||
78 | transactions.RequestCreateInventoryItem(remoteClient, transactionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask); | ||
79 | } | ||
80 | |||
69 | } | 81 | } |
70 | 82 | ||
71 | public void HandleUDPUploadRequest() | 83 | public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data) |
72 | { | 84 | { |
85 | AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); | ||
86 | if (transactions != null) | ||
87 | { | ||
88 | AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction); | ||
89 | if (uploader != null) | ||
90 | { | ||
91 | uploader.Initialise(remoteClient, assetID, transaction, type, data); | ||
92 | } | ||
93 | } | ||
73 | } | 94 | } |
74 | 95 | ||
75 | public void HandleXfer(IClientAPI remoteClient, uint xferID, uint packetID, byte[] data) | 96 | public void HandleXfer(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) |
76 | { | 97 | { |
98 | AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); | ||
99 | if (transactions != null) | ||
100 | { | ||
101 | transactions.HandleXfer(xferID, packetID, data); | ||
102 | } | ||
77 | } | 103 | } |
78 | } | 104 | } |
79 | } | 105 | } |
80 | 106 | ||
81 | 107 | ||
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 8909bdf..cea6e6e 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs | |||
@@ -35,6 +35,7 @@ using libsecondlife.Packets; | |||
35 | using OpenSim.Framework.Interfaces; | 35 | using OpenSim.Framework.Interfaces; |
36 | using OpenSim.Framework.Types; | 36 | using OpenSim.Framework.Types; |
37 | using OpenSim.Framework.Utilities; | 37 | using OpenSim.Framework.Utilities; |
38 | using OpenSim.Framework.Data; | ||
38 | using OpenSim.Region.Capabilities; | 39 | using OpenSim.Region.Capabilities; |
39 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
40 | 41 | ||
@@ -47,11 +48,13 @@ namespace OpenSim.Framework.Communications.Caches | |||
47 | public List<NoteCardCapsUpdate> NotecardUpdaters = new List<NoteCardCapsUpdate>(); | 48 | public List<NoteCardCapsUpdate> NotecardUpdaters = new List<NoteCardCapsUpdate>(); |
48 | public LLUUID UserID; | 49 | public LLUUID UserID; |
49 | public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>(); | 50 | public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>(); |
51 | public AssetTransactionManager Manager; | ||
50 | 52 | ||
51 | // Methods | 53 | // Methods |
52 | public AgentAssetTransactions(LLUUID agentID) | 54 | public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager) |
53 | { | 55 | { |
54 | this.UserID = agentID; | 56 | this.UserID = agentID; |
57 | Manager = manager; | ||
55 | } | 58 | } |
56 | 59 | ||
57 | public AssetCapsUploader RequestCapsUploader() | 60 | public AssetCapsUploader RequestCapsUploader() |
@@ -70,9 +73,34 @@ namespace OpenSim.Framework.Communications.Caches | |||
70 | 73 | ||
71 | public AssetXferUploader RequestXferUploader(LLUUID transactionID) | 74 | public AssetXferUploader RequestXferUploader(LLUUID transactionID) |
72 | { | 75 | { |
73 | AssetXferUploader uploader = new AssetXferUploader(); | 76 | if (!this.XferUploaders.ContainsKey(transactionID)) |
74 | this.XferUploaders.Add(transactionID, uploader); | 77 | { |
75 | return uploader; | 78 | AssetXferUploader uploader = new AssetXferUploader(this); |
79 | |||
80 | this.XferUploaders.Add(transactionID, uploader); | ||
81 | return uploader; | ||
82 | } | ||
83 | return null; | ||
84 | } | ||
85 | |||
86 | public void HandleXfer(ulong xferID, uint packetID, byte[] data) | ||
87 | { | ||
88 | foreach (AssetXferUploader uploader in this.XferUploaders.Values) | ||
89 | { | ||
90 | if (uploader.XferID == xferID) | ||
91 | { | ||
92 | uploader.HandleXferPacket(xferID, packetID, data); | ||
93 | break; | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | |||
98 | public void RequestCreateInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) | ||
99 | { | ||
100 | if (this.XferUploaders.ContainsKey(transactionID)) | ||
101 | { | ||
102 | this.XferUploaders[transactionID].RequestCreateInventoryItem(remoteClient, transactionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask); | ||
103 | } | ||
76 | } | 104 | } |
77 | 105 | ||
78 | // Nested Types | 106 | // Nested Types |
@@ -143,10 +171,23 @@ namespace OpenSim.Framework.Communications.Caches | |||
143 | private IClientAPI ourClient; | 171 | private IClientAPI ourClient; |
144 | public LLUUID TransactionID = LLUUID.Zero; | 172 | public LLUUID TransactionID = LLUUID.Zero; |
145 | public bool UploadComplete; | 173 | public bool UploadComplete; |
146 | public uint XferID; | 174 | public ulong XferID; |
175 | private string m_name = ""; | ||
176 | private string m_description = ""; | ||
177 | private sbyte type = 0; | ||
178 | private sbyte invType = 0; | ||
179 | private uint nextPerm = 0; | ||
180 | private bool m_finished = false; | ||
181 | private bool m_createItem = false; | ||
182 | private AgentAssetTransactions m_userTransactions; | ||
183 | |||
184 | public AssetXferUploader(AgentAssetTransactions transactions) | ||
185 | { | ||
186 | this.m_userTransactions = transactions; | ||
187 | } | ||
147 | 188 | ||
148 | // Methods | 189 | // Methods |
149 | public void HandleXferPacket(uint xferID, uint packetID, byte[] data) | 190 | public void HandleXferPacket(ulong xferID, uint packetID, byte[] data) |
150 | { | 191 | { |
151 | if (this.XferID == xferID) | 192 | if (this.XferID == xferID) |
152 | { | 193 | { |
@@ -216,6 +257,67 @@ namespace OpenSim.Framework.Communications.Caches | |||
216 | newPack.AssetBlock.Success = true; | 257 | newPack.AssetBlock.Success = true; |
217 | newPack.AssetBlock.UUID = this.Asset.FullID; | 258 | newPack.AssetBlock.UUID = this.Asset.FullID; |
218 | this.ourClient.OutPacket(newPack); | 259 | this.ourClient.OutPacket(newPack); |
260 | this.m_finished = true; | ||
261 | if (m_createItem) | ||
262 | { | ||
263 | DoCreateItem(); | ||
264 | } | ||
265 | Console.WriteLine("upload complete "+ this.TransactionID); | ||
266 | //SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data); | ||
267 | } | ||
268 | private void SaveAssetToFile(string filename, byte[] data) | ||
269 | { | ||
270 | FileStream fs = File.Create(filename); | ||
271 | BinaryWriter bw = new BinaryWriter(fs); | ||
272 | bw.Write(data); | ||
273 | bw.Close(); | ||
274 | fs.Close(); | ||
275 | } | ||
276 | |||
277 | public void RequestCreateInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) | ||
278 | { | ||
279 | if (this.TransactionID == transactionID) | ||
280 | { | ||
281 | this.InventFolder = folderID; | ||
282 | this.m_name = name; | ||
283 | this.m_description = description; | ||
284 | this.type = type; | ||
285 | this.invType = invType; | ||
286 | this.nextPerm = nextOwnerMask; | ||
287 | this.Asset.Name = name; | ||
288 | this.Asset.Description = description; | ||
289 | this.Asset.Type = type; | ||
290 | this.Asset.InvType = invType; | ||
291 | m_createItem = true; | ||
292 | if (m_finished) | ||
293 | { | ||
294 | DoCreateItem(); | ||
295 | } | ||
296 | } | ||
297 | } | ||
298 | |||
299 | private void DoCreateItem() | ||
300 | { | ||
301 | this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset); | ||
302 | CachedUserInfo userInfo = m_userTransactions.Manager.CommsManager.UserProfiles.GetUserDetails(ourClient.AgentId); | ||
303 | if (userInfo != null) | ||
304 | { | ||
305 | InventoryItemBase item = new InventoryItemBase(); | ||
306 | item.avatarID = this.ourClient.AgentId; | ||
307 | item.creatorsID = ourClient.AgentId; | ||
308 | item.inventoryID = LLUUID.Random(); | ||
309 | item.assetID = Asset.FullID; | ||
310 | item.inventoryDescription = this.m_description; | ||
311 | item.inventoryName = m_name; | ||
312 | item.assetType = type; | ||
313 | item.invType = this.invType; | ||
314 | item.parentFolderID = this.InventFolder; | ||
315 | item.inventoryCurrentPermissions = 2147483647; | ||
316 | item.inventoryNextPermissions = this.nextPerm; | ||
317 | |||
318 | userInfo.AddItem(ourClient.AgentId, item); | ||
319 | ourClient.SendInventoryItemUpdate(item); | ||
320 | } | ||
219 | } | 321 | } |
220 | } | 322 | } |
221 | 323 | ||
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index ac882ba..7676597 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -45,6 +45,7 @@ namespace OpenSim.Framework.Communications | |||
45 | public IInventoryServices InventoryServer; | 45 | public IInventoryServices InventoryServer; |
46 | public IInterRegionCommunications InterRegion; | 46 | public IInterRegionCommunications InterRegion; |
47 | public UserProfileCache UserProfiles; | 47 | public UserProfileCache UserProfiles; |
48 | public AssetTransactionManager TransactionsManager; | ||
48 | public AssetCache AssetCache; | 49 | public AssetCache AssetCache; |
49 | 50 | ||
50 | public NetworkServersInfo ServersInfo; | 51 | public NetworkServersInfo ServersInfo; |
@@ -53,6 +54,7 @@ namespace OpenSim.Framework.Communications | |||
53 | ServersInfo = serversInfo; | 54 | ServersInfo = serversInfo; |
54 | this.AssetCache = assetCache; | 55 | this.AssetCache = assetCache; |
55 | UserProfiles = new UserProfileCache(this); | 56 | UserProfiles = new UserProfileCache(this); |
57 | TransactionsManager = new AssetTransactionManager(this); | ||
56 | } | 58 | } |
57 | 59 | ||
58 | #region Packet Handlers | 60 | #region Packet Handlers |
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 1af96e7..ff794f9 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -87,6 +87,9 @@ namespace OpenSim.Framework.Interfaces | |||
87 | public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID); | 87 | public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID); |
88 | public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID); | 88 | public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID); |
89 | 89 | ||
90 | public delegate void UDPAssetUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data); | ||
91 | public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data); | ||
92 | |||
90 | public interface IClientAPI | 93 | public interface IClientAPI |
91 | { | 94 | { |
92 | event ImprovedInstantMessage OnInstantMessage; | 95 | event ImprovedInstantMessage OnInstantMessage; |
@@ -135,6 +138,8 @@ namespace OpenSim.Framework.Interfaces | |||
135 | event FetchInventoryDescendents OnFetchInventoryDescendents; | 138 | event FetchInventoryDescendents OnFetchInventoryDescendents; |
136 | event FetchInventory OnFetchInventory; | 139 | event FetchInventory OnFetchInventory; |
137 | event RequestTaskInventory OnRequestTaskInventory; | 140 | event RequestTaskInventory OnRequestTaskInventory; |
141 | event UDPAssetUploadRequest OnAssetUploadRequest; | ||
142 | event XferReceive OnXferReceive; | ||
138 | 143 | ||
139 | event UUIDNameRequest OnNameFromUUIDRequest; | 144 | event UUIDNameRequest OnNameFromUUIDRequest; |
140 | 145 | ||
diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs index 864ea60..876c9b3 100644 --- a/OpenSim/Framework/General/NullClientAPI.cs +++ b/OpenSim/Framework/General/NullClientAPI.cs | |||
@@ -57,6 +57,8 @@ namespace OpenSim.Framework | |||
57 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 57 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
58 | public event FetchInventory OnFetchInventory; | 58 | public event FetchInventory OnFetchInventory; |
59 | public event RequestTaskInventory OnRequestTaskInventory; | 59 | public event RequestTaskInventory OnRequestTaskInventory; |
60 | public event UDPAssetUploadRequest OnAssetUploadRequest; | ||
61 | public event XferReceive OnXferReceive; | ||
60 | 62 | ||
61 | public event UUIDNameRequest OnNameFromUUIDRequest; | 63 | public event UUIDNameRequest OnNameFromUUIDRequest; |
62 | 64 | ||
diff --git a/OpenSim/Framework/UserManager/CAPSService.cs b/OpenSim/Framework/UserManager/CAPSService.cs new file mode 100644 index 0000000..39af140 --- /dev/null +++ b/OpenSim/Framework/UserManager/CAPSService.cs | |||
@@ -0,0 +1,38 @@ | |||
1 | using System; | ||
2 | using System.Collections; | ||
3 | using System.Collections.Generic; | ||
4 | using System.Reflection; | ||
5 | using System.Security.Cryptography; | ||
6 | using libsecondlife; | ||
7 | using Nwc.XmlRpc; | ||
8 | using OpenSim.Framework.Console; | ||
9 | using OpenSim.Framework.Data; | ||
10 | using OpenSim.Framework.Interfaces; | ||
11 | using OpenSim.Framework.Inventory; | ||
12 | using OpenSim.Framework.Utilities; | ||
13 | using OpenSim.Framework.Servers; | ||
14 | |||
15 | namespace OpenSim.Framework.UserManagement | ||
16 | { | ||
17 | public class CAPSService | ||
18 | { | ||
19 | private BaseHttpServer m_server; | ||
20 | |||
21 | public CAPSService(BaseHttpServer httpServer) | ||
22 | { | ||
23 | m_server = httpServer; | ||
24 | this.AddCapsSeedHandler("/CapsSeed/", CapsRequest); | ||
25 | } | ||
26 | |||
27 | private void AddCapsSeedHandler(string path, RestMethod restMethod) | ||
28 | { | ||
29 | m_server.AddStreamHandler(new RestStreamHandler("POST", path, restMethod)); | ||
30 | } | ||
31 | |||
32 | public string CapsRequest(string request, string path, string param) | ||
33 | { | ||
34 | System.Console.WriteLine("new caps request " + request +" from path "+ path); | ||
35 | return ""; | ||
36 | } | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index d9c7508..d7962dc 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -86,6 +86,8 @@ namespace OpenSim.Region.ClientStack | |||
86 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 86 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
87 | public event FetchInventory OnFetchInventory; | 87 | public event FetchInventory OnFetchInventory; |
88 | public event RequestTaskInventory OnRequestTaskInventory; | 88 | public event RequestTaskInventory OnRequestTaskInventory; |
89 | public event UDPAssetUploadRequest OnAssetUploadRequest; | ||
90 | public event XferReceive OnXferReceive; | ||
89 | 91 | ||
90 | public event UUIDNameRequest OnNameFromUUIDRequest; | 92 | public event UUIDNameRequest OnNameFromUUIDRequest; |
91 | 93 | ||
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 58d4cfe..1e3685b 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -217,7 +217,7 @@ namespace OpenSim.Region.ClientStack | |||
217 | case PacketType.ObjectAdd: | 217 | case PacketType.ObjectAdd: |
218 | if (OnAddPrim != null) | 218 | if (OnAddPrim != null) |
219 | { | 219 | { |
220 | ObjectAddPacket addPacket = (ObjectAddPacket) Pack ; | 220 | ObjectAddPacket addPacket = (ObjectAddPacket)Pack; |
221 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); | 221 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); |
222 | 222 | ||
223 | OnAddPrim(this.AgentId, addPacket.ObjectData.RayEnd, shape); | 223 | OnAddPrim(this.AgentId, addPacket.ObjectData.RayEnd, shape); |
@@ -290,7 +290,7 @@ namespace OpenSim.Region.ClientStack | |||
290 | } | 290 | } |
291 | break; | 291 | break; |
292 | case PacketType.ObjectGrab: | 292 | case PacketType.ObjectGrab: |
293 | ObjectGrabPacket grab = (ObjectGrabPacket)Pack; | 293 | ObjectGrabPacket grab = (ObjectGrabPacket)Pack; |
294 | if (OnGrabObject != null) | 294 | if (OnGrabObject != null) |
295 | { | 295 | { |
296 | OnGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this); | 296 | OnGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this); |
@@ -338,7 +338,7 @@ namespace OpenSim.Region.ClientStack | |||
338 | #region Inventory/Asset/Other related packets | 338 | #region Inventory/Asset/Other related packets |
339 | case PacketType.RequestImage: | 339 | case PacketType.RequestImage: |
340 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; | 340 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; |
341 | 341 | ||
342 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) | 342 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) |
343 | { | 343 | { |
344 | m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet); | 344 | m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet); |
@@ -351,14 +351,20 @@ namespace OpenSim.Region.ClientStack | |||
351 | break; | 351 | break; |
352 | case PacketType.AssetUploadRequest: | 352 | case PacketType.AssetUploadRequest: |
353 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | 353 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; |
354 | // Console.WriteLine(request.ToString()); | 354 | if (OnAssetUploadRequest != null) |
355 | //this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); | 355 | { |
356 | OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData); | ||
357 | } | ||
356 | break; | 358 | break; |
357 | case PacketType.RequestXfer: | 359 | case PacketType.RequestXfer: |
358 | //Console.WriteLine(Pack.ToString()); | 360 | //Console.WriteLine(Pack.ToString()); |
359 | break; | 361 | break; |
360 | case PacketType.SendXferPacket: | 362 | case PacketType.SendXferPacket: |
361 | this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack); | 363 | SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; |
364 | if (OnXferReceive != null) | ||
365 | { | ||
366 | OnXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); | ||
367 | } | ||
362 | break; | 368 | break; |
363 | case PacketType.CreateInventoryFolder: | 369 | case PacketType.CreateInventoryFolder: |
364 | if (this.OnCreateNewInventoryFolder != null) | 370 | if (this.OnCreateNewInventoryFolder != null) |
@@ -369,18 +375,11 @@ namespace OpenSim.Region.ClientStack | |||
369 | break; | 375 | break; |
370 | case PacketType.CreateInventoryItem: | 376 | case PacketType.CreateInventoryItem: |
371 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; | 377 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; |
372 | if (createItem.InventoryBlock.TransactionID != LLUUID.Zero) | 378 | if (this.OnCreateNewInventoryItem != null) |
373 | { | 379 | { |
374 | this.UploadAssets.CreateInventoryItem(createItem); | 380 | this.OnCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, createItem.InventoryBlock.FolderID, createItem.InventoryBlock.CallbackID, |
375 | } | 381 | Util.FieldToString(createItem.InventoryBlock.Description), Util.FieldToString(createItem.InventoryBlock.Name), createItem.InventoryBlock.InvType, |
376 | else | 382 | createItem.InventoryBlock.Type, createItem.InventoryBlock.WearableType, createItem.InventoryBlock.NextOwnerMask); |
377 | { | ||
378 | if (this.OnCreateNewInventoryItem != null) | ||
379 | { | ||
380 | this.OnCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, createItem.InventoryBlock.FolderID, createItem.InventoryBlock.CallbackID, | ||
381 | Util.FieldToString(createItem.InventoryBlock.Description), Util.FieldToString(createItem.InventoryBlock.Name), createItem.InventoryBlock.InvType, | ||
382 | createItem.InventoryBlock.Type, createItem.InventoryBlock.WearableType, createItem.InventoryBlock.NextOwnerMask); | ||
383 | } | ||
384 | } | 383 | } |
385 | break; | 384 | break; |
386 | case PacketType.FetchInventory: | 385 | case PacketType.FetchInventory: |
@@ -558,7 +557,7 @@ namespace OpenSim.Region.ClientStack | |||
558 | if (OnParcelPropertiesUpdateRequest != null) | 557 | if (OnParcelPropertiesUpdateRequest != null) |
559 | { | 558 | { |
560 | OnParcelPropertiesUpdateRequest(updatePacket, this); | 559 | OnParcelPropertiesUpdateRequest(updatePacket, this); |
561 | 560 | ||
562 | } | 561 | } |
563 | break; | 562 | break; |
564 | case PacketType.ParcelSelectObjects: | 563 | case PacketType.ParcelSelectObjects: |
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index e2a953c..9ff9133 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs | |||
@@ -33,6 +33,7 @@ using OpenSim.Framework.Communications.Caches; | |||
33 | using OpenSim.Framework.Console; | 33 | using OpenSim.Framework.Console; |
34 | using OpenSim.Framework.Utilities; | 34 | using OpenSim.Framework.Utilities; |
35 | using OpenSim.Framework.Data; | 35 | using OpenSim.Framework.Data; |
36 | using OpenSim.Framework.UserManagement; | ||
36 | 37 | ||
37 | namespace OpenSim.Region.Communications.Local | 38 | namespace OpenSim.Region.Communications.Local |
38 | { | 39 | { |
@@ -42,6 +43,7 @@ namespace OpenSim.Region.Communications.Local | |||
42 | public LocalUserServices UserServices; | 43 | public LocalUserServices UserServices; |
43 | public LocalLoginService LoginServices; | 44 | public LocalLoginService LoginServices; |
44 | public LocalInventoryService InvenServices; | 45 | public LocalInventoryService InvenServices; |
46 | // public CAPSService CapsServices; | ||
45 | 47 | ||
46 | public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate, string welcomeMessage ) | 48 | public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate, string welcomeMessage ) |
47 | : base(serversInfo, httpServer, assetCache) | 49 | : base(serversInfo, httpServer, assetCache) |
@@ -57,6 +59,8 @@ namespace OpenSim.Region.Communications.Local | |||
57 | InstanceServices = new LocalBackEndServices(); | 59 | InstanceServices = new LocalBackEndServices(); |
58 | GridServer = InstanceServices; | 60 | GridServer = InstanceServices; |
59 | InterRegion = InstanceServices; | 61 | InterRegion = InstanceServices; |
62 | |||
63 | //CapsServices = new CAPSService(httpServer); | ||
60 | 64 | ||
61 | LoginServices = new LocalLoginService(UserServices, welcomeMessage, this, serversInfo, accountsAuthenticate); | 65 | LoginServices = new LocalLoginService(UserServices, welcomeMessage, this, serversInfo, accountsAuthenticate); |
62 | httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); | 66 | httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); |
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 88377bc..d3b76de 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs | |||
@@ -90,6 +90,7 @@ namespace OpenSim.Region.Communications.Local | |||
90 | response.RegionY = reg.RegionLocY; | 90 | response.RegionY = reg.RegionLocY; |
91 | 91 | ||
92 | response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; | 92 | response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; |
93 | // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/"; | ||
93 | theUser.currentAgent.currentRegion = reg.SimUUID; | 94 | theUser.currentAgent.currentRegion = reg.SimUUID; |
94 | theUser.currentAgent.currentHandle = reg.RegionHandle; | 95 | theUser.currentAgent.currentHandle = reg.RegionHandle; |
95 | 96 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index cca8998..afa4ea5 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -714,33 +714,41 @@ namespace OpenSim.Region.Environment.Scenes | |||
714 | /// <param name="nextOwnerMask"></param> | 714 | /// <param name="nextOwnerMask"></param> |
715 | public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) | 715 | public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask) |
716 | { | 716 | { |
717 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 717 | if (transActionID == LLUUID.Zero) |
718 | if (userInfo != null) | ||
719 | { | 718 | { |
720 | AssetBase asset = new AssetBase(); | 719 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
721 | asset.Name = name; | 720 | if (userInfo != null) |
722 | asset.Description = description; | 721 | { |
723 | asset.InvType = invType; | 722 | AssetBase asset = new AssetBase(); |
724 | asset.Type = type; | 723 | asset.Name = name; |
725 | asset.FullID = LLUUID.Random(); | 724 | asset.Description = description; |
726 | asset.Data = new byte[1]; | 725 | asset.InvType = invType; |
727 | this.assetCache.AddAsset(asset); | 726 | asset.Type = type; |
728 | 727 | asset.FullID = LLUUID.Random(); | |
729 | InventoryItemBase item = new InventoryItemBase(); | 728 | asset.Data = new byte[1]; |
730 | item.avatarID = remoteClient.AgentId; | 729 | this.assetCache.AddAsset(asset); |
731 | item.creatorsID = remoteClient.AgentId; | 730 | |
732 | item.inventoryID = LLUUID.Random(); | 731 | InventoryItemBase item = new InventoryItemBase(); |
733 | item.assetID = asset.FullID; | 732 | item.avatarID = remoteClient.AgentId; |
734 | item.inventoryDescription = description; | 733 | item.creatorsID = remoteClient.AgentId; |
735 | item.inventoryName = name; | 734 | item.inventoryID = LLUUID.Random(); |
736 | item.assetType = invType; | 735 | item.assetID = asset.FullID; |
737 | item.invType = invType; | 736 | item.inventoryDescription = description; |
738 | item.parentFolderID = folderID; | 737 | item.inventoryName = name; |
739 | item.inventoryCurrentPermissions = 2147483647; | 738 | item.assetType = invType; |
740 | item.inventoryNextPermissions = nextOwnerMask; | 739 | item.invType = invType; |
741 | 740 | item.parentFolderID = folderID; | |
742 | userInfo.AddItem(remoteClient.AgentId, item); | 741 | item.inventoryCurrentPermissions = 2147483647; |
743 | remoteClient.SendInventoryItemUpdate(item); | 742 | item.inventoryNextPermissions = nextOwnerMask; |
743 | |||
744 | userInfo.AddItem(remoteClient.AgentId, item); | ||
745 | remoteClient.SendInventoryItemUpdate(item); | ||
746 | } | ||
747 | } | ||
748 | else | ||
749 | { | ||
750 | commsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask); | ||
751 | //System.Console.WriteLine("request to create inventory item from transaction " + transActionID); | ||
744 | } | 752 | } |
745 | } | 753 | } |
746 | 754 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3ee1f19..378acf9 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -577,6 +577,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
577 | CreateAndAddScenePresence(client); | 577 | CreateAndAddScenePresence(client); |
578 | m_LandManager.sendParcelOverlay(client); | 578 | m_LandManager.sendParcelOverlay(client); |
579 | commsManager.UserProfiles.AddNewUser(client.AgentId); | 579 | commsManager.UserProfiles.AddNewUser(client.AgentId); |
580 | commsManager.TransactionsManager.AddUser(client.AgentId); | ||
580 | } | 581 | } |
581 | 582 | ||
582 | protected virtual void SubscribeToClientEvents(IClientAPI client) | 583 | protected virtual void SubscribeToClientEvents(IClientAPI client) |
@@ -625,6 +626,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
625 | client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; | 626 | client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; |
626 | client.OnRequestTaskInventory += RequestTaskInventory; | 627 | client.OnRequestTaskInventory += RequestTaskInventory; |
627 | client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory; | 628 | client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory; |
629 | client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest; | ||
630 | client.OnXferReceive += commsManager.TransactionsManager.HandleXfer; | ||
628 | 631 | ||
629 | client.OnGrabObject += ProcessObjectGrab; | 632 | client.OnGrabObject += ProcessObjectGrab; |
630 | } | 633 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 7a1f117..3bd83aa 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -706,7 +706,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
706 | } | 706 | } |
707 | } | 707 | } |
708 | } | 708 | } |
709 | |||
710 | #endregion | 709 | #endregion |
711 | /// <summary> | 710 | /// <summary> |
712 | /// | 711 | /// |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index af3d77b..c0132f5 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -71,6 +71,8 @@ namespace SimpleApp | |||
71 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 71 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
72 | public event FetchInventory OnFetchInventory; | 72 | public event FetchInventory OnFetchInventory; |
73 | public event RequestTaskInventory OnRequestTaskInventory; | 73 | public event RequestTaskInventory OnRequestTaskInventory; |
74 | public event UDPAssetUploadRequest OnAssetUploadRequest; | ||
75 | public event XferReceive OnXferReceive; | ||
74 | 76 | ||
75 | public event UUIDNameRequest OnNameFromUUIDRequest; | 77 | public event UUIDNameRequest OnNameFromUUIDRequest; |
76 | 78 | ||