From 653a4ff22ddb80d586a19648a239f01322ef78be Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 27 Aug 2007 15:34:21 +0000 Subject: Deleted a few old files that are no longer used. Deleted the GridInterfaces projects, and for now moved the old local asset server into Framework.Communications, as we prepare to rewrite the asset cache and asset server. Deleted Framework.manager as I am sure this is no longer in use. --- .../Framework/Communications/Cache/AssetCache.cs | 6 +- .../Framework/Communications/Cache/AssetServer.cs | 392 +++++++++++++++++++++ .../Communications/Cache/UserProfileCache.cs | 2 +- OpenSim/Framework/General/Types/PrimData.cs | 228 ------------ OpenSim/Framework/General/Types/RegionInfo.cs | 2 +- OpenSim/Framework/General/UserProfile.cs | 87 ----- 6 files changed, 397 insertions(+), 320 deletions(-) create mode 100644 OpenSim/Framework/Communications/Cache/AssetServer.cs delete mode 100644 OpenSim/Framework/General/Types/PrimData.cs delete mode 100644 OpenSim/Framework/General/UserProfile.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 1b3bb18..3d31ba6 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Caches /// public AssetCache(IAssetServer assetServer) { - Console.WriteLine("Creating Asset cache"); + System.Console.WriteLine("Creating Asset cache"); _assetServer = assetServer; _assetServer.SetReceiver(this); Assets = new Dictionary(); @@ -89,7 +89,7 @@ namespace OpenSim.Framework.Communications.Caches public AssetCache(string assetServerDLLName, string assetServerURL, string assetServerKey) { - Console.WriteLine("Creating Asset cache"); + System.Console.WriteLine("Creating Asset cache"); _assetServer = this.LoadAssetDll(assetServerDLLName); _assetServer.SetServerInfo(assetServerURL, assetServerKey); _assetServer.SetReceiver(this); @@ -119,7 +119,7 @@ namespace OpenSim.Framework.Communications.Caches } catch (Exception e) { - Console.WriteLine(e.Message + " : " + e.StackTrace); + System.Console.WriteLine(e.Message + " : " + e.StackTrace); } } } diff --git a/OpenSim/Framework/Communications/Cache/AssetServer.cs b/OpenSim/Framework/Communications/Cache/AssetServer.cs new file mode 100644 index 0000000..fd203f7 --- /dev/null +++ b/OpenSim/Framework/Communications/Cache/AssetServer.cs @@ -0,0 +1,392 @@ +/* +* Copyright (c) Contributors, http://www.openmetaverse.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.IO; +using System.Threading; +using Db4objects.Db4o; +using Db4objects.Db4o.Query; +using libsecondlife; +using Nini.Config; +using OpenSim.Framework.Console; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; +using OpenSim.Framework.Utilities; + +namespace OpenSim.Framework.Communications.Caches +{ + + public class LocalAssetServer : IAssetServer + { + private IAssetReceiver _receiver; + private BlockingQueue _assetRequests; + private IObjectContainer db; + private Thread _localAssetServerThread; + + public LocalAssetServer() + { + bool yapfile; + this._assetRequests = new BlockingQueue(); + yapfile = File.Exists(Path.Combine(Util.dataDir(), "regionassets.yap")); + + MainLog.Instance.Verbose("Local Asset Server class created"); + db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(), "regionassets.yap")); + MainLog.Instance.Verbose("Db4 Asset database creation"); + + if (!yapfile) + { + this.SetUpAssetDatabase(); + } + + this._localAssetServerThread = new Thread(new ThreadStart(RunRequests)); + this._localAssetServerThread.IsBackground = true; + this._localAssetServerThread.Start(); + + } + + public void SetReceiver(IAssetReceiver receiver) + { + this._receiver = receiver; + } + + public void RequestAsset(LLUUID assetID, bool isTexture) + { + ARequest req = new ARequest(); + req.AssetID = assetID; + req.IsTexture = isTexture; + this._assetRequests.Enqueue(req); + } + + public void UpdateAsset(AssetBase asset) + { + + } + + public void UploadNewAsset(AssetBase asset) + { + AssetStorage store = new AssetStorage(); + store.Data = asset.Data; + store.Name = asset.Name; + store.UUID = asset.FullID; + db.Set(store); + db.Commit(); + } + + public void SetServerInfo(string ServerUrl, string ServerKey) + { + + } + public void Close() + { + if (db != null) + { + MainLog.Instance.Verbose("Closing local asset server database"); + db.Close(); + } + } + + private void RunRequests() + { + while (true) + { + byte[] idata = null; + bool found = false; + AssetStorage foundAsset = null; + ARequest req = this._assetRequests.Dequeue(); + IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID)); + if (result.Count > 0) + { + foundAsset = (AssetStorage)result.Next(); + found = true; + } + + AssetBase asset = new AssetBase(); + if (found) + { + asset.FullID = foundAsset.UUID; + asset.Type = foundAsset.Type; + asset.InvType = foundAsset.Type; + asset.Name = foundAsset.Name; + idata = foundAsset.Data; + asset.Data = idata; + _receiver.AssetReceived(asset, req.IsTexture); + } + else + { + //asset.FullID = ; + _receiver.AssetNotFound(req.AssetID); + } + + } + + } + + private void SetUpAssetDatabase() + { + MainLog.Instance.Verbose("Setting up asset database"); + + AssetBase Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001"); + Image.Name = "Bricks"; + this.LoadAsset(Image, true, "bricks.jp2"); + AssetStorage store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002"); + Image.Name = "Plywood"; + this.LoadAsset(Image, true, "plywood.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003"); + Image.Name = "Rocks"; + this.LoadAsset(Image, true, "rocks.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004"); + Image.Name = "Granite"; + this.LoadAsset(Image, true, "granite.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005"); + Image.Name = "Hardwood"; + this.LoadAsset(Image, true, "hardwood.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005"); + Image.Name = "Prim Base Texture"; + this.LoadAsset(Image, true, "plywood.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000006"); + Image.Name = "Map Base Texture"; + this.LoadAsset(Image, true, "map_base.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000007"); + Image.Name = "Map Texture"; + this.LoadAsset(Image, true, "map1.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000010"); + Image.Name = "Female Body Texture"; + this.LoadAsset(Image, true, "femalebody.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000011"); + Image.Name = "Female Bottom Texture"; + this.LoadAsset(Image, true, "femalebottom.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000012"); + Image.Name = "Female Face Texture"; + this.LoadAsset(Image, true, "femaleface.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"); + Image.Name = "Skin"; + Image.Type = 13; + Image.InvType = 13; + this.LoadAsset(Image, false, "base_skin.dat"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + + Image = new AssetBase(); + Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); + Image.Name = "Shape"; + Image.Type = 13; + Image.InvType = 13; + this.LoadAsset(Image, false, "base_shape.dat"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-38f9-1111-024e-222222111110"); + Image.Name = "Shirt"; + Image.Type = 5; + Image.InvType = 18; + this.LoadAsset(Image, false, "newshirt.dat"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-38f9-1111-024e-222222111120"); + Image.Name = "Shirt"; + Image.Type = 5; + Image.InvType = 18; + this.LoadAsset(Image, false, "newpants.dat"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + string filePath = Path.Combine(Util.configDir(), "OpenSimAssetSet.xml"); + if (File.Exists(filePath)) + { + XmlConfigSource source = new XmlConfigSource(filePath); + ReadAssetDetails(source); + } + } + + protected void ReadAssetDetails(IConfigSource source) + { + AssetBase newAsset = null; + for (int i = 0; i < source.Configs.Count; i++) + { + newAsset = new AssetBase(); + newAsset.FullID = new LLUUID(source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated())); + newAsset.Name = source.Configs[i].GetString("name", ""); + newAsset.Type = (sbyte)source.Configs[i].GetInt("assetType", 0); + newAsset.InvType = (sbyte)source.Configs[i].GetInt("inventoryType", 0); + string fileName = source.Configs[i].GetString("fileName", ""); + if (fileName != "") + { + this.LoadAsset(newAsset, false, fileName); + AssetStorage store = new AssetStorage(); + store.Data = newAsset.Data; + store.Name = newAsset.Name; + store.UUID = newAsset.FullID; + db.Set(store); + db.Commit(); + } + } + } + + private void LoadAsset(AssetBase info, bool image, string filename) + { + //should request Asset from storage manager + //but for now read from file + + string dataPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; + string fileName = Path.Combine(dataPath, filename); + FileInfo fInfo = new FileInfo(fileName); + long numBytes = fInfo.Length; + FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); + byte[] idata = new byte[numBytes]; + BinaryReader br = new BinaryReader(fStream); + idata = br.ReadBytes((int)numBytes); + br.Close(); + fStream.Close(); + info.Data = idata; + //info.loaded=true; + } + } + public class AssetUUIDQuery : Predicate + { + private LLUUID _findID; + + public AssetUUIDQuery(LLUUID find) + { + _findID = find; + } + public bool Match(AssetStorage asset) + { + return (asset.UUID == _findID); + } + } + +} + diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs index a599a19..07d7cf4 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs @@ -70,7 +70,7 @@ namespace OpenSim.Framework.Communications.Caches } else { - Console.WriteLine("CACHE", "User profile for user not found"); + System.Console.WriteLine("CACHE", "User profile for user not found"); } } } diff --git a/OpenSim/Framework/General/Types/PrimData.cs b/OpenSim/Framework/General/Types/PrimData.cs deleted file mode 100644 index 9b24c0f..0000000 --- a/OpenSim/Framework/General/Types/PrimData.cs +++ /dev/null @@ -1,228 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System; -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - public class PrimData - { - private const uint FULL_MASK_PERMISSIONS = 2147483647; - - public LLUUID OwnerID; - public byte PCode; - public ushort PathBegin; - public ushort PathEnd; - public byte PathScaleX; - public byte PathScaleY; - public byte PathShearX; - public byte PathShearY; - public sbyte PathSkew; - public ushort ProfileBegin; - public ushort ProfileEnd; - public LLVector3 Scale; - public byte PathCurve; - public byte ProfileCurve; - public uint ParentID = 0; - public ushort ProfileHollow; - public sbyte PathRadiusOffset; - public byte PathRevolutions; - public sbyte PathTaperX; - public sbyte PathTaperY; - public sbyte PathTwist; - public sbyte PathTwistBegin; - public byte[] TextureEntry; // a LL textureEntry in byte[] format - - public Int32 CreationDate; - public uint OwnerMask = FULL_MASK_PERMISSIONS; - public uint NextOwnerMask = FULL_MASK_PERMISSIONS; - public uint GroupMask = FULL_MASK_PERMISSIONS; - public uint EveryoneMask = FULL_MASK_PERMISSIONS; - public uint BaseMask = FULL_MASK_PERMISSIONS; - - //following only used during prim storage - public LLVector3 Position; - public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0); - public uint LocalID; - public LLUUID FullID; - - public PrimData() - { - - } - - public PrimData(byte[] data) - { - int i = 0; - - this.OwnerID = new LLUUID(data, i); i += 16; - this.PCode = data[i++]; - this.PathBegin = (ushort)(data[i++] + (data[i++] << 8)); - this.PathEnd = (ushort)(data[i++] + (data[i++] << 8)); - this.PathScaleX = data[i++]; - this.PathScaleY = data[i++]; - this.PathShearX = data[i++]; - this.PathShearY = data[i++]; - this.PathSkew = (sbyte)data[i++]; - this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8)); - this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8)); - this.Scale = new LLVector3(data, i); i += 12; - this.PathCurve = data[i++]; - this.ProfileCurve = data[i++]; - this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8)); - this.PathRadiusOffset = (sbyte)data[i++]; - this.PathRevolutions = data[i++]; - this.PathTaperX = (sbyte)data[i++]; - this.PathTaperY = (sbyte)data[i++]; - this.PathTwist = (sbyte)data[i++]; - this.PathTwistBegin = (sbyte)data[i++]; - ushort length = (ushort)(data[i++] + (data[i++] << 8)); - this.TextureEntry = new byte[length]; - Array.Copy(data, i, TextureEntry, 0, length); i += length; - this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.Position = new LLVector3(data, i); i += 12; - this.Rotation = new LLQuaternion(data, i, true); i += 12; - this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.FullID = new LLUUID(data, i); i += 16; - - } - - public byte[] ToBytes() - { - int i = 0; - byte[] bytes = new byte[126 + TextureEntry.Length]; - Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16; - bytes[i++] = this.PCode; - bytes[i++] = (byte)(this.PathBegin % 256); - bytes[i++] = (byte)((this.PathBegin >> 8) % 256); - bytes[i++] = (byte)(this.PathEnd % 256); - bytes[i++] = (byte)((this.PathEnd >> 8) % 256); - bytes[i++] = this.PathScaleX; - bytes[i++] = this.PathScaleY; - bytes[i++] = this.PathShearX; - bytes[i++] = this.PathShearY; - bytes[i++] = (byte)this.PathSkew; - bytes[i++] = (byte)(this.ProfileBegin % 256); - bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256); - bytes[i++] = (byte)(this.ProfileEnd % 256); - bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256); - Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12; - bytes[i++] = this.PathCurve; - bytes[i++] = this.ProfileCurve; - bytes[i++] = (byte)(ParentID % 256); - bytes[i++] = (byte)((ParentID >> 8) % 256); - bytes[i++] = (byte)((ParentID >> 16) % 256); - bytes[i++] = (byte)((ParentID >> 24) % 256); - bytes[i++] = (byte)(this.ProfileHollow % 256); - bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256); - bytes[i++] = ((byte)this.PathRadiusOffset); - bytes[i++] = this.PathRevolutions; - bytes[i++] = ((byte)this.PathTaperX); - bytes[i++] = ((byte)this.PathTaperY); - bytes[i++] = ((byte)this.PathTwist); - bytes[i++] = ((byte)this.PathTwistBegin); - bytes[i++] = (byte)(TextureEntry.Length % 256); - bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256); - Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length; - bytes[i++] = (byte)(this.CreationDate % 256); - bytes[i++] = (byte)((this.CreationDate >> 8) % 256); - bytes[i++] = (byte)((this.CreationDate >> 16) % 256); - bytes[i++] = (byte)((this.CreationDate >> 24) % 256); - bytes[i++] = (byte)(this.OwnerMask % 256); - bytes[i++] = (byte)((this.OwnerMask >> 8) % 256); - bytes[i++] = (byte)((this.OwnerMask >> 16) % 256); - bytes[i++] = (byte)((this.OwnerMask >> 24) % 256); - bytes[i++] = (byte)(this.NextOwnerMask % 256); - bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256); - bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256); - bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256); - bytes[i++] = (byte)(this.GroupMask % 256); - bytes[i++] = (byte)((this.GroupMask >> 8) % 256); - bytes[i++] = (byte)((this.GroupMask >> 16) % 256); - bytes[i++] = (byte)((this.GroupMask >> 24) % 256); - bytes[i++] = (byte)(this.EveryoneMask % 256); - bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256); - bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256); - bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256); - bytes[i++] = (byte)(this.BaseMask % 256); - bytes[i++] = (byte)((this.BaseMask >> 8) % 256); - bytes[i++] = (byte)((this.BaseMask >> 16) % 256); - bytes[i++] = (byte)((this.BaseMask >> 24) % 256); - Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; - if (this.Rotation == new LLQuaternion(0, 0, 0, 0)) - { - this.Rotation = new LLQuaternion(0, 1, 0, 0); - } - Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12; - bytes[i++] = (byte)(this.LocalID % 256); - bytes[i++] = (byte)((this.LocalID >> 8) % 256); - bytes[i++] = (byte)((this.LocalID >> 16) % 256); - bytes[i++] = (byte)((this.LocalID >> 24) % 256); - Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16; - - return bytes; - } - - //public static PrimData DefaultCube() - //{ - // PrimData primData = new PrimData(); - // primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - // primData.FullID = LLUUID.Random(); - // primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f); - // primData.Rotation = new LLQuaternion(0, 0, 0, 1); - // primData.PCode = 9; - // primData.ParentID = 0; - // primData.PathBegin = 0; - // primData.PathEnd = 0; - // primData.PathScaleX = 0; - // primData.PathScaleY = 0; - // primData.PathShearX = 0; - // primData.PathShearY = 0; - // primData.PathSkew = 0; - // primData.ProfileBegin = 0; - // primData.ProfileEnd = 0; - // primData.PathCurve = 16; - // primData.ProfileCurve = 1; - // primData.ProfileHollow = 0; - // primData.PathRadiusOffset = 0; - // primData.PathRevolutions = 0; - // primData.PathTaperX = 0; - // primData.PathTaperY = 0; - // primData.PathTwist = 0; - // primData.PathTwistBegin = 0; - - // return primData; - //} - } -} diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index c567aa6..b7dff17 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -216,7 +216,7 @@ namespace OpenSim.Framework.Types configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Simulator Name", "OpenSim Test", false); configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false); configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); - configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "localworld.yap", false); + configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", "9000", false); configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); diff --git a/OpenSim/Framework/General/UserProfile.cs b/OpenSim/Framework/General/UserProfile.cs deleted file mode 100644 index ec5a485..0000000 --- a/OpenSim/Framework/General/UserProfile.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System.Collections.Generic; -using System.Security.Cryptography; -using libsecondlife; -using OpenSim.Framework.Inventory; - -namespace OpenSim.Framework.User -{ - public class UserProfile - { - - public string firstname; - public string lastname; - public ulong homeregionhandle; - public LLVector3 homepos; - public LLVector3 homelookat; - - public bool IsGridGod = false; - public bool IsLocal = true; // will be used in future for visitors from foreign grids - public string AssetURL; - public string MD5passwd; - - public LLUUID CurrentSessionID; - public LLUUID CurrentSecureSessionID; - public LLUUID UUID; - public Dictionary Circuits = new Dictionary(); // tracks circuit codes - - public AgentInventory Inventory; - - public UserProfile() - { - Circuits = new Dictionary(); - Inventory = new AgentInventory(); - homeregionhandle = Helpers.UIntsToLong((1000 * 256), (1000 * 256)); - homepos = new LLVector3(); - homelookat = new LLVector3(); - } - - public void InitSessionData() - { - RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); - - byte[] randDataS = new byte[16]; - byte[] randDataSS = new byte[16]; - - rand.GetBytes(randDataS); - rand.GetBytes(randDataSS); - - CurrentSecureSessionID = new LLUUID(randDataSS,0); - CurrentSessionID = new LLUUID(randDataS,0); - - } - - public void AddSimCircuit(uint circuitCode, LLUUID regionUUID) - { - if (this.Circuits.ContainsKey(regionUUID) == false) - this.Circuits.Add(regionUUID, circuitCode); - } - - } -} -- cgit v1.1