From a7fe1b63f31fdfe438ed52512ccd277f9e33ff2e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 1 Jun 2007 23:34:37 +0000 Subject: * ZOMG Wtf Comments? * OpenGrid.Framework.Data is now well documented --- .../OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs | 68 ++++++-- .../OpenGrid.Framework.Data/GridData.cs | 26 +++ .../OpenGrid.Framework.Data/ILogData.cs | 51 ++++++ .../OpenGrid.Framework.Data/IniConfig.cs | 26 +++ .../OpenGrid.Framework.Data/InventoryData.cs | 74 +++++++++ .../OpenGrid.Framework.Data/SimProfileData.cs | 29 ++++ .../OpenGrid.Framework.Data/UserData.cs | 29 ++++ .../OpenGrid.Framework.Data/UserProfileData.cs | 185 +++++++++++++++++---- 8 files changed, 449 insertions(+), 39 deletions(-) (limited to 'OpenGridServices') diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs index 2d00ca6..cbe64e6 100644 --- a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs +++ b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs @@ -12,7 +12,7 @@ * 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 ``AS IS'' AND ANY +* 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 BE LIABLE FOR ANY @@ -32,8 +32,15 @@ using Db4objects.Db4o; namespace OpenGrid.Config.GridConfigDb4o { + /// + /// A grid configuration interface for returning the DB4o Config Provider + /// public class Db40ConfigPlugin: IGridConfig { + /// + /// Loads and returns a configuration objeect + /// + /// A grid configuration object public GridConfig GetConfigObject() { OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Loading Db40Config dll"); @@ -41,49 +48,81 @@ namespace OpenGrid.Config.GridConfigDb4o } } + /// + /// A DB4o based Gridserver configuration object + /// public class DbGridConfig : GridConfig { + /// + /// The DB4o Database + /// private IObjectContainer db; + /// + /// User configuration for the Grid Config interfaces + /// public void LoadDefaults() { OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); + // About the grid options this.GridOwner = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid owner", "OGS development team"); + // Asset Options this.DefaultAssetServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/"); - this.AssetSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to asset server","null"); - this.AssetRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from asset server","null"); + this.AssetSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to asset server","null"); + this.AssetRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from asset server","null"); - this.DefaultUserServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/"); - this.UserSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to user server","null"); - this.UserRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from user server","null"); + // User Server Options + this.DefaultUserServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/"); + this.UserSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to user server","null"); + this.UserRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from user server","null"); - this.SimSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to sims","null"); - this.SimRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from sims","null"); + // Region Server Options + this.SimSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to sims","null"); + this.SimRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from sims","null"); } + /// + /// Initialises a new configuration object + /// public override void InitConfig() { try { + // Perform Db4o initialisation db = Db4oFactory.OpenFile("opengrid.yap"); + + // Locate the grid configuration object IObjectSet result = db.Get(typeof(DbGridConfig)); + // Found? if(result.Count==1) { OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Found a GridConfig object in the local database, loading"); foreach (DbGridConfig cfg in result) { + // Import each setting into this class + // Grid Settings this.GridOwner=cfg.GridOwner; + // Asset Settings this.DefaultAssetServer=cfg.DefaultAssetServer; this.AssetSendKey=cfg.AssetSendKey; this.AssetRecvKey=cfg.AssetRecvKey; + // User Settings this.DefaultUserServer=cfg.DefaultUserServer; this.UserSendKey=cfg.UserSendKey; this.UserRecvKey=cfg.UserRecvKey; + // Region Settings this.SimSendKey=cfg.SimSendKey; this.SimRecvKey=cfg.SimRecvKey; } + // Create a new configuration object from this class } else { OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); + + // Load default settings into this class LoadDefaults(); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Writing out default settings to local database"); + + // Saves to the database file... + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Writing out default settings to local database"); db.Set(this); + + // Closes file locks db.Close(); } } catch(Exception e) { @@ -91,19 +130,28 @@ namespace OpenGrid.Config.GridConfigDb4o OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); } + // Grid Settings OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Grid settings loaded:"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Grid owner: " + this.GridOwner); + + // Asset Settings OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Default asset server: " + this.DefaultAssetServer); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to asset server: " + this.AssetSendKey); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from asset server: " + this.AssetRecvKey); + + // User Settings OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Default user server: " + this.DefaultUserServer); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to user server: " + this.UserSendKey); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from user server: " + this.UserRecvKey); + + // Region Settings OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to sims: " + this.SimSendKey); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from sims: " + this.SimRecvKey); } - + /// + /// Closes down the database and releases filesystem locks + /// public void Shutdown() { db.Close(); } diff --git a/OpenGridServices/OpenGrid.Framework.Data/GridData.cs b/OpenGridServices/OpenGrid.Framework.Data/GridData.cs index 6dad37e..4d1c0da 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/GridData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data/GridData.cs @@ -1,3 +1,29 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* 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 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 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; diff --git a/OpenGridServices/OpenGrid.Framework.Data/ILogData.cs b/OpenGridServices/OpenGrid.Framework.Data/ILogData.cs index 7c6a2c5..53d0204 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/ILogData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data/ILogData.cs @@ -1,18 +1,69 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* 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 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 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 OpenGrid.Framework.Data { + /// + /// The severity of an individual log message + /// public enum LogSeverity : int { + /// + /// Critical: systems failure + /// CRITICAL = 1, + /// + /// Major: warning prior to systems failure + /// MAJOR = 2, + /// + /// Medium: an individual non-critical task failed + /// MEDIUM = 3, + /// + /// Low: Informational warning + /// LOW = 4, + /// + /// Info: Information + /// INFO = 5, + /// + /// Verbose: Debug Information + /// VERBOSE = 6 } + + /// + /// An interface to a LogData storage system + /// public interface ILogData { void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,string logMessage); diff --git a/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs b/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs index 58597d2..df4f38b 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs +++ b/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs @@ -1,3 +1,29 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* 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 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 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; diff --git a/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs b/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs index b43557d..88e58d6 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs @@ -1,3 +1,29 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* 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 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 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; @@ -5,27 +31,75 @@ using libsecondlife; namespace OpenGrid.Framework.Data { + /// + /// Inventory Item - contains all the properties associated with an individual inventory piece. + /// public class InventoryItemBase { + /// + /// A UUID containing the ID for the inventory item itself + /// public LLUUID inventoryID; + /// + /// The UUID of the associated asset on the asset server + /// public LLUUID assetID; + /// + /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) + /// public int type; + /// + /// The folder this item is contained in (NULL_KEY = Inventory Root) + /// public LLUUID parentFolderID; + /// + /// The owner of this inventory item + /// public LLUUID avatarID; + /// + /// The name of the inventory item (must be less than 64 characters) + /// public string inventoryName; + /// + /// The description of the inventory item (must be less than 64 characters) + /// public string inventoryDescription; + /// + /// A mask containing the permissions for the next owner (cannot be enforced) + /// public uint inventoryNextPermissions; + /// + /// A mask containing permissions for the current owner (cannot be enforced) + /// public uint inventoryCurrentPermissions; } + /// + /// A Class for folders which contain users inventory + /// public class InventoryFolderBase { + /// + /// The name of the folder (64 characters or less) + /// public string name; + /// + /// The agent who's inventory this is contained by + /// public LLUUID agentID; + /// + /// The folder this folder is contained in (NULL_KEY for root) + /// public LLUUID parentID; + /// + /// The UUID for this folder + /// public LLUUID folderID; } + /// + /// An interface for accessing inventory data from a storage server + /// public interface IInventoryData { /// diff --git a/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs b/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs index c66610e..3e65420 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs @@ -1,9 +1,38 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* 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 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 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 OpenGrid.Framework.Data { + /// + /// A class which contains information known to the grid server about a region + /// public class SimProfileData { /// diff --git a/OpenGridServices/OpenGrid.Framework.Data/UserData.cs b/OpenGridServices/OpenGrid.Framework.Data/UserData.cs index 4802c5f..d37ea71 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/UserData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data/UserData.cs @@ -1,3 +1,29 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* 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 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 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; @@ -5,6 +31,9 @@ using libsecondlife; namespace OpenGrid.Framework.Data { + /// + /// An interface for connecting to user storage servers. + /// public interface IUserData { /// diff --git a/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs b/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs index 3f42762..35ebcf3 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs @@ -1,3 +1,29 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* 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 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 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; @@ -5,50 +31,151 @@ using libsecondlife; namespace OpenGrid.Framework.Data { + /// + /// Information about a particular user known to the userserver + /// public class UserProfileData { + /// + /// The ID value for this user + /// public LLUUID UUID; - public string username; // The configurable part of the users username - public string surname; // The users surname (can be used to indicate user class - eg 'Test User' or 'Test Admin') - public string passwordHash; // Hash of the users password - public string passwordSalt; // Salt for the users password + /// + /// The first component of a users account name + /// + public string username; + /// + /// The second component of a users account name + /// + public string surname; - public ulong homeRegion; // RegionHandle of home - public LLVector3 homeLocation; // Home Location inside the sim - public LLVector3 homeLookAt; // Coordinates where the user is looking + /// + /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) + /// + /// This is double MD5'd because the client sends an unsalted MD5 to the loginserver + public string passwordHash; + /// + /// The salt used for the users hash, should be 32 bytes or longer + /// + public string passwordSalt; + /// + /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into + /// + public ulong homeRegion; + /// + /// The coordinates inside the region of the home location + /// + public LLVector3 homeLocation; + /// + /// Where the user will be looking when they rez. + /// + public LLVector3 homeLookAt; - public int created; // UNIX Epoch Timestamp (User Creation) - public int lastLogin; // UNIX Epoch Timestamp (Last Login Time) + /// + /// A UNIX Timestamp (seconds since epoch) for the users creation + /// + public int created; + /// + /// A UNIX Timestamp for the users last login date / time + /// + public int lastLogin; - public string userInventoryURI; // URI to inventory server for this user - public string userAssetURI; // URI to asset server for this user + /// + /// A URI to the users inventory server, used for foreigners and large grids + /// + public string userInventoryURI; + /// + /// A URI to the users asset server, used for foreigners and large grids. + /// + public string userAssetURI; - public uint profileCanDoMask; // Profile window "I can do" mask + /// + /// A uint mask containing the "I can do" fields of the users profile + /// + public uint profileCanDoMask; + /// + /// A uint mask containing the "I want to do" part of the users profile + /// public uint profileWantDoMask; // Profile window "I want to" mask - public string profileAboutText; // My about window text - public string profileFirstText; // First Life Text + /// + /// The about text listed in a users profile. + /// + public string profileAboutText; + /// + /// The first life about text listed in a users profile + /// + public string profileFirstText; - public LLUUID profileImage; // My avatars profile image - public LLUUID profileFirstImage; // First-life image - public UserAgentData currentAgent; // The users last agent + /// + /// The profile image for an avatar stored on the asset server + /// + public LLUUID profileImage; + /// + /// The profile image for the users first life tab + /// + public LLUUID profileFirstImage; + /// + /// The users last registered agent (filled in on the user server) + /// + public UserAgentData currentAgent; } + /// + /// Information about a users session + /// public class UserAgentData { - public LLUUID UUID; // Account ID - public string agentIP; // The IP of the agent - public uint agentPort; // The port of the agent - public bool agentOnline; // The online status of the agent - public LLUUID sessionID; // The session ID for the agent (used by client) - public LLUUID secureSessionID; // The secure session ID for the agent (used by client) - public LLUUID regionID; // The region ID the agent occupies - public int loginTime; // EPOCH based Timestamp - public int logoutTime; // Timestamp or 0 if N/A - public LLUUID currentRegion; // UUID of the users current region - public ulong currentHandle; // RegionHandle of the users current region - public LLVector3 currentPos; // Current position in the region + /// + /// The UUID of the users avatar (not the agent!) + /// + public LLUUID UUID; + /// + /// The IP address of the user + /// + public string agentIP; + /// + /// The port of the user + /// + public uint agentPort; + /// + /// Is the user online? + /// + public bool agentOnline; + /// + /// The session ID for the user (also the agent ID) + /// + public LLUUID sessionID; + /// + /// The "secure" session ID for the user + /// + /// Not very secure. Dont rely on it for anything more than Linden Lab does. + public LLUUID secureSessionID; + /// + /// The region the user logged into initially + /// + public LLUUID regionID; + /// + /// A unix timestamp from when the user logged in + /// + public int loginTime; + /// + /// When this agent expired and logged out, 0 if still online + /// + public int logoutTime; + /// + /// Current region the user is logged into + /// + public LLUUID currentRegion; + /// + /// Region handle of the current region the user is in + /// + public ulong currentHandle; + /// + /// The position of the user within the region + /// + public LLVector3 currentPos; } } -- cgit v1.1