From 646bbbc84b8010e0dacbeed5342cdb045f46cc49 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 27 Jun 2007 15:28:52 +0000 Subject: Some work on restructuring the namespaces / project names. Note this doesn't compile yet as not all the code has been changed to use the new namespaces. Am committing it now for feedback on the namespaces. --- OpenSim/Framework/General/AgentInventory.cs | 267 ++++++++++++++++++ .../Framework/General/AuthenticateSessionBase.cs | 132 +++++++++ OpenSim/Framework/General/BlockingQueue.cs | 60 ++++ OpenSim/Framework/General/IRegionCommsListener.cs | 47 ++++ .../General/Interfaces/AuthenticateResponse.cs | 51 ++++ .../General/Interfaces/Config/IGenericConfig.cs | 42 +++ .../General/Interfaces/Config/IGridConfig.cs | 63 +++++ .../General/Interfaces/Config/IUserConfig.cs | 57 ++++ .../Framework/General/Interfaces/IAssetServer.cs | 69 +++++ OpenSim/Framework/General/Interfaces/IClientAPI.cs | 160 +++++++++++ .../Framework/General/Interfaces/ILocalStorage.cs | 69 +++++ .../Framework/General/Interfaces/IUserServer.cs | 42 +++ OpenSim/Framework/General/Interfaces/IWorld.cs | 45 +++ .../General/Interfaces/Scripting/IScriptAPI.cs | 42 +++ .../General/Interfaces/Scripting/IScriptEngine.cs | 41 +++ OpenSim/Framework/General/LLSDHelpers.cs | 246 +++++++++++++++++ OpenSim/Framework/General/Logger.cs | 85 ++++++ OpenSim/Framework/General/LoginService.cs | 41 +++ OpenSim/Framework/General/OpenSim.Framework.csproj | 213 +++++++++++++++ .../General/OpenSim.Framework.csproj.user | 12 + .../Framework/General/Properties/AssemblyInfo.cs | 33 +++ OpenSim/Framework/General/RegionCommsListener.cs | 69 +++++ OpenSim/Framework/General/Remoting.cs | 136 +++++++++ OpenSim/Framework/General/SimProfile.cs | 122 +++++++++ OpenSim/Framework/General/Types/AgentCiruitData.cs | 50 ++++ OpenSim/Framework/General/Types/AgentWearable.cs | 60 ++++ OpenSim/Framework/General/Types/AssetBase.cs | 49 ++++ OpenSim/Framework/General/Types/AssetLandmark.cs | 61 +++++ OpenSim/Framework/General/Types/AssetStorage.cs | 50 ++++ OpenSim/Framework/General/Types/EstateSettings.cs | 97 +++++++ OpenSim/Framework/General/Types/Login.cs | 52 ++++ OpenSim/Framework/General/Types/MapBlockData.cs | 25 ++ OpenSim/Framework/General/Types/NeighbourInfo.cs | 50 ++++ .../Framework/General/Types/NetworkServersInfo.cs | 181 ++++++++++++ OpenSim/Framework/General/Types/ParcelData.cs | 115 ++++++++ OpenSim/Framework/General/Types/PrimData.cs | 230 ++++++++++++++++ OpenSim/Framework/General/Types/RegionHandle.cs | 120 ++++++++ OpenSim/Framework/General/Types/RegionInfo.cs | 304 +++++++++++++++++++++ OpenSim/Framework/General/UserProfile.cs | 89 ++++++ OpenSim/Framework/General/Util.cs | 186 +++++++++++++ 40 files changed, 3863 insertions(+) create mode 100644 OpenSim/Framework/General/AgentInventory.cs create mode 100644 OpenSim/Framework/General/AuthenticateSessionBase.cs create mode 100644 OpenSim/Framework/General/BlockingQueue.cs create mode 100644 OpenSim/Framework/General/IRegionCommsListener.cs create mode 100644 OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs create mode 100644 OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs create mode 100644 OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs create mode 100644 OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs create mode 100644 OpenSim/Framework/General/Interfaces/IAssetServer.cs create mode 100644 OpenSim/Framework/General/Interfaces/IClientAPI.cs create mode 100644 OpenSim/Framework/General/Interfaces/ILocalStorage.cs create mode 100644 OpenSim/Framework/General/Interfaces/IUserServer.cs create mode 100644 OpenSim/Framework/General/Interfaces/IWorld.cs create mode 100644 OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs create mode 100644 OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs create mode 100644 OpenSim/Framework/General/LLSDHelpers.cs create mode 100644 OpenSim/Framework/General/Logger.cs create mode 100644 OpenSim/Framework/General/LoginService.cs create mode 100644 OpenSim/Framework/General/OpenSim.Framework.csproj create mode 100644 OpenSim/Framework/General/OpenSim.Framework.csproj.user create mode 100644 OpenSim/Framework/General/Properties/AssemblyInfo.cs create mode 100644 OpenSim/Framework/General/RegionCommsListener.cs create mode 100644 OpenSim/Framework/General/Remoting.cs create mode 100644 OpenSim/Framework/General/SimProfile.cs create mode 100644 OpenSim/Framework/General/Types/AgentCiruitData.cs create mode 100644 OpenSim/Framework/General/Types/AgentWearable.cs create mode 100644 OpenSim/Framework/General/Types/AssetBase.cs create mode 100644 OpenSim/Framework/General/Types/AssetLandmark.cs create mode 100644 OpenSim/Framework/General/Types/AssetStorage.cs create mode 100644 OpenSim/Framework/General/Types/EstateSettings.cs create mode 100644 OpenSim/Framework/General/Types/Login.cs create mode 100644 OpenSim/Framework/General/Types/MapBlockData.cs create mode 100644 OpenSim/Framework/General/Types/NeighbourInfo.cs create mode 100644 OpenSim/Framework/General/Types/NetworkServersInfo.cs create mode 100644 OpenSim/Framework/General/Types/ParcelData.cs create mode 100644 OpenSim/Framework/General/Types/PrimData.cs create mode 100644 OpenSim/Framework/General/Types/RegionHandle.cs create mode 100644 OpenSim/Framework/General/Types/RegionInfo.cs create mode 100644 OpenSim/Framework/General/UserProfile.cs create mode 100644 OpenSim/Framework/General/Util.cs (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/AgentInventory.cs b/OpenSim/Framework/General/AgentInventory.cs new file mode 100644 index 0000000..fbf4d23 --- /dev/null +++ b/OpenSim/Framework/General/AgentInventory.cs @@ -0,0 +1,267 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; +using OpenSim.Framework.Types; +using OpenSim.Framework.Utilities; + +namespace OpenSim.Framework.Inventory +{ + public class AgentInventory + { + //Holds the local copy of Inventory info for a agent + public Dictionary InventoryFolders; + public Dictionary InventoryItems; + public InventoryFolder InventoryRoot; + public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server + public LLUUID AgentID; + public AvatarWearable[] Wearables; + + public AgentInventory() + { + InventoryFolders = new Dictionary(); + InventoryItems = new Dictionary(); + this.Initialise(); + } + + public virtual void Initialise() + { + Wearables = new AvatarWearable[13]; //should be 12 of these + for (int i = 0; i < 13; i++) + { + Wearables[i] = new AvatarWearable(); + } + + } + + public bool CreateNewFolder(LLUUID folderID, ushort type) + { + InventoryFolder Folder = new InventoryFolder(); + Folder.FolderID = folderID; + Folder.OwnerID = this.AgentID; + Folder.DefaultType = type; + this.InventoryFolders.Add(Folder.FolderID, Folder); + return (true); + } + + public void CreateRootFolder(LLUUID newAgentID, bool createTextures) + { + this.AgentID = newAgentID; + InventoryRoot = new InventoryFolder(); + InventoryRoot.FolderID = LLUUID.Random(); + InventoryRoot.ParentID = new LLUUID(); + InventoryRoot.Version = 1; + InventoryRoot.DefaultType = 8; + InventoryRoot.OwnerID = this.AgentID; + InventoryRoot.FolderName = "My Inventory"; + InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot); + InventoryRoot.OwnerID = this.AgentID; + if (createTextures) + { + this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID); + } + } + + public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName) + { + InventoryFolder Folder = new InventoryFolder(); + Folder.FolderID = folderID; + Folder.OwnerID = this.AgentID; + Folder.DefaultType = type; + Folder.FolderName = folderName; + this.InventoryFolders.Add(Folder.FolderID, Folder); + + return (true); + } + + public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent) + { + if (!this.InventoryFolders.ContainsKey(folderID)) + { + System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory"); + InventoryFolder Folder = new InventoryFolder(); + Folder.FolderID = folderID; + Folder.OwnerID = this.AgentID; + Folder.DefaultType = type; + Folder.FolderName = folderName; + Folder.ParentID = parent; + this.InventoryFolders.Add(Folder.FolderID, Folder); + } + + return (true); + } + + public bool HasFolder(LLUUID folderID) + { + if (this.InventoryFolders.ContainsKey(folderID)) + { + return true; + } + return false; + } + + public LLUUID GetFolderID(string folderName) + { + foreach (InventoryFolder inv in this.InventoryFolders.Values) + { + if (inv.FolderName == folderName) + { + return inv.FolderID; + } + } + + return LLUUID.Zero; + } + + public bool UpdateItemAsset(LLUUID itemID, AssetBase asset) + { + if(this.InventoryItems.ContainsKey(itemID)) + { + InventoryItem Item = this.InventoryItems[itemID]; + Item.AssetID = asset.FullID; + System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated()); + //TODO need to update the rest of the info + } + return true; + } + + public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) + { + System.Console.WriteLine("updating inventory item details"); + if (this.InventoryItems.ContainsKey(itemID)) + { + System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name)); + InventoryItem Item = this.InventoryItems[itemID]; + Item.Name = Util.FieldToString(packet.Name); + System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated()); + //TODO need to update the rest of the info + } + return true; + } + + public LLUUID AddToInventory(LLUUID folderID, AssetBase asset) + { + if (this.InventoryFolders.ContainsKey(folderID)) + { + LLUUID NewItemID = LLUUID.Random(); + + InventoryItem Item = new InventoryItem(); + Item.FolderID = folderID; + Item.OwnerID = AgentID; + Item.AssetID = asset.FullID; + Item.ItemID = NewItemID; + Item.Type = asset.Type; + Item.Name = asset.Name; + Item.Description = asset.Description; + Item.InvType = asset.InvType; + this.InventoryItems.Add(Item.ItemID, Item); + InventoryFolder Folder = InventoryFolders[Item.FolderID]; + Folder.Items.Add(Item); + return (Item.ItemID); + } + else + { + return (null); + } + } + + public bool DeleteFromInventory(LLUUID itemID) + { + bool res = false; + if (this.InventoryItems.ContainsKey(itemID)) + { + InventoryItem item = this.InventoryItems[itemID]; + this.InventoryItems.Remove(itemID); + foreach (InventoryFolder fold in InventoryFolders.Values) + { + if (fold.Items.Contains(item)) + { + fold.Items.Remove(item); + break; + } + } + res = true; + + } + return res; + } + } + + public class InventoryFolder + { + public List Items; + //public List Subfolders; + public LLUUID FolderID; + public LLUUID OwnerID; + public LLUUID ParentID = LLUUID.Zero; + public string FolderName; + public ushort DefaultType; + public ushort Version; + + public InventoryFolder() + { + Items = new List(); + //Subfolders = new List(); + } + + } + + public class InventoryItem + { + public LLUUID FolderID; + public LLUUID OwnerID; + public LLUUID ItemID; + public LLUUID AssetID; + public LLUUID CreatorID; + public sbyte InvType; + public sbyte Type; + public string Name =""; + public string Description; + + public InventoryItem() + { + this.CreatorID = LLUUID.Zero; + } + + public string ExportString() + { + string typ = "notecard"; + string result = ""; + result += "\tinv_object\t0\n\t{\n"; + result += "\t\tobj_id\t%s\n"; + result += "\t\tparent_id\t"+ ItemID.ToString() +"\n"; + result += "\t\ttype\t"+ typ +"\n"; + result += "\t\tname\t" + Name+"|\n"; + result += "\t}\n"; + return result; + } + } +} diff --git a/OpenSim/Framework/General/AuthenticateSessionBase.cs b/OpenSim/Framework/General/AuthenticateSessionBase.cs new file mode 100644 index 0000000..73dd3e2 --- /dev/null +++ b/OpenSim/Framework/General/AuthenticateSessionBase.cs @@ -0,0 +1,132 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework +{ + public class AuthenticateSessionsBase + { + public Dictionary AgentCircuits = new Dictionary(); + + public AuthenticateSessionsBase() + { + + } + + public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) + { + AgentCircuitData validcircuit = null; + if (this.AgentCircuits.ContainsKey(circuitcode)) + { + validcircuit = this.AgentCircuits[circuitcode]; + } + AuthenticateResponse user = new AuthenticateResponse(); + if (validcircuit == null) + { + //don't have this circuit code in our list + user.Authorised = false; + return (user); + } + + if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) + { + user.Authorised = true; + user.LoginInfo = new Login(); + user.LoginInfo.Agent = agentID; + user.LoginInfo.Session = sessionID; + user.LoginInfo.SecureSession = validcircuit.SecureSessionID; + user.LoginInfo.First = validcircuit.firstname; + user.LoginInfo.Last = validcircuit.lastname; + user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; + user.LoginInfo.BaseFolder = validcircuit.BaseFolder; + } + else + { + // Invalid + user.Authorised = false; + } + + return (user); + } + + public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) + { + if (this.AgentCircuits.ContainsKey(circuitCode)) + { + this.AgentCircuits[circuitCode] = agentData; + } + else + { + this.AgentCircuits.Add(circuitCode, agentData); + } + } + + public LLVector3 GetPosition(uint circuitCode) + { + LLVector3 vec = new LLVector3(); + if (this.AgentCircuits.ContainsKey(circuitCode)) + { + vec = this.AgentCircuits[circuitCode].startpos; + } + return vec; + } + + public void UpdateAgentData(AgentCircuitData agentData) + { + if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode)) + { + this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname; + this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname; + this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; + // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); + } + } + + public void UpdateAgentChildStatus(uint circuitcode, bool childstatus) + { + if (this.AgentCircuits.ContainsKey(circuitcode)) + { + this.AgentCircuits[circuitcode].child = childstatus; + } + } + + public bool GetAgentChildStatus(uint circuitcode) + { + if (this.AgentCircuits.ContainsKey(circuitcode)) + { + return this.AgentCircuits[circuitcode].child; + } + return false; + } + } +} \ No newline at end of file diff --git a/OpenSim/Framework/General/BlockingQueue.cs b/OpenSim/Framework/General/BlockingQueue.cs new file mode 100644 index 0000000..667b8d8 --- /dev/null +++ b/OpenSim/Framework/General/BlockingQueue.cs @@ -0,0 +1,60 @@ +/* +* 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.Threading; +using System.Collections.Generic; +using System.Text; + +namespace OpenSim.Framework.Utilities +{ + public class BlockingQueue + { + private Queue _queue = new Queue(); + private object _queueSync = new object(); + + public void Enqueue(T value) + { + lock (_queueSync) + { + _queue.Enqueue(value); + Monitor.Pulse(_queueSync); + } + } + + public T Dequeue() + { + lock (_queueSync) + { + if (_queue.Count < 1) + Monitor.Wait(_queueSync); + + return _queue.Dequeue(); + } + } + } +} diff --git a/OpenSim/Framework/General/IRegionCommsListener.cs b/OpenSim/Framework/General/IRegionCommsListener.cs new file mode 100644 index 0000000..0e80941 --- /dev/null +++ b/OpenSim/Framework/General/IRegionCommsListener.cs @@ -0,0 +1,47 @@ +/* +* 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.Collections.Generic; +using System.Text; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework +{ + public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); + public delegate void UpdateNeighbours(List neighbours); + public delegate void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); + + public interface IRegionCommsListener + { + event ExpectUserDelegate OnExpectUser; + event GenericCall2 OnExpectChildAgent; + event AgentCrossing OnAvatarCrossingIntoRegion; + event UpdateNeighbours OnNeighboursUpdate; + } +} diff --git a/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs new file mode 100644 index 0000000..462e2c5 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs @@ -0,0 +1,51 @@ +/* +* 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.Collections; +using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; +using System.IO; +using libsecondlife; +using OpenSim; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework.Interfaces +{ + public class AuthenticateResponse + { + public bool Authorised; + public Login LoginInfo; + + public AuthenticateResponse() + { + + } + + } +} diff --git a/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs new file mode 100644 index 0000000..13980fe --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs @@ -0,0 +1,42 @@ +/* +* 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.Collections.Generic; +using System.Text; + +namespace OpenSim.Framework.Interfaces +{ + public interface IGenericConfig + { + void LoadData(); + string GetAttribute(string attributeName); + bool SetAttribute(string attributeName, string attributeValue); + void Commit(); + void Close(); + } +} diff --git a/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs new file mode 100644 index 0000000..0fafe1a --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs @@ -0,0 +1,63 @@ +/* +* 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.Collections.Generic; +using System.IO; +using libsecondlife; +//using OpenSim.world; + +namespace OpenSim.Framework.Interfaces +{ + /// + /// + + + public abstract class GridConfig + { + public string GridOwner; + public string DefaultStartupMsg; + public string DefaultAssetServer; + public string AssetSendKey; + public string AssetRecvKey; + public string DefaultUserServer; + public string UserSendKey; + public string UserRecvKey; + public string SimSendKey; + public string SimRecvKey; + + + public abstract void InitConfig(); + + } + + public interface IGridConfig + { + GridConfig GetConfigObject(); + } +} diff --git a/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs new file mode 100644 index 0000000..2f4b340 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs @@ -0,0 +1,57 @@ +/* +* 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.Collections.Generic; +using System.IO; +using libsecondlife; +//using OpenSim.world; + +namespace OpenSim.Framework.Interfaces +{ + /// + /// + + + public abstract class UserConfig + { + public string DefaultStartupMsg; + public string GridServerURL; + public string GridSendKey; + public string GridRecvKey; + + + public abstract void InitConfig(); + + } + + public interface IUserConfig + { + UserConfig GetConfigObject(); + } +} diff --git a/OpenSim/Framework/General/Interfaces/IAssetServer.cs b/OpenSim/Framework/General/Interfaces/IAssetServer.cs new file mode 100644 index 0000000..826392d --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IAssetServer.cs @@ -0,0 +1,69 @@ +/* +* 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.Net; +using System.Net.Sockets; +using System.IO; +using System.Threading; +using libsecondlife; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework.Interfaces +{ + /// + /// Description of IAssetServer. + /// + + public interface IAssetServer + { + void SetReceiver(IAssetReceiver receiver); + void RequestAsset(LLUUID assetID, bool isTexture); + void UpdateAsset(AssetBase asset); + void UploadNewAsset(AssetBase asset); + void SetServerInfo(string ServerUrl, string ServerKey); + void Close(); + } + + // could change to delegate? + public interface IAssetReceiver + { + void AssetReceived(AssetBase asset, bool IsTexture); + void AssetNotFound(AssetBase asset); + } + + public interface IAssetPlugin + { + IAssetServer GetAssetServer(); + } + + public struct ARequest + { + public LLUUID AssetID; + public bool IsTexture; + } +} diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs new file mode 100644 index 0000000..009648c --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -0,0 +1,160 @@ +/* +* 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.Collections.Generic; +using System.Text; +using OpenSim.Framework.Inventory; +using libsecondlife; +using libsecondlife.Packets; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework.Interfaces +{ + public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); + public delegate void RezObject(AssetBase primAsset, LLVector3 pos); + public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west); + public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); + public delegate void StartAnim(LLUUID animID, int seq); + public delegate void LinkObjects(uint parent, List children); + public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); + public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); + + public delegate void GenericCall(IClientAPI remoteClient); + public delegate void GenericCall2(); + public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary. + public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); + public delegate void GenericCall5(IClientAPI remoteClient, bool status); + public delegate void GenericCall6(LLUUID uid); + + public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); + public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); + public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); + public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); + public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); + public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); + public delegate void StatusChange(bool status); + public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); + public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); + public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient); + + public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); + public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); + public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); + public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); // NOTETOSELFremove the packet part + + public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); + + public interface IClientAPI + { + event ChatFromViewer OnChatFromViewer; + event RezObject OnRezObject; + event ModifyTerrain OnModifyTerrain; + event SetAppearance OnSetAppearance; + event StartAnim OnStartAnim; + event LinkObjects OnLinkObjects; + event RequestMapBlocks OnRequestMapBlocks; + event TeleportLocationRequest OnTeleportLocationRequest; + + event GenericCall4 OnDeRezObject; + event GenericCall OnRegionHandShakeReply; + event GenericCall OnRequestWearables; + event GenericCall2 OnCompleteMovementToRegion; + event UpdateAgent OnAgentUpdate; + event GenericCall OnRequestAvatarsData; + event GenericCall4 OnAddPrim; + event UpdateVector OnGrapObject; + event ObjectSelect OnDeGrapObject; + event MoveObject OnGrapUpdate; + + event UpdateShape OnUpdatePrimShape; + event ObjectSelect OnObjectSelect; + event UpdatePrimFlags OnUpdatePrimFlags; + event UpdatePrimTexture OnUpdatePrimTexture; + event UpdateVector OnUpdatePrimPosition; + event UpdatePrimRotation OnUpdatePrimRotation; + event UpdateVector OnUpdatePrimScale; + event StatusChange OnChildAgentStatus; + event GenericCall2 OnStopMovement; + event NewAvatar OnNewAvatar; + event GenericCall6 OnRemoveAvatar; + + event ParcelPropertiesRequest OnParcelPropertiesRequest; + event ParcelDivideRequest OnParcelDivideRequest; + event ParcelJoinRequest OnParcelJoinRequest; + event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; + + event EstateOwnerMessageRequest OnEstateOwnerMessage; + + LLVector3 StartPos + { + get; + set; + } + + LLUUID AgentId + { + get; + } + + string FirstName + { + get; + } + + string LastName + { + get; + } + + void OutPacket(Packet newPack); + void SendWearables(AvatarWearable[] wearables); + void SendRegionHandshake(RegionInfo regionInfo); + void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); + void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); + void SendLayerData(float[] map); + void SendLayerData(int px, int py, float[] map); + void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); + void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); + AgentCircuitData RequestClientInfo(); + void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort); + void SendMapBlock(List mapBlocks); + void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); + void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags); + void SendTeleportCancel(); + void SendTeleportLocationStart(); + void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); + + void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry); + void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); + + void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags); + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags); + void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); + } +} diff --git a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs new file mode 100644 index 0000000..4987d10 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs @@ -0,0 +1,69 @@ +/* +* 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; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework.Interfaces +{ + /// + /// ILocalStorage. Really hacked together right now needs cleaning up + /// + public interface ILocalStorage + { + void Initialise(string datastore); + + void StorePrim(PrimData prim); + void RemovePrim(LLUUID primID); + void LoadPrimitives(ILocalStorageReceiver receiver); + + float[] LoadWorld(); + void SaveMap(float[] heightmap); + + void SaveParcels(ParcelData[] parcels); + void SaveParcel(ParcelData parcel); + void RemoveParcel(ParcelData parcel); + void RemoveAllParcels(); + void LoadParcels(ILocalStorageParcelReceiver recv); + + void ShutDown(); + } + + public interface ILocalStorageReceiver + { + void PrimFromStorage(PrimData prim); + } + + public interface ILocalStorageParcelReceiver + { + void ParcelFromStorage(ParcelData data); + void NoParcelDataFromStorage(); + } +} + diff --git a/OpenSim/Framework/General/Interfaces/IUserServer.cs b/OpenSim/Framework/General/Interfaces/IUserServer.cs new file mode 100644 index 0000000..c6e2223 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IUserServer.cs @@ -0,0 +1,42 @@ +/* +* 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.Collections.Generic; +using System.Text; +using OpenSim.Framework.Inventory; +using libsecondlife; + +namespace OpenSim.Framework.Interfaces +{ + public interface IUserServer + { + AgentInventory RequestAgentsInventory(LLUUID agentID); + void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); + bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory); + } +} diff --git a/OpenSim/Framework/General/Interfaces/IWorld.cs b/OpenSim/Framework/General/Interfaces/IWorld.cs new file mode 100644 index 0000000..4857417 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IWorld.cs @@ -0,0 +1,45 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework.Interfaces +{ + public interface IWorld + { + void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child); + void RemoveClient(LLUUID agentID); + + RegionInfo RegionInfo { get; } + object SyncRoot { get; } + uint NextLocalId { get; } + } +} diff --git a/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs b/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs new file mode 100644 index 0000000..0c1627b --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs @@ -0,0 +1,42 @@ +/* +* 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.Collections.Generic; +using System.Text; +using OpenSim.Framework.Types; + +using libsecondlife; +namespace OpenSim.Framework.Interfaces +{ + public interface IScriptAPI + { + LLVector3 GetEntityPosition(uint localID); + void SetEntityPosition(uint localID, float x, float y, float z); + uint GetRandomAvatarID(); + } +} diff --git a/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs b/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs new file mode 100644 index 0000000..ca50be0 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs @@ -0,0 +1,41 @@ +/* +* 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.Collections.Generic; +using System.Text; + +namespace OpenSim.Framework.Interfaces +{ + public interface IScriptEngine + { + bool Init(IScriptAPI api); + string GetName(); + void LoadScript(string script, string scriptName, uint entityID); + void OnFrame(); + } +} diff --git a/OpenSim/Framework/General/LLSDHelpers.cs b/OpenSim/Framework/General/LLSDHelpers.cs new file mode 100644 index 0000000..051520c --- /dev/null +++ b/OpenSim/Framework/General/LLSDHelpers.cs @@ -0,0 +1,246 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Xml; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class LLSDHelpers + { + public static string SerialiseLLSDReply(object obj) + { + StringWriter sw = new StringWriter(); + XmlTextWriter writer = new XmlTextWriter(sw); + writer.Formatting = Formatting.None; + writer.WriteStartElement(String.Empty, "llsd", String.Empty); + LLSDHelpers.SerializeLLSDType(writer, obj); + writer.WriteEndElement(); + writer.Close(); + return sw.ToString(); + } + + public static void SerializeLLSDType(XmlTextWriter writer, object obj) + { + Type myType = obj.GetType(); + LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); + if (llsdattributes.Length > 0) + { + switch (llsdattributes[0].ObjectType) + { + case "MAP": + writer.WriteStartElement(String.Empty, "map", String.Empty); + System.Reflection.FieldInfo[] fields = myType.GetFields(); + for (int i = 0; i < fields.Length; i++) + { + object fieldValue = fields[i].GetValue(obj); + LLSDType[] fieldAttributes = (LLSDType[])fieldValue.GetType().GetCustomAttributes(typeof(LLSDType), false); + if (fieldAttributes.Length > 0) + { + writer.WriteStartElement(String.Empty, "key", String.Empty); + writer.WriteString(fields[i].Name); + writer.WriteEndElement(); + SerializeLLSDType(writer, fieldValue); + } + else + { + //Console.WriteLine("LLSD field name" + fields[i].Name + " , " + fields[i].GetValue(obj).GetType()); + writer.WriteStartElement(String.Empty, "key", String.Empty); + writer.WriteString(fields[i].Name); + writer.WriteEndElement(); + LLSD.LLSDWriteOne(writer, fieldValue); + } + } + writer.WriteEndElement(); + break; + case "ARRAY": + // LLSDArray arrayObject = obj as LLSDArray; + // ArrayList a = arrayObject.Array; + ArrayList a = (ArrayList)obj.GetType().GetField("Array").GetValue(obj); + writer.WriteStartElement(String.Empty, "array", String.Empty); + foreach (object item in a) + { + SerializeLLSDType(writer, item); + } + writer.WriteEndElement(); + break; + } + } + else + { + LLSD.LLSDWriteOne(writer, obj); + } + } + + public static object DeserialiseLLSDMap(Hashtable llsd, object obj) + { + Type myType = obj.GetType(); + LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); + if (llsdattributes.Length > 0) + { + switch (llsdattributes[0].ObjectType) + { + case "MAP": + IDictionaryEnumerator enumerator = llsd.GetEnumerator(); + while (enumerator.MoveNext()) + { + System.Reflection.FieldInfo field = myType.GetField((string)enumerator.Key); + if (field != null) + { + if (enumerator.Value is Hashtable) + { + object fieldValue = field.GetValue(obj); + DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); + } + else if (enumerator.Value is ArrayList) + { + object fieldValue = field.GetValue(obj); + fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); + //TODO + // the LLSD map/array types in the array need to be deserialised + // but first we need to know the right class to deserialise them into. + } + else + { + field.SetValue(obj, enumerator.Value); + } + } + } + break; + } + } + return obj; + } + } + + [LLSDType("MAP")] + public class LLSDMapLayerResponse + { + public LLSDMapRequest AgentData = new LLSDMapRequest(); + public LLSDArray LayerData = new LLSDArray(); + + public LLSDMapLayerResponse() + { + + } + } + + [LLSDType("MAP")] + public class LLSDCapsDetails + { + public string MapLayer = ""; + public string NewFileAgentInventory = ""; + //public string EventQueueGet = ""; + + public LLSDCapsDetails() + { + + } + } + + [LLSDType("MAP")] + public class LLSDMapLayer + { + public int Left = 0; + public int Right = 0; + public int Top = 0; + public int Bottom = 0; + public LLUUID ImageID = LLUUID.Zero; + + public LLSDMapLayer() + { + + } + } + + [LLSDType("ARRAY")] + public class LLSDArray + { + public ArrayList Array = new ArrayList(); + + public LLSDArray() + { + + } + } + + [LLSDType("MAP")] + public class LLSDMapRequest + { + public int Flags = 0; + + public LLSDMapRequest() + { + + } + } + + [LLSDType("MAP")] + public class LLSDUploadReply + { + public string new_asset = ""; + public LLUUID new_inventory_item = LLUUID.Zero; + public string state = ""; + + public LLSDUploadReply() + { + + } + } + + [LLSDType("MAP")] + public class LLSDCapEvent + { + public int id = 0; + public LLSDArray events = new LLSDArray(); + + public LLSDCapEvent() + { + + } + } + + [LLSDType("MAP")] + public class LLSDEmpty + { + public LLSDEmpty() + { + + } + } + + [LLSDType("MAP")] + public class LLSDTest + { + public int Test1 = 20; + public int Test2 = 10; + + public LLSDTest() + { + + } + } + + + [AttributeUsage(AttributeTargets.Class)] + public class LLSDType : Attribute + { + private string myType; + + public LLSDType(string type) + { + myType = type; + + } + + public string ObjectType + { + get + { + return myType; + } + } + } +} diff --git a/OpenSim/Framework/General/Logger.cs b/OpenSim/Framework/General/Logger.cs new file mode 100644 index 0000000..e7eaa03 --- /dev/null +++ b/OpenSim/Framework/General/Logger.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSim.Framework +{ + public class Logger + { + public static Logger Instance = new Logger( false ); + + public delegate void LoggerMethodDelegate(); + private delegate bool LoggerDelegate( LoggerMethodDelegate whatToDo ); + + + private LoggerDelegate m_delegate; + + public Logger( bool log ) + { + if( log ) + { + m_delegate = CatchAndLog; + } + else + { + m_delegate = DontCatch; + } + } + + public bool Wrap( LoggerMethodDelegate whatToDo ) + { + return m_delegate( whatToDo ); + } + + + private bool CatchAndLog(LoggerMethodDelegate whatToDo) + { + try + { + whatToDo(); + return true; + } + catch(Exception e) + { + System.Console.WriteLine( "Exception logged!!! Woah!!!!" ); + return false; + } + } + + private bool DontCatch(LoggerMethodDelegate whatToDo) + { + whatToDo(); + return true; + } + + public class LoggerExample + { + public void TryWrap() + { + // This will log and ignore + Logger log = new Logger(true); + + log.Wrap(delegate() + { + Int16.Parse("waa!"); + }); + + // This will throw; + try + { + + log = new Logger(false); + + log.Wrap(delegate() + { + Int16.Parse("waa!"); + }); + } + catch + { + System.Console.WriteLine("Example barfed!"); + } + } + } + } +} diff --git a/OpenSim/Framework/General/LoginService.cs b/OpenSim/Framework/General/LoginService.cs new file mode 100644 index 0000000..f14754f --- /dev/null +++ b/OpenSim/Framework/General/LoginService.cs @@ -0,0 +1,41 @@ +/* +* 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.Collections; +using System.Collections.Generic; +using System.Text; +using Nwc.XmlRpc; +using libsecondlife; + +namespace OpenSim.Framework.Grid +{ + public abstract class LoginService + { + + } +} \ No newline at end of file diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj new file mode 100644 index 0000000..e164d5a --- /dev/null +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -0,0 +1,213 @@ + + + Local + 8.0.50727 + 2.0 + {8ACA2445-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + OpenSim.Framework + JScript + Grid + IE50 + false + Library + + OpenSim.Framework + + + + + + False + 285212672 + False + + + TRACE;DEBUG + + True + 4096 + False + ..\..\..\bin\ + False + False + False + 4 + + + + False + 285212672 + False + + + TRACE + + False + 4096 + True + ..\..\..\bin\ + False + False + False + 4 + + + + + ..\..\..\bin\Db4objects.Db4o.dll + False + + + ..\..\..\bin\libsecondlife.dll + False + + + System.dll + False + + + System.Xml.dll + False + + + ..\..\..\bin\XMLRPC.dll + False + + + + + OpenSim.Framework.Console + {A7CD0630-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + + + + + diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj.user b/OpenSim/Framework/General/OpenSim.Framework.csproj.user new file mode 100644 index 0000000..6841907 --- /dev/null +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj.user @@ -0,0 +1,12 @@ + + + Debug + AnyCPU + C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ + 8.0.50727 + ProjectFiles + 0 + + + + diff --git a/OpenSim/Framework/General/Properties/AssemblyInfo.cs b/OpenSim/Framework/General/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..86f5cdb --- /dev/null +++ b/OpenSim/Framework/General/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OpenSim.FrameWork")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenSim.FrameWork")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim/Framework/General/RegionCommsListener.cs b/OpenSim/Framework/General/RegionCommsListener.cs new file mode 100644 index 0000000..bba928f --- /dev/null +++ b/OpenSim/Framework/General/RegionCommsListener.cs @@ -0,0 +1,69 @@ +/* +* 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.Collections.Generic; +using System.Text; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; + +namespace OpenSim.Framework +{ + public class RegionCommsListener :IRegionCommsListener + { + public event ExpectUserDelegate OnExpectUser; + public event GenericCall2 OnExpectChildAgent; + public event AgentCrossing OnAvatarCrossingIntoRegion; + public event UpdateNeighbours OnNeighboursUpdate; + + /// + /// + /// + /// + /// + public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) + { + if(OnExpectUser != null) + { + OnExpectUser(regionHandle, agent); + return true; + } + + return false; + } + + public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + { + if (OnAvatarCrossingIntoRegion != null) + { + OnAvatarCrossingIntoRegion(regionHandle, agentID, position); + return true; + } + return false; + } + } +} diff --git a/OpenSim/Framework/General/Remoting.cs b/OpenSim/Framework/General/Remoting.cs new file mode 100644 index 0000000..e6fdf70 --- /dev/null +++ b/OpenSim/Framework/General/Remoting.cs @@ -0,0 +1,136 @@ +/* +* 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.Collections.Generic; +using System.Text; +using System.Security.Cryptography; + +namespace OpenSim.Framework +{ + /// + /// NEEDS AUDIT. + /// + /// + /// Suggested implementation + /// Store two digests for each foreign host. A local copy of the local hash using the local challenge (when issued), and a local copy of the remote hash using the remote challenge. + /// When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message. + /// When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[]. + /// Both hosts should be performing these operations for this to be effective. + /// + class RemoteDigest + { + private byte[] currentHash; + private byte[] secret; + + private SHA512Managed SHA512; + + /// + /// Initialises a new RemoteDigest authentication mechanism + /// + /// Needs an audit by a cryptographic professional - was not "roll your own"'d by choice but rather a serious lack of decent authentication mechanisms in .NET remoting + /// The shared secret between systems (for inter-sim, this is provided in encrypted form during connection, for grid this is input manually in setup) + /// Binary salt - some common value - to be decided what + /// The challenge key provided by the third party + public RemoteDigest(string sharedSecret, byte[] salt, string challenge) + { + SHA512 = new SHA512Managed(); + Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret,salt); + secret = RFC2898.GetBytes(512); + ASCIIEncoding ASCII = new ASCIIEncoding(); + + currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge))); + } + + /// + /// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented. + /// + /// The incoming data + /// The remote digest + /// + public bool Authenticate(byte[] data, byte[] digest) + { + byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); + if (digest == newHash) + { + currentHash = newHash; + return true; + } + else + { + throw new Exception("Hash comparison failed. Key resync required."); + } + } + + /// + /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message. + /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the + /// hashes will get out of sync and throw an exception when validation is attempted. + /// + /// The outgoing data + /// The local digest + public byte[] Sign(byte[] data) + { + currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); + return currentHash; + } + + /// + /// Generates a new challenge string to be issued to a foreign host. Challenges are 1024-bit (effective strength of less than 512-bits) messages generated using the Crytographic Random Number Generator. + /// + /// A 128-character hexadecimal string containing the challenge. + public static string GenerateChallenge() + { + RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider(); + byte[] bytes = new byte[64]; + RNG.GetBytes(bytes); + + StringBuilder sb = new StringBuilder(bytes.Length * 2); + foreach (byte b in bytes) + { + sb.AppendFormat("{0:x2}", b); + } + return sb.ToString(); + } + + /// + /// Helper function, merges two byte arrays + /// + /// Sourced from MSDN Forum + /// A + /// B + /// C + private byte[] AppendArrays(byte[] a, byte[] b) + { + byte[] c = new byte[a.Length + b.Length]; + Buffer.BlockCopy(a, 0, c, 0, a.Length); + Buffer.BlockCopy(b, 0, c, a.Length, b.Length); + return c; + } + + } +} diff --git a/OpenSim/Framework/General/SimProfile.cs b/OpenSim/Framework/General/SimProfile.cs new file mode 100644 index 0000000..cfa5e50 --- /dev/null +++ b/OpenSim/Framework/General/SimProfile.cs @@ -0,0 +1,122 @@ +/* +* 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.Collections.Generic; +using System.Collections; +using System.Xml; +using System.Text; +using libsecondlife; +using Nwc.XmlRpc; + +namespace OpenSim.Framework.Sims +{ + public class SimProfile + { + public LLUUID UUID; + public ulong regionhandle; + public string regionname; + public string sim_ip; + public uint sim_port; + public string caps_url; + public uint RegionLocX; + public uint RegionLocY; + public string sendkey; + public string recvkey; + public bool online; + + public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey) + { + try + { + Hashtable GridReqParams = new Hashtable(); + GridReqParams["region_handle"] = region_handle.ToString(); + GridReqParams["authkey"] = SendKey; + ArrayList SendParams = new ArrayList(); + SendParams.Add(GridReqParams); + XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); + + XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); + + Hashtable RespData = (Hashtable)GridResp.Value; + this.UUID = new LLUUID((string)RespData["UUID"]); + this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256)); + this.regionname = (string)RespData["regionname"]; + this.sim_ip = (string)RespData["sim_ip"]; + this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); + this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/"; + this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]); + this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]); + this.sendkey = SendKey; + this.recvkey = RecvKey; + } + catch (Exception e) + { + System.Console.WriteLine(e.ToString()); + } + return this; + } + + public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey) + { + try + { + Hashtable GridReqParams = new Hashtable(); + GridReqParams["UUID"] = UUID.ToString(); + GridReqParams["authkey"] = SendKey; + ArrayList SendParams = new ArrayList(); + SendParams.Add(GridReqParams); + XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); + + XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); + + Hashtable RespData = (Hashtable)GridResp.Value; + this.UUID = new LLUUID((string)RespData["UUID"]); + this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256)); + this.regionname = (string)RespData["regionname"]; + this.sim_ip = (string)RespData["sim_ip"]; + this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); + this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/"; + this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]); + this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]); + this.sendkey = SendKey; + this.recvkey = RecvKey; + } + catch (Exception e) + { + System.Console.WriteLine(e.ToString()); + } + return this; + } + + + public SimProfile() + { + } + } + +} diff --git a/OpenSim/Framework/General/Types/AgentCiruitData.cs b/OpenSim/Framework/General/Types/AgentCiruitData.cs new file mode 100644 index 0000000..a650343 --- /dev/null +++ b/OpenSim/Framework/General/Types/AgentCiruitData.cs @@ -0,0 +1,50 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class AgentCircuitData + { + public AgentCircuitData() { } + public LLUUID AgentID; + public LLUUID SessionID; + public LLUUID SecureSessionID; + public LLVector3 startpos; + public string firstname; + public string lastname; + public uint circuitcode; + public bool child; + public LLUUID InventoryFolder; + public LLUUID BaseFolder; + public string CapsPath = ""; + } +} diff --git a/OpenSim/Framework/General/Types/AgentWearable.cs b/OpenSim/Framework/General/Types/AgentWearable.cs new file mode 100644 index 0000000..4c93da7 --- /dev/null +++ b/OpenSim/Framework/General/Types/AgentWearable.cs @@ -0,0 +1,60 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class AvatarWearable + { + public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); + public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); + + public AvatarWearable() + { + + } + + public static AvatarWearable[] DefaultWearables + { + get + { + AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these + for (int i = 0; i < 13; i++) + { + defaultWearables[i] = new AvatarWearable(); + } + defaultWearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); + defaultWearables[0].ItemID = LLUUID.Random(); + return defaultWearables; + } + } + } +} diff --git a/OpenSim/Framework/General/Types/AssetBase.cs b/OpenSim/Framework/General/Types/AssetBase.cs new file mode 100644 index 0000000..86586a6 --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetBase.cs @@ -0,0 +1,49 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class AssetBase + { + public byte[] Data; + public LLUUID FullID; + public sbyte Type; + public sbyte InvType; + public string Name; + public string Description; + + public AssetBase() + { + + } + } +} diff --git a/OpenSim/Framework/General/Types/AssetLandmark.cs b/OpenSim/Framework/General/Types/AssetLandmark.cs new file mode 100644 index 0000000..8a10b70 --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetLandmark.cs @@ -0,0 +1,61 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class AssetLandmark : AssetBase + { + public int Version; + public LLVector3 Position; + public LLUUID RegionID; + + public AssetLandmark(AssetBase a) + { + this.Data = a.Data; + this.FullID = a.FullID; + this.Type = a.Type; + this.InvType = a.InvType; + this.Name = a.Name; + this.Description = a.Description; + InternData(); + } + + private void InternData() + { + string temp = System.Text.Encoding.UTF8.GetString(Data).Trim(); + string[] parts = temp.Split('\n'); + int.TryParse(parts[0].Substring(17, 1), out Version); + LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID); + LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position); + } + } +} diff --git a/OpenSim/Framework/General/Types/AssetStorage.cs b/OpenSim/Framework/General/Types/AssetStorage.cs new file mode 100644 index 0000000..8cac23a --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetStorage.cs @@ -0,0 +1,50 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class AssetStorage + { + + public AssetStorage() { + } + + public AssetStorage(LLUUID assetUUID) { + UUID=assetUUID; + } + + public byte[] Data; + public sbyte Type; + public string Name; + public LLUUID UUID; + } +} diff --git a/OpenSim/Framework/General/Types/EstateSettings.cs b/OpenSim/Framework/General/Types/EstateSettings.cs new file mode 100644 index 0000000..778c893 --- /dev/null +++ b/OpenSim/Framework/General/Types/EstateSettings.cs @@ -0,0 +1,97 @@ +/* +* 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.Collections.Generic; +using System.Text; + +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class EstateSettings + { + //Settings to this island + public float billableFactor = (float)0.0; + public uint estateID = 0; + public uint parentEstateID = 0; + + public byte maxAgents = 40; + public float objectBonusFactor = (float)1.0; + + public int redirectGridX = 0; //?? + public int redirectGridY = 0; //?? + public libsecondlife.Simulator.RegionFlags regionFlags = libsecondlife.Simulator.RegionFlags.None; //Booleam values of various region settings + public libsecondlife.Simulator.SimAccess simAccess = libsecondlife.Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default. + public float sunHour = 0; + + public float terrainRaiseLimit = 0; + public float terrainLowerLimit = 0; + + public bool useFixedSun = false; + public int pricePerMeter = 1; + + public ushort regionWaterHeight = 20; + public bool regionAllowTerraform = true; + + // Region Information + // Low resolution 'base' textures. No longer used. + public LLUUID terrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default + public LLUUID terrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default + public LLUUID terrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default + public LLUUID terrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default + + // Higher resolution terrain textures + public LLUUID terrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000"); + public LLUUID terrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000"); + public LLUUID terrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000"); + public LLUUID terrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000"); + + // First quad - each point is bilinearly interpolated at each meter of terrain + public float terrainStartHeight0 = 10.0f; + public float terrainStartHeight1 = 10.0f; + public float terrainStartHeight2 = 10.0f; + public float terrainStartHeight3 = 10.0f; + + // Second quad - also bilinearly interpolated. + // Terrain texturing is done that: + // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y] + public float terrainHeightRange0 = 60.0f; //00 + public float terrainHeightRange1 = 60.0f; //01 + public float terrainHeightRange2 = 60.0f; //10 + public float terrainHeightRange3 = 60.0f; //11 + + // Terrain Default (Must be in F32 Format!) + public string terrainFile = "default.r32"; + public double terrainMultiplier = 60.0; + public float waterHeight = (float)20.0; + + public LLUUID terrainImageID = LLUUID.Zero; // the assetID that is the current Map image for this region + + } +} diff --git a/OpenSim/Framework/General/Types/Login.cs b/OpenSim/Framework/General/Types/Login.cs new file mode 100644 index 0000000..3180a16 --- /dev/null +++ b/OpenSim/Framework/General/Types/Login.cs @@ -0,0 +1,52 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class Login + { + public string First = "Test"; + public string Last = "User"; + public LLUUID Agent; + public LLUUID Session; + public LLUUID SecureSession = LLUUID.Zero; + public LLUUID InventoryFolder; + public LLUUID BaseFolder; + public uint CircuitCode; + public string CapsPath =""; + + public Login() + { + + } + } +} diff --git a/OpenSim/Framework/General/Types/MapBlockData.cs b/OpenSim/Framework/General/Types/MapBlockData.cs new file mode 100644 index 0000000..2e6f56e --- /dev/null +++ b/OpenSim/Framework/General/Types/MapBlockData.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class MapBlockData + { + public uint Flags; + public ushort X; + public ushort Y; + public byte Agents; + public byte Access; + public byte WaterHeight; + public LLUUID MapImageId; + public String Name; + public uint RegionFlags; + + public MapBlockData() + { + + } + } +} diff --git a/OpenSim/Framework/General/Types/NeighbourInfo.cs b/OpenSim/Framework/General/Types/NeighbourInfo.cs new file mode 100644 index 0000000..310fd1c --- /dev/null +++ b/OpenSim/Framework/General/Types/NeighbourInfo.cs @@ -0,0 +1,50 @@ +/* +* 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.Collections.Generic; +using System.Text; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Utilities; +using OpenSim.Framework.Console; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class NeighbourInfo + { + public NeighbourInfo() + { + } + + public ulong regionhandle; + public uint RegionLocX; + public uint RegionLocY; + public string sim_ip; + public uint sim_port; + } +} diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs new file mode 100644 index 0000000..73d7811 --- /dev/null +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs @@ -0,0 +1,181 @@ +/* +* 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.Collections.Generic; +using System.Text; +using OpenSim.Framework.Interfaces; + +namespace OpenSim.Framework.Types +{ + public class NetworkServersInfo + { + public string AssetURL = "http://127.0.0.1:8003/"; + public string AssetSendKey = ""; + + public string GridURL = ""; + public string GridSendKey = ""; + public string GridRecvKey = ""; + public string UserURL = ""; + public string UserSendKey = ""; + public string UserRecvKey = ""; + public bool isSandbox; + + public uint DefaultHomeLocX = 0; + public uint DefaultHomeLocY = 0; + + public int HttpListenerPort = 9000; + public int RemotingListenerPort = 8895; + + public void InitConfig(bool sandboxMode, IGenericConfig configData) + { + this.isSandbox = sandboxMode; + + try + { + string attri = ""; + + attri = ""; + attri = configData.GetAttribute("HttpListenerPort"); + if (attri == "") + { + string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); + configData.SetAttribute("HttpListenerPort", location); + this.HttpListenerPort = Convert.ToInt32(location); + } + else + { + this.HttpListenerPort = Convert.ToInt32(attri); + } + + attri = ""; + attri = configData.GetAttribute("RemotingListenerPort"); + if (attri == "") + { + string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); + configData.SetAttribute("RemotingListenerPort", location); + this.RemotingListenerPort = Convert.ToInt32(location); + } + else + { + this.RemotingListenerPort = Convert.ToInt32(attri); + } + + if (sandboxMode) + { + // default home location X + attri = ""; + attri = configData.GetAttribute("DefaultLocationX"); + if (attri == "") + { + string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); + configData.SetAttribute("DefaultLocationX", location); + this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); + } + else + { + this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri); + } + + // default home location Y + attri = ""; + attri = configData.GetAttribute("DefaultLocationY"); + if (attri == "") + { + string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); + configData.SetAttribute("DefaultLocationY", location); + this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); + } + else + { + this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri); + } + } + if (!isSandbox) + { + //Grid Server + attri = ""; + attri = configData.GetAttribute("GridServerURL"); + if (attri == "") + { + this.GridURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); + configData.SetAttribute("GridServerURL", this.GridURL); + } + else + { + this.GridURL = attri; + } + + //Grid Send Key + attri = ""; + attri = configData.GetAttribute("GridSendKey"); + if (attri == "") + { + this.GridSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); + configData.SetAttribute("GridSendKey", this.GridSendKey); + } + else + { + this.GridSendKey = attri; + } + + //Grid Receive Key + attri = ""; + attri = configData.GetAttribute("GridRecvKey"); + if (attri == "") + { + this.GridRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); + configData.SetAttribute("GridRecvKey", this.GridRecvKey); + } + else + { + this.GridRecvKey = attri; + } + + attri = ""; + attri = configData.GetAttribute("AssetServerURL"); + if (attri == "") + { + this.AssetURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); + configData.SetAttribute("AssetServerURL", this.GridURL); + } + else + { + this.AssetURL = attri; + } + + } + configData.Commit(); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + } + } + } +} diff --git a/OpenSim/Framework/General/Types/ParcelData.cs b/OpenSim/Framework/General/Types/ParcelData.cs new file mode 100644 index 0000000..40f128a --- /dev/null +++ b/OpenSim/Framework/General/Types/ParcelData.cs @@ -0,0 +1,115 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + + public class ParcelData + { + public byte[] parcelBitmapByteArray = new byte[512]; + public string parcelName = ""; + public string parcelDesc = ""; + public LLUUID ownerID = new LLUUID(); + public bool isGroupOwned = false; + public LLVector3 AABBMin = new LLVector3(); + public LLVector3 AABBMax = new LLVector3(); + public int area = 0; + public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned + public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID + public libsecondlife.Parcel.ParcelCategory category = new libsecondlife.Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category + public int claimDate = 0; //Unemplemented + public int claimPrice = 0; //Unemplemented + public LLUUID groupID = new LLUUID(); //Unemplemented + public int groupPrims = 0; //Unemplemented + public int salePrice = 0; //Unemeplemented. Parcels price. + public libsecondlife.Parcel.ParcelStatus parcelStatus = libsecondlife.Parcel.ParcelStatus.None; + public libsecondlife.Parcel.ParcelFlags parcelFlags = libsecondlife.Parcel.ParcelFlags.None; + public byte landingType = 0; + public byte mediaAutoScale = 0; + public LLUUID mediaID = LLUUID.Zero; + public int localID = 0; + public LLUUID globalID = new LLUUID(); + + public string mediaURL = ""; + public string musicURL = ""; + public float passHours = 0; + public int passPrice = 0; + public LLUUID snapshotID = LLUUID.Zero; + public LLVector3 userLocation = new LLVector3(); + public LLVector3 userLookAt = new LLVector3(); + + public ParcelData() + { + globalID = LLUUID.Random(); + } + + public ParcelData Copy() + { + ParcelData parcelData = new ParcelData(); + + parcelData.AABBMax = this.AABBMax; + parcelData.AABBMin = this.AABBMin; + parcelData.area = this.area; + parcelData.auctionID = this.auctionID; + parcelData.authBuyerID = this.authBuyerID; + parcelData.category = this.category; + parcelData.claimDate = this.claimDate; + parcelData.claimPrice = this.claimPrice; + parcelData.globalID = this.globalID; + parcelData.groupID = this.groupID; + parcelData.groupPrims = this.groupPrims; + parcelData.isGroupOwned = this.isGroupOwned; + parcelData.localID = this.localID; + parcelData.landingType = this.landingType; + parcelData.mediaAutoScale = this.mediaAutoScale; + parcelData.mediaID = this.mediaID; + parcelData.mediaURL = this.mediaURL; + parcelData.musicURL = this.musicURL; + parcelData.ownerID = this.ownerID; + parcelData.parcelBitmapByteArray = (byte[])this.parcelBitmapByteArray.Clone(); + parcelData.parcelDesc = this.parcelDesc; + parcelData.parcelFlags = this.parcelFlags; + parcelData.parcelName = this.parcelName; + parcelData.parcelStatus = this.parcelStatus; + parcelData.passHours = this.passHours; + parcelData.passPrice = this.passPrice; + parcelData.salePrice = this.salePrice; + parcelData.snapshotID = this.snapshotID; + parcelData.userLocation = this.userLocation; + parcelData.userLookAt = this.userLookAt; + + return parcelData; + + } + } + +} diff --git a/OpenSim/Framework/General/Types/PrimData.cs b/OpenSim/Framework/General/Types/PrimData.cs new file mode 100644 index 0000000..f84ae3e --- /dev/null +++ b/OpenSim/Framework/General/Types/PrimData.cs @@ -0,0 +1,230 @@ +/* +* 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.Collections.Generic; +using System.Text; +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/RegionHandle.cs b/OpenSim/Framework/General/Types/RegionHandle.cs new file mode 100644 index 0000000..1271d04 --- /dev/null +++ b/OpenSim/Framework/General/Types/RegionHandle.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net; + +namespace OpenSim.Framework.Types +{ + /// + /// A class for manipulating RegionHandle coordinates + /// + class RegionHandle + { + private UInt64 handle; + + /// + /// Initialises a new grid-aware RegionHandle + /// + /// IP Address of the Grid Server for this region + /// Grid X Coordinate + /// Grid Y Coordinate + public RegionHandle(string ip, short x, short y) + { + IPAddress addr = IPAddress.Parse(ip); + + long baseHandle = addr.Address; + + // Split the IP address in half + short a = (short)((baseHandle << 16) & 0xFFFF); + short b = (short)((baseHandle << 0) & 0xFFFF); + + // Raise the bounds a little + uint nx = (uint)x; + uint ny = (uint)y; + + // Multiply grid coords to get region coords + nx *= 256; + ny *= 256; + + // Stuff the IP address in too + nx = (uint)a << 16; + ny = (uint)b << 16; + + handle = ((UInt64)nx << 32) | (uint)ny; + } + + /// + /// Initialises a new RegionHandle that is not inter-grid aware + /// + /// Grid X Coordinate + /// Grid Y Coordinate + public RegionHandle(uint x, uint y) + { + handle = ((x * 256) << 32) | (y * 256); + } + + /// + /// Initialises a new RegionHandle from an existing value + /// + /// A U64 RegionHandle + public RegionHandle(UInt64 Region) + { + handle = Region; + } + + /// + /// Returns the Grid Masked RegionHandle - For use in Teleport packets and other packets where sending the grid IP address may be handy. + /// + /// Do not use for SimulatorEnable packets. The client will choke. + /// Region Handle including IP Address encoding + public UInt64 getTeleportHandle() + { + return handle; + } + + /// + /// Returns a RegionHandle which may be used for SimulatorEnable packets. Removes the IP address encoding and returns the lower bounds. + /// + /// A U64 RegionHandle for use in SimulatorEnable packets. + public UInt64 getNeighbourHandle() + { + UInt64 mask = 0x0000FFFF0000FFFF; + + return handle | mask; + } + + /// + /// Returns the IP Address of the GridServer from a Grid-Encoded RegionHandle + /// + /// Grid Server IP Address + public IPAddress getGridIP() + { + uint a = (uint)((handle >> 16) & 0xFFFF); + uint b = (uint)((handle >> 48) & 0xFFFF); + + return new IPAddress((long)(a << 16) | (long)b); + } + + /// + /// Returns the X Coordinate from a Grid-Encoded RegionHandle + /// + /// X Coordinate + public uint getGridX() + { + uint x = (uint)((handle >> 32) & 0xFFFF); + + return x; + } + + /// + /// Returns the Y Coordinate from a Grid-Encoded RegionHandle + /// + /// Y Coordinate + public uint getGridY() + { + uint y = (uint)((handle >> 0) & 0xFFFF); + + return y; + } + } +} diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs new file mode 100644 index 0000000..48e6922 --- /dev/null +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -0,0 +1,304 @@ +/* +* 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.Collections.Generic; +using System.Text; +using System.Globalization; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Utilities; +using OpenSim.Framework.Console; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + public class RegionInfo + { + public LLUUID SimUUID = new LLUUID(); + public string RegionName = ""; + public uint RegionLocX = 0; + public uint RegionLocY = 0; + public ulong RegionHandle = 0; + + public string DataStore = ""; + public bool isSandbox = false; + + public LLUUID MasterAvatarAssignedUUID = new LLUUID(); + public string MasterAvatarFirstName = ""; + public string MasterAvatarLastName = ""; + public string MasterAvatarSandboxPassword = ""; + + /// + /// Port used for listening (TCP and UDP) + /// + /// Seperate TCP and UDP + public int CommsIPListenPort = 0; + /// + /// Address used for internal listening (default: 0.0.0.0?) + /// + public string CommsIPListenAddr = ""; + /// + /// Address used for external addressing (DNS or IP) + /// + public string CommsExternalAddress = ""; + + + public EstateSettings estateSettings; + + public RegionInfo() + { + estateSettings = new EstateSettings(); + } + + + public void InitConfig(bool sandboxMode, IGenericConfig configData) + { + this.isSandbox = sandboxMode; + try + { + // Sim UUID + string attri = ""; + attri = configData.GetAttribute("SimUUID"); + if (attri == "") + { + this.SimUUID = LLUUID.Random(); + configData.SetAttribute("SimUUID", this.SimUUID.ToString()); + } + else + { + this.SimUUID = new LLUUID(attri); + } + + // Sim name + attri = ""; + attri = configData.GetAttribute("SimName"); + if (attri == "") + { + this.RegionName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Name", "OpenSim test"); + configData.SetAttribute("SimName", this.RegionName); + } + else + { + this.RegionName = attri; + } + // Sim/Grid location X + attri = ""; + attri = configData.GetAttribute("SimLocationX"); + if (attri == "") + { + string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location X", "997"); + configData.SetAttribute("SimLocationX", location); + this.RegionLocX = (uint)Convert.ToUInt32(location); + } + else + { + this.RegionLocX = (uint)Convert.ToUInt32(attri); + } + // Sim/Grid location Y + attri = ""; + attri = configData.GetAttribute("SimLocationY"); + if (attri == "") + { + string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location Y", "996"); + configData.SetAttribute("SimLocationY", location); + this.RegionLocY = (uint)Convert.ToUInt32(location); + } + else + { + this.RegionLocY = (uint)Convert.ToUInt32(attri); + } + + // Local storage datastore + attri = ""; + attri = configData.GetAttribute("Datastore"); + if (attri == "") + { + string datastore = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Filename for local storage", "localworld.yap"); + configData.SetAttribute("Datastore", datastore); + this.DataStore = datastore; + } + else + { + this.DataStore = attri; + } + + //Sim Listen Port + attri = ""; + attri = configData.GetAttribute("SimListenPort"); + if (attri == "") + { + string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000"); + configData.SetAttribute("SimListenPort", port); + this.CommsIPListenPort = Convert.ToInt32(port); + } + else + { + this.CommsIPListenPort = Convert.ToInt32(attri); + } + + //Sim Listen Address + attri = ""; + attri = configData.GetAttribute("SimListenAddress"); + if (attri == "") + { + this.CommsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); + configData.SetAttribute("SimListenAddress", this.CommsIPListenAddr); + } + else + { + // Probably belongs elsewhere, but oh well. + if (attri.Trim().StartsWith("SYSTEMIP")) + { + string localhostname = System.Net.Dns.GetHostName(); + System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); + try + { + this.CommsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found + + foreach (System.Net.IPAddress ip in ips) + { + if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) + { + this.CommsIPListenAddr = ip.ToString(); + break; + } + } + } + catch (Exception e) + { + e.ToString(); + this.CommsIPListenAddr = "0.0.0.0"; // Use the default if we fail + } + } + else + { + this.CommsIPListenAddr = attri; + } + } + + // Sim External Address + attri = ""; + attri = configData.GetAttribute("SimExternalAddress"); + if (attri == "") + { + this.CommsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); + configData.SetAttribute("SimExternalAddress", this.CommsExternalAddress); + } + else + { + this.CommsExternalAddress = attri; + } + + attri = ""; + attri = configData.GetAttribute("TerrainFile"); + if (attri == "") + { + this.estateSettings.terrainFile = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32"); + configData.SetAttribute("TerrainFile", this.estateSettings.terrainFile); + } + else + { + this.estateSettings.terrainFile = attri; + } + + attri = ""; + attri = configData.GetAttribute("TerrainMultiplier"); + if (attri == "") + { + string re = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); + this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture); + configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString()); + } + else + { + this.estateSettings.terrainMultiplier = Convert.ToDouble(attri); + } + + attri = ""; + attri = configData.GetAttribute("MasterAvatarFirstName"); + if (attri == "") + { + this.MasterAvatarFirstName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test"); + + configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName); + } + else + { + this.MasterAvatarFirstName = attri; + } + + attri = ""; + attri = configData.GetAttribute("MasterAvatarLastName"); + if (attri == "") + { + this.MasterAvatarLastName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User"); + + configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName); + } + else + { + this.MasterAvatarLastName = attri; + } + + if (isSandbox) //Sandbox Mode Specific Settings + { + attri = ""; + attri = configData.GetAttribute("MasterAvatarSandboxPassword"); + if (attri == "") + { + this.MasterAvatarSandboxPassword = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test"); + + //Should I store this? + configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword); + } + else + { + this.MasterAvatarSandboxPassword = attri; + } + } + + this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); + + configData.Commit(); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + } + + OpenSim.Framework.Console.MainLog.Instance.Verbose("Sim settings loaded:"); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "UUID: " + this.SimUUID.ToStringHyphenated()); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "Name: " + this.RegionName); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Handle: " + this.RegionHandle.ToString()); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "Sandbox Mode? " + isSandbox.ToString()); + + } + } +} diff --git a/OpenSim/Framework/General/UserProfile.cs b/OpenSim/Framework/General/UserProfile.cs new file mode 100644 index 0000000..04ff20b --- /dev/null +++ b/OpenSim/Framework/General/UserProfile.cs @@ -0,0 +1,89 @@ +/* +* 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.Collections.Generic; +using System.Text; +using libsecondlife; +using OpenSim.Framework.Inventory; +using System.Security.Cryptography; + +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((997 * 256), (996 * 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); + } + + } +} diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs new file mode 100644 index 0000000..8c34c9b --- /dev/null +++ b/OpenSim/Framework/General/Util.cs @@ -0,0 +1,186 @@ +/* +* 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.Security.Cryptography; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; + +namespace OpenSim.Framework.Utilities +{ + public class Util + { + private static Random randomClass = new Random(); + private static uint nextXferID = 5000; + private static object XferLock = new object(); + + public static ulong UIntsToLong(uint X, uint Y) + { + return Helpers.UIntsToLong(X, Y); + } + + public static Random RandomClass + { + get + { + return randomClass; + } + } + + public static uint GetNextXferID() + { + uint id = 0; + lock(XferLock) + { + id = nextXferID; + nextXferID++; + } + return id; + } + + public static int UnixTimeSinceEpoch() + { + TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); + int timestamp = (int)t.TotalSeconds; + return timestamp; + } + + public static string Md5Hash(string pass) + { + MD5 md5 = MD5CryptoServiceProvider.Create(); + byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass)); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < dataMd5.Length; i++) + sb.AppendFormat("{0:x2}", dataMd5[i]); + return sb.ToString(); + } + + public static string GetRandomCapsPath() + { + LLUUID caps = LLUUID.Random(); + string capsPath = caps.ToStringHyphenated(); + capsPath = capsPath.Remove(capsPath.Length - 4, 4); + return capsPath; + } + + //public static int fast_distance2d(int x, int y) + //{ + // x = System.Math.Abs(x); + // y = System.Math.Abs(y); + + // int min = System.Math.Min(x, y); + + // return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); + //} + + public static string FieldToString(byte[] bytes) + { + return FieldToString(bytes, String.Empty); + } + + /// + /// Convert a variable length field (byte array) to a string, with a + /// field name prepended to each line of the output + /// + /// If the byte array has unprintable characters in it, a + /// hex dump will be put in the string instead + /// The byte array to convert to a string + /// A field name to prepend to each line of output + /// An ASCII string or a string containing a hex dump, minus + /// the null terminator + public static string FieldToString(byte[] bytes, string fieldName) + { + // Check for a common case + if (bytes.Length == 0) return String.Empty; + + StringBuilder output = new StringBuilder(); + bool printable = true; + + for (int i = 0; i < bytes.Length; ++i) + { + // Check if there are any unprintable characters in the array + if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09 + && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00) + { + printable = false; + break; + } + } + + if (printable) + { + if (fieldName.Length > 0) + { + output.Append(fieldName); + output.Append(": "); + } + + if (bytes[bytes.Length - 1] == 0x00) + output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1)); + else + output.Append(UTF8Encoding.UTF8.GetString(bytes)); + } + else + { + for (int i = 0; i < bytes.Length; i += 16) + { + if (i != 0) + output.Append(Environment.NewLine); + if (fieldName.Length > 0) + { + output.Append(fieldName); + output.Append(": "); + } + + for (int j = 0; j < 16; j++) + { + if ((i + j) < bytes.Length) + output.Append(String.Format("{0:X2} ", bytes[i + j])); + else + output.Append(" "); + } + + for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) + { + if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) + output.Append((char)bytes[i + j]); + else + output.Append("."); + } + } + } + + return output.ToString(); + } + public Util() + { + + } + } +} -- cgit v1.1 From fe120533efd0ec6b2248d96b9a1f8b7637c5dadd Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 17:12:32 +0000 Subject: *Updated prebuild.xml and ran prebuild again *Removed .user, .suo, and unneccessary files in /bin/Physics/ *OpenSim.sln should compile with nant and on windows now --- OpenSim/Framework/General/OpenSim.Framework.csproj | 62 +++++++++++----------- .../General/OpenSim.Framework.csproj.user | 12 ----- 2 files changed, 31 insertions(+), 43 deletions(-) delete mode 100644 OpenSim/Framework/General/OpenSim.Framework.csproj.user (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index e164d5a..7f71949 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -94,112 +94,112 @@ Code - + Code - + Code Code - - Code - - + Code Code - + Code - + Code Code - + + Code + + Code Code + + Code + Code + + Code + Code Code - + Code - + Code Code - - Code - Code - - Code - - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj.user b/OpenSim/Framework/General/OpenSim.Framework.csproj.user deleted file mode 100644 index 6841907..0000000 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - -- cgit v1.1 From 1dcc814b703771c4dd96592b73727db2b54028a3 Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 17:20:45 +0000 Subject: *More compile fixes (should be it on OpenSim.sln) --- OpenSim/Framework/General/OpenSim.Framework.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 7f71949..3e77f1e 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -91,10 +91,10 @@ Code - + Code - + Code -- cgit v1.1 From 3456d951d89fbc83f742d40ca8ca2a1a79d414eb Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 28 Jun 2007 13:13:17 +0000 Subject: Imported the scripting changes, so now should be up to date with sugilite. --- OpenSim/Framework/General/LLSDHelpers.cs | 246 --------------------- OpenSim/Framework/General/OpenSim.Framework.csproj | 63 +++--- .../Framework/General/OpenSim.Framework.dll.build | 80 +++++++ 3 files changed, 110 insertions(+), 279 deletions(-) delete mode 100644 OpenSim/Framework/General/LLSDHelpers.cs create mode 100644 OpenSim/Framework/General/OpenSim.Framework.dll.build (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/LLSDHelpers.cs b/OpenSim/Framework/General/LLSDHelpers.cs deleted file mode 100644 index 051520c..0000000 --- a/OpenSim/Framework/General/LLSDHelpers.cs +++ /dev/null @@ -1,246 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Xml; -using libsecondlife; - -namespace OpenSim.Framework -{ - public class LLSDHelpers - { - public static string SerialiseLLSDReply(object obj) - { - StringWriter sw = new StringWriter(); - XmlTextWriter writer = new XmlTextWriter(sw); - writer.Formatting = Formatting.None; - writer.WriteStartElement(String.Empty, "llsd", String.Empty); - LLSDHelpers.SerializeLLSDType(writer, obj); - writer.WriteEndElement(); - writer.Close(); - return sw.ToString(); - } - - public static void SerializeLLSDType(XmlTextWriter writer, object obj) - { - Type myType = obj.GetType(); - LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); - if (llsdattributes.Length > 0) - { - switch (llsdattributes[0].ObjectType) - { - case "MAP": - writer.WriteStartElement(String.Empty, "map", String.Empty); - System.Reflection.FieldInfo[] fields = myType.GetFields(); - for (int i = 0; i < fields.Length; i++) - { - object fieldValue = fields[i].GetValue(obj); - LLSDType[] fieldAttributes = (LLSDType[])fieldValue.GetType().GetCustomAttributes(typeof(LLSDType), false); - if (fieldAttributes.Length > 0) - { - writer.WriteStartElement(String.Empty, "key", String.Empty); - writer.WriteString(fields[i].Name); - writer.WriteEndElement(); - SerializeLLSDType(writer, fieldValue); - } - else - { - //Console.WriteLine("LLSD field name" + fields[i].Name + " , " + fields[i].GetValue(obj).GetType()); - writer.WriteStartElement(String.Empty, "key", String.Empty); - writer.WriteString(fields[i].Name); - writer.WriteEndElement(); - LLSD.LLSDWriteOne(writer, fieldValue); - } - } - writer.WriteEndElement(); - break; - case "ARRAY": - // LLSDArray arrayObject = obj as LLSDArray; - // ArrayList a = arrayObject.Array; - ArrayList a = (ArrayList)obj.GetType().GetField("Array").GetValue(obj); - writer.WriteStartElement(String.Empty, "array", String.Empty); - foreach (object item in a) - { - SerializeLLSDType(writer, item); - } - writer.WriteEndElement(); - break; - } - } - else - { - LLSD.LLSDWriteOne(writer, obj); - } - } - - public static object DeserialiseLLSDMap(Hashtable llsd, object obj) - { - Type myType = obj.GetType(); - LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); - if (llsdattributes.Length > 0) - { - switch (llsdattributes[0].ObjectType) - { - case "MAP": - IDictionaryEnumerator enumerator = llsd.GetEnumerator(); - while (enumerator.MoveNext()) - { - System.Reflection.FieldInfo field = myType.GetField((string)enumerator.Key); - if (field != null) - { - if (enumerator.Value is Hashtable) - { - object fieldValue = field.GetValue(obj); - DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); - } - else if (enumerator.Value is ArrayList) - { - object fieldValue = field.GetValue(obj); - fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); - //TODO - // the LLSD map/array types in the array need to be deserialised - // but first we need to know the right class to deserialise them into. - } - else - { - field.SetValue(obj, enumerator.Value); - } - } - } - break; - } - } - return obj; - } - } - - [LLSDType("MAP")] - public class LLSDMapLayerResponse - { - public LLSDMapRequest AgentData = new LLSDMapRequest(); - public LLSDArray LayerData = new LLSDArray(); - - public LLSDMapLayerResponse() - { - - } - } - - [LLSDType("MAP")] - public class LLSDCapsDetails - { - public string MapLayer = ""; - public string NewFileAgentInventory = ""; - //public string EventQueueGet = ""; - - public LLSDCapsDetails() - { - - } - } - - [LLSDType("MAP")] - public class LLSDMapLayer - { - public int Left = 0; - public int Right = 0; - public int Top = 0; - public int Bottom = 0; - public LLUUID ImageID = LLUUID.Zero; - - public LLSDMapLayer() - { - - } - } - - [LLSDType("ARRAY")] - public class LLSDArray - { - public ArrayList Array = new ArrayList(); - - public LLSDArray() - { - - } - } - - [LLSDType("MAP")] - public class LLSDMapRequest - { - public int Flags = 0; - - public LLSDMapRequest() - { - - } - } - - [LLSDType("MAP")] - public class LLSDUploadReply - { - public string new_asset = ""; - public LLUUID new_inventory_item = LLUUID.Zero; - public string state = ""; - - public LLSDUploadReply() - { - - } - } - - [LLSDType("MAP")] - public class LLSDCapEvent - { - public int id = 0; - public LLSDArray events = new LLSDArray(); - - public LLSDCapEvent() - { - - } - } - - [LLSDType("MAP")] - public class LLSDEmpty - { - public LLSDEmpty() - { - - } - } - - [LLSDType("MAP")] - public class LLSDTest - { - public int Test1 = 20; - public int Test2 = 10; - - public LLSDTest() - { - - } - } - - - [AttributeUsage(AttributeTargets.Class)] - public class LLSDType : Attribute - { - private string myType; - - public LLSDType(string type) - { - myType = type; - - } - - public string ObjectType - { - get - { - return myType; - } - } - } -} diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 3e77f1e..d18e583 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -91,115 +91,112 @@ Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code Code - - Code - - + Code Code - - Code - Code - - Code - Code Code - + Code - + Code Code + + Code + Code - + + Code + + Code Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build new file mode 100644 index 0000000..04e3382 --- /dev/null +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.1 From 561db23e5fbfcd110423c6a408ac0a11bebbedac Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 28 Jun 2007 14:10:05 +0000 Subject: Finished removing the old scripting code, Scene.Scripting.cs and OpenSim.Framework.Interfaces.Scripting. --- .../General/Interfaces/Scripting/IScriptAPI.cs | 42 ---------------------- .../General/Interfaces/Scripting/IScriptEngine.cs | 41 --------------------- OpenSim/Framework/General/OpenSim.Framework.csproj | 6 ---- .../Framework/General/OpenSim.Framework.dll.build | 2 -- 4 files changed, 91 deletions(-) delete mode 100644 OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs delete mode 100644 OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs b/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs deleted file mode 100644 index 0c1627b..0000000 --- a/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs +++ /dev/null @@ -1,42 +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 System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Types; - -using libsecondlife; -namespace OpenSim.Framework.Interfaces -{ - public interface IScriptAPI - { - LLVector3 GetEntityPosition(uint localID); - void SetEntityPosition(uint localID, float x, float y, float z); - uint GetRandomAvatarID(); - } -} diff --git a/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs b/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs deleted file mode 100644 index ca50be0..0000000 --- a/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs +++ /dev/null @@ -1,41 +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 System.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework.Interfaces -{ - public interface IScriptEngine - { - bool Init(IScriptAPI api); - string GetName(); - void LoadScript(string script, string scriptName, uint entityID); - void OnFrame(); - } -} diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index d18e583..48db634 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -148,12 +148,6 @@ Code - - Code - - - Code - Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index 04e3382..a18838b 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -31,8 +31,6 @@ - - -- cgit v1.1 From 108d89f89436556c8f4662197903c374db943f7d Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 28 Jun 2007 16:17:20 +0000 Subject: *Master User is now set up *Added support for getting user profile information from remote grid server (untested) *Updated prebuild.xml --- OpenSim/Framework/General/OpenSim.Framework.csproj | 60 +++++++++++----------- .../Framework/General/OpenSim.Framework.dll.build | 36 ++++++------- .../Framework/General/Types/NetworkServersInfo.cs | 39 ++++++++++++++ 3 files changed, 87 insertions(+), 48 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 48db634..261b96b 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -91,106 +91,106 @@ Code - - Code - - + Code - + Code Code - + Code Code - + Code - + Code Code - + + Code + + Code Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index a18838b..f05217f 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -12,40 +12,40 @@ + - - - - - + + + - + + + + - - - + - + + + + - - + + + - - + + - - - - diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index 73d7811..c6b81a7 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs @@ -156,6 +156,45 @@ namespace OpenSim.Framework.Types this.GridRecvKey = attri; } + //Grid Server + attri = ""; + attri = configData.GetAttribute("UserServerURL"); + if (attri == "") + { + this.UserURL= OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); + configData.SetAttribute("UserServerURL", this.UserURL); + } + else + { + this.UserURL = attri; + } + + //Grid Send Key + attri = ""; + attri = configData.GetAttribute("UserSendKey"); + if (attri == "") + { + this.UserSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to user server", "null"); + configData.SetAttribute("UserSendKey", this.UserSendKey); + } + else + { + this.UserSendKey = attri; + } + + //Grid Receive Key + attri = ""; + attri = configData.GetAttribute("UserRecvKey"); + if (attri == "") + { + this.UserRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); + configData.SetAttribute("GridRecvKey", this.UserRecvKey); + } + else + { + this.UserRecvKey = attri; + } + attri = ""; attri = configData.GetAttribute("AssetServerURL"); if (attri == "") -- cgit v1.1 From fe0528b98cfc13d26ac7f1bf6bc23655be1f52e5 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 28 Jun 2007 19:09:50 +0000 Subject: *Added UUIDNameRequest packet support (untested, but should work -- at least in sandbox mode) *Various small renamings --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 4 ++++ OpenSim/Framework/General/OpenSim.Framework.csproj | 4 ++-- OpenSim/Framework/General/OpenSim.Framework.dll.build | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 009648c..4e8ac1a 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -69,6 +69,8 @@ namespace OpenSim.Framework.Interfaces public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); + public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); + public interface IClientAPI { event ChatFromViewer OnChatFromViewer; @@ -103,6 +105,8 @@ namespace OpenSim.Framework.Interfaces event NewAvatar OnNewAvatar; event GenericCall6 OnRemoveAvatar; + event UUIDNameRequest OnNameFromUUIDRequest; + event ParcelPropertiesRequest OnParcelPropertiesRequest; event ParcelDivideRequest OnParcelDivideRequest; event ParcelJoinRequest OnParcelJoinRequest; diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 261b96b..fbbf568 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -133,10 +133,10 @@ Code - + Code - + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index f05217f..f81737d 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -26,8 +26,8 @@ - + -- cgit v1.1 From 135e9b1f538ae77dfd8bf68139c960fb8e016c16 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 28 Jun 2007 19:35:20 +0000 Subject: * Removed J# language support because it has issues with Mono. --- OpenSim/Framework/General/OpenSim.Framework.csproj | 60 +++++++++++----------- .../Framework/General/OpenSim.Framework.dll.build | 38 +++++++------- 2 files changed, 49 insertions(+), 49 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index fbbf568..48db634 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -91,106 +91,106 @@ Code - - Code - Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code Code - + Code - + Code - + Code Code + + Code + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index f81737d..a18838b 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -12,40 +12,40 @@ - - - - - - + + + + + + - - - + + + - + - - - - + - - + + - - - + + + + + + -- cgit v1.1 From 90b01ba80ccaa69bf7cf76be6ce0a6ca05717d6c Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 29 Jun 2007 01:58:16 +0000 Subject: *Hopefully fixed the empty dialog box error on client when logging in on sandbox mode --- OpenSim/Framework/General/RegionCommsListener.cs | 1 + OpenSim/Framework/General/Types/RegionInfo.cs | 4 ++-- OpenSim/Framework/General/UserProfile.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/RegionCommsListener.cs b/OpenSim/Framework/General/RegionCommsListener.cs index bba928f..5fa2f58 100644 --- a/OpenSim/Framework/General/RegionCommsListener.cs +++ b/OpenSim/Framework/General/RegionCommsListener.cs @@ -49,6 +49,7 @@ namespace OpenSim.Framework { if(OnExpectUser != null) { + OnExpectUser(regionHandle, agent); return true; } diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 48e6922..0fba6ca 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -110,7 +110,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimLocationX"); if (attri == "") { - string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location X", "997"); + string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location X", "1000"); configData.SetAttribute("SimLocationX", location); this.RegionLocX = (uint)Convert.ToUInt32(location); } @@ -123,7 +123,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimLocationY"); if (attri == "") { - string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location Y", "996"); + string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); configData.SetAttribute("SimLocationY", location); this.RegionLocY = (uint)Convert.ToUInt32(location); } diff --git a/OpenSim/Framework/General/UserProfile.cs b/OpenSim/Framework/General/UserProfile.cs index 04ff20b..263dba2 100644 --- a/OpenSim/Framework/General/UserProfile.cs +++ b/OpenSim/Framework/General/UserProfile.cs @@ -59,7 +59,7 @@ namespace OpenSim.Framework.User { Circuits = new Dictionary(); Inventory = new AgentInventory(); - homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256)); + homeregionhandle = Helpers.UIntsToLong((1000 * 256), (1000 * 256)); homepos = new LLVector3(); homelookat = new LLVector3(); } -- cgit v1.1 From 6b3777d3db323f2054aeff1ba4be3e78edef21b8 Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 29 Jun 2007 16:43:48 +0000 Subject: *Deleted Logger.cs from OpenSim.Framework --- OpenSim/Framework/General/Logger.cs | 85 ---------------------- OpenSim/Framework/General/OpenSim.Framework.csproj | 59 +++++++-------- .../Framework/General/OpenSim.Framework.dll.build | 39 +++++----- 3 files changed, 47 insertions(+), 136 deletions(-) delete mode 100644 OpenSim/Framework/General/Logger.cs (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Logger.cs b/OpenSim/Framework/General/Logger.cs deleted file mode 100644 index e7eaa03..0000000 --- a/OpenSim/Framework/General/Logger.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework -{ - public class Logger - { - public static Logger Instance = new Logger( false ); - - public delegate void LoggerMethodDelegate(); - private delegate bool LoggerDelegate( LoggerMethodDelegate whatToDo ); - - - private LoggerDelegate m_delegate; - - public Logger( bool log ) - { - if( log ) - { - m_delegate = CatchAndLog; - } - else - { - m_delegate = DontCatch; - } - } - - public bool Wrap( LoggerMethodDelegate whatToDo ) - { - return m_delegate( whatToDo ); - } - - - private bool CatchAndLog(LoggerMethodDelegate whatToDo) - { - try - { - whatToDo(); - return true; - } - catch(Exception e) - { - System.Console.WriteLine( "Exception logged!!! Woah!!!!" ); - return false; - } - } - - private bool DontCatch(LoggerMethodDelegate whatToDo) - { - whatToDo(); - return true; - } - - public class LoggerExample - { - public void TryWrap() - { - // This will log and ignore - Logger log = new Logger(true); - - log.Wrap(delegate() - { - Int16.Parse("waa!"); - }); - - // This will throw; - try - { - - log = new Logger(false); - - log.Wrap(delegate() - { - Int16.Parse("waa!"); - }); - } - catch - { - System.Console.WriteLine("Example barfed!"); - } - } - } - } -} diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 48db634..c12d436 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -88,109 +88,106 @@ - - Code - Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index a18838b..0d8077b 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -11,41 +11,40 @@ - + + - - - - - - + + + + + + - - - + - - - - - - - - - - + + + + + + + + + + -- cgit v1.1 From e4df6ea08e75294cf47f7f99ea5a3751f9aa0c8e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 29 Jun 2007 22:09:52 +0000 Subject: * Created new "UUID" class to override LLUUID in general. (Unable to inherit from LLUUID, so written as a wrapper + extra functions), 1:1 Feature compatible with LLUUID designed as "Drop In" replacement. --- OpenSim/Framework/General/OpenSim.Framework.csproj | 39 ++++--- OpenSim/Framework/General/Types/UUID.cs | 129 +++++++++++++++++++++ 2 files changed, 153 insertions(+), 15 deletions(-) create mode 100644 OpenSim/Framework/General/Types/UUID.cs (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index c12d436..57076a1 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,7 +6,8 @@ {8ACA2445-0000-0000-0000-000000000000} Debug AnyCPU - + + OpenSim.Framework @@ -15,9 +16,11 @@ IE50 false Library - + + OpenSim.Framework - + + @@ -28,7 +31,8 @@ TRACE;DEBUG - + + True 4096 False @@ -37,7 +41,8 @@ False False 4 - + + False @@ -46,7 +51,8 @@ TRACE - + + False 4096 True @@ -55,26 +61,28 @@ False False 4 - + + - + ..\..\..\bin\Db4objects.Db4o.dll False - + ..\..\..\bin\libsecondlife.dll False - + System.dll False - + + System.Xml.dll False - + ..\..\..\bin\XMLRPC.dll False @@ -84,7 +92,7 @@ OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -103,6 +111,7 @@ Code + Code @@ -198,4 +207,4 @@ - + \ No newline at end of file diff --git a/OpenSim/Framework/General/Types/UUID.cs b/OpenSim/Framework/General/Types/UUID.cs new file mode 100644 index 0000000..8d47c30 --- /dev/null +++ b/OpenSim/Framework/General/Types/UUID.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; + +namespace OpenSim.Framework.Types +{ + class UUID + { + public LLUUID llUUID; + + public UUID(string uuid) + { + llUUID = new LLUUID(uuid); + } + + public UUID(byte[] uuid) + { + llUUID = new LLUUID(uuid, 0); + } + + public UUID(byte[] uuid, int offset) + { + llUUID = new LLUUID(uuid, offset); + } + + public UUID() + { + llUUID = LLUUID.Zero; + } + + public UUID(ulong uuid) + { + llUUID = new LLUUID(uuid); + } + + public UUID(UInt32 first, UInt32 second, UInt32 third, UInt32 fourth) + { + byte[] uuid = new byte[16]; + + byte[] n = BitConverter.GetBytes(first); + n.CopyTo(uuid, 0); + n = BitConverter.GetBytes(second); + n.CopyTo(uuid, 4); + n = BitConverter.GetBytes(third); + n.CopyTo(uuid, 8); + n = BitConverter.GetBytes(fourth); + n.CopyTo(uuid, 12); + + llUUID = new LLUUID(uuid,0); + } + + public override string ToString() + { + return llUUID.ToString(); + } + + public string ToStringHyphenated() + { + return llUUID.ToStringHyphenated(); + } + + public byte[] GetBytes() + { + return llUUID.GetBytes(); + } + + public UInt32[] GetInts() + { + UInt32[] ints = new UInt32[4]; + ints[0] = BitConverter.ToUInt32(llUUID.Data, 0); + ints[1] = BitConverter.ToUInt32(llUUID.Data, 4); + ints[2] = BitConverter.ToUInt32(llUUID.Data, 8); + ints[3] = BitConverter.ToUInt32(llUUID.Data, 12); + + return ints; + } + + public LLUUID GetLLUUID() + { + return llUUID; + } + + public uint CRC() + { + return llUUID.CRC(); + } + + public override int GetHashCode() + { + return llUUID.GetHashCode(); + } + + public void Combine(UUID other) + { + llUUID.Combine(other.GetLLUUID()); + } + + public void Combine(LLUUID other) + { + llUUID.Combine(other); + } + + public override bool Equals(Object other) + { + return llUUID.Equals(other); + } + + public static bool operator ==(UUID a, UUID b) + { + return a.Equals(b); + } + + public static bool operator !=(UUID a, UUID b) + { + return !a.Equals(b); + } + + public static bool operator ==(UUID a, LLUUID b) + { + return a.Equals(b); + } + + public static bool operator !=(UUID a, LLUUID b) + { + return !a.Equals(b); + } + } +} -- cgit v1.1 From b8b701fabba7123b6a03ecae5aeaa3afb77459b9 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 29 Jun 2007 22:10:55 +0000 Subject: * Small bugfix comparing equal UUIDs --- OpenSim/Framework/General/Types/UUID.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/UUID.cs b/OpenSim/Framework/General/Types/UUID.cs index 8d47c30..bb9206f 100644 --- a/OpenSim/Framework/General/Types/UUID.cs +++ b/OpenSim/Framework/General/Types/UUID.cs @@ -108,12 +108,12 @@ namespace OpenSim.Framework.Types public static bool operator ==(UUID a, UUID b) { - return a.Equals(b); + return a.llUUID.Equals(b.GetLLUUID()); } public static bool operator !=(UUID a, UUID b) { - return !a.Equals(b); + return !a.llUUID.Equals(b.GetLLUUID()); } public static bool operator ==(UUID a, LLUUID b) -- cgit v1.1 From 5e805656db1215518a344d6d5364629a4997fd47 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 1 Jul 2007 13:17:27 +0000 Subject: Fixed SimpleApp - aka thankgoditssundaycommit * Updated SimpleApp with various introduced dependencies * Extracted ScenePrescence creation in Scene * removed try-catchall from UserManagerBase (that actually hid a bug) * Refactored RegionInfo * handle is calculated * it will explode upon accessing x,y,ip,port,externalip if not explicitly initialized * Removed superfluous 'ref' keywords * Removed a shitload of 'catch Exception e' that causes build warnings * Lots of small refactorings, renames et c * Ignored some bins --- OpenSim/Framework/General/Interfaces/IWorld.cs | 2 +- OpenSim/Framework/General/OpenSim.Framework.csproj | 100 ++++++++-------- .../Framework/General/OpenSim.Framework.dll.build | 39 ++++--- OpenSim/Framework/General/Types/RegionInfo.cs | 127 +++++++++++++++------ 4 files changed, 162 insertions(+), 106 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IWorld.cs b/OpenSim/Framework/General/Interfaces/IWorld.cs index 4857417..2edc0b4 100644 --- a/OpenSim/Framework/General/Interfaces/IWorld.cs +++ b/OpenSim/Framework/General/Interfaces/IWorld.cs @@ -35,7 +35,7 @@ namespace OpenSim.Framework.Interfaces { public interface IWorld { - void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child); + void AddNewClient(IClientAPI client, bool child); void RemoveClient(LLUUID agentID); RegionInfo RegionInfo { get; } diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 57076a1..7d3d53a 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,8 +6,7 @@ {8ACA2445-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenSim.Framework @@ -16,11 +15,9 @@ IE50 false Library - - + OpenSim.Framework - - + @@ -31,8 +28,7 @@ TRACE;DEBUG - - + True 4096 False @@ -41,8 +37,7 @@ False False 4 - - + False @@ -51,8 +46,7 @@ TRACE - - + False 4096 True @@ -61,28 +55,26 @@ False False 4 - - + - + ..\..\..\bin\Db4objects.Db4o.dll False - + ..\..\..\bin\libsecondlife.dll False - + System.dll False - - + System.Xml.dll False - + ..\..\..\bin\XMLRPC.dll False @@ -92,17 +84,14 @@ OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False - - Code - - + Code - + Code @@ -111,92 +100,97 @@ Code - - + Code - + + Code + + Code Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + + Code + + Code @@ -207,4 +201,4 @@ - \ No newline at end of file + diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index 0d8077b..239e3e5 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -11,40 +11,41 @@ + - - - - - - + + + + + - - + + - + - - - - - + - - + + - - - + + + + + + + + diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 0fba6ca..1ead3c4 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -40,9 +40,38 @@ namespace OpenSim.Framework.Types { public LLUUID SimUUID = new LLUUID(); public string RegionName = ""; - public uint RegionLocX = 0; - public uint RegionLocY = 0; - public ulong RegionHandle = 0; + + private uint? m_regionLocX; + public uint RegionLocX + { + get + { + return m_regionLocX.Value; + } + } + + private uint? m_regionLocY; + public uint RegionLocY + { + get + { + return m_regionLocY.Value; + } + } + + private ulong? m_regionHandle; + public ulong RegionHandle + { + get + { + if (!m_regionHandle.HasValue) + { + m_regionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); + } + + return m_regionHandle.Value; + } + } public string DataStore = ""; public bool isSandbox = false; @@ -52,19 +81,43 @@ namespace OpenSim.Framework.Types public string MasterAvatarLastName = ""; public string MasterAvatarSandboxPassword = ""; + private int? m_commsIPListenPort; + /// /// Port used for listening (TCP and UDP) /// /// Seperate TCP and UDP - public int CommsIPListenPort = 0; + public int CommsIPListenPort + { + get + { + return m_commsIPListenPort.Value; + } + } + + private string m_commsIPListenAddr; /// /// Address used for internal listening (default: 0.0.0.0?) /// - public string CommsIPListenAddr = ""; + public string CommsIPListenAddr + { + get + { + return m_commsIPListenAddr; + } + } + + private string m_commsExternalAddress; /// /// Address used for external addressing (DNS or IP) /// - public string CommsExternalAddress = ""; + public string CommsExternalAddress + { + get + { + return m_commsExternalAddress; + } + } public EstateSettings estateSettings; @@ -73,7 +126,16 @@ namespace OpenSim.Framework.Types { estateSettings = new EstateSettings(); } - + + public RegionInfo( uint regionLocX, uint regionLocY, string simIp, int simPort, string simUri ) : this() + { + m_regionLocX = regionLocX; + m_regionLocY = regionLocY; + + m_commsIPListenAddr = simIp; + m_commsIPListenPort = simPort; + m_commsExternalAddress = simUri; + } public void InitConfig(bool sandboxMode, IGenericConfig configData) { @@ -112,11 +174,11 @@ namespace OpenSim.Framework.Types { string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location X", "1000"); configData.SetAttribute("SimLocationX", location); - this.RegionLocX = (uint)Convert.ToUInt32(location); + m_regionLocX = (uint)Convert.ToUInt32(location); } else { - this.RegionLocX = (uint)Convert.ToUInt32(attri); + m_regionLocX = (uint)Convert.ToUInt32(attri); } // Sim/Grid location Y attri = ""; @@ -125,13 +187,15 @@ namespace OpenSim.Framework.Types { string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); configData.SetAttribute("SimLocationY", location); - this.RegionLocY = (uint)Convert.ToUInt32(location); + m_regionLocY = (uint)Convert.ToUInt32(location); } else { - this.RegionLocY = (uint)Convert.ToUInt32(attri); + m_regionLocY = (uint)Convert.ToUInt32(attri); } + m_regionHandle = null; + // Local storage datastore attri = ""; attri = configData.GetAttribute("Datastore"); @@ -153,11 +217,11 @@ namespace OpenSim.Framework.Types { string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000"); configData.SetAttribute("SimListenPort", port); - this.CommsIPListenPort = Convert.ToInt32(port); + m_commsIPListenPort = Convert.ToInt32(port); } else { - this.CommsIPListenPort = Convert.ToInt32(attri); + m_commsIPListenPort = Convert.ToInt32(attri); } //Sim Listen Address @@ -165,8 +229,8 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimListenAddress"); if (attri == "") { - this.CommsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); - configData.SetAttribute("SimListenAddress", this.CommsIPListenAddr); + m_commsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); + configData.SetAttribute("SimListenAddress", CommsIPListenAddr ); } else { @@ -177,26 +241,25 @@ namespace OpenSim.Framework.Types System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); try { - this.CommsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found + m_commsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found foreach (System.Net.IPAddress ip in ips) { if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) { - this.CommsIPListenAddr = ip.ToString(); + m_commsIPListenAddr = ip.ToString(); break; } } } - catch (Exception e) + catch (Exception) { - e.ToString(); - this.CommsIPListenAddr = "0.0.0.0"; // Use the default if we fail + m_commsIPListenAddr = "0.0.0.0"; // Use the default if we fail } } else { - this.CommsIPListenAddr = attri; + m_commsIPListenAddr = attri; } } @@ -205,12 +268,12 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimExternalAddress"); if (attri == "") { - this.CommsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); - configData.SetAttribute("SimExternalAddress", this.CommsExternalAddress); + m_commsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); + configData.SetAttribute("SimExternalAddress", CommsExternalAddress); } else { - this.CommsExternalAddress = attri; + m_commsExternalAddress = attri; } attri = ""; @@ -281,8 +344,6 @@ namespace OpenSim.Framework.Types } } - this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); - configData.Commit(); } catch (Exception e) @@ -292,13 +353,13 @@ namespace OpenSim.Framework.Types } OpenSim.Framework.Console.MainLog.Instance.Verbose("Sim settings loaded:"); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "UUID: " + this.SimUUID.ToStringHyphenated()); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Name: " + this.RegionName); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Handle: " + this.RegionHandle.ToString()); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Sandbox Mode? " + isSandbox.ToString()); - + OpenSim.Framework.Console.MainLog.Instance.Verbose("UUID: " + this.SimUUID.ToStringHyphenated()); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Name: " + this.RegionName); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); + } } } -- cgit v1.1 From 06a8c132005b4ab804f25d54c0c0f899fc98e3a1 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 1 Jul 2007 16:07:41 +0000 Subject: MAJOR IP RESTRUCTURING * moving towards IPEndPoints all over the place * trying to make the internal/external division --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 7 +- OpenSim/Framework/General/Types/RegionInfo.cs | 270 +++++++++++++-------- 2 files changed, 167 insertions(+), 110 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 4e8ac1a..ea4c5c9 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -32,6 +32,7 @@ using OpenSim.Framework.Inventory; using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework.Types; +using System.Net; namespace OpenSim.Framework.Interfaces { @@ -143,12 +144,12 @@ namespace OpenSim.Framework.Interfaces void SendLayerData(float[] map); void SendLayerData(int px, int py, float[] map); void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); - void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); + void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint ); AgentCircuitData RequestClientInfo(); - void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort); + void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint ); void SendMapBlock(List mapBlocks); void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); - void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags); + void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags); void SendTeleportCancel(); void SendTeleportLocationStart(); void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 1ead3c4..d98dd60 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -33,6 +33,7 @@ using OpenSim.Framework.Interfaces; using OpenSim.Framework.Utilities; using OpenSim.Framework.Console; using libsecondlife; +using System.Net; namespace OpenSim.Framework.Types { @@ -41,6 +42,32 @@ namespace OpenSim.Framework.Types public LLUUID SimUUID = new LLUUID(); public string RegionName = ""; + private IPEndPoint m_internalEndPoint; + public IPEndPoint InternalEndPoint + { + get + { + return m_internalEndPoint; + } + } + + public IPEndPoint ExternalEndPoint + { + get + { + return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); + } + } + + private string m_externalHostName; + public string ExternalHostName + { + get + { + return m_externalHostName; + } + } + private uint? m_regionLocX; public uint RegionLocX { @@ -81,43 +108,43 @@ namespace OpenSim.Framework.Types public string MasterAvatarLastName = ""; public string MasterAvatarSandboxPassword = ""; - private int? m_commsIPListenPort; + //private int? m_commsIPListenPort; - /// - /// Port used for listening (TCP and UDP) - /// - /// Seperate TCP and UDP - public int CommsIPListenPort - { - get - { - return m_commsIPListenPort.Value; - } - } - - private string m_commsIPListenAddr; - /// - /// Address used for internal listening (default: 0.0.0.0?) - /// - public string CommsIPListenAddr - { - get - { - return m_commsIPListenAddr; - } - } - - private string m_commsExternalAddress; - /// - /// Address used for external addressing (DNS or IP) - /// - public string CommsExternalAddress - { - get - { - return m_commsExternalAddress; - } - } + ///// + ///// Port used for listening (TCP and UDP) + ///// + ///// Seperate TCP and UDP + //public int CommsIPListenPort + //{ + // get + // { + // return m_commsIPListenPort.Value; + // } + //} + + //private string m_commsIPListenAddr; + ///// + ///// Address used for internal listening (default: 0.0.0.0?) + ///// + //public string CommsIPListenAddr + //{ + // get + // { + // return m_commsIPListenAddr; + // } + //} + + //private string m_commsExternalAddress; + ///// + ///// Address used for external addressing (DNS or IP) + ///// + //public string CommsExternalAddress + //{ + // get + // { + // return m_commsExternalAddress; + // } + //} public EstateSettings estateSettings; @@ -126,15 +153,19 @@ namespace OpenSim.Framework.Types { estateSettings = new EstateSettings(); } - - public RegionInfo( uint regionLocX, uint regionLocY, string simIp, int simPort, string simUri ) : this() + + public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) + : this() { m_regionLocX = regionLocX; - m_regionLocY = regionLocY; - - m_commsIPListenAddr = simIp; - m_commsIPListenPort = simPort; - m_commsExternalAddress = simUri; + m_regionLocY = regionLocY; + + //m_commsIPListenAddr = simIp; + //m_commsIPListenPort = simPort; + //m_commsExternalAddress = simUri; + + m_internalEndPoint = internalEndPoint; + m_externalHostName = externalUri; } public void InitConfig(bool sandboxMode, IGenericConfig configData) @@ -195,7 +226,7 @@ namespace OpenSim.Framework.Types } m_regionHandle = null; - + // Local storage datastore attri = ""; attri = configData.GetAttribute("Datastore"); @@ -210,71 +241,67 @@ namespace OpenSim.Framework.Types this.DataStore = attri; } - //Sim Listen Port - attri = ""; - attri = configData.GetAttribute("SimListenPort"); - if (attri == "") - { - string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000"); - configData.SetAttribute("SimListenPort", port); - m_commsIPListenPort = Convert.ToInt32(port); - } - else - { - m_commsIPListenPort = Convert.ToInt32(attri); - } + IPAddress internalAddress = GetIPAddress(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections"); + int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); + m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); + + m_externalHostName = MainLog.Instance.CmdPrompt("External Host Name", "localhost"); + + + + //Sim Listen Address - attri = ""; - attri = configData.GetAttribute("SimListenAddress"); - if (attri == "") - { - m_commsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); - configData.SetAttribute("SimListenAddress", CommsIPListenAddr ); - } - else - { - // Probably belongs elsewhere, but oh well. - if (attri.Trim().StartsWith("SYSTEMIP")) - { - string localhostname = System.Net.Dns.GetHostName(); - System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); - try - { - m_commsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found - - foreach (System.Net.IPAddress ip in ips) - { - if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) - { - m_commsIPListenAddr = ip.ToString(); - break; - } - } - } - catch (Exception) - { - m_commsIPListenAddr = "0.0.0.0"; // Use the default if we fail - } - } - else - { - m_commsIPListenAddr = attri; - } - } + //attri = ""; + //attri = configData.GetAttribute("SimListenAddress"); + //if (attri == "") + //{ + // m_commsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); + // configData.SetAttribute("SimListenAddress", CommsIPListenAddr); + //} + //else + //{ + // // Probably belongs elsewhere, but oh well. + // if (attri.Trim().StartsWith("SYSTEMIP")) + // { + // string localhostname = System.Net.Dns.GetHostName(); + // System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); + // try + // { + // m_commsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found - // Sim External Address - attri = ""; - attri = configData.GetAttribute("SimExternalAddress"); - if (attri == "") - { - m_commsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); - configData.SetAttribute("SimExternalAddress", CommsExternalAddress); - } - else - { - m_commsExternalAddress = attri; - } + // foreach (System.Net.IPAddress ip in ips) + // { + // if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) + // { + // m_commsIPListenAddr = ip.ToString(); + // break; + // } + // } + // } + // catch (Exception) + // { + // m_commsIPListenAddr = "0.0.0.0"; // Use the default if we fail + // } + // } + // else + // { + // m_commsIPListenAddr = attri; + // } + //} + + //// Sim External Address + //attri = ""; + //attri = configData.GetAttribute("SimExternalAddress"); + //if (attri == "") + //{ + // m_commsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); + // configData.SetAttribute("SimExternalAddress", CommsExternalAddress); + //} + //else + //{ + // m_commsExternalAddress = attri; + //} attri = ""; attri = configData.GetAttribute("TerrainFile"); @@ -357,9 +384,38 @@ namespace OpenSim.Framework.Types OpenSim.Framework.Console.MainLog.Instance.Verbose("Name: " + this.RegionName); OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Listening on IP end point: " + m_internalEndPoint.ToString() ); OpenSim.Framework.Console.MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); } + + private IPAddress GetIPAddress(IGenericConfig configData, string attrName, string defaultvalue, string prompt) + { + string addressStr = configData.GetAttribute(attrName); + + IPAddress address; + + if (!IPAddress.TryParse(addressStr, out address)) + { + address = MainLog.Instance.CmdPromptIPAddress(prompt, defaultvalue); + configData.SetAttribute(attrName, address.ToString()); + } + return address; + } + + private int GetIPPort(IGenericConfig configData, string attrName, string defaultvalue, string prompt) + { + string portStr = configData.GetAttribute(attrName); + + int port; + + if (!int.TryParse(portStr, out port)) + { + port = MainLog.Instance.CmdPromptIPPort(prompt, defaultvalue); + configData.SetAttribute(attrName, port.ToString()); + } + + return port; + } } } -- cgit v1.1 From 7cafe7f6d98ddd28af7c9272640c141732d455c8 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 1 Jul 2007 16:19:47 +0000 Subject: * now saves ExternalHostName in config --- OpenSim/Framework/General/Types/RegionInfo.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index d98dd60..cbd8695 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -245,8 +245,7 @@ namespace OpenSim.Framework.Types int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); - m_externalHostName = MainLog.Instance.CmdPrompt("External Host Name", "localhost"); - + m_externalHostName = GetString(configData, "ExternalHostName", "localhost", "External Host Name"); @@ -389,6 +388,18 @@ namespace OpenSim.Framework.Types } + private string GetString(IGenericConfig configData, string attrName, string defaultvalue, string prompt) + { + string s = configData.GetAttribute(attrName); + + if (String.IsNullOrEmpty( s )) + { + s = MainLog.Instance.CmdPrompt(prompt, defaultvalue); + configData.SetAttribute(attrName, s ); + } + return s; + } + private IPAddress GetIPAddress(IGenericConfig configData, string attrName, string defaultvalue, string prompt) { string addressStr = configData.GetAttribute(attrName); -- cgit v1.1 From 9800c05c1b3c7804466d6f3a9c38a739156625fd Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 1 Jul 2007 17:26:33 +0000 Subject: Started change to having SceneObject and then that having child Primitives which in turn have a Shape object (currently PrimitiveBaseShape). The plan is only for the SceneObject to interface with the physics engines. As a physics Entity should be able to have mulitple shapes connected to it. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 2 + OpenSim/Framework/General/OpenSim.Framework.csproj | 3 + .../Framework/General/OpenSim.Framework.dll.build | 1 + .../Framework/General/Types/PrimitiveBaseShape.cs | 106 +++++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 OpenSim/Framework/General/Types/PrimitiveBaseShape.cs (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index ea4c5c9..9c112ae 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -160,6 +160,8 @@ namespace OpenSim.Framework.Interfaces void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags); void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags); + void SendPrimitiveToClient2(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID); + void SendPrimitiveToClient2(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID); void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); } } diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 7d3d53a..a577ea3 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -184,6 +184,9 @@ Code + + Code + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index 239e3e5..10fafbf 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -43,6 +43,7 @@ + diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs new file mode 100644 index 0000000..094a8a0 --- /dev/null +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; +using OpenSim.Framework.Interfaces; + +namespace OpenSim.Framework.Types +{ + public enum ShapeType + { + Box, + Sphere, + Ring, + Tube, + Torus, + Prism, + Scuplted, + Cylinder + } + + public class PrimitiveBaseShape + { + private ShapeType type; + + 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 ShapeType PrimType + { + get + { + return this.type; + } + } + + public LLVector3 PrimScale + { + get + { + return this.Scale; + } + } + + public PrimitiveBaseShape() + { + + } + + //void returns need to change of course + public void GetMesh() + { + + } + + public static PrimitiveBaseShape DefaultCube() + { + PrimitiveBaseShape primShape = new PrimitiveBaseShape(); + + primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); + primShape.PCode = 9; + primShape.ParentID = 0; + primShape.PathBegin = 0; + primShape.PathEnd = 0; + primShape.PathScaleX = 0; + primShape.PathScaleY = 0; + primShape.PathShearX = 0; + primShape.PathShearY = 0; + primShape.PathSkew = 0; + primShape.ProfileBegin = 0; + primShape.ProfileEnd = 0; + primShape.PathCurve = 16; + primShape.ProfileCurve = 1; + primShape.ProfileHollow = 0; + primShape.PathRadiusOffset = 0; + primShape.PathRevolutions = 0; + primShape.PathTaperX = 0; + primShape.PathTaperY = 0; + primShape.PathTwist = 0; + primShape.PathTwistBegin = 0; + + return primShape; + } + } + +} -- cgit v1.1 From 54ef77f0fda5fabc6f4677e145fafb74d225a77e Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 1 Jul 2007 18:33:44 +0000 Subject: Can change the name and description of a prim. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 9c112ae..2110b74 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -51,6 +51,7 @@ namespace OpenSim.Framework.Interfaces public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); public delegate void GenericCall5(IClientAPI remoteClient, bool status); public delegate void GenericCall6(LLUUID uid); + public delegate void GenericCall7(uint localID, string message); public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); @@ -96,6 +97,8 @@ namespace OpenSim.Framework.Interfaces event UpdateShape OnUpdatePrimShape; event ObjectSelect OnObjectSelect; + event GenericCall7 OnObjectDescription; + event GenericCall7 OnObjectName; event UpdatePrimFlags OnUpdatePrimFlags; event UpdatePrimTexture OnUpdatePrimTexture; event UpdateVector OnUpdatePrimPosition; -- cgit v1.1 From 97d441fca4846818b8c67297fa0065cb3c8e989f Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 1 Jul 2007 20:30:02 +0000 Subject: * replaced some more of those butt-fuggly attr constructs with nice Get<> calls; somebody should finish the job. --- OpenSim/Framework/General/Types/RegionInfo.cs | 84 ++------------------------- 1 file changed, 4 insertions(+), 80 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index cbd8695..9cef2ba 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -227,93 +227,17 @@ namespace OpenSim.Framework.Types m_regionHandle = null; - // Local storage datastore - attri = ""; - attri = configData.GetAttribute("Datastore"); - if (attri == "") - { - string datastore = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Filename for local storage", "localworld.yap"); - configData.SetAttribute("Datastore", datastore); - this.DataStore = datastore; - } - else - { - this.DataStore = attri; - } - + this.DataStore = GetString(configData, "Datastore", "localworld.yap", "Filename for local storage"); + IPAddress internalAddress = GetIPAddress(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections"); int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); m_externalHostName = GetString(configData, "ExternalHostName", "localhost", "External Host Name"); - + estateSettings.terrainFile = + GetString(configData, "TerrainFile", "default.r32", "GENERAL SETTING: Default Terrain File"); - - //Sim Listen Address - //attri = ""; - //attri = configData.GetAttribute("SimListenAddress"); - //if (attri == "") - //{ - // m_commsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); - // configData.SetAttribute("SimListenAddress", CommsIPListenAddr); - //} - //else - //{ - // // Probably belongs elsewhere, but oh well. - // if (attri.Trim().StartsWith("SYSTEMIP")) - // { - // string localhostname = System.Net.Dns.GetHostName(); - // System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); - // try - // { - // m_commsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found - - // foreach (System.Net.IPAddress ip in ips) - // { - // if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) - // { - // m_commsIPListenAddr = ip.ToString(); - // break; - // } - // } - // } - // catch (Exception) - // { - // m_commsIPListenAddr = "0.0.0.0"; // Use the default if we fail - // } - // } - // else - // { - // m_commsIPListenAddr = attri; - // } - //} - - //// Sim External Address - //attri = ""; - //attri = configData.GetAttribute("SimExternalAddress"); - //if (attri == "") - //{ - // m_commsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); - // configData.SetAttribute("SimExternalAddress", CommsExternalAddress); - //} - //else - //{ - // m_commsExternalAddress = attri; - //} - - attri = ""; - attri = configData.GetAttribute("TerrainFile"); - if (attri == "") - { - this.estateSettings.terrainFile = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32"); - configData.SetAttribute("TerrainFile", this.estateSettings.terrainFile); - } - else - { - this.estateSettings.terrainFile = attri; - } - attri = ""; attri = configData.GetAttribute("TerrainMultiplier"); if (attri == "") -- cgit v1.1 From 2852cda727f86567c18c6fab193ed31195c9934c Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 1 Jul 2007 21:04:33 +0000 Subject: More work on SceneObject/Primitive and building (Linking is a work in progress as is all). Committing now as I've finished for the night and will be continued tomorrow. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 4 ++-- OpenSim/Framework/General/Types/PrimitiveBaseShape.cs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 2110b74..d62247c 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -163,8 +163,8 @@ namespace OpenSim.Framework.Interfaces void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags); void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags); - void SendPrimitiveToClient2(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID); - void SendPrimitiveToClient2(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID); + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); } } diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 094a8a0..7c8de16 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -36,7 +36,6 @@ namespace OpenSim.Framework.Types public LLVector3 Scale; public byte PathCurve; public byte ProfileCurve; - public uint ParentID = 0; public ushort ProfileHollow; public sbyte PathRadiusOffset; public byte PathRevolutions; @@ -73,13 +72,13 @@ namespace OpenSim.Framework.Types } - public static PrimitiveBaseShape DefaultCube() + public static PrimitiveBaseShape DefaultBox() { PrimitiveBaseShape primShape = new PrimitiveBaseShape(); + primShape.type = ShapeType.Box; primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); primShape.PCode = 9; - primShape.ParentID = 0; primShape.PathBegin = 0; primShape.PathEnd = 0; primShape.PathScaleX = 0; -- cgit v1.1 From 7f18f494f1200f0f6470020a794e5291124f3ead Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 1 Jul 2007 21:45:47 +0000 Subject: Just committing this because I want my commit to be on the front page of www.opensimulator.org rather than lbsa71's being there. --- OpenSim/Framework/General/Types/PrimitiveBaseShape.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 7c8de16..584bc9b 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -16,12 +16,13 @@ namespace OpenSim.Framework.Types Torus, Prism, Scuplted, - Cylinder + Cylinder, + Unknown } public class PrimitiveBaseShape { - private ShapeType type; + private ShapeType type = ShapeType.Unknown; public byte PCode; public ushort PathBegin; -- cgit v1.1 From d78f6505e351c3975a40e68ecd7b34760eec658d Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 2 Jul 2007 06:55:36 +0000 Subject: * worked some more on the RegionInfo attr fuggliness --- OpenSim/Framework/General/Types/RegionInfo.cs | 76 ++++++--------------------- 1 file changed, 15 insertions(+), 61 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 9cef2ba..69a941e 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -108,45 +108,6 @@ namespace OpenSim.Framework.Types public string MasterAvatarLastName = ""; public string MasterAvatarSandboxPassword = ""; - //private int? m_commsIPListenPort; - - ///// - ///// Port used for listening (TCP and UDP) - ///// - ///// Seperate TCP and UDP - //public int CommsIPListenPort - //{ - // get - // { - // return m_commsIPListenPort.Value; - // } - //} - - //private string m_commsIPListenAddr; - ///// - ///// Address used for internal listening (default: 0.0.0.0?) - ///// - //public string CommsIPListenAddr - //{ - // get - // { - // return m_commsIPListenAddr; - // } - //} - - //private string m_commsExternalAddress; - ///// - ///// Address used for external addressing (DNS or IP) - ///// - //public string CommsExternalAddress - //{ - // get - // { - // return m_commsExternalAddress; - // } - //} - - public EstateSettings estateSettings; public RegionInfo() @@ -160,10 +121,6 @@ namespace OpenSim.Framework.Types m_regionLocX = regionLocX; m_regionLocY = regionLocY; - //m_commsIPListenAddr = simIp; - //m_commsIPListenPort = simPort; - //m_commsExternalAddress = simUri; - m_internalEndPoint = internalEndPoint; m_externalHostName = externalUri; } @@ -173,32 +130,24 @@ namespace OpenSim.Framework.Types this.isSandbox = sandboxMode; try { - // Sim UUID string attri = ""; - attri = configData.GetAttribute("SimUUID"); - if (attri == "") + + // Sim UUID + string simId = configData.GetAttribute("SimUUID"); + if (String.IsNullOrEmpty( simId )) { this.SimUUID = LLUUID.Random(); - configData.SetAttribute("SimUUID", this.SimUUID.ToString()); } else { - this.SimUUID = new LLUUID(attri); + this.SimUUID = new LLUUID(simId); } + configData.SetAttribute("SimUUID", this.SimUUID.ToString()); - // Sim name - attri = ""; - attri = configData.GetAttribute("SimName"); - if (attri == "") - { - this.RegionName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Name", "OpenSim test"); - configData.SetAttribute("SimName", this.RegionName); - } - else - { - this.RegionName = attri; - } - // Sim/Grid location X + this.RegionName = GetString(configData, "SimName", "OpenSim test", "Region Name"); + + //m_regionLocX = (uint) GetInt(configData, "SimLocationX", 1000, "Grid Location X"); + attri = ""; attri = configData.GetAttribute("SimLocationX"); if (attri == "") @@ -312,6 +261,11 @@ namespace OpenSim.Framework.Types } + private uint GetInt(IGenericConfig configData, string p, int p_3, string p_4) + { + throw new Exception("The method or operation is not implemented."); + } + private string GetString(IGenericConfig configData, string attrName, string defaultvalue, string prompt) { string s = configData.GetAttribute(attrName); -- cgit v1.1 From 9ff5bb9873e41936ef3ddb6fcea2f0529e425e52 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 2 Jul 2007 06:57:42 +0000 Subject: * Applied Weathros/tedd's IP v6 patch --- OpenSim/Framework/General/Types/RegionInfo.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 69a941e..7b99d06 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -55,7 +55,25 @@ namespace OpenSim.Framework.Types { get { - return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); + // Old one defaults to IPv6 + //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); + + // New method favors IPv4 + IPAddress ia = null; + foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) + { + if (ia == null) + ia = Adr; + + if (Adr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + { + ia = Adr; + break; + } + + } + + return new IPEndPoint(ia, m_internalEndPoint.Port); } } -- cgit v1.1 From 9b6b6d05d45cf0f754a0b26bf6240ef50be66563 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 3 Jul 2007 14:37:29 +0000 Subject: * Optimized usings (the 'LL ate my scripts' commit) * added some licensing info --- OpenSim/Framework/General/AgentInventory.cs | 2 -- .../Framework/General/AuthenticateSessionBase.cs | 2 -- OpenSim/Framework/General/BlockingQueue.cs | 4 +-- OpenSim/Framework/General/IRegionCommsListener.cs | 5 ++- .../General/Interfaces/AuthenticateResponse.cs | 8 ----- .../General/Interfaces/Config/IGenericConfig.cs | 4 --- .../General/Interfaces/Config/IGridConfig.cs | 4 --- .../General/Interfaces/Config/IUserConfig.cs | 4 --- .../Framework/General/Interfaces/IAssetServer.cs | 5 --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 5 +-- .../Framework/General/Interfaces/ILocalStorage.cs | 1 - .../Framework/General/Interfaces/IUserServer.cs | 5 +-- OpenSim/Framework/General/Interfaces/IWorld.cs | 3 -- OpenSim/Framework/General/LoginService.cs | 7 ---- .../Framework/General/Properties/AssemblyInfo.cs | 2 -- OpenSim/Framework/General/RegionCommsListener.cs | 6 ++-- OpenSim/Framework/General/Remoting.cs | 3 +- OpenSim/Framework/General/SimProfile.cs | 3 -- OpenSim/Framework/General/Types/AgentCiruitData.cs | 3 -- OpenSim/Framework/General/Types/AgentWearable.cs | 3 -- OpenSim/Framework/General/Types/AssetBase.cs | 3 -- OpenSim/Framework/General/Types/AssetLandmark.cs | 4 +-- OpenSim/Framework/General/Types/AssetStorage.cs | 3 -- OpenSim/Framework/General/Types/EstateSettings.cs | 8 ++--- OpenSim/Framework/General/Types/Login.cs | 3 -- OpenSim/Framework/General/Types/MapBlockData.cs | 2 -- OpenSim/Framework/General/Types/NeighbourInfo.cs | 8 ----- .../Framework/General/Types/NetworkServersInfo.cs | 29 ++++++++------- OpenSim/Framework/General/Types/ParcelData.cs | 9 ++--- OpenSim/Framework/General/Types/PrimData.cs | 2 -- .../Framework/General/Types/PrimitiveBaseShape.cs | 5 --- OpenSim/Framework/General/Types/RegionHandle.cs | 2 -- OpenSim/Framework/General/Types/RegionInfo.cs | 41 +++++++++++----------- OpenSim/Framework/General/Types/UUID.cs | 2 -- OpenSim/Framework/General/UserProfile.cs | 4 +-- OpenSim/Framework/General/Util.cs | 2 -- 36 files changed, 49 insertions(+), 157 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/AgentInventory.cs b/OpenSim/Framework/General/AgentInventory.cs index fbf4d23..e45a0cd 100644 --- a/OpenSim/Framework/General/AgentInventory.cs +++ b/OpenSim/Framework/General/AgentInventory.cs @@ -25,9 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; using System.Collections.Generic; -using System.Text; using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework.Types; diff --git a/OpenSim/Framework/General/AuthenticateSessionBase.cs b/OpenSim/Framework/General/AuthenticateSessionBase.cs index 73dd3e2..71616e3 100644 --- a/OpenSim/Framework/General/AuthenticateSessionBase.cs +++ b/OpenSim/Framework/General/AuthenticateSessionBase.cs @@ -25,9 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; using System.Collections.Generic; -using System.Text; using libsecondlife; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; diff --git a/OpenSim/Framework/General/BlockingQueue.cs b/OpenSim/Framework/General/BlockingQueue.cs index 667b8d8..0cc8124 100644 --- a/OpenSim/Framework/General/BlockingQueue.cs +++ b/OpenSim/Framework/General/BlockingQueue.cs @@ -25,10 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Threading; using System.Collections.Generic; -using System.Text; +using System.Threading; namespace OpenSim.Framework.Utilities { diff --git a/OpenSim/Framework/General/IRegionCommsListener.cs b/OpenSim/Framework/General/IRegionCommsListener.cs index 0e80941..32444f9 100644 --- a/OpenSim/Framework/General/IRegionCommsListener.cs +++ b/OpenSim/Framework/General/IRegionCommsListener.cs @@ -25,9 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; using System.Collections.Generic; -using System.Text; +using libsecondlife; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; @@ -35,7 +34,7 @@ namespace OpenSim.Framework { public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); public delegate void UpdateNeighbours(List neighbours); - public delegate void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); + public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position); public interface IRegionCommsListener { diff --git a/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs index 462e2c5..508485b 100644 --- a/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs +++ b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs @@ -25,14 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using System.IO; -using libsecondlife; -using OpenSim; using OpenSim.Framework.Types; namespace OpenSim.Framework.Interfaces diff --git a/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs index 13980fe..2c379dd 100644 --- a/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs +++ b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs @@ -25,10 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; - namespace OpenSim.Framework.Interfaces { public interface IGenericConfig diff --git a/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs index 0fafe1a..81dc293 100644 --- a/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs +++ b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs @@ -26,10 +26,6 @@ * */ -using System; -using System.Collections.Generic; -using System.IO; -using libsecondlife; //using OpenSim.world; namespace OpenSim.Framework.Interfaces diff --git a/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs index 2f4b340..ae6cedb 100644 --- a/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs +++ b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs @@ -26,10 +26,6 @@ * */ -using System; -using System.Collections.Generic; -using System.IO; -using libsecondlife; //using OpenSim.world; namespace OpenSim.Framework.Interfaces diff --git a/OpenSim/Framework/General/Interfaces/IAssetServer.cs b/OpenSim/Framework/General/Interfaces/IAssetServer.cs index 826392d..ab60dd7 100644 --- a/OpenSim/Framework/General/Interfaces/IAssetServer.cs +++ b/OpenSim/Framework/General/Interfaces/IAssetServer.cs @@ -25,11 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Net; -using System.Net.Sockets; -using System.IO; -using System.Threading; using libsecondlife; using OpenSim.Framework.Types; diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index d62247c..b5a0a0b 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -25,14 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Inventory; +using System.Net; using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework.Types; -using System.Net; namespace OpenSim.Framework.Interfaces { diff --git a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs index 4987d10..dbdb25d 100644 --- a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs +++ b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs @@ -26,7 +26,6 @@ * */ -using System; using libsecondlife; using OpenSim.Framework.Types; diff --git a/OpenSim/Framework/General/Interfaces/IUserServer.cs b/OpenSim/Framework/General/Interfaces/IUserServer.cs index c6e2223..b3700d2 100644 --- a/OpenSim/Framework/General/Interfaces/IUserServer.cs +++ b/OpenSim/Framework/General/Interfaces/IUserServer.cs @@ -25,11 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Inventory; using libsecondlife; +using OpenSim.Framework.Inventory; namespace OpenSim.Framework.Interfaces { diff --git a/OpenSim/Framework/General/Interfaces/IWorld.cs b/OpenSim/Framework/General/Interfaces/IWorld.cs index 2edc0b4..204c01b 100644 --- a/OpenSim/Framework/General/Interfaces/IWorld.cs +++ b/OpenSim/Framework/General/Interfaces/IWorld.cs @@ -25,9 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; using OpenSim.Framework.Types; diff --git a/OpenSim/Framework/General/LoginService.cs b/OpenSim/Framework/General/LoginService.cs index f14754f..02efcec 100644 --- a/OpenSim/Framework/General/LoginService.cs +++ b/OpenSim/Framework/General/LoginService.cs @@ -25,13 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using Nwc.XmlRpc; -using libsecondlife; - namespace OpenSim.Framework.Grid { public abstract class LoginService diff --git a/OpenSim/Framework/General/Properties/AssemblyInfo.cs b/OpenSim/Framework/General/Properties/AssemblyInfo.cs index 86f5cdb..004040b 100644 --- a/OpenSim/Framework/General/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/General/Properties/AssemblyInfo.cs @@ -1,7 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. diff --git a/OpenSim/Framework/General/RegionCommsListener.cs b/OpenSim/Framework/General/RegionCommsListener.cs index 5fa2f58..2b0bc62 100644 --- a/OpenSim/Framework/General/RegionCommsListener.cs +++ b/OpenSim/Framework/General/RegionCommsListener.cs @@ -25,9 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; +using libsecondlife; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; @@ -57,7 +55,7 @@ namespace OpenSim.Framework return false; } - public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) { if (OnAvatarCrossingIntoRegion != null) { diff --git a/OpenSim/Framework/General/Remoting.cs b/OpenSim/Framework/General/Remoting.cs index e6fdf70..df32db2 100644 --- a/OpenSim/Framework/General/Remoting.cs +++ b/OpenSim/Framework/General/Remoting.cs @@ -26,9 +26,8 @@ * */ using System; -using System.Collections.Generic; -using System.Text; using System.Security.Cryptography; +using System.Text; namespace OpenSim.Framework { diff --git a/OpenSim/Framework/General/SimProfile.cs b/OpenSim/Framework/General/SimProfile.cs index cfa5e50..47f1af3 100644 --- a/OpenSim/Framework/General/SimProfile.cs +++ b/OpenSim/Framework/General/SimProfile.cs @@ -26,10 +26,7 @@ * */ using System; -using System.Collections.Generic; using System.Collections; -using System.Xml; -using System.Text; using libsecondlife; using Nwc.XmlRpc; diff --git a/OpenSim/Framework/General/Types/AgentCiruitData.cs b/OpenSim/Framework/General/Types/AgentCiruitData.cs index a650343..00e9d0a 100644 --- a/OpenSim/Framework/General/Types/AgentCiruitData.cs +++ b/OpenSim/Framework/General/Types/AgentCiruitData.cs @@ -25,9 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/Types/AgentWearable.cs b/OpenSim/Framework/General/Types/AgentWearable.cs index 4c93da7..6152b7d 100644 --- a/OpenSim/Framework/General/Types/AgentWearable.cs +++ b/OpenSim/Framework/General/Types/AgentWearable.cs @@ -25,9 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/Types/AssetBase.cs b/OpenSim/Framework/General/Types/AssetBase.cs index 86586a6..c203f51 100644 --- a/OpenSim/Framework/General/Types/AssetBase.cs +++ b/OpenSim/Framework/General/Types/AssetBase.cs @@ -25,9 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/Types/AssetLandmark.cs b/OpenSim/Framework/General/Types/AssetLandmark.cs index 8a10b70..8aa872e 100644 --- a/OpenSim/Framework/General/Types/AssetLandmark.cs +++ b/OpenSim/Framework/General/Types/AssetLandmark.cs @@ -25,8 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; using System.Text; using libsecondlife; @@ -51,7 +49,7 @@ namespace OpenSim.Framework.Types private void InternData() { - string temp = System.Text.Encoding.UTF8.GetString(Data).Trim(); + string temp = Encoding.UTF8.GetString(Data).Trim(); string[] parts = temp.Split('\n'); int.TryParse(parts[0].Substring(17, 1), out Version); LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID); diff --git a/OpenSim/Framework/General/Types/AssetStorage.cs b/OpenSim/Framework/General/Types/AssetStorage.cs index 8cac23a..3681336 100644 --- a/OpenSim/Framework/General/Types/AssetStorage.cs +++ b/OpenSim/Framework/General/Types/AssetStorage.cs @@ -25,9 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/Types/EstateSettings.cs b/OpenSim/Framework/General/Types/EstateSettings.cs index 778c893..436b109 100644 --- a/OpenSim/Framework/General/Types/EstateSettings.cs +++ b/OpenSim/Framework/General/Types/EstateSettings.cs @@ -26,10 +26,6 @@ * */ -using System; -using System.Collections.Generic; -using System.Text; - using libsecondlife; namespace OpenSim.Framework.Types @@ -46,8 +42,8 @@ namespace OpenSim.Framework.Types public int redirectGridX = 0; //?? public int redirectGridY = 0; //?? - public libsecondlife.Simulator.RegionFlags regionFlags = libsecondlife.Simulator.RegionFlags.None; //Booleam values of various region settings - public libsecondlife.Simulator.SimAccess simAccess = libsecondlife.Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default. + public Simulator.RegionFlags regionFlags = Simulator.RegionFlags.None; //Booleam values of various region settings + public Simulator.SimAccess simAccess = Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default. public float sunHour = 0; public float terrainRaiseLimit = 0; diff --git a/OpenSim/Framework/General/Types/Login.cs b/OpenSim/Framework/General/Types/Login.cs index 3180a16..d54c019 100644 --- a/OpenSim/Framework/General/Types/Login.cs +++ b/OpenSim/Framework/General/Types/Login.cs @@ -25,9 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/Types/MapBlockData.cs b/OpenSim/Framework/General/Types/MapBlockData.cs index 2e6f56e..fbb3b73 100644 --- a/OpenSim/Framework/General/Types/MapBlockData.cs +++ b/OpenSim/Framework/General/Types/MapBlockData.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/Types/NeighbourInfo.cs b/OpenSim/Framework/General/Types/NeighbourInfo.cs index 310fd1c..bb67981 100644 --- a/OpenSim/Framework/General/Types/NeighbourInfo.cs +++ b/OpenSim/Framework/General/Types/NeighbourInfo.cs @@ -25,14 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; -using libsecondlife; - namespace OpenSim.Framework.Types { public class NeighbourInfo diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index c6b81a7..89ebf94 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs @@ -26,8 +26,7 @@ * */ using System; -using System.Collections.Generic; -using System.Text; +using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; namespace OpenSim.Framework.Types @@ -63,7 +62,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("HttpListenerPort"); if (attri == "") { - string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); + string location = MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); configData.SetAttribute("HttpListenerPort", location); this.HttpListenerPort = Convert.ToInt32(location); } @@ -76,7 +75,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("RemotingListenerPort"); if (attri == "") { - string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); + string location = MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); configData.SetAttribute("RemotingListenerPort", location); this.RemotingListenerPort = Convert.ToInt32(location); } @@ -92,7 +91,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("DefaultLocationX"); if (attri == "") { - string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); + string location = MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); configData.SetAttribute("DefaultLocationX", location); this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); } @@ -106,7 +105,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("DefaultLocationY"); if (attri == "") { - string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); + string location = MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); configData.SetAttribute("DefaultLocationY", location); this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); } @@ -122,7 +121,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("GridServerURL"); if (attri == "") { - this.GridURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); + this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); configData.SetAttribute("GridServerURL", this.GridURL); } else @@ -135,7 +134,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("GridSendKey"); if (attri == "") { - this.GridSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); + this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); configData.SetAttribute("GridSendKey", this.GridSendKey); } else @@ -148,7 +147,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("GridRecvKey"); if (attri == "") { - this.GridRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); + this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); configData.SetAttribute("GridRecvKey", this.GridRecvKey); } else @@ -161,7 +160,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("UserServerURL"); if (attri == "") { - this.UserURL= OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); + this.UserURL= MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); configData.SetAttribute("UserServerURL", this.UserURL); } else @@ -174,7 +173,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("UserSendKey"); if (attri == "") { - this.UserSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to user server", "null"); + this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server", "null"); configData.SetAttribute("UserSendKey", this.UserSendKey); } else @@ -187,7 +186,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("UserRecvKey"); if (attri == "") { - this.UserRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); + this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); configData.SetAttribute("GridRecvKey", this.UserRecvKey); } else @@ -199,7 +198,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("AssetServerURL"); if (attri == "") { - this.AssetURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); + this.AssetURL = MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); configData.SetAttribute("AssetServerURL", this.GridURL); } else @@ -212,8 +211,8 @@ namespace OpenSim.Framework.Types } catch (Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + MainLog.Instance.Warn(e.ToString()); } } } diff --git a/OpenSim/Framework/General/Types/ParcelData.cs b/OpenSim/Framework/General/Types/ParcelData.cs index 40f128a..761d55e 100644 --- a/OpenSim/Framework/General/Types/ParcelData.cs +++ b/OpenSim/Framework/General/Types/ParcelData.cs @@ -25,9 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types @@ -45,14 +42,14 @@ namespace OpenSim.Framework.Types public int area = 0; public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID - public libsecondlife.Parcel.ParcelCategory category = new libsecondlife.Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category + public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category public int claimDate = 0; //Unemplemented public int claimPrice = 0; //Unemplemented public LLUUID groupID = new LLUUID(); //Unemplemented public int groupPrims = 0; //Unemplemented public int salePrice = 0; //Unemeplemented. Parcels price. - public libsecondlife.Parcel.ParcelStatus parcelStatus = libsecondlife.Parcel.ParcelStatus.None; - public libsecondlife.Parcel.ParcelFlags parcelFlags = libsecondlife.Parcel.ParcelFlags.None; + public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.None; + public Parcel.ParcelFlags parcelFlags = Parcel.ParcelFlags.None; public byte landingType = 0; public byte mediaAutoScale = 0; public LLUUID mediaID = LLUUID.Zero; diff --git a/OpenSim/Framework/General/Types/PrimData.cs b/OpenSim/Framework/General/Types/PrimData.cs index f84ae3e..ff81bcd 100644 --- a/OpenSim/Framework/General/Types/PrimData.cs +++ b/OpenSim/Framework/General/Types/PrimData.cs @@ -26,8 +26,6 @@ * */ using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 584bc9b..1357e06 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Interfaces; namespace OpenSim.Framework.Types { diff --git a/OpenSim/Framework/General/Types/RegionHandle.cs b/OpenSim/Framework/General/Types/RegionHandle.cs index 1271d04..409b05a 100644 --- a/OpenSim/Framework/General/Types/RegionHandle.cs +++ b/OpenSim/Framework/General/Types/RegionHandle.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Net; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 7b99d06..4602dcf 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -26,14 +26,13 @@ * */ using System; -using System.Collections.Generic; -using System.Text; using System.Globalization; +using System.Net; +using System.Net.Sockets; +using libsecondlife; +using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; -using libsecondlife; -using System.Net; namespace OpenSim.Framework.Types { @@ -65,7 +64,7 @@ namespace OpenSim.Framework.Types if (ia == null) ia = Adr; - if (Adr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + if (Adr.AddressFamily == AddressFamily.InterNetwork) { ia = Adr; break; @@ -170,7 +169,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimLocationX"); if (attri == "") { - string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location X", "1000"); + string location = MainLog.Instance.CmdPrompt("Grid Location X", "1000"); configData.SetAttribute("SimLocationX", location); m_regionLocX = (uint)Convert.ToUInt32(location); } @@ -183,7 +182,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimLocationY"); if (attri == "") { - string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); + string location = MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); configData.SetAttribute("SimLocationY", location); m_regionLocY = (uint)Convert.ToUInt32(location); } @@ -209,7 +208,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("TerrainMultiplier"); if (attri == "") { - string re = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); + string re = MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture); configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString()); } @@ -222,7 +221,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("MasterAvatarFirstName"); if (attri == "") { - this.MasterAvatarFirstName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test"); + this.MasterAvatarFirstName = MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test"); configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName); } @@ -235,7 +234,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("MasterAvatarLastName"); if (attri == "") { - this.MasterAvatarLastName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User"); + this.MasterAvatarLastName = MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User"); configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName); } @@ -250,7 +249,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("MasterAvatarSandboxPassword"); if (attri == "") { - this.MasterAvatarSandboxPassword = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test"); + this.MasterAvatarSandboxPassword = MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test"); //Should I store this? configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword); @@ -265,17 +264,17 @@ namespace OpenSim.Framework.Types } catch (Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + MainLog.Instance.Warn(e.ToString()); } - OpenSim.Framework.Console.MainLog.Instance.Verbose("Sim settings loaded:"); - OpenSim.Framework.Console.MainLog.Instance.Verbose("UUID: " + this.SimUUID.ToStringHyphenated()); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Name: " + this.RegionName); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Listening on IP end point: " + m_internalEndPoint.ToString() ); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); + MainLog.Instance.Verbose("Sim settings loaded:"); + MainLog.Instance.Verbose("UUID: " + this.SimUUID.ToStringHyphenated()); + MainLog.Instance.Verbose("Name: " + this.RegionName); + MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); + MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); + MainLog.Instance.Verbose("Listening on IP end point: " + m_internalEndPoint.ToString() ); + MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); } diff --git a/OpenSim/Framework/General/Types/UUID.cs b/OpenSim/Framework/General/Types/UUID.cs index bb9206f..9cde18e 100644 --- a/OpenSim/Framework/General/Types/UUID.cs +++ b/OpenSim/Framework/General/Types/UUID.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using libsecondlife; namespace OpenSim.Framework.Types diff --git a/OpenSim/Framework/General/UserProfile.cs b/OpenSim/Framework/General/UserProfile.cs index 263dba2..243208a 100644 --- a/OpenSim/Framework/General/UserProfile.cs +++ b/OpenSim/Framework/General/UserProfile.cs @@ -25,12 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; using System.Collections.Generic; -using System.Text; +using System.Security.Cryptography; using libsecondlife; using OpenSim.Framework.Inventory; -using System.Security.Cryptography; namespace OpenSim.Framework.User { diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs index 8c34c9b..13e3af2 100644 --- a/OpenSim/Framework/General/Util.cs +++ b/OpenSim/Framework/General/Util.cs @@ -27,10 +27,8 @@ */ using System; using System.Security.Cryptography; -using System.Collections.Generic; using System.Text; using libsecondlife; -using libsecondlife.Packets; namespace OpenSim.Framework.Utilities { -- cgit v1.1 From e06ffb3981d29ddb3383690b4a05dc684813b6d9 Mon Sep 17 00:00:00 2001 From: mingchen Date: Tue, 3 Jul 2007 17:03:14 +0000 Subject: *Removed GridInfo class as it has been previously replaced with the much better NetworkServersInfo class *Got the GridServer in OGS1 to go through with registering the region, but the actual storage of the region isnt working right now. **After this is fixed, grid mode should work! --- OpenSim/Framework/General/Types/NetworkServersInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index 89ebf94..142edc0 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs @@ -121,7 +121,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("GridServerURL"); if (attri == "") { - this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); + this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:13801/"); configData.SetAttribute("GridServerURL", this.GridURL); } else -- cgit v1.1 From 78e420f48bc8ce79f45c5a90d8ebb4004d7993e7 Mon Sep 17 00:00:00 2001 From: mingchen Date: Tue, 3 Jul 2007 19:26:35 +0000 Subject: *Fixed storage issue as noted in last commit of the OGS1 GridServer *Reverted the default remote grid server port back to 8001 (from a port change to debug a previous issue) --- OpenSim/Framework/General/Types/NetworkServersInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index 142edc0..89ebf94 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs @@ -121,7 +121,7 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("GridServerURL"); if (attri == "") { - this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:13801/"); + this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); configData.SetAttribute("GridServerURL", this.GridURL); } else -- cgit v1.1 From bd8018fa1cb32aa42e2a1a41ebb01fc0f1b0a04b Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 3 Jul 2007 20:10:20 +0000 Subject: Today's work on Building support/tools. Think I am slowly getting there. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 2 ++ OpenSim/Framework/General/Types/PrimitiveBaseShape.cs | 1 + 2 files changed, 3 insertions(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index b5a0a0b..c3291c4 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -56,6 +56,7 @@ namespace OpenSim.Framework.Interfaces public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); + public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); public delegate void StatusChange(bool status); public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); @@ -100,6 +101,7 @@ namespace OpenSim.Framework.Interfaces event UpdatePrimTexture OnUpdatePrimTexture; event UpdateVector OnUpdatePrimPosition; event UpdatePrimRotation OnUpdatePrimRotation; + event UpdatePrimGroupRotation OnUpdatePrimGroupRotation; event UpdateVector OnUpdatePrimScale; event StatusChange OnChildAgentStatus; event GenericCall2 OnStopMovement; diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 1357e06..a6671d1 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -12,6 +12,7 @@ namespace OpenSim.Framework.Types Prism, Scuplted, Cylinder, + Foliage, Unknown } -- cgit v1.1 From 249ce4cf6f353dd59ebec27689e74a527c39a090 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 4 Jul 2007 05:49:12 +0000 Subject: * More cleaning - Sugilite now only has build errors for "value is never used" properties (which I presume will be filled in over time) --- OpenSim/Framework/General/Types/RegionHandle.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/RegionHandle.cs b/OpenSim/Framework/General/Types/RegionHandle.cs index 409b05a..4a055ad 100644 --- a/OpenSim/Framework/General/Types/RegionHandle.cs +++ b/OpenSim/Framework/General/Types/RegionHandle.cs @@ -20,7 +20,10 @@ namespace OpenSim.Framework.Types { IPAddress addr = IPAddress.Parse(ip); - long baseHandle = addr.Address; + if (addr.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork) + throw new Exception("Bad RegionHandle Parameter - must be an IPv4 address"); + + uint baseHandle = BitConverter.ToUInt32(addr.GetAddressBytes(), 0); // Split the IP address in half short a = (short)((baseHandle << 16) & 0xFFFF); -- cgit v1.1 From beb3073bec9438a439e13eaec40a8320a9279adc Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 4 Jul 2007 19:07:27 +0000 Subject: A bit more work on Building tools/support. updated Axiom.MathLib.dll. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index c3291c4..2c7e143 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -56,6 +56,7 @@ namespace OpenSim.Framework.Interfaces public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); + public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); public delegate void StatusChange(bool status); public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); @@ -100,7 +101,9 @@ namespace OpenSim.Framework.Interfaces event UpdatePrimFlags OnUpdatePrimFlags; event UpdatePrimTexture OnUpdatePrimTexture; event UpdateVector OnUpdatePrimPosition; + event UpdateVector OnUpdatePrimSinglePosition; event UpdatePrimRotation OnUpdatePrimRotation; + event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; event UpdatePrimGroupRotation OnUpdatePrimGroupRotation; event UpdateVector OnUpdatePrimScale; event StatusChange OnChildAgentStatus; -- cgit v1.1 From 583f2a9de8e503773a427facd5f81a82b40bd585 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 5 Jul 2007 15:15:28 +0000 Subject: *Removed SimProfile.cs as it is no longer needed (in favor of SimProfileData) *Added simulator_data_request XMLRPC method to request data from the grid server about a sim instead of faking its login *Login is progressing, now just getting an XML error (http://pastebin.com/942515) -- if you can fix this, throw MingChen in IRC a Private Message --- OpenSim/Framework/General/OpenSim.Framework.csproj | 61 +++++------ .../Framework/General/OpenSim.Framework.dll.build | 39 ++++--- OpenSim/Framework/General/SimProfile.cs | 119 --------------------- 3 files changed, 48 insertions(+), 171 deletions(-) delete mode 100644 OpenSim/Framework/General/SimProfile.cs (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index a577ea3..4a72db0 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -97,103 +97,100 @@ Code - + Code - + Code - + Code Code - - Code - - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index 10fafbf..9fb35bc 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -14,39 +14,38 @@ + + - - - - - + + + + - - - - - - - - - - - + + + - + + - - - + + + + + + + + diff --git a/OpenSim/Framework/General/SimProfile.cs b/OpenSim/Framework/General/SimProfile.cs deleted file mode 100644 index 47f1af3..0000000 --- a/OpenSim/Framework/General/SimProfile.cs +++ /dev/null @@ -1,119 +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 System.Collections; -using libsecondlife; -using Nwc.XmlRpc; - -namespace OpenSim.Framework.Sims -{ - public class SimProfile - { - public LLUUID UUID; - public ulong regionhandle; - public string regionname; - public string sim_ip; - public uint sim_port; - public string caps_url; - public uint RegionLocX; - public uint RegionLocY; - public string sendkey; - public string recvkey; - public bool online; - - public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey) - { - try - { - Hashtable GridReqParams = new Hashtable(); - GridReqParams["region_handle"] = region_handle.ToString(); - GridReqParams["authkey"] = SendKey; - ArrayList SendParams = new ArrayList(); - SendParams.Add(GridReqParams); - XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - - XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); - - Hashtable RespData = (Hashtable)GridResp.Value; - this.UUID = new LLUUID((string)RespData["UUID"]); - this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256)); - this.regionname = (string)RespData["regionname"]; - this.sim_ip = (string)RespData["sim_ip"]; - this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); - this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/"; - this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]); - this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]); - this.sendkey = SendKey; - this.recvkey = RecvKey; - } - catch (Exception e) - { - System.Console.WriteLine(e.ToString()); - } - return this; - } - - public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey) - { - try - { - Hashtable GridReqParams = new Hashtable(); - GridReqParams["UUID"] = UUID.ToString(); - GridReqParams["authkey"] = SendKey; - ArrayList SendParams = new ArrayList(); - SendParams.Add(GridReqParams); - XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - - XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); - - Hashtable RespData = (Hashtable)GridResp.Value; - this.UUID = new LLUUID((string)RespData["UUID"]); - this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256)); - this.regionname = (string)RespData["regionname"]; - this.sim_ip = (string)RespData["sim_ip"]; - this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); - this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/"; - this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]); - this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]); - this.sendkey = SendKey; - this.recvkey = RecvKey; - } - catch (Exception e) - { - System.Console.WriteLine(e.ToString()); - } - return this; - } - - - public SimProfile() - { - } - } - -} -- cgit v1.1 From 93640f1d71115dea680639c4564dcf89ecab4b61 Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 6 Jul 2007 13:57:49 +0000 Subject: *Fixed 2 small references to localhost which has some conflicts when resolving. *Grid mode now gets past region handshake, BUT the client (both nicholas and the normal one) crash as soon as the next step is displayed on the screen --- OpenSim/Framework/General/Types/RegionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 4602dcf..e6bc82a 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -199,7 +199,7 @@ namespace OpenSim.Framework.Types int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); - m_externalHostName = GetString(configData, "ExternalHostName", "localhost", "External Host Name"); + m_externalHostName = GetString(configData, "ExternalHostName", "127.0.0.1", "External Host Name"); estateSettings.terrainFile = GetString(configData, "TerrainFile", "default.r32", "GENERAL SETTING: Default Terrain File"); -- cgit v1.1 From 10ece46cf681f389b9ecce5e89b94d749a44e9c1 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 8 Jul 2007 02:58:01 +0000 Subject: * Updating prebuild --- OpenSim/Framework/General/OpenSim.Framework.csproj | 58 +++++++++++----------- .../Framework/General/OpenSim.Framework.dll.build | 38 +++++++------- 2 files changed, 48 insertions(+), 48 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 4a72db0..c5124cd 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -97,100 +97,100 @@ Code - + Code - + Code - + Code Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index 9fb35bc..a44f0fc 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -14,38 +14,38 @@ - - - - + + + + - - + + - - - - - - - - - + + + + + - - - + + - + + + + + + -- cgit v1.1 From bdab40280b64e31b763a99f6c2011e7e91e7d0fa Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 8 Jul 2007 03:32:27 +0000 Subject: * Added instant message support for the local region. Grid support forthcoming. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 3 ++ OpenSim/Framework/General/OpenSim.Framework.csproj | 40 ++++++++++++---------- 2 files changed, 25 insertions(+), 18 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 2c7e143..acacabe 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -34,6 +34,7 @@ using OpenSim.Framework.Types; namespace OpenSim.Framework.Interfaces { public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); + public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list public delegate void RezObject(AssetBase primAsset, LLVector3 pos); public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west); public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); @@ -74,6 +75,7 @@ namespace OpenSim.Framework.Interfaces public interface IClientAPI { + event ImprovedInstantMessage OnInstantMessage; event ChatFromViewer OnChatFromViewer; event RezObject OnRezObject; event ModifyTerrain OnModifyTerrain; @@ -146,6 +148,7 @@ namespace OpenSim.Framework.Interfaces void SendRegionHandshake(RegionInfo regionInfo); void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); + void SendInstantMessage(string message, LLUUID target); void SendLayerData(float[] map); void SendLayerData(int px, int py, float[] map); void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index c5124cd..192e757 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,7 +6,8 @@ {8ACA2445-0000-0000-0000-000000000000} Debug AnyCPU - + + OpenSim.Framework @@ -15,9 +16,11 @@ IE50 false Library - + + OpenSim.Framework - + + @@ -28,7 +31,8 @@ TRACE;DEBUG - + + True 4096 False @@ -37,7 +41,8 @@ False False 4 - + + False @@ -46,7 +51,8 @@ TRACE - + + False 4096 True @@ -55,36 +61,34 @@ False False 4 - + + - + ..\..\..\bin\Db4objects.Db4o.dll False - + ..\..\..\bin\libsecondlife.dll False - + System.dll False - + System.Xml.dll False - - ..\..\..\bin\XMLRPC.dll - False - + OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -201,4 +205,4 @@ - + \ No newline at end of file -- cgit v1.1 From 4adf4c57d481369af0d98d8addab2f7b54ce21a5 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 8 Jul 2007 12:10:32 +0000 Subject: --- OpenSim/Framework/General/OpenSim.Framework.csproj | 40 ++++++++++------------ 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 192e757..c5124cd 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,8 +6,7 @@ {8ACA2445-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenSim.Framework @@ -16,11 +15,9 @@ IE50 false Library - - + OpenSim.Framework - - + @@ -31,8 +28,7 @@ TRACE;DEBUG - - + True 4096 False @@ -41,8 +37,7 @@ False False 4 - - + False @@ -51,8 +46,7 @@ TRACE - - + False 4096 True @@ -61,34 +55,36 @@ False False 4 - - + - + ..\..\..\bin\Db4objects.Db4o.dll False - + ..\..\..\bin\libsecondlife.dll False - + System.dll False - + System.Xml.dll False - + + ..\..\..\bin\XMLRPC.dll + False + OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -205,4 +201,4 @@ - \ No newline at end of file + -- cgit v1.1 From 5f8de1e7045b9daa2d4f3b21ca826987e32efe6e Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 8 Jul 2007 19:27:04 +0000 Subject: * By popular demand, all generated build files are now deleted. Somebody should make sure the wiki is updated. --- OpenSim/Framework/General/OpenSim.Framework.csproj | 204 --------------------- .../Framework/General/OpenSim.Framework.dll.build | 78 -------- 2 files changed, 282 deletions(-) delete mode 100644 OpenSim/Framework/General/OpenSim.Framework.csproj delete mode 100644 OpenSim/Framework/General/OpenSim.Framework.dll.build (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj deleted file mode 100644 index c5124cd..0000000 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ /dev/null @@ -1,204 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {8ACA2445-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Framework - JScript - Grid - IE50 - false - Library - - OpenSim.Framework - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - ..\..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - System.dll - False - - - System.Xml.dll - False - - - ..\..\..\bin\XMLRPC.dll - False - - - - - OpenSim.Framework.Console - {A7CD0630-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build deleted file mode 100644 index a44f0fc..0000000 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.1 From 252ff78eb3fafe2c8214446973f3c7f2e80297a2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 8 Jul 2007 19:28:53 +0000 Subject: Applied animations patch (#175) submitted by dalien --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index acacabe..c7e0d22 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -145,6 +145,7 @@ namespace OpenSim.Framework.Interfaces void OutPacket(Packet newPack); void SendWearables(AvatarWearable[] wearables); + void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); void SendRegionHandshake(RegionInfo regionInfo); void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); -- cgit v1.1 From f62b7f3d1ed0fbc1afc431a1e25c20ec8effe243 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 8 Jul 2007 19:47:04 +0000 Subject: * reverted rev 1200 waiting for info re animations.xml --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index c7e0d22..acacabe 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -145,7 +145,6 @@ namespace OpenSim.Framework.Interfaces void OutPacket(Packet newPack); void SendWearables(AvatarWearable[] wearables); - void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); void SendRegionHandshake(RegionInfo regionInfo); void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); -- cgit v1.1 From e8acf1cca92592fea38208dbfe4137555431434d Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 9 Jul 2007 15:29:39 +0000 Subject: * Begun work on Primitive Duplication. Not hooked up yet, but theoretically could be done so. In practice, more work needs to be done. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index acacabe..206122d 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -59,6 +59,7 @@ namespace OpenSim.Framework.Interfaces public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); + public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags); public delegate void StatusChange(bool status); public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); @@ -92,6 +93,7 @@ namespace OpenSim.Framework.Interfaces event UpdateAgent OnAgentUpdate; event GenericCall OnRequestAvatarsData; event GenericCall4 OnAddPrim; + event ObjectDuplicate OnObjectDuplicate; event UpdateVector OnGrapObject; event ObjectSelect OnDeGrapObject; event MoveObject OnGrapUpdate; -- cgit v1.1 From 93f3ef7e0d1c7d8b9c578ffdf4e45d9c0d2dde6c Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 9 Jul 2007 15:59:35 +0000 Subject: Done a little bit of renaming in primitive.cs and on a few events in IClientAPI. Disabled CAPS asset uploading as it seems it now crashes the server. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 206122d..7042f40 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -104,11 +104,11 @@ namespace OpenSim.Framework.Interfaces event GenericCall7 OnObjectName; event UpdatePrimFlags OnUpdatePrimFlags; event UpdatePrimTexture OnUpdatePrimTexture; - event UpdateVector OnUpdatePrimPosition; + event UpdateVector OnUpdatePrimGroupPosition; event UpdateVector OnUpdatePrimSinglePosition; - event UpdatePrimRotation OnUpdatePrimRotation; + event UpdatePrimRotation OnUpdatePrimGroupRotation; event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; - event UpdatePrimGroupRotation OnUpdatePrimGroupRotation; + event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; event UpdateVector OnUpdatePrimScale; event StatusChange OnChildAgentStatus; event GenericCall2 OnStopMovement; -- cgit v1.1 From d91f33b87b4578eb5e5a9ef22f383ed598cc28e2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 9 Jul 2007 19:56:22 +0000 Subject: Re-applied dalien patch (#175) and included bin\data with avataranimations.xml --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 7042f40..7bc8d14 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -147,6 +147,7 @@ namespace OpenSim.Framework.Interfaces void OutPacket(Packet newPack); void SendWearables(AvatarWearable[] wearables); + void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); void SendRegionHandshake(RegionInfo regionInfo); void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); -- cgit v1.1 From 08a1fa3f96eee5e067475da453a3770ff15780f9 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 9 Jul 2007 21:03:36 +0000 Subject: * Introduced ClientManager for great justice. --- OpenSim/Framework/General/ClientManager.cs | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 OpenSim/Framework/General/ClientManager.cs (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs new file mode 100644 index 0000000..5b6e7b3 --- /dev/null +++ b/OpenSim/Framework/General/ClientManager.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Interfaces; + +namespace OpenSim.Framework +{ + public delegate void ForEachClientDelegate( IClientAPI client ); + public class ClientManager + { + private Dictionary m_clientThreads; + + public void ForEachClient(ForEachClientDelegate whatToDo) + { + foreach (IClientAPI client in m_clientThreads.Values) + { + whatToDo(client); + } + } + + public ClientManager() + { + m_clientThreads = new Dictionary(); + } + + public void Add(uint id, IClientAPI client ) + { + m_clientThreads.Add( id, client ); + } + } +} -- cgit v1.1 From 85dd493614cda12488eb7920713ddda07c921dbc Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 9 Jul 2007 21:25:43 +0000 Subject: * some follow up renaming of members et c. --- OpenSim/Framework/General/ClientManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs index 5b6e7b3..03ad226 100644 --- a/OpenSim/Framework/General/ClientManager.cs +++ b/OpenSim/Framework/General/ClientManager.cs @@ -8,11 +8,11 @@ namespace OpenSim.Framework public delegate void ForEachClientDelegate( IClientAPI client ); public class ClientManager { - private Dictionary m_clientThreads; + private Dictionary m_clients; public void ForEachClient(ForEachClientDelegate whatToDo) { - foreach (IClientAPI client in m_clientThreads.Values) + foreach (IClientAPI client in m_clients.Values) { whatToDo(client); } @@ -20,12 +20,12 @@ namespace OpenSim.Framework public ClientManager() { - m_clientThreads = new Dictionary(); + m_clients = new Dictionary(); } public void Add(uint id, IClientAPI client ) { - m_clientThreads.Add( id, client ); + m_clients.Add( id, client ); } } } -- cgit v1.1 From ebdc64730a832a6e5dc2dc7d304eff813c73e933 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 10 Jul 2007 18:58:42 +0000 Subject: Fixed the crashing when trying to look at the map in grid mode. Although the textures for the regions don't seem to show up, about to look into that. --- OpenSim/Framework/General/Types/RegionInfo.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index e6bc82a..72d1a4c 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -117,6 +117,20 @@ namespace OpenSim.Framework.Types } } + // Only used for remote regions , ie ones not in the current instance + private uint m_remotingPort; + public uint RemotingPort + { + get + { + return m_remotingPort; + } + set + { + m_remotingPort = value; + } + } + public string DataStore = ""; public bool isSandbox = false; -- cgit v1.1 From f0ecc1de4ccb40ed23b5bc925130bda3ff07c1a6 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 10 Jul 2007 20:52:43 +0000 Subject: preliminary inter region communications (between regions in different instances) now works, so child agents and border crossings (and teleporting) now work. The .net remoting is still very basic: we need security sinks added. And we really need the OGS 2 protocol as soon as possible. --- OpenSim/Framework/General/Types/AgentCiruitData.cs | 2 ++ OpenSim/Framework/General/Types/RegionInfo.cs | 1 + 2 files changed, 3 insertions(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Types/AgentCiruitData.cs b/OpenSim/Framework/General/Types/AgentCiruitData.cs index 00e9d0a..ed9ee3c 100644 --- a/OpenSim/Framework/General/Types/AgentCiruitData.cs +++ b/OpenSim/Framework/General/Types/AgentCiruitData.cs @@ -26,9 +26,11 @@ * */ using libsecondlife; +using System; namespace OpenSim.Framework.Types { + [Serializable] public class AgentCircuitData { public AgentCircuitData() { } diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 72d1a4c..cfc0925 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -130,6 +130,7 @@ namespace OpenSim.Framework.Types m_remotingPort = value; } } + public string RemotingAddress; public string DataStore = ""; public bool isSandbox = false; -- cgit v1.1 From 561b87b303e8e141ef516b8725ebd3c0be8b1122 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 11 Jul 2007 02:51:51 +0000 Subject: * Applying dalien's patches from bug#177 and #179 --- OpenSim/Framework/General/ClientManager.cs | 5 +++++ OpenSim/Framework/General/Interfaces/IClientAPI.cs | 2 ++ 2 files changed, 7 insertions(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs index 03ad226..b560ca8 100644 --- a/OpenSim/Framework/General/ClientManager.cs +++ b/OpenSim/Framework/General/ClientManager.cs @@ -23,6 +23,11 @@ namespace OpenSim.Framework m_clients = new Dictionary(); } + public void Remove(uint id) + { + m_clients.Remove(id); + } + public void Add(uint id, IClientAPI client ) { m_clients.Add( id, client ); diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 7bc8d14..1b0c682 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -147,6 +147,8 @@ namespace OpenSim.Framework.Interfaces void OutPacket(Packet newPack); void SendWearables(AvatarWearable[] wearables); + void SendStartPingCheck(byte seq); + void SendKillObject(ulong regionHandle, uint avatarLocalID); void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); void SendRegionHandshake(RegionInfo regionInfo); void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); -- cgit v1.1