From c89db49f3cd3bbd60577eb5a1787ccf8dea930e3 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 19 Aug 2007 13:35:20 +0000 Subject: Sqlite datastore should now save the textures and extraparams data (used by sculpties) correctly. [Really need to add a ExtraParams field to the sqlite database though, but for now I have combined their data so that we don't lose backward compatibility, know a couple of people have been using the datastore already]. Now have a rough day/night cycle (the movement of the sun needs to be made smoother but for now it is better than we had I think). Added dalien's patch (issue 294) for saving and loading prims to a xml file (think he will be modifying these to be import/export functions and maybe writing a xml datastore for backups). Some preliminary work on task inventory (ie object's/prim's inventory). Added place holder data for AvatarProperties (ie a avatar's profile). Should we store this sort of data on the user server or have another server for it (a normal webserver should work). Added a few more method to IClientAPI. Sure there is something I'm forgeting. --- .../Communications/Cache/AssetTransactions.cs | 4 +-- .../Framework/Communications/Capabilities/Caps.cs | 40 ++++++++++++++++------ OpenSim/Framework/General/Interfaces/IClientAPI.cs | 8 +++++ OpenSim/Framework/General/NullClientAPI.cs | 7 ++++ .../Framework/General/Types/PrimitiveBaseShape.cs | 33 +++++++++--------- 5 files changed, 64 insertions(+), 28 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 7f52739..addd20a 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs @@ -156,7 +156,7 @@ namespace OpenSim.Framework.Communications.Caches } if (this.OnUpLoad != null) { - this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data); + this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data, "" , ""); } return text; } @@ -373,7 +373,7 @@ namespace OpenSim.Framework.Communications.Caches } if (this.OnUpLoad != null) { - this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data); + this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data, "" , "" ); } return text; } diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 14f9c95..6afb35c 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -39,7 +39,7 @@ using OpenSim.Framework.Data; namespace OpenSim.Region.Capabilities { - public delegate void UpLoadedAsset(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data); + public delegate void UpLoadedAsset(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data, string inventoryType, string assetType); public delegate LLUUID UpdateItem(LLUUID itemID, byte[] data); public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item); public delegate LLUUID ItemUpdatedCallback(LLUUID userID, LLUUID itemID, byte[] data); @@ -113,7 +113,7 @@ namespace OpenSim.Region.Capabilities /// public string CapsRequest(string request, string path, string param) { - //Console.WriteLine("caps request " + request); + // Console.WriteLine("caps request " + request); string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); return result; } @@ -270,7 +270,7 @@ namespace OpenSim.Region.Capabilities /// public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) { - // Console.WriteLine("asset upload request via CAPS"); + //Console.WriteLine("asset upload request via CAPS" + llsdRequest.inventory_type +" , "+ llsdRequest.asset_type); string assetName = llsdRequest.name; string assetDes = llsdRequest.description; @@ -280,7 +280,7 @@ namespace OpenSim.Region.Capabilities LLUUID parentFolder = llsdRequest.folder_id; string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); - AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, "" , "", capsBase + uploaderPath, this.httpListener); + AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, llsdRequest.asset_type, capsBase + uploaderPath, this.httpListener); httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; @@ -297,13 +297,27 @@ namespace OpenSim.Region.Capabilities /// /// /// - public void UploadCompleteHandler(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data) + public void UploadCompleteHandler(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data, string inventoryType, string assetType) { + sbyte assType = 0; + sbyte inType = 0; + + if (inventoryType == "sound") + { + inType = 1; + assType = 1; + } + else if (inventoryType == "animation") + { + inType = 19; + assType = 19; + } + AssetBase asset; asset = new AssetBase(); asset.FullID = assetID; - asset.Type = 0; - asset.InvType = 0; + asset.Type = assType; + asset.InvType = inType; asset.Name = assetName; asset.Data = data; this.assetCache.AddAsset(asset); @@ -315,8 +329,8 @@ namespace OpenSim.Region.Capabilities item.assetID = asset.FullID; item.inventoryDescription = assetDescription; item.inventoryName = assetName; - item.assetType = 0; - item.invType = 0; + item.assetType = assType; + item.invType = inType; item.parentFolderID = parentFolder; item.inventoryCurrentPermissions = 2147483647; item.inventoryNextPermissions = 2147483647; @@ -350,6 +364,9 @@ namespace OpenSim.Region.Capabilities private string m_assetName = ""; private string m_assetDes = ""; + private string m_invType = ""; + private string m_assetType = ""; + /// /// /// @@ -366,6 +383,9 @@ namespace OpenSim.Region.Capabilities uploaderPath = path; httpListener = httpServer; parentFolder = parentFolderID; + m_assetType = assetType; + m_invType = invType; + } /// @@ -393,7 +413,7 @@ namespace OpenSim.Region.Capabilities if (OnUpLoad != null) { - OnUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data); + OnUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType); } return res; diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 8db1e15..2cedea0 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -89,6 +89,7 @@ namespace OpenSim.Framework.Interfaces public delegate void UDPAssetUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data); public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data); + public delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName); public interface IClientAPI { @@ -140,6 +141,7 @@ namespace OpenSim.Framework.Interfaces event RequestTaskInventory OnRequestTaskInventory; event UDPAssetUploadRequest OnAssetUploadRequest; event XferReceive OnXferReceive; + event RequestXfer OnRequestXfer; event UUIDNameRequest OnNameFromUUIDRequest; @@ -212,11 +214,17 @@ namespace OpenSim.Framework.Interfaces void SendInventoryItemUpdate(InventoryItemBase Item); void SendRemoveInventoryItem(LLUUID itemID); void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName); + void SendXferPacket(ulong xferID, uint packet, byte[] data); + + void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID); + void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags); void SendNameReply(LLUUID profileId, string firstname, string lastname); void SendAlertMessage(string message); void SendAgentAlertMessage(string message, bool modal); void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url); bool AddMoney( int debit ); + + void SendViewerTime(int phase); } } diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs index 6be2563..e001549 100644 --- a/OpenSim/Framework/General/NullClientAPI.cs +++ b/OpenSim/Framework/General/NullClientAPI.cs @@ -59,6 +59,7 @@ namespace OpenSim.Framework public event RequestTaskInventory OnRequestTaskInventory; public event UDPAssetUploadRequest OnAssetUploadRequest; public event XferReceive OnXferReceive; + public event RequestXfer OnRequestXfer; public event UUIDNameRequest OnNameFromUUIDRequest; @@ -140,6 +141,10 @@ namespace OpenSim.Framework public virtual void SendInventoryItemUpdate(InventoryItemBase Item) { } public virtual void SendRemoveInventoryItem(LLUUID itemID) { } public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) { } + public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) { } + + public virtual void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) { } + public virtual void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags) { } public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname){} public void SendAlertMessage(string message) { } @@ -151,6 +156,8 @@ namespace OpenSim.Framework { return false; } + + public void SendViewerTime(int phase) { } } } diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 87cf173..728767f 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -12,12 +12,12 @@ namespace OpenSim.Framework.Types RightTriangle = 4, HalfCircle = 5 } - + public enum HollowShape : byte { Same = 0, Circle = 16, - Square =32, + Square = 32, Triangle = 48 } @@ -26,7 +26,7 @@ namespace OpenSim.Framework.Types Primitive = 9, Avatar = 47 } - + public enum Extrusion : byte { Straight = 16, @@ -34,11 +34,11 @@ namespace OpenSim.Framework.Types Curve2 = 48, Flexible = 128 } - + public class PrimitiveBaseShape { private static byte[] m_defaultTextureEntry; - + public byte PCode; public ushort PathBegin; public ushort PathEnd; @@ -100,14 +100,14 @@ namespace OpenSim.Framework.Types { m_defaultTextureEntry = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")).ToBytes(); } - + public PrimitiveBaseShape() { PCode = (byte)PCodeEnum.Primitive; ExtraParams = new byte[1]; TextureEntry = m_defaultTextureEntry; } - + //void returns need to change of course public virtual void GetMesh() { @@ -121,11 +121,12 @@ namespace OpenSim.Framework.Types } public class GenericShape : PrimitiveBaseShape - { - public GenericShape() : base() + { + public GenericShape() + : base() { - - } + + } } public class BoxShape : PrimitiveBaseShape @@ -133,7 +134,7 @@ namespace OpenSim.Framework.Types public BoxShape() : base() { - PathCurve = (byte) Extrusion.Straight; + PathCurve = (byte)Extrusion.Straight; ProfileShape = ProfileShape.Square; PathScaleX = 100; PathScaleY = 100; @@ -156,8 +157,8 @@ namespace OpenSim.Framework.Types { BoxShape boxShape = new BoxShape(); - boxShape.SetSide( 0.5f ); - + boxShape.SetSide(0.5f); + return boxShape; } } @@ -182,12 +183,12 @@ namespace OpenSim.Framework.Types private void SetHeigth(float heigth) { - Scale.Z = heigth; + Scale.Z = heigth; } private void SetRadius(float radius) { - Scale.X = Scale.Y = radius*2f; + Scale.X = Scale.Y = radius * 2f; } } } -- cgit v1.1