123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Net;
- using System.Net.Sockets;
- using System.Reflection;
- using System.Text;
- using System.Xml;
- using log4net;
- using OpenMetaverse;
- using OpenSim.Framework;
- namespace OpenSim.Services.UserProfilesService
- {
-
-
-
-
-
-
-
- public class OpenProfileClient
- {
- static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- private string m_serverURI;
-
-
-
-
- public OpenProfileClient(string serverURI)
- {
- m_serverURI = serverURI;
- }
-
-
-
-
-
-
-
-
-
-
- public bool RequestAvatarPropertiesUsingOpenProfile(ref UserProfileProperties props)
- {
- Hashtable ReqHash = new Hashtable();
- ReqHash["avatar_id"] = props.UserId.ToString();
- Hashtable profileData = XMLRPCRequester.SendRequest(ReqHash, "avatar_properties_request", m_serverURI);
- if (profileData == null)
- return false;
- if (!profileData.ContainsKey("data"))
- return false;
- ArrayList dataArray = (ArrayList)profileData["data"];
- if (dataArray == null || dataArray[0] == null)
- return false;
- profileData = (Hashtable)dataArray[0];
- props.WebUrl = string.Empty;
- props.AboutText = String.Empty;
- props.FirstLifeText = String.Empty;
- props.ImageId = UUID.Zero;
- props.FirstLifeImageId = UUID.Zero;
- props.PartnerId = UUID.Zero;
- if (profileData["ProfileUrl"] != null)
- props.WebUrl = profileData["ProfileUrl"].ToString();
- if (profileData["AboutText"] != null)
- props.AboutText = profileData["AboutText"].ToString();
- if (profileData["FirstLifeAboutText"] != null)
- props.FirstLifeText = profileData["FirstLifeAboutText"].ToString();
- if (profileData["Image"] != null)
- props.ImageId = new UUID(profileData["Image"].ToString());
- if (profileData["FirstLifeImage"] != null)
- props.FirstLifeImageId = new UUID(profileData["FirstLifeImage"].ToString());
- if (profileData["Partner"] != null)
- props.PartnerId = new UUID(profileData["Partner"].ToString());
- props.WantToMask = 0;
- props.WantToText = String.Empty;
- props.SkillsMask = 0;
- props.SkillsText = String.Empty;
- props.Language = String.Empty;
- if (profileData["wantmask"] != null)
- props.WantToMask = Convert.ToInt32(profileData["wantmask"].ToString());
- if (profileData["wanttext"] != null)
- props.WantToText = profileData["wanttext"].ToString();
- if (profileData["skillsmask"] != null)
- props.SkillsMask = Convert.ToInt32(profileData["skillsmask"].ToString());
- if (profileData["skillstext"] != null)
- props.SkillsText = profileData["skillstext"].ToString();
- if (profileData["languages"] != null)
- props.Language = profileData["languages"].ToString();
- return true;
- }
- }
- }
|