aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2010-01-08 10:43:34 -0800
committerDiva Canto2010-01-08 10:43:34 -0800
commitb63405c1a796b44b58081857d01f726372467628 (patch)
tree564d03059ed55f7b0740fd00e6dd7d1e34edea5d /OpenSim/Region
parent* Finished SimulationServiceConnector (diff)
downloadopensim-SC_OLD-b63405c1a796b44b58081857d01f726372467628.zip
opensim-SC_OLD-b63405c1a796b44b58081857d01f726372467628.tar.gz
opensim-SC_OLD-b63405c1a796b44b58081857d01f726372467628.tar.bz2
opensim-SC_OLD-b63405c1a796b44b58081857d01f726372467628.tar.xz
Inching ahead... This compiles, but very likely does not run.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs38
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs57
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs5
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs41
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs20
8 files changed, 68 insertions, 96 deletions
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index 10a3232..cf7bcef 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -534,26 +534,28 @@ namespace OpenSim.Region.CoreModules.InterGrid
534 userProfile.WantDoMask = 0; 534 userProfile.WantDoMask = 0;
535 userProfile.WebLoginKey = UUID.Random(); 535 userProfile.WebLoginKey = UUID.Random();
536 536
537 // Do caps registration 537 // !!! REFACTORING PROBLEM. This needs to be changed for 0.7
538 // get seed capagentData.firstname = FirstName;agentData.lastname = LastName; 538 //
539 if (homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID) == null && !GridMode) 539 //// Do caps registration
540 { 540 //// get seed capagentData.firstname = FirstName;agentData.lastname = LastName;
541 homeScene.CommsManager.UserAdminService.AddUser( 541 //if (homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID) == null && !GridMode)
542 agentData.firstname, agentData.lastname, CreateRandomStr(7), "", 542 //{
543 homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID); 543 // homeScene.CommsManager.UserAdminService.AddUser(
544 // agentData.firstname, agentData.lastname, CreateRandomStr(7), "",
545 // homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID);
544 546
545 UserProfileData userProfile2 = homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID); 547 // UserProfileData userProfile2 = homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID);
546 if (userProfile2 != null) 548 // if (userProfile2 != null)
547 { 549 // {
548 userProfile = userProfile2; 550 // userProfile = userProfile2;
549 userProfile.AboutText = "OGP USER"; 551 // userProfile.AboutText = "OGP USER";
550 userProfile.FirstLifeAboutText = "OGP USER"; 552 // userProfile.FirstLifeAboutText = "OGP USER";
551 homeScene.CommsManager.UserService.UpdateUserProfile(userProfile); 553 // homeScene.CommsManager.UserService.UpdateUserProfile(userProfile);
552 } 554 // }
553 } 555 //}
554 556
555 // Stick our data in the cache so the region will know something about us 557 //// Stick our data in the cache so the region will know something about us
556 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(userProfile); 558 //homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(userProfile);
557 559
558 // Call 'new user' event handler 560 // Call 'new user' event handler
559 string reason; 561 string reason;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 1fdf1ef..7584dd8 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -161,7 +161,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
161 m_UserProfileService = m_Scene.CommsManager.UserProfileCacheService; 161 m_UserProfileService = m_Scene.CommsManager.UserProfileCacheService;
162 // ugh! 162 // ugh!
163 m_UserProfileService.SetInventoryService(this); 163 m_UserProfileService.SetInventoryService(this);
164 scene.CommsManager.UserService.SetInventoryService(this);
165 164
166 m_Initialized = true; 165 m_Initialized = true;
167 } 166 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index 66d11dd..f2e344f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -133,7 +133,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
133 { 133 {
134 // ugh! 134 // ugh!
135 scene.CommsManager.UserProfileCacheService.SetInventoryService(this); 135 scene.CommsManager.UserProfileCacheService.SetInventoryService(this);
136 scene.CommsManager.UserService.SetInventoryService(this);
137 m_Initialized = true; 136 m_Initialized = true;
138 } 137 }
139 138
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
index 69504df..3580c27 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
@@ -116,7 +116,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
116 { 116 {
117 // ugh! 117 // ugh!
118 scene.CommsManager.UserProfileCacheService.SetInventoryService(this); 118 scene.CommsManager.UserProfileCacheService.SetInventoryService(this);
119 scene.CommsManager.UserService.SetInventoryService(this);
120 m_Initialized = true; 119 m_Initialized = true;
121 } 120 }
122 121
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d8874b2..e22dd2d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -296,6 +296,17 @@ namespace OpenSim.Region.Framework.Scenes
296 } 296 }
297 } 297 }
298 298
299 protected OpenSim.Services.Interfaces.IAvatarService m_AvatarService;
300 public OpenSim.Services.Interfaces.IAvatarService AvatarService
301 {
302 get
303 {
304 if (m_AvatarService == null)
305 m_AvatarService = RequestModuleInterface<OpenSim.Services.Interfaces.IAvatarService>();
306 return m_AvatarService;
307 }
308 }
309
299 protected IXMLRPC m_xmlrpcModule; 310 protected IXMLRPC m_xmlrpcModule;
300 protected IWorldComm m_worldCommModule; 311 protected IWorldComm m_worldCommModule;
301 protected IAvatarFactory m_AvatarFactory; 312 protected IAvatarFactory m_AvatarFactory;
@@ -2975,21 +2986,11 @@ namespace OpenSim.Region.Framework.Scenes
2975 /// <param name="client">The IClientAPI for the client</param> 2986 /// <param name="client">The IClientAPI for the client</param>
2976 public virtual void TeleportClientHome(UUID agentId, IClientAPI client) 2987 public virtual void TeleportClientHome(UUID agentId, IClientAPI client)
2977 { 2988 {
2978 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); 2989 OpenSim.Services.Interfaces.PresenceInfo pinfo = PresenceService.GetAgent(client.SessionId);
2979 if (UserProfile != null) 2990
2991 if (pinfo != null)
2980 { 2992 {
2981 GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID); 2993 GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, pinfo.HomeRegionID);
2982 if (regionInfo == null)
2983 {
2984 uint x = 0, y = 0;
2985 Utils.LongToUInts(UserProfile.HomeRegion, out x, out y);
2986 regionInfo = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
2987 if (regionInfo != null) // home region can be away temporarily, too
2988 {
2989 UserProfile.HomeRegionID = regionInfo.RegionID;
2990 CommsManager.UserService.UpdateUserProfile(UserProfile);
2991 }
2992 }
2993 if (regionInfo == null) 2994 if (regionInfo == null)
2994 { 2995 {
2995 // can't find the Home region: Tell viewer and abort 2996 // can't find the Home region: Tell viewer and abort
@@ -2997,7 +2998,7 @@ namespace OpenSim.Region.Framework.Scenes
2997 return; 2998 return;
2998 } 2999 }
2999 RequestTeleportLocation( 3000 RequestTeleportLocation(
3000 client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt, 3001 client, regionInfo.RegionHandle, pinfo.HomePosition, pinfo.HomeLookAt,
3001 (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome)); 3002 (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome));
3002 } 3003 }
3003 } 3004 }
@@ -3089,7 +3090,7 @@ namespace OpenSim.Region.Framework.Scenes
3089 } 3090 }
3090 3091
3091 /// <summary> 3092 /// <summary>
3092 /// Sets the Home Point. The GridService uses this to know where to put a user when they log-in 3093 /// Sets the Home Point. The LoginService uses this to know where to put a user when they log-in
3093 /// </summary> 3094 /// </summary>
3094 /// <param name="remoteClient"></param> 3095 /// <param name="remoteClient"></param>
3095 /// <param name="regionHandle"></param> 3096 /// <param name="regionHandle"></param>
@@ -3098,27 +3099,11 @@ namespace OpenSim.Region.Framework.Scenes
3098 /// <param name="flags"></param> 3099 /// <param name="flags"></param>
3099 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) 3100 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
3100 { 3101 {
3101 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); 3102 if (PresenceService.SetHomeLocation(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt))
3102 if (UserProfile != null)
3103 {
3104 // I know I'm ignoring the regionHandle provided by the teleport location request.
3105 // reusing the TeleportLocationRequest delegate, so regionHandle isn't valid
3106 UserProfile.HomeRegionID = RegionInfo.RegionID;
3107 // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around.
3108 // TODO: The HomeRegion property can be removed then, too
3109 UserProfile.HomeRegion = RegionInfo.RegionHandle;
3110
3111 UserProfile.HomeLocation = position;
3112 UserProfile.HomeLookAt = lookAt;
3113 CommsManager.UserService.UpdateUserProfile(UserProfile);
3114
3115 // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. 3103 // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
3116 m_dialogModule.SendAlertToUser(remoteClient, "Home position set."); 3104 m_dialogModule.SendAlertToUser(remoteClient, "Home position set.");
3117 }
3118 else 3105 else
3119 {
3120 m_dialogModule.SendAlertToUser(remoteClient, "Set Home request Failed."); 3106 m_dialogModule.SendAlertToUser(remoteClient, "Set Home request Failed.");
3121 }
3122 } 3107 }
3123 3108
3124 /// <summary> 3109 /// <summary>
@@ -3254,12 +3239,6 @@ namespace OpenSim.Region.Framework.Scenes
3254 m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString()); 3239 m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString());
3255 } 3240 }
3256 3241
3257 // Remove client agent from profile, so new logins will work
3258 if (!childagentYN)
3259 {
3260 m_sceneGridService.ClearUserAgent(agentID);
3261 }
3262
3263 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); 3242 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
3264 3243
3265 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 3244 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index f612d17..53693e4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -1455,11 +1455,6 @@ namespace OpenSim.Region.Framework.Scenes
1455 m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz); 1455 m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz);
1456 } 1456 }
1457 1457
1458 public void ClearUserAgent(UUID avatarID)
1459 {
1460 m_commsProvider.UserService.ClearUserAgent(avatarID);
1461 }
1462
1463 public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) 1458 public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
1464 { 1459 {
1465 m_commsProvider.AddNewUserFriend(friendlistowner, friend, perms); 1460 m_commsProvider.AddNewUserFriend(friendlistowner, friend, perms);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index 8d32e66..c8a10b5 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -43,6 +43,8 @@ using OpenSim.Region.CoreModules.Framework.EventQueue;
43using OpenSim.Region.Framework.Interfaces; 43using OpenSim.Region.Framework.Interfaces;
44using OpenSim.Region.Framework.Scenes; 44using OpenSim.Region.Framework.Scenes;
45 45
46using OpenSim.Services.Interfaces;
47
46using Caps = OpenSim.Framework.Capabilities.Caps; 48using Caps = OpenSim.Framework.Capabilities.Caps;
47using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; 49using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags;
48 50
@@ -507,10 +509,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
507 { 509 {
508 if (m_debugEnabled) 510 if (m_debugEnabled)
509 { 511 {
510 UserProfileData targetUserProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(member.AgentID); 512 UserAccount targetUser = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, member.AgentID);
511 if (targetUserProfile != null) 513 if (targetUser != null)
512 { 514 {
513 m_log.DebugFormat("[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, targetUserProfile.Name, member.AcceptNotices); 515 m_log.DebugFormat("[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, targetUser.FirstName + " " + targetUser.LastName, member.AcceptNotices);
514 } 516 }
515 else 517 else
516 { 518 {
@@ -990,9 +992,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
990 remoteClient.SendEjectGroupMemberReply(remoteClient.AgentId, groupID, true); 992 remoteClient.SendEjectGroupMemberReply(remoteClient.AgentId, groupID, true);
991 993
992 GroupRecord groupInfo = m_groupData.GetGroupRecord(grID, groupID, null); 994 GroupRecord groupInfo = m_groupData.GetGroupRecord(grID, groupID, null);
993 UserProfileData userProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(ejecteeID); 995 UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, ejecteeID);
994 996 if ((groupInfo == null) || (account == null))
995 if ((groupInfo == null) || (userProfile == null))
996 { 997 {
997 return; 998 return;
998 } 999 }
@@ -1032,9 +1033,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1032 msg.toAgentID = remoteClient.AgentId.Guid; 1033 msg.toAgentID = remoteClient.AgentId.Guid;
1033 msg.timestamp = 0; 1034 msg.timestamp = 0;
1034 msg.fromAgentName = remoteClient.Name; 1035 msg.fromAgentName = remoteClient.Name;
1035 if (userProfile != null) 1036 if (account != null)
1036 { 1037 {
1037 msg.message = string.Format("{2} has been ejected from '{1}' by {0}.", remoteClient.Name, groupInfo.GroupName, userProfile.Name); 1038 msg.message = string.Format("{2} has been ejected from '{1}' by {0}.", remoteClient.Name, groupInfo.GroupName, account.FirstName + " " + account.LastName);
1038 } 1039 }
1039 else 1040 else
1040 { 1041 {
@@ -1147,8 +1148,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1147 info.RequestID.AgentID = client.AgentId; 1148 info.RequestID.AgentID = client.AgentId;
1148 info.RequestID.SessionID = client.SessionId; 1149 info.RequestID.SessionID = client.SessionId;
1149 1150
1150 UserProfileData userProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(client.AgentId); 1151 //UserProfileData userProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(client.AgentId);
1151 if (userProfile == null) 1152 UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, client.AgentId);
1153 if (account == null)
1152 { 1154 {
1153 // This should be impossible. If I've been passed a reference to a client 1155 // This should be impossible. If I've been passed a reference to a client
1154 // that client should be registered with the UserService. So something 1156 // that client should be registered with the UserService. So something
@@ -1160,16 +1162,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1160 info.RequestID.UserServiceURL = m_sceneList[0].CommsManager.NetworkServersInfo.UserURL; 1162 info.RequestID.UserServiceURL = m_sceneList[0].CommsManager.NetworkServersInfo.UserURL;
1161 1163
1162 } 1164 }
1163 else if (userProfile is ForeignUserProfileData)
1164 {
1165 // They aren't from around here
1166 ForeignUserProfileData fupd = (ForeignUserProfileData)userProfile;
1167 info.RequestID.UserServiceURL = fupd.UserServerURI;
1168 }
1169 else 1165 else
1170 { 1166 {
1167 string domain = m_sceneList[0].CommsManager.NetworkServersInfo.UserURL;
1168 if (account.ServiceURLs["HomeURI"] != null)
1169 domain = account.ServiceURLs["HomeURI"].ToString();
1171 // They're a local user, use this: 1170 // They're a local user, use this:
1172 info.RequestID.UserServiceURL = m_sceneList[0].CommsManager.NetworkServersInfo.UserURL; 1171 info.RequestID.UserServiceURL = domain;
1173 } 1172 }
1174 1173
1175 m_clientRequestIDInfo.Add(client.AgentId, info); 1174 m_clientRequestIDInfo.Add(client.AgentId, info);
@@ -1342,12 +1341,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1342 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 1341 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1343 1342
1344 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff 1343 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
1345 UserProfileData userProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(dataForAgentID); 1344 UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, dataForAgentID);
1346 string firstname, lastname; 1345 string firstname, lastname;
1347 if (userProfile != null) 1346 if (account != null)
1348 { 1347 {
1349 firstname = userProfile.FirstName; 1348 firstname = account.FirstName;
1350 lastname = userProfile.SurName; 1349 lastname = account.LastName;
1351 } 1350 }
1352 else 1351 else
1353 { 1352 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 39b597e..2bfd3fb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -52,8 +52,9 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
52using OpenSim.Region.ScriptEngine.Interfaces; 52using OpenSim.Region.ScriptEngine.Interfaces;
53using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; 53using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
54using OpenSim.Services.Interfaces; 54using OpenSim.Services.Interfaces;
55 55using OpenSim.Services.Interfaces;
56using GridRegion = OpenSim.Services.Interfaces.GridRegion; 56using GridRegion = OpenSim.Services.Interfaces.GridRegion;
57using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
57 58
58using AssetLandmark = OpenSim.Framework.AssetLandmark; 59using AssetLandmark = OpenSim.Framework.AssetLandmark;
59 60
@@ -3842,13 +3843,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3842 3843
3843 UUID uuid = (UUID)id; 3844 UUID uuid = (UUID)id;
3844 3845
3845 UserProfileData userProfile = 3846 UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
3846 World.CommsManager.UserService.GetUserProfile(uuid);
3847 3847
3848 UserAgentData userAgent = 3848 PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
3849 World.CommsManager.UserService.GetAgentByUUID(uuid); 3849 PresenceInfo pinfo = PresenceInfo.GetOnlinePresence(pinfos);
3850 3850
3851 if (userProfile == null || userAgent == null) 3851 if (pinfo == null)
3852 return UUID.Zero.ToString(); 3852 return UUID.Zero.ToString();
3853 3853
3854 string reply = String.Empty; 3854 string reply = String.Empty;
@@ -3857,17 +3857,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3857 { 3857 {
3858 case 1: // DATA_ONLINE (0|1) 3858 case 1: // DATA_ONLINE (0|1)
3859 // TODO: implement fetching of this information 3859 // TODO: implement fetching of this information
3860 if (userProfile.CurrentAgent!=null && userProfile.CurrentAgent.AgentOnline) 3860 if (pinfo != null)
3861 reply = "1"; 3861 reply = "1";
3862 else 3862 else
3863 reply = "0"; 3863 reply = "0";
3864 break; 3864 break;
3865 case 2: // DATA_NAME (First Last) 3865 case 2: // DATA_NAME (First Last)
3866 reply = userProfile.FirstName + " " + userProfile.SurName; 3866 reply = account.FirstName + " " + account.LastName;
3867 break; 3867 break;
3868 case 3: // DATA_BORN (YYYY-MM-DD) 3868 case 3: // DATA_BORN (YYYY-MM-DD)
3869 DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); 3869 DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0);
3870 born = born.AddSeconds(userProfile.Created); 3870 born = born.AddSeconds(account.Created);
3871 reply = born.ToString("yyyy-MM-dd"); 3871 reply = born.ToString("yyyy-MM-dd");
3872 break; 3872 break;
3873 case 4: // DATA_RATING (0,0,0,0,0,0) 3873 case 4: // DATA_RATING (0,0,0,0,0,0)