| 15 |
using OpenSim.Region.Framework.Scenes; |
using OpenSim.Region.Framework.Scenes; |
| 16 |
using OpenSim.Services.Interfaces; |
using OpenSim.Services.Interfaces; |
| 17 |
using Mono.Addins; |
using Mono.Addins; |
| 18 |
|
using OpenSim.Services.Connectors.Hypergrid; |
| 19 |
|
|
| 20 |
[assembly: Addin("OpenProfileModule", "0.1")] |
[assembly: Addin("OpenProfileModule", "0.1")] |
| 21 |
[assembly: AddinDependency("OpenSim", "0.5")] |
[assembly: AddinDependency("OpenSim", "0.5")] |
| 178 |
try |
try |
| 179 |
{ |
{ |
| 180 |
XmlRpcRequest Req = new XmlRpcRequest(method, SendParams); |
XmlRpcRequest Req = new XmlRpcRequest(method, SendParams); |
|
// HG Change! |
|
|
// Will need to know the server: Pass it in the ReqParams??? |
|
|
// Resp = Req.Send(m_ProfileServer, 30000); |
|
| 181 |
Resp = Req.Send(server, 30000); |
Resp = Req.Send(server, 30000); |
| 182 |
} |
} |
| 183 |
catch (WebException ex) |
catch (WebException ex) |
| 241 |
UUID targetID; |
UUID targetID; |
| 242 |
UUID.TryParse(args[0], out targetID); |
UUID.TryParse(args[0], out targetID); |
| 243 |
|
|
| 244 |
|
// Can't handle NPC yet... |
| 245 |
|
ScenePresence p = FindPresence(targetID); |
| 246 |
|
if (p.PresenceType == PresenceType.Npc) |
| 247 |
|
return; |
| 248 |
|
|
| 249 |
string serverURI = string.Empty; |
string serverURI = string.Empty; |
| 250 |
bool foreign = GetUserProfileServerURI(targetID, out serverURI); |
bool foreign = GetUserProfileServerURI(targetID, out serverURI); |
| 251 |
|
|
| 354 |
UUID targetID; |
UUID targetID; |
| 355 |
UUID.TryParse(args[0], out targetID); |
UUID.TryParse(args[0], out targetID); |
| 356 |
|
|
| 357 |
|
// Can't handle NPC yet... |
| 358 |
|
ScenePresence p = FindPresence(targetID); |
| 359 |
|
if (p.PresenceType == PresenceType.Npc) |
| 360 |
|
return; |
| 361 |
|
|
| 362 |
string serverURI = string.Empty; |
string serverURI = string.Empty; |
| 363 |
bool foreign = GetUserProfileServerURI(targetID, out serverURI); |
bool foreign = GetUserProfileServerURI(targetID, out serverURI); |
| 364 |
|
|
| 666 |
{ |
{ |
| 667 |
Hashtable ReqHash = new Hashtable(); |
Hashtable ReqHash = new Hashtable(); |
| 668 |
|
|
| 669 |
|
// Can't handle NPC yet... |
| 670 |
|
ScenePresence p = FindPresence(userID); |
| 671 |
|
if (p.PresenceType == PresenceType.Npc) |
| 672 |
|
{ |
| 673 |
|
Hashtable npc =new Hashtable(); |
| 674 |
|
npc["success"] = "false"; |
| 675 |
|
npc["errorMessage"] = "Presence is NPC. "; |
| 676 |
|
return npc; |
| 677 |
|
} |
| 678 |
|
|
| 679 |
ReqHash["avatar_id"] = userID.ToString(); |
ReqHash["avatar_id"] = userID.ToString(); |
| 680 |
|
|
| 681 |
string serverURI = string.Empty; |
string serverURI = string.Empty; |
| 696 |
|
|
| 697 |
public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) |
public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) |
| 698 |
{ |
{ |
| 699 |
|
|
| 700 |
|
// Can't handle NPC yet... |
| 701 |
|
ScenePresence p = FindPresence(avatarID); |
| 702 |
|
if (p.PresenceType == PresenceType.Npc) |
| 703 |
|
return; |
| 704 |
|
|
| 705 |
IScene s = remoteClient.Scene; |
IScene s = remoteClient.Scene; |
| 706 |
if (!(s is Scene)) |
if (!(s is Scene)) |
| 707 |
return; |
return; |
| 816 |
|
|
| 817 |
remoteClient.SendAvatarInterestsReply(avatarID, wantMask, wantText, |
remoteClient.SendAvatarInterestsReply(avatarID, wantMask, wantText, |
| 818 |
skillsMask, skillsText, languages); |
skillsMask, skillsText, languages); |
| 819 |
|
|
| 820 |
} |
} |
| 821 |
|
|
| 822 |
public void UpdateAvatarProperties(IClientAPI remoteClient, UserProfileData newProfile) |
public void UpdateAvatarProperties(IClientAPI remoteClient, UserProfileData newProfile) |
| 875 |
IUserManagement uManage = UserManagementModule; |
IUserManagement uManage = UserManagementModule; |
| 876 |
Dictionary<string,object> info = new Dictionary<string, object>(); |
Dictionary<string,object> info = new Dictionary<string, object>(); |
| 877 |
|
|
| 878 |
|
|
| 879 |
if (!uManage.IsLocalGridUser(userID)) |
if (!uManage.IsLocalGridUser(userID)) |
| 880 |
{ |
{ |
|
// serverURI = uManage.GetUserServerURL(userID, "ProfileServerURI"); |
|
|
info["user_flags"] = uManage.GetUserFlags(userID); |
|
|
info["user_created"] = uManage.GetUserCreated(userID); |
|
|
info["user_title"] = uManage.GetUserTitle(userID); |
|
| 881 |
// Is Foreign |
// Is Foreign |
| 882 |
|
string home_url = uManage.GetUserServerURL(userID, "HomeURI"); |
| 883 |
|
UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url); |
| 884 |
|
|
| 885 |
|
Dictionary<string, object> urls = uConn.GetServerURLs(userID); |
| 886 |
|
Dictionary<string, object> account = uConn.GetUserInfo(userID); |
| 887 |
|
|
| 888 |
|
info["user_flags"] = account["user_flags"]; |
| 889 |
|
info["user_created"] = account["user_created"]; |
| 890 |
|
info["user_title"] = account["user_title"]; |
| 891 |
userInfo = info; |
userInfo = info; |
| 892 |
return true; |
return true; |
| 893 |
} |
} |
| 894 |
else |
else |
| 895 |
{ |
{ |
|
// serverURI = m_ProfileServer; |
|
| 896 |
// Is local |
// Is local |
| 897 |
info["user_flags"] = uManage.GetUserFlags(userID); |
Scene scene = m_Scenes[0]; |
| 898 |
info["user_created"] = uManage.GetUserCreated(userID); |
IUserAccountService uas = scene.UserAccountService; |
| 899 |
info["user_title"] = uManage.GetUserTitle(userID); |
UserAccount account = uas.GetUserAccount(scene.RegionInfo.ScopeID, userID); |
| 900 |
|
|
| 901 |
|
info["user_flags"] = account.UserFlags; |
| 902 |
|
info["user_created"] = account.Created; |
| 903 |
|
info["user_title"] = account.UserTitle; |
| 904 |
userInfo = info; |
userInfo = info; |
| 905 |
|
|
| 906 |
return false; |
return false; |
| 907 |
} |
} |
| 908 |
} |
} |