From 08b507517b8dc33f66de1e0815af330bb3c54696 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 2 Jan 2010 18:18:13 -0800 Subject: Test client for remote presence connector, and for the service itself. Connector seems to work well. --- OpenSim/Tests/Clients/Presence/OpenSim.Server.ini | 33 ++++++ OpenSim/Tests/Clients/Presence/PresenceClient.cs | 128 ++++++++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 OpenSim/Tests/Clients/Presence/OpenSim.Server.ini create mode 100644 OpenSim/Tests/Clients/Presence/PresenceClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini b/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini new file mode 100644 index 0000000..47e73f9 --- /dev/null +++ b/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini @@ -0,0 +1,33 @@ +; * Run a ROBUST server shell like this, from bin: +; * $ OpenSim.Server.exe -inifile ../OpenSim/Tests/Clients/Presence/OpenSim.Server.ini +; * +; * Then run this client like this, from bin: +; * $ OpenSim.Tests.Clients.PresenceClient.exe +; * +; * + +[Startup] +ServiceConnectors = "OpenSim.Server.Handlers.dll:PresenceServiceConnector" + +; * This is common for all services, it's the network setup for the entire +; * server instance +; * +[Network] +port = 8003 + +; * The following are for the remote console +; * They have no effect for the local or basic console types +; * Leave commented to diable logins to the console +;ConsoleUser = Test +;ConsolePass = secret + +; * As an example, the below configuration precisely mimicks the legacy +; * asset server. It is read by the asset IN connector (defined above) +; * and it then loads the OUT connector (a local database module). That, +; * in turn, reads the asset loader and database connection information +; * +[PresenceService] + LocalServiceModule = "OpenSim.Services.PresenceService.dll:PresenceService" + StorageProvider = "OpenSim.Data.MySQL.dll" + ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;" + diff --git a/OpenSim/Tests/Clients/Presence/PresenceClient.cs b/OpenSim/Tests/Clients/Presence/PresenceClient.cs new file mode 100644 index 0000000..3416804 --- /dev/null +++ b/OpenSim/Tests/Clients/Presence/PresenceClient.cs @@ -0,0 +1,128 @@ +/* + * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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.Reflection; + +using OpenMetaverse; +using log4net; +using log4net.Appender; +using log4net.Layout; + +using OpenSim.Framework; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors; + +namespace OpenSim.Tests.Clients.PresenceClient +{ + public class PresenceClient + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + public static void Main(string[] args) + { + ConsoleAppender consoleAppender = new ConsoleAppender(); + consoleAppender.Layout = + new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); + log4net.Config.BasicConfigurator.Configure(consoleAppender); + + string serverURI = "http://127.0.0.1:8003"; + PresenceServicesConnector m_Connector = new PresenceServicesConnector(serverURI); + + UUID user1 = UUID.Random(); + UUID session1 = UUID.Random(); + UUID region1 = UUID.Random(); + + bool success = m_Connector.LoginAgent(user1.ToString(), session1, UUID.Zero); + if (success) + m_log.InfoFormat("[PRESENCE CLIENT]: Successfully logged in user {0} with session {1}", user1, session1); + else + m_log.InfoFormat("[PRESENCE CLIENT]: failed to login user {0}", user1); + + System.Console.WriteLine("\n"); + + PresenceInfo pinfo = m_Connector.GetAgent(session1); + if (pinfo == null) + m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0}", user1); + else + m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}", + pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID); + + System.Console.WriteLine("\n"); + success = m_Connector.ReportAgent(session1, region1, new Vector3(128, 128, 128), new Vector3(4, 5, 6)); + if (success) + m_log.InfoFormat("[PRESENCE CLIENT]: Successfully reported session {0} in region {1}", user1, region1); + else + m_log.InfoFormat("[PRESENCE CLIENT]: failed to report session {0}", session1); + pinfo = m_Connector.GetAgent(session1); + if (pinfo == null) + m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for second time", user1); + else + m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}", + pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID); + + System.Console.WriteLine("\n"); + success = m_Connector.SetHomeLocation(user1.ToString(), region1, new Vector3(128, 128, 128), new Vector3(4, 5, 6)); + if (success) + m_log.InfoFormat("[PRESENCE CLIENT]: Successfully set home for user {0} in region {1}", user1, region1); + else + m_log.InfoFormat("[PRESENCE CLIENT]: failed to set home for user {0}", user1); + pinfo = m_Connector.GetAgent(session1); + if (pinfo == null) + m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for third time", user1); + else + m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}", + pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID); + + System.Console.WriteLine("\n"); + success = m_Connector.LogoutAgent(session1); + if (success) + m_log.InfoFormat("[PRESENCE CLIENT]: Successfully logged out user {0}", user1); + else + m_log.InfoFormat("[PRESENCE CLIENT]: failed to logout user {0}", user1); + pinfo = m_Connector.GetAgent(session1); + if (pinfo == null) + m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for fourth time", user1); + else + m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}", + pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID); + + System.Console.WriteLine("\n"); + success = m_Connector.ReportAgent(session1, UUID.Random(), Vector3.Zero, Vector3.Zero); + if (success) + m_log.InfoFormat("[PRESENCE CLIENT]: Report agent succeeded, but this is wrong"); + else + m_log.InfoFormat("[PRESENCE CLIENT]: failed to report agent, as it should because user is not logged in"); + + } + + } +} -- cgit v1.1 From 8bed461957c38fb90a65a148d3f3791e9e0222f8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 2 Jan 2010 20:16:21 -0800 Subject: Test client for remote user account connector and service. It seems to be working. --- .../Tests/Clients/UserAccounts/OpenSim.Server.ini | 33 ++++++ .../Clients/UserAccounts/UserAccountsClient.cs | 120 +++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini create mode 100644 OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini b/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini new file mode 100644 index 0000000..eb1f473 --- /dev/null +++ b/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini @@ -0,0 +1,33 @@ +; * Run a ROBUST server shell like this, from bin: +; * $ OpenSim.Server.exe -inifile ../OpenSim/Tests/Clients/Presence/OpenSim.Server.ini +; * +; * Then run this client like this, from bin: +; * $ OpenSim.Tests.Clients.UserAccountClient.exe +; * +; * + +[Startup] +ServiceConnectors = "OpenSim.Server.Handlers.dll:UserAccountServiceConnector" + +; * This is common for all services, it's the network setup for the entire +; * server instance +; * +[Network] +port = 8003 + +; * The following are for the remote console +; * They have no effect for the local or basic console types +; * Leave commented to diable logins to the console +;ConsoleUser = Test +;ConsolePass = secret + +; * As an example, the below configuration precisely mimicks the legacy +; * asset server. It is read by the asset IN connector (defined above) +; * and it then loads the OUT connector (a local database module). That, +; * in turn, reads the asset loader and database connection information +; * +[UserAccountService] + LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" + StorageProvider = "OpenSim.Data.MySQL.dll" + ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;" + diff --git a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs b/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs new file mode 100644 index 0000000..56195b1 --- /dev/null +++ b/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs @@ -0,0 +1,120 @@ +/* + * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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.Reflection; + +using OpenMetaverse; +using log4net; +using log4net.Appender; +using log4net.Layout; + +using OpenSim.Framework; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors; + +namespace OpenSim.Tests.Clients.PresenceClient +{ + public class UserAccountsClient + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + public static void Main(string[] args) + { + ConsoleAppender consoleAppender = new ConsoleAppender(); + consoleAppender.Layout = + new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); + log4net.Config.BasicConfigurator.Configure(consoleAppender); + + string serverURI = "http://127.0.0.1:8003"; + UserAccountServicesConnector m_Connector = new UserAccountServicesConnector(serverURI); + + UUID user1 = UUID.Random(); + string first = "Completely"; + string last = "Clueless"; + string email = "foo@bar.com"; + + UserAccount account = new UserAccount(user1); + account.FirstName = first; + account.LastName = last; + account.Email = email; + account.ServiceURLs = new Dictionary(); + account.ServiceURLs.Add("InventoryServerURI", "http://cnn.com"); + account.ServiceURLs.Add("AssetServerURI", "http://cnn.com"); + + bool success = m_Connector.StoreUserAccount(account); + if (success) + m_log.InfoFormat("[USER CLIENT]: Successfully created account for user {0} {1}", account.FirstName, account.LastName); + else + m_log.InfoFormat("[USER CLIENT]: failed to create user {0} {1}", account.FirstName, account.LastName); + + System.Console.WriteLine("\n"); + + account = m_Connector.GetUserAccount(UUID.Zero, user1); + if (account == null) + m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); + else + { + m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", + account.PrincipalID, account.FirstName, account.LastName, account.Email); + foreach (KeyValuePair kvp in account.ServiceURLs) + m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); + } + + System.Console.WriteLine("\n"); + + account = m_Connector.GetUserAccount(UUID.Zero, first, last); + if (account == null) + m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by name for {0}", user1); + else + { + m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", + account.PrincipalID, account.FirstName, account.LastName, account.Email); + foreach (KeyValuePair kvp in account.ServiceURLs) + m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); + } + + System.Console.WriteLine("\n"); + account = m_Connector.GetUserAccount(UUID.Zero, email); + if (account == null) + m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by email for {0}", user1); + else + { + m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", + account.PrincipalID, account.FirstName, account.LastName, account.Email); + foreach (KeyValuePair kvp in account.ServiceURLs) + m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); + } + + } + + } +} -- cgit v1.1 From b63405c1a796b44b58081857d01f726372467628 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 8 Jan 2010 10:43:34 -0800 Subject: Inching ahead... This compiles, but very likely does not run. --- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index b13e8dd..dbb8fd4 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -194,8 +194,6 @@ namespace OpenSim.Tests.Common.Setup m_inventoryService.PostInitialise(); m_assetService.PostInitialise(); - testScene.CommsManager.UserService.SetInventoryService(testScene.InventoryService); - testScene.SetModuleInterfaces(); testScene.LandChannel = new TestLandChannel(testScene); -- cgit v1.1 From 1e1b2ab221851efc414678b7ea52ef2ca788ce9f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 10:40:07 -0800 Subject: * OMG! All but one references to UserProfileCacheService have been rerouted! * HG is seriously broken here * Compiles. Untested. --- OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 147 +++++++++++---------- 1 file changed, 75 insertions(+), 72 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index cb76bc1..b54299b 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs @@ -37,82 +37,85 @@ namespace OpenSim.Tests.Common.Setup /// public static class UserProfileTestUtils { - /// - /// Create a test user with a standard inventory - /// - /// - /// - /// Callback to invoke when inventory has been loaded. This is required because - /// loading may be asynchronous, even on standalone - /// - /// - public static CachedUserInfo CreateUserWithInventory( - CommunicationsManager commsManager, OnInventoryReceivedDelegate callback) - { - UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); - return CreateUserWithInventory(commsManager, userId, callback); - } + // REFACTORING PROBLEM + // This needs to be rewritten + + ///// + ///// Create a test user with a standard inventory + ///// + ///// + ///// + ///// Callback to invoke when inventory has been loaded. This is required because + ///// loading may be asynchronous, even on standalone + ///// + ///// + //public static CachedUserInfo CreateUserWithInventory( + // CommunicationsManager commsManager, OnInventoryReceivedDelegate callback) + //{ + // UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); + // return CreateUserWithInventory(commsManager, userId, callback); + //} - /// - /// Create a test user with a standard inventory - /// - /// - /// User ID - /// - /// Callback to invoke when inventory has been loaded. This is required because - /// loading may be asynchronous, even on standalone - /// - /// - public static CachedUserInfo CreateUserWithInventory( - CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback) - { - return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback); - } + ///// + ///// Create a test user with a standard inventory + ///// + ///// + ///// User ID + ///// + ///// Callback to invoke when inventory has been loaded. This is required because + ///// loading may be asynchronous, even on standalone + ///// + ///// + //public static CachedUserInfo CreateUserWithInventory( + // CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback) + //{ + // return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback); + //} - /// - /// Create a test user with a standard inventory - /// - /// - /// First name of user - /// Last name of user - /// User ID - /// - /// Callback to invoke when inventory has been loaded. This is required because - /// loading may be asynchronous, even on standalone - /// - /// - public static CachedUserInfo CreateUserWithInventory( - CommunicationsManager commsManager, string firstName, string lastName, - UUID userId, OnInventoryReceivedDelegate callback) - { - return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback); - } + ///// + ///// Create a test user with a standard inventory + ///// + ///// + ///// First name of user + ///// Last name of user + ///// User ID + ///// + ///// Callback to invoke when inventory has been loaded. This is required because + ///// loading may be asynchronous, even on standalone + ///// + ///// + //public static CachedUserInfo CreateUserWithInventory( + // CommunicationsManager commsManager, string firstName, string lastName, + // UUID userId, OnInventoryReceivedDelegate callback) + //{ + // return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback); + //} - /// - /// Create a test user with a standard inventory - /// - /// - /// First name of user - /// Last name of user - /// Password - /// User ID - /// - /// Callback to invoke when inventory has been loaded. This is required because - /// loading may be asynchronous, even on standalone - /// - /// - public static CachedUserInfo CreateUserWithInventory( - CommunicationsManager commsManager, string firstName, string lastName, string password, - UUID userId, OnInventoryReceivedDelegate callback) - { - LocalUserServices lus = (LocalUserServices)commsManager.UserService; - lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId); + ///// + ///// Create a test user with a standard inventory + ///// + ///// + ///// First name of user + ///// Last name of user + ///// Password + ///// User ID + ///// + ///// Callback to invoke when inventory has been loaded. This is required because + ///// loading may be asynchronous, even on standalone + ///// + ///// + //public static CachedUserInfo CreateUserWithInventory( + // CommunicationsManager commsManager, string firstName, string lastName, string password, + // UUID userId, OnInventoryReceivedDelegate callback) + //{ + // LocalUserServices lus = (LocalUserServices)commsManager.UserService; + // lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId); - CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); - userInfo.OnInventoryReceived += callback; - userInfo.FetchInventory(); + // CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); + // userInfo.OnInventoryReceived += callback; + // userInfo.FetchInventory(); - return userInfo; - } + // return userInfo; + //} } } -- cgit v1.1 From 4dd523b45d1e635c66eb4e556764fabe29dbfc58 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 15:34:56 -0800 Subject: * Changed IPresenceService Logout, so that it takes a position and a lookat * CommsManager.AvatarService rerouted --- OpenSim/Tests/Clients/Presence/PresenceClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Presence/PresenceClient.cs b/OpenSim/Tests/Clients/Presence/PresenceClient.cs index 3416804..4f959f6 100644 --- a/OpenSim/Tests/Clients/Presence/PresenceClient.cs +++ b/OpenSim/Tests/Clients/Presence/PresenceClient.cs @@ -103,7 +103,7 @@ namespace OpenSim.Tests.Clients.PresenceClient pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID); System.Console.WriteLine("\n"); - success = m_Connector.LogoutAgent(session1); + success = m_Connector.LogoutAgent(session1, Vector3.Zero, Vector3.UnitY); if (success) m_log.InfoFormat("[PRESENCE CLIENT]: Successfully logged out user {0}", user1); else -- cgit v1.1 From 0c2946031bccf75c28968b6adcde5cce5bc45c13 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 19:42:36 -0800 Subject: CommunicationsManager is practically empty. Only NetworkServersInfo is there. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 013462e..fccc282 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -62,8 +62,6 @@ namespace OpenSim.Tests.Common.Mock lus.AddPlugin(new TemporaryUserProfilePlugin()); m_userDataPlugin = new TestUserDataPlugin(); lus.AddPlugin(m_userDataPlugin); - m_userService = lus; - m_userAdminService = lus; } } -- cgit v1.1 From cddd48aeeaee98d14fd4ae887cdf32abc6110c40 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 21:00:03 -0800 Subject: Some more unnecessary things deleted in Framework.Communications. --- OpenSim/Tests/Common/Mock/MockUserService.cs | 149 --------------------- .../Tests/Common/Mock/TestCommunicationsManager.cs | 5 - 2 files changed, 154 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/MockUserService.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockUserService.cs b/OpenSim/Tests/Common/Mock/MockUserService.cs deleted file mode 100644 index 396ef25..0000000 --- a/OpenSim/Tests/Common/Mock/MockUserService.cs +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; -using OpenSim.Services.Interfaces; - -namespace OpenSim.Tests.Common -{ - public class MockUserService : IUserService - { - public void AddTemporaryUserProfile(UserProfileData userProfile) - { - throw new NotImplementedException(); - } - - public UserProfileData GetUserProfile(string firstName, string lastName) - { - throw new NotImplementedException(); - } - - public UserProfileData GetUserProfile(UUID userId) - { - throw new NotImplementedException(); - } - - public UserProfileData GetUserProfile(Uri uri) - { - UserProfileData userProfile = new UserProfileData(); - -// userProfile.ID = new UUID(Util.GetHashGuid(uri.ToString(), AssetCache.AssetInfo.Secret)); - - return userProfile; - } - - public Uri GetUserUri(UserProfileData userProfile) - { - throw new NotImplementedException(); - } - - public UserAgentData GetAgentByUUID(UUID userId) - { - throw new NotImplementedException(); - } - - public void ClearUserAgent(UUID avatarID) - { - throw new NotImplementedException(); - } - - public List GenerateAgentPickerRequestResponse(UUID QueryID, string Query) - { - throw new NotImplementedException(); - } - - public UserProfileData SetupMasterUser(string firstName, string lastName) - { - throw new NotImplementedException(); - } - - public UserProfileData SetupMasterUser(string firstName, string lastName, string password) - { - throw new NotImplementedException(); - } - - public UserProfileData SetupMasterUser(UUID userId) - { - throw new NotImplementedException(); - } - - public bool UpdateUserProfile(UserProfileData data) - { - throw new NotImplementedException(); - } - - public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) - { - throw new NotImplementedException(); - } - - public void RemoveUserFriend(UUID friendlistowner, UUID friend) - { - throw new NotImplementedException(); - } - - public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) - { - throw new NotImplementedException(); - } - - public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat) - { - throw new NotImplementedException(); - } - - public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz) - { - throw new NotImplementedException(); - } - - public List GetUserFriendList(UUID friendlistowner) - { - throw new NotImplementedException(); - } - - public bool VerifySession(UUID userID, UUID sessionID) - { - return true; - } - - public void SetInventoryService(IInventoryService inv) - { - throw new NotImplementedException(); - } - - public virtual bool AuthenticateUserByPassword(UUID userID, string password) - { - throw new NotImplementedException(); - } - } -} diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index fccc282..d4cdcd6 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -58,11 +58,6 @@ namespace OpenSim.Tests.Common.Mock : base(serversInfo, null) { - LocalUserServices lus = new LocalUserServices(991, 992, this); - lus.AddPlugin(new TemporaryUserProfilePlugin()); - m_userDataPlugin = new TestUserDataPlugin(); - lus.AddPlugin(m_userDataPlugin); - } } } -- cgit v1.1 From 751e70af788bf27fa0401c25d899f73186c8eafa Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 21:37:36 -0800 Subject: NetworkServersInfo removed from CommsManager. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 1 - OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 1 - 2 files changed, 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index d4cdcd6..8e193c1 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -30,7 +30,6 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Region.Communications.Local; using OpenSim.Data; namespace OpenSim.Tests.Common.Mock diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index b54299b..24ad3eb 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs @@ -28,7 +28,6 @@ using OpenMetaverse; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; -using OpenSim.Region.Communications.Local; namespace OpenSim.Tests.Common.Setup { -- cgit v1.1 From 001d3695683d9511446d194feeb763c437170028 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 07:45:47 -0800 Subject: CommunicationsManager deleted. --- .../Tests/Common/Mock/TestCommunicationsManager.cs | 62 --------------------- OpenSim/Tests/Common/Mock/TestScene.cs | 4 +- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 64 +++++++++++----------- 3 files changed, 35 insertions(+), 95 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs deleted file mode 100644 index 8e193c1..0000000 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; -using OpenSim.Framework.Servers; -using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Data; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestCommunicationsManager : CommunicationsManager - { - public IUserDataPlugin UserDataPlugin - { - get { return m_userDataPlugin; } - } - private IUserDataPlugin m_userDataPlugin; - - // public IInventoryDataPlugin InventoryDataPlugin - // { - // get { return m_inventoryDataPlugin; } - // } - // private IInventoryDataPlugin m_inventoryDataPlugin; - - public TestCommunicationsManager() - : this(null) - { - } - - public TestCommunicationsManager(NetworkServersInfo serversInfo) - : base(serversInfo, null) - { - - } - } -} diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 22cfa2c..bf3825b 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -40,10 +40,10 @@ namespace OpenSim.Tests.Common.Mock { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, - CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager, + SceneCommunicationService sceneGridService, StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, commsMan, sceneGridService, storeManager, moduleLoader, + : base(regInfo, authen, sceneGridService, storeManager, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index dbb8fd4..f6c9f3b 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -60,7 +60,6 @@ namespace OpenSim.Tests.Common.Setup private static ISharedRegionModule m_assetService = null; private static ISharedRegionModule m_inventoryService = null; private static ISharedRegionModule m_gridService = null; - private static TestCommunicationsManager commsManager = null; /// /// Set up a test scene @@ -83,21 +82,23 @@ namespace OpenSim.Tests.Common.Setup public static TestScene SetupScene(String realServices) { return SetupScene( - "Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager(), realServices); + "Unit test region", UUID.Random(), 1000, 1000, realServices); } - /// - /// Set up a test scene - /// - /// - /// Starts real inventory and asset services, as opposed to mock ones, if true - /// This should be the same if simulating two scenes within a standalone - /// - public static TestScene SetupScene(TestCommunicationsManager cm, String realServices) - { - return SetupScene( - "Unit test region", UUID.Random(), 1000, 1000, cm, ""); - } + // REFACTORING PROBLEM. No idea what the difference is with the previous one + ///// + ///// Set up a test scene + ///// + ///// + ///// Starts real inventory and asset services, as opposed to mock ones, if true + ///// This should be the same if simulating two scenes within a standalone + ///// + //public static TestScene SetupScene(String realServices) + //{ + // return SetupScene( + // "Unit test region", UUID.Random(), 1000, 1000, ""); + //} + /// /// Set up a test scene /// @@ -107,9 +108,9 @@ namespace OpenSim.Tests.Common.Setup /// Y co-ordinate of the region /// This should be the same if simulating two scenes within a standalone /// - public static TestScene SetupScene(string name, UUID id, uint x, uint y, TestCommunicationsManager cm) + public static TestScene SetupScene(string name, UUID id, uint x, uint y) { - return SetupScene(name, id, x, y, cm, ""); + return SetupScene(name, id, x, y,""); } @@ -125,23 +126,24 @@ namespace OpenSim.Tests.Common.Setup /// Starts real inventory and asset services, as opposed to mock ones, if true /// public static TestScene SetupScene( - string name, UUID id, uint x, uint y, TestCommunicationsManager cm, String realServices) + string name, UUID id, uint x, uint y, String realServices) { bool newScene = false; Console.WriteLine("Setting up test scene {0}", name); - - // If cm is the same as our last commsManager used, this means the tester wants to link - // regions. In this case, don't use the sameshared region modules and dont initialize them again. - // Also, no need to start another MainServer and MainConsole instance. - if (cm == null || cm != commsManager) - { - System.Console.WriteLine("Starting a brand new scene"); - newScene = true; - MainConsole.Instance = new LocalConsole("TEST PROMPT"); - MainServer.Instance = new BaseHttpServer(980); - commsManager = cm; - } + + // REFACTORING PROBLEM! + //// If cm is the same as our last commsManager used, this means the tester wants to link + //// regions. In this case, don't use the sameshared region modules and dont initialize them again. + //// Also, no need to start another MainServer and MainConsole instance. + //if (cm == null || cm != commsManager) + //{ + // System.Console.WriteLine("Starting a brand new scene"); + // newScene = true; + // MainConsole.Instance = new LocalConsole("TEST PROMPT"); + // MainServer.Instance = new BaseHttpServer(980); + // commsManager = cm; + //} // We must set up a console otherwise setup of some modules may fail RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); @@ -149,13 +151,13 @@ namespace OpenSim.Tests.Common.Setup regInfo.RegionID = id; AgentCircuitManager acm = new AgentCircuitManager(); - SceneCommunicationService scs = new SceneCommunicationService(cm); + SceneCommunicationService scs = new SceneCommunicationService(); StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", ""); IConfigSource configSource = new IniConfigSource(); TestScene testScene = new TestScene( - regInfo, acm, cm, scs, sm, null, false, false, false, configSource, null); + regInfo, acm, scs, sm, null, false, false, false, configSource, null); INonSharedRegionModule capsModule = new CapabilitiesModule(); capsModule.Initialise(new IniConfigSource()); -- cgit v1.1 From c5ea783526611a968400a1936e4c6764ee1c7013 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 07:51:33 -0800 Subject: OpenSim/Framework/Communications/Cache deleted. LibraryRootFolder deleted. --- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 2 +- OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index bf3825b..85031f7 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -29,7 +29,7 @@ using System; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; + using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Scenes; diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index f6c9f3b..e37e137 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -32,7 +32,7 @@ using Nini.Config; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; + using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index 24ad3eb..cd61fa6 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs @@ -27,7 +27,7 @@ using OpenMetaverse; using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; + namespace OpenSim.Tests.Common.Setup { -- cgit v1.1 From 04e29c1bacbc1e2df980ae15896a847ce7535da2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 16 Jan 2010 21:42:44 -0800 Subject: Beginning of rewriting HG. Compiles, and runs, but HG functions not restored yet. --- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 85031f7..076cb7a 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common.Mock /// /// /// - public override bool AuthenticateUser(AgentCircuitData agent, out string reason) + public override bool VerifyUserPresence(AgentCircuitData agent, out string reason) { reason = String.Empty; return true; -- cgit v1.1 From 5001f61c08fea2ebfcb2590be69073d04d129d70 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 29 Jan 2010 18:59:41 -0800 Subject: * HGGridConnector is no longer necessary. * Handle logout properly. This needed an addition to IClientAPI, because of how the logout packet is currently being handled -- the agent is being removed from the scene before the different event handlers are executed, which is broken. --- OpenSim/Tests/Common/Mock/TestClient.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 8b79502..0e32950 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -365,7 +365,11 @@ namespace OpenSim.Tests.Common.Mock get { return true; } set { } } - + public bool IsLoggingOut + { + get { return false; } + set { } + } public UUID ActiveGroupId { get { return UUID.Zero; } @@ -1194,14 +1198,14 @@ namespace OpenSim.Tests.Common.Mock public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } -- cgit v1.1 From 9821c4f566e11c75c8d87721777480c5b2e2bd4e Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 14 Feb 2010 15:41:57 -0600 Subject: Revolution is on the roll again! :) Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events). Direct flames and kudos to Revolution, please Signed-off-by: Melanie --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b5eaf43..7dab6a1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -206,6 +206,8 @@ namespace OpenSim.Tests.Common.Mock public event ObjectBuy OnObjectBuy; public event BuyObjectInventory OnBuyObjectInventory; public event AgentSit OnUndo; + public event AgentSit OnRedo; + public event LandUndo OnLandUndo; public event ForceReleaseControls OnForceReleaseControls; -- cgit v1.1 From bb171717ceaef37b022a135209c2e0bf031d21f9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 21 Feb 2010 15:38:52 -0800 Subject: Deleted obsolete files in the Data layer. Compiles. --- OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 216 ------------------------ 1 file changed, 216 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs deleted file mode 100644 index 5188cf6..0000000 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Data; - -namespace OpenSim.Tests.Common.Mock -{ - /// - /// In memory user data provider. Might be quite useful as a proper user data plugin, though getting mono addins - /// to load any plugins when running unit tests has proven impossible so far. Currently no locking since unit - /// tests are single threaded. - /// - public class TestUserDataPlugin : IUserDataPlugin - { - public string Version { get { return "0"; } } - public string Name { get { return "TestUserDataPlugin"; } } - - /// - /// User profiles keyed by name - /// - private Dictionary m_userProfilesByName = new Dictionary(); - - /// - /// User profiles keyed by uuid - /// - private Dictionary m_userProfilesByUuid = new Dictionary(); - - /// - /// User profiles and their agents - /// - private Dictionary m_agentByProfileUuid = new Dictionary(); - - /// - /// Friends list by uuid - /// - private Dictionary> m_friendsListByUuid = new Dictionary>(); - - public void Initialise() {} - public void Dispose() {} - - public void AddTemporaryUserProfile(UserProfileData userProfile) - { - // Not interested - } - - public void AddNewUserProfile(UserProfileData user) - { - UpdateUserProfile(user); - } - - public UserProfileData GetUserByUUID(UUID user) - { - UserProfileData userProfile = null; - m_userProfilesByUuid.TryGetValue(user, out userProfile); - - return userProfile; - } - - public UserProfileData GetUserByName(string fname, string lname) - { - UserProfileData userProfile = null; - m_userProfilesByName.TryGetValue(fname + " " + lname, out userProfile); - - return userProfile; - } - - public UserProfileData GetUserByUri(Uri uri) { return null; } - - public bool UpdateUserProfile(UserProfileData user) - { - m_userProfilesByUuid[user.ID] = user; - m_userProfilesByName[user.FirstName + " " + user.SurName] = user; - - return true; - } - - public List GeneratePickerResults(UUID queryID, string query) { return null; } - - public UserAgentData GetAgentByUUID(UUID user) - { - UserAgentData userAgent = null; - m_agentByProfileUuid.TryGetValue(user, out userAgent); - - return userAgent; - } - - public UserAgentData GetAgentByName(string name) - { - UserProfileData userProfile = null; - m_userProfilesByName.TryGetValue(name, out userProfile); - UserAgentData userAgent = null; - m_agentByProfileUuid.TryGetValue(userProfile.ID, out userAgent); - - return userAgent; - } - - public UserAgentData GetAgentByName(string fname, string lname) - { - UserProfileData userProfile = GetUserByName(fname,lname); - UserAgentData userAgent = null; - m_agentByProfileUuid.TryGetValue(userProfile.ID, out userAgent); - - return userAgent; - } - - public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) {} - - public void AddNewUserAgent(UserAgentData agent) - { - m_agentByProfileUuid[agent.ProfileID] = agent; - } - public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) - { - FriendListItem newfriend = new FriendListItem(); - newfriend.FriendPerms = perms; - newfriend.Friend = friend; - newfriend.FriendListOwner = friendlistowner; - - if (!m_friendsListByUuid.ContainsKey(friendlistowner)) - { - List friendslist = new List(); - m_friendsListByUuid[friendlistowner] = friendslist; - - } - m_friendsListByUuid[friendlistowner].Add(newfriend); - } - - public void RemoveUserFriend(UUID friendlistowner, UUID friend) - { - if (m_friendsListByUuid.ContainsKey(friendlistowner)) - { - List friendslist = m_friendsListByUuid[friendlistowner]; - foreach (FriendListItem frienditem in friendslist) - { - if (frienditem.Friend == friend) - { - friendslist.Remove(frienditem); - break; - } - } - } - } - - public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) - { - if (m_friendsListByUuid.ContainsKey(friendlistowner)) - { - List friendslist = m_friendsListByUuid[friendlistowner]; - foreach (FriendListItem frienditem in friendslist) - { - if (frienditem.Friend == friend) - { - frienditem.FriendPerms = perms; - break; - } - } - } - } - - public List GetUserFriendList(UUID friendlistowner) - { - if (m_friendsListByUuid.ContainsKey(friendlistowner)) - { - return m_friendsListByUuid[friendlistowner]; - } - else - return new List(); - - - } - - public Dictionary GetFriendRegionInfos(List uuids) { return null; } - - public bool MoneyTransferRequest(UUID from, UUID to, uint amount) { return false; } - - public bool InventoryTransferRequest(UUID from, UUID to, UUID inventory) { return false; } - - public void Initialise(string connect) { return; } - - public AvatarAppearance GetUserAppearance(UUID user) { return null; } - - public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) {} - - public void ResetAttachments(UUID userID) {} - - public void LogoutUsers(UUID regionID) {} - } -} -- cgit v1.1 From 2e7aa387f7a705079df4b534978c0f134591eea9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 21 Feb 2010 19:11:48 -0800 Subject: One more test running. --- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index e37e137..9e718f6 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -45,6 +45,7 @@ using OpenSim.Region.CoreModules.Avatar.Gods; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; using OpenSim.Services.Interfaces; using OpenSim.Tests.Common.Mock; @@ -60,6 +61,7 @@ namespace OpenSim.Tests.Common.Setup private static ISharedRegionModule m_assetService = null; private static ISharedRegionModule m_inventoryService = null; private static ISharedRegionModule m_gridService = null; + private static ISharedRegionModule m_userAccountService = null; /// /// Set up a test scene @@ -183,6 +185,8 @@ namespace OpenSim.Tests.Common.Setup StartInventoryService(testScene, false); if (realServices.Contains("grid")) StartGridService(testScene, true); + if (realServices.Contains("useraccounts")) + StartUserAccountService(testScene, true); } // If not, make sure the shared module gets references to this new scene @@ -269,6 +273,28 @@ namespace OpenSim.Tests.Common.Setup //testScene.AddRegionModule(m_gridService.Name, m_gridService); } + private static void StartUserAccountService(Scene testScene, bool real) + { + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.AddConfig("UserAccountService"); + config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector"); + config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); + if (real) + config.Configs["UserAccountService"].Set("LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService"); + if (m_userAccountService == null) + { + ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector(); + userAccountService.Initialise(config); + m_userAccountService = userAccountService; + } + //else + // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService"); + m_userAccountService.AddRegion(testScene); + m_userAccountService.RegionLoaded(testScene); + //testScene.AddRegionModule(m_gridService.Name, m_gridService); + } + /// /// Setup modules for a scene using their default settings. -- cgit v1.1 From 7665aad002ef066fc31fa9497225d2668641c769 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 22 Feb 2010 13:27:17 -0800 Subject: * Adds CreatorID to asset metadata. This is just the plumbing to support CreatorID, it doesn't modify database backends or OAR files to support storing/loading it --- OpenSim/Tests/Common/Setup/AssetHelpers.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs index 1188b62..98de514 100644 --- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs +++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs @@ -38,12 +38,9 @@ namespace OpenSim.Tests.Common /// /// Create an asset from the given data /// - /// - /// - /// - public static AssetBase CreateAsset(UUID assetUuid, string data) + public static AssetBase CreateAsset(UUID assetUuid, string data, UUID creatorID) { - AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object); + AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object, creatorID); asset.Data = Encoding.ASCII.GetBytes(data); return asset; } @@ -56,7 +53,7 @@ namespace OpenSim.Tests.Common /// public static AssetBase CreateAsset(UUID assetUuid, SceneObjectGroup sog) { - AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object); + AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object, sog.OwnerID); asset.Data = Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(sog)); return asset; } -- cgit v1.1 From df76e95aa2dc9f3f3a0c546761b7624adc183ed0 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 22 Feb 2010 14:18:59 -0800 Subject: Changed asset CreatorID to a string --- OpenSim/Tests/Common/Setup/AssetHelpers.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs index 98de514..1fc3cb5 100644 --- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs +++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs @@ -40,7 +40,7 @@ namespace OpenSim.Tests.Common /// public static AssetBase CreateAsset(UUID assetUuid, string data, UUID creatorID) { - AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object, creatorID); + AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object, creatorID.ToString()); asset.Data = Encoding.ASCII.GetBytes(data); return asset; } @@ -53,7 +53,7 @@ namespace OpenSim.Tests.Common /// public static AssetBase CreateAsset(UUID assetUuid, SceneObjectGroup sog) { - AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object, sog.OwnerID); + AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object, sog.OwnerID.ToString()); asset.Data = Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(sog)); return asset; } -- cgit v1.1 From 5c5966545d14de43500b95109e8ce81058ebe2c3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 28 Feb 2010 12:07:38 -0800 Subject: Initial Online friends notification seems to be working reliably now. All this needs more testing, but everything is there. --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 873b3ac..803b352 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -95,7 +95,7 @@ namespace OpenSim.Tests.Common.Mock public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; public event GenericCall2 OnRequestWearables; - public event GenericCall2 OnCompleteMovementToRegion; + public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnAgentUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; @@ -453,7 +453,7 @@ namespace OpenSim.Tests.Common.Mock public void CompleteMovement() { - OnCompleteMovementToRegion(); + OnCompleteMovementToRegion(this); } public virtual void ActivateGesture(UUID assetId, UUID gestureId) @@ -752,7 +752,7 @@ namespace OpenSim.Tests.Common.Mock if (OnCompleteMovementToRegion != null) { - OnCompleteMovementToRegion(); + OnCompleteMovementToRegion(this); } } public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) -- cgit v1.1 From 44e7224b86dbcd369ce2569328e3b00fc3b209ab Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 28 Feb 2010 22:47:31 +0000 Subject: Add missing ChangeUserRights packet sender --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 803b352..c424183 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1209,5 +1209,9 @@ namespace OpenSim.Tests.Common.Mock public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) { } + + public void SendChangeUserRights(UUID friendID, int rights) + { + } } } -- cgit v1.1 From 86c621fdc77fadb898cf53578e83746cd8f8711b Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 28 Feb 2010 22:56:31 +0000 Subject: Change the signature of SendChangeUserRights, because we have to send this to both parties --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c424183..6403c1b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1210,7 +1210,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendChangeUserRights(UUID friendID, int rights) + public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) { } } -- cgit v1.1