mirror of
https://github.com/kcozens/OpenSimProfile.git
synced 2026-08-14 09:02:00 +00:00
De-tabified file and stripped trailing whitespace.
git-svn-id: http://forge.opensimulator.org/svn/osprofile/trunk@61 19860011-0018-435d-96ae-4a7b0aaa3128
This commit is contained in:
@@ -17,76 +17,76 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSimProfile.Modules.OpenProfile
|
||||
{
|
||||
public class OpenProfileModule : IRegionModule
|
||||
{
|
||||
//
|
||||
// Log module
|
||||
//
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public class OpenProfileModule : IRegionModule
|
||||
{
|
||||
//
|
||||
// Log module
|
||||
//
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
//
|
||||
// Module vars
|
||||
//
|
||||
private IConfigSource m_gConfig;
|
||||
private List<Scene> m_Scenes = new List<Scene>();
|
||||
private string m_ProfileServer = "";
|
||||
private bool m_Enabled = true;
|
||||
//
|
||||
// Module vars
|
||||
//
|
||||
private IConfigSource m_gConfig;
|
||||
private List<Scene> m_Scenes = new List<Scene>();
|
||||
private string m_ProfileServer = "";
|
||||
private bool m_Enabled = true;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
IConfig profileConfig = config.Configs["Profile"];
|
||||
IConfig profileConfig = config.Configs["Profile"];
|
||||
|
||||
if (m_Scenes.Count == 0) // First time
|
||||
{
|
||||
if (profileConfig == null)
|
||||
{
|
||||
m_Enabled = false;
|
||||
return;
|
||||
}
|
||||
m_ProfileServer = profileConfig.GetString("ProfileURL", "");
|
||||
if (m_ProfileServer == "")
|
||||
{
|
||||
m_Enabled = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[PROFILE] OpenProfile module is activated");
|
||||
m_Enabled = true;
|
||||
}
|
||||
}
|
||||
if (m_Scenes.Count == 0) // First time
|
||||
{
|
||||
if (profileConfig == null)
|
||||
{
|
||||
m_Enabled = false;
|
||||
return;
|
||||
}
|
||||
m_ProfileServer = profileConfig.GetString("ProfileURL", "");
|
||||
if (m_ProfileServer == "")
|
||||
{
|
||||
m_Enabled = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[PROFILE] OpenProfile module is activated");
|
||||
m_Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_Scenes.Contains(scene))
|
||||
m_Scenes.Add(scene);
|
||||
if (!m_Scenes.Contains(scene))
|
||||
m_Scenes.Add(scene);
|
||||
|
||||
m_gConfig = config;
|
||||
m_gConfig = config;
|
||||
|
||||
// Hook up events
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
// Hook up events
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
}
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "ProfileModule"; }
|
||||
}
|
||||
public string Name
|
||||
{
|
||||
get { return "ProfileModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
ScenePresence FindPresence(UUID clientID)
|
||||
{
|
||||
@@ -101,25 +101,25 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
return null;
|
||||
}
|
||||
|
||||
/// New Client Event Handler
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
// Subscribe to messages
|
||||
/// New Client Event Handler
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
// Subscribe to messages
|
||||
|
||||
// Classifieds
|
||||
client.AddGenericPacketHandler("avatarclassifiedsrequest", HandleAvatarClassifiedsRequest);
|
||||
client.OnClassifiedInfoUpdate += ClassifiedInfoUpdate;
|
||||
client.OnClassifiedDelete += ClassifiedDelete;
|
||||
// Classifieds
|
||||
client.AddGenericPacketHandler("avatarclassifiedsrequest", HandleAvatarClassifiedsRequest);
|
||||
client.OnClassifiedInfoUpdate += ClassifiedInfoUpdate;
|
||||
client.OnClassifiedDelete += ClassifiedDelete;
|
||||
|
||||
// Picks
|
||||
client.AddGenericPacketHandler("avatarpicksrequest", HandleAvatarPicksRequest);
|
||||
client.AddGenericPacketHandler("pickinforequest", HandlePickInfoRequest);
|
||||
client.OnPickInfoUpdate += PickInfoUpdate;
|
||||
client.OnPickDelete += PickDelete;
|
||||
// Picks
|
||||
client.AddGenericPacketHandler("avatarpicksrequest", HandleAvatarPicksRequest);
|
||||
client.AddGenericPacketHandler("pickinforequest", HandlePickInfoRequest);
|
||||
client.OnPickInfoUpdate += PickInfoUpdate;
|
||||
client.OnPickDelete += PickDelete;
|
||||
|
||||
// Notes
|
||||
client.AddGenericPacketHandler("avatarnotesrequest", HandleAvatarNotesRequest);
|
||||
client.OnAvatarNotesUpdate += AvatarNotesUpdate;
|
||||
// Notes
|
||||
client.AddGenericPacketHandler("avatarnotesrequest", HandleAvatarNotesRequest);
|
||||
client.OnAvatarNotesUpdate += AvatarNotesUpdate;
|
||||
|
||||
//Profile
|
||||
client.OnRequestAvatarProperties += RequestAvatarProperties;
|
||||
@@ -127,129 +127,129 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
client.OnAvatarInterestUpdate += AvatarInterestsUpdate;
|
||||
client.OnUserInfoRequest += UserPreferencesRequest;
|
||||
client.OnUpdateUserInfo += UpdateUserPreferences;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Make external XMLRPC request
|
||||
//
|
||||
private Hashtable GenericXMLRPCRequest(Hashtable ReqParams, string method)
|
||||
{
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(ReqParams);
|
||||
//
|
||||
// Make external XMLRPC request
|
||||
//
|
||||
private Hashtable GenericXMLRPCRequest(Hashtable ReqParams, string method)
|
||||
{
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(ReqParams);
|
||||
|
||||
// Send Request
|
||||
XmlRpcResponse Resp;
|
||||
try
|
||||
{
|
||||
XmlRpcRequest Req = new XmlRpcRequest(method, SendParams);
|
||||
Resp = Req.Send(m_ProfileServer, 30000);
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
m_log.ErrorFormat("[PROFILE]: Unable to connect to Profile " +
|
||||
"Server {0}. Exception {1}", m_ProfileServer, ex);
|
||||
// Send Request
|
||||
XmlRpcResponse Resp;
|
||||
try
|
||||
{
|
||||
XmlRpcRequest Req = new XmlRpcRequest(method, SendParams);
|
||||
Resp = Req.Send(m_ProfileServer, 30000);
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
m_log.ErrorFormat("[PROFILE]: Unable to connect to Profile " +
|
||||
"Server {0}. Exception {1}", m_ProfileServer, ex);
|
||||
|
||||
Hashtable ErrorHash = new Hashtable();
|
||||
ErrorHash["success"] = false;
|
||||
ErrorHash["errorMessage"] = "Unable to search at this time. ";
|
||||
ErrorHash["errorURI"] = "";
|
||||
Hashtable ErrorHash = new Hashtable();
|
||||
ErrorHash["success"] = false;
|
||||
ErrorHash["errorMessage"] = "Unable to search at this time. ";
|
||||
ErrorHash["errorURI"] = "";
|
||||
|
||||
return ErrorHash;
|
||||
}
|
||||
catch (SocketException ex)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PROFILE]: Unable to connect to Profile Server {0}. Method {1}, params {2}. " +
|
||||
"Exception {3}", m_ProfileServer, method, ReqParams, ex);
|
||||
return ErrorHash;
|
||||
}
|
||||
catch (SocketException ex)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PROFILE]: Unable to connect to Profile Server {0}. Method {1}, params {2}. " +
|
||||
"Exception {3}", m_ProfileServer, method, ReqParams, ex);
|
||||
|
||||
Hashtable ErrorHash = new Hashtable();
|
||||
ErrorHash["success"] = false;
|
||||
ErrorHash["errorMessage"] = "Unable to search at this time. ";
|
||||
ErrorHash["errorURI"] = "";
|
||||
Hashtable ErrorHash = new Hashtable();
|
||||
ErrorHash["success"] = false;
|
||||
ErrorHash["errorMessage"] = "Unable to search at this time. ";
|
||||
ErrorHash["errorURI"] = "";
|
||||
|
||||
return ErrorHash;
|
||||
}
|
||||
catch (XmlException ex)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PROFILE]: Unable to connect to Profile Server {0}. Method {1}, params {2}. " +
|
||||
"Exception {3}", m_ProfileServer, method, ReqParams.ToString(), ex);
|
||||
Hashtable ErrorHash = new Hashtable();
|
||||
ErrorHash["success"] = false;
|
||||
ErrorHash["errorMessage"] = "Unable to search at this time. ";
|
||||
ErrorHash["errorURI"] = "";
|
||||
return ErrorHash;
|
||||
}
|
||||
catch (XmlException ex)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PROFILE]: Unable to connect to Profile Server {0}. Method {1}, params {2}. " +
|
||||
"Exception {3}", m_ProfileServer, method, ReqParams.ToString(), ex);
|
||||
Hashtable ErrorHash = new Hashtable();
|
||||
ErrorHash["success"] = false;
|
||||
ErrorHash["errorMessage"] = "Unable to search at this time. ";
|
||||
ErrorHash["errorURI"] = "";
|
||||
|
||||
return ErrorHash;
|
||||
}
|
||||
if (Resp.IsFault)
|
||||
{
|
||||
Hashtable ErrorHash = new Hashtable();
|
||||
ErrorHash["success"] = false;
|
||||
ErrorHash["errorMessage"] = "Unable to search at this time. ";
|
||||
ErrorHash["errorURI"] = "";
|
||||
return ErrorHash;
|
||||
}
|
||||
Hashtable RespData = (Hashtable)Resp.Value;
|
||||
return ErrorHash;
|
||||
}
|
||||
if (Resp.IsFault)
|
||||
{
|
||||
Hashtable ErrorHash = new Hashtable();
|
||||
ErrorHash["success"] = false;
|
||||
ErrorHash["errorMessage"] = "Unable to search at this time. ";
|
||||
ErrorHash["errorURI"] = "";
|
||||
return ErrorHash;
|
||||
}
|
||||
Hashtable RespData = (Hashtable)Resp.Value;
|
||||
|
||||
return RespData;
|
||||
}
|
||||
return RespData;
|
||||
}
|
||||
|
||||
// Classifieds Handler
|
||||
// Classifieds Handler
|
||||
|
||||
public void HandleAvatarClassifiedsRequest(Object sender, string method, List<String> args)
|
||||
{
|
||||
public void HandleAvatarClassifiedsRequest(Object sender, string method, List<String> args)
|
||||
{
|
||||
if (!(sender is IClientAPI))
|
||||
return;
|
||||
|
||||
IClientAPI remoteClient = (IClientAPI)sender;
|
||||
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
ReqHash["uuid"] = args[0];
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
method);
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
ReqHash["uuid"] = args[0];
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
method);
|
||||
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
|
||||
Dictionary<UUID, string> classifieds = new Dictionary<UUID, string>();
|
||||
|
||||
foreach (Object o in dataArray)
|
||||
{
|
||||
Hashtable d = (Hashtable)o;
|
||||
|
||||
foreach (Object o in dataArray)
|
||||
{
|
||||
Hashtable d = (Hashtable)o;
|
||||
|
||||
classifieds[new UUID(d["classifiedid"].ToString())] = d["name"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
remoteClient.SendAvatarClassifiedReply(remoteClient.AgentId,
|
||||
classifieds);
|
||||
}
|
||||
remoteClient.SendAvatarClassifiedReply(remoteClient.AgentId,
|
||||
classifieds);
|
||||
}
|
||||
|
||||
// Classifieds Update
|
||||
// Classifieds Update
|
||||
|
||||
public void ClassifiedInfoUpdate(UUID queryclassifiedID, uint queryCategory, string queryName, string queryDescription, UUID queryParcelID,
|
||||
uint queryParentEstate, UUID querySnapshotID, Vector3 queryGlobalPos, byte queryclassifiedFlags,
|
||||
int queryclassifiedPrice, IClientAPI remoteClient)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
public void ClassifiedInfoUpdate(UUID queryclassifiedID, uint queryCategory, string queryName, string queryDescription, UUID queryParcelID,
|
||||
uint queryParentEstate, UUID querySnapshotID, Vector3 queryGlobalPos, byte queryclassifiedFlags,
|
||||
int queryclassifiedPrice, IClientAPI remoteClient)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
ReqHash["creatorUUID"] = remoteClient.AgentId.ToString();
|
||||
ReqHash["classifiedUUID"] = queryclassifiedID.ToString();
|
||||
ReqHash["category"] = queryCategory.ToString();
|
||||
ReqHash["name"] = queryName;
|
||||
ReqHash["description"] = queryDescription;
|
||||
ReqHash["category"] = queryCategory.ToString();
|
||||
ReqHash["name"] = queryName;
|
||||
ReqHash["description"] = queryDescription;
|
||||
ReqHash["parentestate"] = queryParentEstate.ToString();
|
||||
ReqHash["snapshotUUID"] = querySnapshotID.ToString();
|
||||
ReqHash["snapshotUUID"] = querySnapshotID.ToString();
|
||||
ReqHash["sim_name"] = remoteClient.Scene.RegionInfo.RegionName;
|
||||
ReqHash["globalpos"] = queryGlobalPos.ToString();
|
||||
ReqHash["classifiedFlags"] = queryclassifiedFlags.ToString();
|
||||
ReqHash["classifiedPrice"] = queryclassifiedPrice.ToString();
|
||||
ReqHash["classifiedPrice"] = queryclassifiedPrice.ToString();
|
||||
|
||||
ScenePresence p = FindPresence(remoteClient.AgentId);
|
||||
|
||||
@@ -261,63 +261,65 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
|
||||
// Getting the global position for the Avatar
|
||||
|
||||
Vector3 posGlobal = new Vector3(remoteClient.Scene.RegionInfo.RegionLocX * Constants.RegionSize + avaPos.X, remoteClient.Scene.RegionInfo.RegionLocY * Constants.RegionSize + avaPos.Y, avaPos.Z);
|
||||
Vector3 posGlobal = new Vector3(remoteClient.Scene.RegionInfo.RegionLocX * Constants.RegionSize + avaPos.X,
|
||||
remoteClient.Scene.RegionInfo.RegionLocY * Constants.RegionSize + avaPos.Y,
|
||||
avaPos.Z);
|
||||
|
||||
ReqHash["pos_global"] = posGlobal.ToString();
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"classified_update");
|
||||
"classified_update");
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Classifieds Delete
|
||||
// Classifieds Delete
|
||||
|
||||
public void ClassifiedDelete (UUID queryClassifiedID, IClientAPI remoteClient)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
public void ClassifiedDelete (UUID queryClassifiedID, IClientAPI remoteClient)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
ReqHash["classifiedID"] = queryClassifiedID.ToString();
|
||||
ReqHash["classifiedID"] = queryClassifiedID.ToString();
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"classified_delete");
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"classified_delete");
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Picks Handler
|
||||
// Picks Handler
|
||||
|
||||
public void HandleAvatarPicksRequest(Object sender, string method, List<String> args)
|
||||
{
|
||||
public void HandleAvatarPicksRequest(Object sender, string method, List<String> args)
|
||||
{
|
||||
if (!(sender is IClientAPI))
|
||||
return;
|
||||
|
||||
IClientAPI remoteClient = (IClientAPI)sender;
|
||||
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
ReqHash["uuid"] = args[0];
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
method);
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
ReqHash["uuid"] = args[0];
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
method);
|
||||
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
|
||||
Dictionary<UUID, string> picks = new Dictionary<UUID, string>();
|
||||
|
||||
@@ -326,71 +328,71 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
foreach (Object o in dataArray)
|
||||
{
|
||||
Hashtable d = (Hashtable)o;
|
||||
|
||||
|
||||
picks[new UUID(d["pickid"].ToString())] = d["name"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
remoteClient.SendAvatarPicksReply(remoteClient.AgentId,
|
||||
picks);
|
||||
}
|
||||
remoteClient.SendAvatarPicksReply(remoteClient.AgentId,
|
||||
picks);
|
||||
}
|
||||
|
||||
// Picks Request
|
||||
// Picks Request
|
||||
|
||||
public void HandlePickInfoRequest(Object sender, string method, List<String> args)
|
||||
{
|
||||
public void HandlePickInfoRequest(Object sender, string method, List<String> args)
|
||||
{
|
||||
if (!(sender is IClientAPI))
|
||||
return;
|
||||
|
||||
IClientAPI remoteClient = (IClientAPI)sender;
|
||||
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
ReqHash["avatar_id"] = args[0];
|
||||
ReqHash["pick_id"] = args[1];
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
method);
|
||||
ReqHash["avatar_id"] = args[0];
|
||||
ReqHash["pick_id"] = args[1];
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
method);
|
||||
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
|
||||
Hashtable d = (Hashtable)dataArray[0];
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
|
||||
Hashtable d = (Hashtable)dataArray[0];
|
||||
|
||||
Vector3 globalPos = new Vector3();
|
||||
Vector3.TryParse(d["posglobal"].ToString(), out globalPos);
|
||||
Vector3.TryParse(d["posglobal"].ToString(), out globalPos);
|
||||
|
||||
if (d["description"] == null)
|
||||
d["description"] = String.Empty;
|
||||
|
||||
remoteClient.SendPickInfoReply(
|
||||
remoteClient.SendPickInfoReply(
|
||||
new UUID(d["pickuuid"].ToString()),
|
||||
new UUID(d["creatoruuid"].ToString()),
|
||||
Convert.ToBoolean(d["toppick"]),
|
||||
new UUID(d["parceluuid"].ToString()),
|
||||
d["name"].ToString(),
|
||||
d["description"].ToString(),
|
||||
new UUID(d["snapshotuuid"].ToString()),
|
||||
d["user"].ToString(),
|
||||
d["originalname"].ToString(),
|
||||
d["simname"].ToString(),
|
||||
globalPos,
|
||||
Convert.ToInt32(d["sortorder"]),
|
||||
Convert.ToBoolean(d["enabled"]));
|
||||
}
|
||||
Convert.ToBoolean(d["toppick"]),
|
||||
new UUID(d["parceluuid"].ToString()),
|
||||
d["name"].ToString(),
|
||||
d["description"].ToString(),
|
||||
new UUID(d["snapshotuuid"].ToString()),
|
||||
d["user"].ToString(),
|
||||
d["originalname"].ToString(),
|
||||
d["simname"].ToString(),
|
||||
globalPos,
|
||||
Convert.ToInt32(d["sortorder"]),
|
||||
Convert.ToBoolean(d["enabled"]));
|
||||
}
|
||||
|
||||
// Picks Update
|
||||
// Picks Update
|
||||
|
||||
public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
ReqHash["agent_id"] = remoteClient.AgentId.ToString();
|
||||
ReqHash["pick_id"] = pickID.ToString();
|
||||
ReqHash["creator_id"] = creatorID.ToString();
|
||||
@@ -418,68 +420,68 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
|
||||
// Getting the owner of the parcel
|
||||
|
||||
|
||||
|
||||
|
||||
// Getting the description of the parcel
|
||||
|
||||
|
||||
// Do the request
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"picks_update");
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"picks_update");
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Picks Delete
|
||||
// Picks Delete
|
||||
|
||||
public void PickDelete(IClientAPI remoteClient, UUID queryPickID)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
ReqHash["pick_id"] = queryPickID.ToString();
|
||||
public void PickDelete(IClientAPI remoteClient, UUID queryPickID)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"picks_delete");
|
||||
ReqHash["pick_id"] = queryPickID.ToString();
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"picks_delete");
|
||||
|
||||
// Notes Handler
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAvatarNotesRequest(Object sender, string method, List<String> args)
|
||||
{
|
||||
// Notes Handler
|
||||
|
||||
public void HandleAvatarNotesRequest(Object sender, string method, List<String> args)
|
||||
{
|
||||
if (!(sender is IClientAPI))
|
||||
return;
|
||||
|
||||
IClientAPI remoteClient = (IClientAPI)sender;
|
||||
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
|
||||
ReqHash["uuid"] = args[0];
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
method);
|
||||
ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
|
||||
ReqHash["uuid"] = args[0];
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
method);
|
||||
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
|
||||
if (dataArray != null && dataArray[0] != null)
|
||||
{
|
||||
@@ -495,29 +497,29 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
new UUID(ReqHash["uuid"].ToString()),
|
||||
"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Notes Update
|
||||
// Notes Update
|
||||
|
||||
public void AvatarNotesUpdate(IClientAPI remoteClient, UUID queryTargetID, string queryNotes)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
|
||||
ReqHash["target_id"] = queryTargetID.ToString();
|
||||
ReqHash["notes"] = queryNotes;
|
||||
public void AvatarNotesUpdate(IClientAPI remoteClient, UUID queryTargetID, string queryNotes)
|
||||
{
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"avatar_notes_update");
|
||||
ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
|
||||
ReqHash["target_id"] = queryTargetID.ToString();
|
||||
ReqHash["notes"] = queryNotes;
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"avatar_notes_update");
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Convert.ToBoolean(result["success"]))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
result["errorMessage"].ToString(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Standard Profile bits
|
||||
public void AvatarInterestsUpdate(IClientAPI remoteClient, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages)
|
||||
{
|
||||
@@ -546,7 +548,7 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
Hashtable ReqHash = new Hashtable();
|
||||
|
||||
ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
|
||||
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"user_preferences_request");
|
||||
|
||||
@@ -564,8 +566,8 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
Hashtable d = (Hashtable)dataArray[0];
|
||||
|
||||
remoteClient.SendUserInfoReply(
|
||||
Convert.ToBoolean(d["imviaemail"]),
|
||||
Convert.ToBoolean(d["visible"]),
|
||||
Convert.ToBoolean(d["imviaemail"]),
|
||||
Convert.ToBoolean(d["visible"]),
|
||||
d["email"].ToString());
|
||||
}
|
||||
}
|
||||
@@ -598,7 +600,7 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
|
||||
Hashtable result = GenericXMLRPCRequest(ReqHash,
|
||||
"avatar_properties_request");
|
||||
|
||||
|
||||
ArrayList dataArray = (ArrayList)result["data"];
|
||||
|
||||
if (dataArray != null && dataArray[0] != null)
|
||||
@@ -683,5 +685,5 @@ namespace OpenSimProfile.Modules.OpenProfile
|
||||
RequestAvatarProperties(remoteClient, newProfile.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user