Cleaning up the OpenProfile.cs code and webservices

git-svn-id: http://forge.opensimulator.org/svn/osprofile/trunk@22 19860011-0018-435d-96ae-4a7b0aaa3128
This commit is contained in:
fly-man-
2009-02-20 14:28:02 +00:00
parent a8abff294f
commit 00bc6c7eb6
2 changed files with 53 additions and 0 deletions
@@ -99,6 +99,14 @@ namespace OpenSimProfile.Modules.OpenProfile
client.AddGenericPacketHandler("avatarnotesrequest", HandleAvatarNotesRequest);
// Handle the Classifieds / Picks reading part
client.AddGenericPacketHandler("pickinforequest", HandlePickInfoRequest);
// Handle the Classifieds Update and Delete
client.OnClassifiedInfoUpdate += ClassifiedInfoUpdate;
client.OnClassifiedDelete += ClassifiedDelete;
//Handle the Notes Update
// client.OnAvatarNotesUpdate += AvatarNotesUpdate;
// Handle the Picks Update and Delete
// client.OnPickInfoUpdate += PickInfoUpdate;
// client.OnPickDelete += PickDelete;
}
//
@@ -323,5 +331,26 @@ namespace OpenSimProfile.Modules.OpenProfile
// d["sortorder"].ToString(),
// d["enabled"].ToString());
}
public void ClassifiedInfoUpdate ()
{
}
public void ClassifiedDelete (UUID queryClassifiedID, IClientAPI remoteClient)
{
Hashtable ReqHash = new Hashtable();
ReqHash["classifiedID"] = queryClassifiedID.ToString();
Hashtable result = GenericXMLRPCRequest(ReqHash,
"classified_delete");
if (!Convert.ToBoolean(result["success"]))
{
remoteClient.SendAgentAlertMessage(
result["errorMessage"].ToString(), false);
return;
}
}
}
}
+24
View File
@@ -153,6 +153,30 @@ function pickinforequest($method_name, $params, $app_data)
print $response_xml;
}
xmlrpc_server_register_method($xmlrpc_server, "classified_delete",
"classified_delete");
function classified_delete($method_name, $params, $app_data)
{
$req = $params[0];
$owneruuid = $req['owneruuid'];
$classifieduuid = $req['classifieduuid'];
$result = mysql_query("delete from ossearch.classifieds where ".
"creatoruuid = '". mysql_escape_string($owneruuid) ."' AND ".
"classifieduuid = '".mysql_escape_string($classifieduuid) ."'");
$response_xml = xmlrpc_encode(array(
'success' => True,
'errorMessage' => "",
'data' => $data
));
print $response_xml;
}
#
# Process the request
#