mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
* OMG! All but one references to UserProfileCacheService have been rerouted!
* HG is seriously broken here * Compiles. Untested.
This commit is contained in:
@@ -37,82 +37,85 @@ namespace OpenSim.Tests.Common.Setup
|
||||
/// </summary>
|
||||
public static class UserProfileTestUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a test user with a standard inventory
|
||||
/// </summary>
|
||||
/// <param name="commsManager"></param>
|
||||
/// <param name="callback">
|
||||
/// Callback to invoke when inventory has been loaded. This is required because
|
||||
/// loading may be asynchronous, even on standalone
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
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
|
||||
|
||||
///// <summary>
|
||||
///// Create a test user with a standard inventory
|
||||
///// </summary>
|
||||
///// <param name="commsManager"></param>
|
||||
///// <param name="callback">
|
||||
///// Callback to invoke when inventory has been loaded. This is required because
|
||||
///// loading may be asynchronous, even on standalone
|
||||
///// </param>
|
||||
///// <returns></returns>
|
||||
//public static CachedUserInfo CreateUserWithInventory(
|
||||
// CommunicationsManager commsManager, OnInventoryReceivedDelegate callback)
|
||||
//{
|
||||
// UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099");
|
||||
// return CreateUserWithInventory(commsManager, userId, callback);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Create a test user with a standard inventory
|
||||
/// </summary>
|
||||
/// <param name="commsManager"></param>
|
||||
/// <param name="userId">User ID</param>
|
||||
/// <param name="callback">
|
||||
/// Callback to invoke when inventory has been loaded. This is required because
|
||||
/// loading may be asynchronous, even on standalone
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public static CachedUserInfo CreateUserWithInventory(
|
||||
CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback)
|
||||
{
|
||||
return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback);
|
||||
}
|
||||
///// <summary>
|
||||
///// Create a test user with a standard inventory
|
||||
///// </summary>
|
||||
///// <param name="commsManager"></param>
|
||||
///// <param name="userId">User ID</param>
|
||||
///// <param name="callback">
|
||||
///// Callback to invoke when inventory has been loaded. This is required because
|
||||
///// loading may be asynchronous, even on standalone
|
||||
///// </param>
|
||||
///// <returns></returns>
|
||||
//public static CachedUserInfo CreateUserWithInventory(
|
||||
// CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback)
|
||||
//{
|
||||
// return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Create a test user with a standard inventory
|
||||
/// </summary>
|
||||
/// <param name="commsManager"></param>
|
||||
/// <param name="firstName">First name of user</param>
|
||||
/// <param name="lastName">Last name of user</param>
|
||||
/// <param name="userId">User ID</param>
|
||||
/// <param name="callback">
|
||||
/// Callback to invoke when inventory has been loaded. This is required because
|
||||
/// loading may be asynchronous, even on standalone
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public static CachedUserInfo CreateUserWithInventory(
|
||||
CommunicationsManager commsManager, string firstName, string lastName,
|
||||
UUID userId, OnInventoryReceivedDelegate callback)
|
||||
{
|
||||
return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback);
|
||||
}
|
||||
///// <summary>
|
||||
///// Create a test user with a standard inventory
|
||||
///// </summary>
|
||||
///// <param name="commsManager"></param>
|
||||
///// <param name="firstName">First name of user</param>
|
||||
///// <param name="lastName">Last name of user</param>
|
||||
///// <param name="userId">User ID</param>
|
||||
///// <param name="callback">
|
||||
///// Callback to invoke when inventory has been loaded. This is required because
|
||||
///// loading may be asynchronous, even on standalone
|
||||
///// </param>
|
||||
///// <returns></returns>
|
||||
//public static CachedUserInfo CreateUserWithInventory(
|
||||
// CommunicationsManager commsManager, string firstName, string lastName,
|
||||
// UUID userId, OnInventoryReceivedDelegate callback)
|
||||
//{
|
||||
// return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Create a test user with a standard inventory
|
||||
/// </summary>
|
||||
/// <param name="commsManager"></param>
|
||||
/// <param name="firstName">First name of user</param>
|
||||
/// <param name="lastName">Last name of user</param>
|
||||
/// <param name="password">Password</param>
|
||||
/// <param name="userId">User ID</param>
|
||||
/// <param name="callback">
|
||||
/// Callback to invoke when inventory has been loaded. This is required because
|
||||
/// loading may be asynchronous, even on standalone
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
///// <summary>
|
||||
///// Create a test user with a standard inventory
|
||||
///// </summary>
|
||||
///// <param name="commsManager"></param>
|
||||
///// <param name="firstName">First name of user</param>
|
||||
///// <param name="lastName">Last name of user</param>
|
||||
///// <param name="password">Password</param>
|
||||
///// <param name="userId">User ID</param>
|
||||
///// <param name="callback">
|
||||
///// Callback to invoke when inventory has been loaded. This is required because
|
||||
///// loading may be asynchronous, even on standalone
|
||||
///// </param>
|
||||
///// <returns></returns>
|
||||
//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;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user