diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/UserManager/LoginResponse.cs (renamed from Common/OpenGrid.Framework.UserManager/LoginResponse.cs) | 5 | ||||
-rw-r--r-- | OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.csproj (renamed from Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj) | 32 | ||||
-rw-r--r-- | OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.dll.build | 50 | ||||
-rw-r--r-- | OpenSim/Framework/UserManager/UserManagerBase.cs (renamed from Common/OpenGrid.Framework.UserManager/UserManagerBase.cs) | 135 |
4 files changed, 133 insertions, 89 deletions
diff --git a/Common/OpenGrid.Framework.UserManager/LoginResponse.cs b/OpenSim/Framework/UserManager/LoginResponse.cs index 514ebef..d1cd8cf 100644 --- a/Common/OpenGrid.Framework.UserManager/LoginResponse.cs +++ b/OpenSim/Framework/UserManager/LoginResponse.cs | |||
@@ -9,7 +9,7 @@ using OpenSim.Framework.Utilities; | |||
9 | using OpenSim.Framework.Interfaces; | 9 | using OpenSim.Framework.Interfaces; |
10 | using Nwc.XmlRpc; | 10 | using Nwc.XmlRpc; |
11 | 11 | ||
12 | namespace OpenGrid.Framework.UserManagement | 12 | namespace OpenSim.Framework.UserManagement |
13 | { | 13 | { |
14 | 14 | ||
15 | /// <summary> | 15 | /// <summary> |
@@ -124,7 +124,7 @@ namespace OpenGrid.Framework.UserManagement | |||
124 | this.ErrorReason = "key"; | 124 | this.ErrorReason = "key"; |
125 | this.welcomeMessage = "Welcome to OpenSim!"; | 125 | this.welcomeMessage = "Welcome to OpenSim!"; |
126 | this.seedCapability = ""; | 126 | this.seedCapability = ""; |
127 | this.home = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + this.userProfile.homepos.X.ToString() + ",r" + this.userProfile.homepos.Y.ToString() + ",r" + this.userProfile.homepos.Z.ToString() + "], 'look_at':[r" + this.userProfile.homelookat.X.ToString() + ",r" + this.userProfile.homelookat.Y.ToString() + ",r" + this.userProfile.homelookat.Z.ToString() + "]}"; | 127 | this.home = "{'region_handle':[r" + (1000 * 256).ToString() + ",r" + (1000 * 256).ToString() + "], 'position':[r" + this.userProfile.homepos.X.ToString() + ",r" + this.userProfile.homepos.Y.ToString() + ",r" + this.userProfile.homepos.Z.ToString() + "], 'look_at':[r" + this.userProfile.homelookat.X.ToString() + ",r" + this.userProfile.homelookat.Y.ToString() + ",r" + this.userProfile.homelookat.Z.ToString() + "]}"; |
128 | this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; | 128 | this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; |
129 | this.RegionX = (uint)255232; | 129 | this.RegionX = (uint)255232; |
130 | this.RegionY = (uint)254976; | 130 | this.RegionY = (uint)254976; |
@@ -227,6 +227,7 @@ namespace OpenGrid.Framework.UserManagement | |||
227 | 227 | ||
228 | responseData["sim_port"] =(Int32) this.SimPort; | 228 | responseData["sim_port"] =(Int32) this.SimPort; |
229 | responseData["sim_ip"] = this.SimAddress; | 229 | responseData["sim_ip"] = this.SimAddress; |
230 | Console.MainLog.Instance.Warn("SIM IP: " + responseData["sim_ip"] + "; SIM PORT: " + responseData["sim_port"]); | ||
230 | responseData["agent_id"] = this.AgentID.ToStringHyphenated(); | 231 | responseData["agent_id"] = this.AgentID.ToStringHyphenated(); |
231 | responseData["session_id"] = this.SessionID.ToStringHyphenated(); | 232 | responseData["session_id"] = this.SessionID.ToStringHyphenated(); |
232 | responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated(); | 233 | responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated(); |
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj b/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.csproj index 9a3cdba..02aa3f3 100644 --- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj +++ b/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.csproj | |||
@@ -3,20 +3,20 @@ | |||
3 | <ProjectType>Local</ProjectType> | 3 | <ProjectType>Local</ProjectType> |
4 | <ProductVersion>8.0.50727</ProductVersion> | 4 | <ProductVersion>8.0.50727</ProductVersion> |
5 | <SchemaVersion>2.0</SchemaVersion> | 5 | <SchemaVersion>2.0</SchemaVersion> |
6 | <ProjectGuid>{DA9A7391-0000-0000-0000-000000000000}</ProjectGuid> | 6 | <ProjectGuid>{586E2916-0000-0000-0000-000000000000}</ProjectGuid> |
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | 7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | 8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
9 | <ApplicationIcon></ApplicationIcon> | 9 | <ApplicationIcon></ApplicationIcon> |
10 | <AssemblyKeyContainerName> | 10 | <AssemblyKeyContainerName> |
11 | </AssemblyKeyContainerName> | 11 | </AssemblyKeyContainerName> |
12 | <AssemblyName>OpenGrid.Framework.UserManagement</AssemblyName> | 12 | <AssemblyName>OpenSim.Framework.UserManagement</AssemblyName> |
13 | <DefaultClientScript>JScript</DefaultClientScript> | 13 | <DefaultClientScript>JScript</DefaultClientScript> |
14 | <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> | 14 | <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> |
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | 15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> |
16 | <DelaySign>false</DelaySign> | 16 | <DelaySign>false</DelaySign> |
17 | <OutputType>Library</OutputType> | 17 | <OutputType>Library</OutputType> |
18 | <AppDesignerFolder></AppDesignerFolder> | 18 | <AppDesignerFolder></AppDesignerFolder> |
19 | <RootNamespace>OpenGrid.Framework.UserManagement</RootNamespace> | 19 | <RootNamespace>OpenSim.Framework.UserManagement</RootNamespace> |
20 | <StartupObject></StartupObject> | 20 | <StartupObject></StartupObject> |
21 | <FileUpgradeFlags> | 21 | <FileUpgradeFlags> |
22 | </FileUpgradeFlags> | 22 | </FileUpgradeFlags> |
@@ -32,7 +32,7 @@ | |||
32 | <DebugSymbols>True</DebugSymbols> | 32 | <DebugSymbols>True</DebugSymbols> |
33 | <FileAlignment>4096</FileAlignment> | 33 | <FileAlignment>4096</FileAlignment> |
34 | <Optimize>False</Optimize> | 34 | <Optimize>False</Optimize> |
35 | <OutputPath>..\..\bin\</OutputPath> | 35 | <OutputPath>..\..\..\bin\</OutputPath> |
36 | <RegisterForComInterop>False</RegisterForComInterop> | 36 | <RegisterForComInterop>False</RegisterForComInterop> |
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | 37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> |
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | 38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
@@ -50,7 +50,7 @@ | |||
50 | <DebugSymbols>False</DebugSymbols> | 50 | <DebugSymbols>False</DebugSymbols> |
51 | <FileAlignment>4096</FileAlignment> | 51 | <FileAlignment>4096</FileAlignment> |
52 | <Optimize>True</Optimize> | 52 | <Optimize>True</Optimize> |
53 | <OutputPath>..\..\bin\</OutputPath> | 53 | <OutputPath>..\..\..\bin\</OutputPath> |
54 | <RegisterForComInterop>False</RegisterForComInterop> | 54 | <RegisterForComInterop>False</RegisterForComInterop> |
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | 55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> |
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | 56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
@@ -59,11 +59,11 @@ | |||
59 | </PropertyGroup> | 59 | </PropertyGroup> |
60 | <ItemGroup> | 60 | <ItemGroup> |
61 | <Reference Include="Db4objects.Db4o.dll" > | 61 | <Reference Include="Db4objects.Db4o.dll" > |
62 | <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath> | 62 | <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath> |
63 | <Private>False</Private> | 63 | <Private>False</Private> |
64 | </Reference> | 64 | </Reference> |
65 | <Reference Include="libsecondlife.dll" > | 65 | <Reference Include="libsecondlife.dll" > |
66 | <HintPath>..\..\bin\libsecondlife.dll</HintPath> | 66 | <HintPath>..\..\..\bin\libsecondlife.dll</HintPath> |
67 | <Private>False</Private> | 67 | <Private>False</Private> |
68 | </Reference> | 68 | </Reference> |
69 | <Reference Include="OpenSim.Framework" > | 69 | <Reference Include="OpenSim.Framework" > |
@@ -74,12 +74,12 @@ | |||
74 | <HintPath>OpenSim.Framework.Console.dll</HintPath> | 74 | <HintPath>OpenSim.Framework.Console.dll</HintPath> |
75 | <Private>False</Private> | 75 | <Private>False</Private> |
76 | </Reference> | 76 | </Reference> |
77 | <Reference Include="OpenSim.GenericConfig.Xml" > | 77 | <Reference Include="OpenSim.Framework.GenericConfig.Xml" > |
78 | <HintPath>OpenSim.GenericConfig.Xml.dll</HintPath> | 78 | <HintPath>OpenSim.Framework.GenericConfig.Xml.dll</HintPath> |
79 | <Private>False</Private> | 79 | <Private>False</Private> |
80 | </Reference> | 80 | </Reference> |
81 | <Reference Include="OpenSim.Servers" > | 81 | <Reference Include="OpenSim.Framework.Servers" > |
82 | <HintPath>OpenSim.Servers.dll</HintPath> | 82 | <HintPath>OpenSim.Framework.Servers.dll</HintPath> |
83 | <Private>False</Private> | 83 | <Private>False</Private> |
84 | </Reference> | 84 | </Reference> |
85 | <Reference Include="System" > | 85 | <Reference Include="System" > |
@@ -94,15 +94,15 @@ | |||
94 | <HintPath>System.Xml.dll</HintPath> | 94 | <HintPath>System.Xml.dll</HintPath> |
95 | <Private>False</Private> | 95 | <Private>False</Private> |
96 | </Reference> | 96 | </Reference> |
97 | <Reference Include="XMLRPC" > | 97 | <Reference Include="XMLRPC.dll" > |
98 | <HintPath>XMLRPC.dll</HintPath> | 98 | <HintPath>..\..\..\bin\XMLRPC.dll</HintPath> |
99 | <Private>False</Private> | 99 | <Private>False</Private> |
100 | </Reference> | 100 | </Reference> |
101 | </ItemGroup> | 101 | </ItemGroup> |
102 | <ItemGroup> | 102 | <ItemGroup> |
103 | <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj"> | 103 | <ProjectReference Include="..\Data\OpenSim.Framework.Data.csproj"> |
104 | <Name>OpenGrid.Framework.Data</Name> | 104 | <Name>OpenSim.Framework.Data</Name> |
105 | <Project>{62CDF671-0000-0000-0000-000000000000}</Project> | 105 | <Project>{36B72A9B-0000-0000-0000-000000000000}</Project> |
106 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 106 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
107 | <Private>False</Private> | 107 | <Private>False</Private> |
108 | </ProjectReference> | 108 | </ProjectReference> |
diff --git a/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.dll.build b/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.dll.build new file mode 100644 index 0000000..d2f4345 --- /dev/null +++ b/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.dll.build | |||
@@ -0,0 +1,50 @@ | |||
1 | <?xml version="1.0" ?> | ||
2 | <project name="OpenSim.Framework.UserManagement" default="build"> | ||
3 | <target name="build"> | ||
4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> | ||
5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> | ||
6 | <copy todir="${project::get-base-directory()}/${build.dir}"> | ||
7 | <fileset basedir="${project::get-base-directory()}"> | ||
8 | </fileset> | ||
9 | </copy> | ||
10 | <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> | ||
11 | <resources prefix="OpenSim.Framework.UserManagement" dynamicprefix="true" > | ||
12 | </resources> | ||
13 | <sources failonempty="true"> | ||
14 | <include name="LoginResponse.cs" /> | ||
15 | <include name="UserManagerBase.cs" /> | ||
16 | </sources> | ||
17 | <references basedir="${project::get-base-directory()}"> | ||
18 | <lib> | ||
19 | <include name="${project::get-base-directory()}" /> | ||
20 | <include name="${project::get-base-directory()}/${build.dir}" /> | ||
21 | </lib> | ||
22 | <include name="../../../bin/Db4objects.Db4o.dll" /> | ||
23 | <include name="../../../bin/libsecondlife.dll" /> | ||
24 | <include name="OpenSim.Framework.dll" /> | ||
25 | <include name="OpenSim.Framework.Console.dll" /> | ||
26 | <include name="../../../bin/OpenSim.Framework.Data.dll" /> | ||
27 | <include name="OpenSim.Framework.GenericConfig.Xml.dll" /> | ||
28 | <include name="OpenSim.Framework.Servers.dll" /> | ||
29 | <include name="System.dll" /> | ||
30 | <include name="System.Data.dll" /> | ||
31 | <include name="System.Xml.dll" /> | ||
32 | <include name="../../../bin/XMLRPC.dll" /> | ||
33 | </references> | ||
34 | </csc> | ||
35 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" /> | ||
36 | <mkdir dir="${project::get-base-directory()}/../../../bin/"/> | ||
37 | <copy todir="${project::get-base-directory()}/../../../bin/"> | ||
38 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > | ||
39 | <include name="*.dll"/> | ||
40 | <include name="*.exe"/> | ||
41 | </fileset> | ||
42 | </copy> | ||
43 | </target> | ||
44 | <target name="clean"> | ||
45 | <delete dir="${bin.dir}" failonerror="false" /> | ||
46 | <delete dir="${obj.dir}" failonerror="false" /> | ||
47 | </target> | ||
48 | <target name="doc" description="Creates documentation."> | ||
49 | </target> | ||
50 | </project> | ||
diff --git a/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index 01fbf3a..d06059e 100644 --- a/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using OpenGrid.Framework.Data; | 32 | using OpenSim.Framework.Data; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | using System.Reflection; | 34 | using System.Reflection; |
35 | 35 | ||
@@ -41,7 +41,7 @@ using OpenSim.Framework.Utilities; | |||
41 | 41 | ||
42 | using System.Security.Cryptography; | 42 | using System.Security.Cryptography; |
43 | 43 | ||
44 | namespace OpenGrid.Framework.UserManagement | 44 | namespace OpenSim.Framework.UserManagement |
45 | { | 45 | { |
46 | public class UserManagerBase | 46 | public class UserManagerBase |
47 | { | 47 | { |
@@ -468,17 +468,16 @@ namespace OpenGrid.Framework.UserManagement | |||
468 | } | 468 | } |
469 | catch (Exception e) | 469 | catch (Exception e) |
470 | { | 470 | { |
471 | Console.WriteLine(e.ToString()); | 471 | System.Console.WriteLine(e.ToString()); |
472 | return logResponse.CreateDeadRegionResponse(); | 472 | return logResponse.CreateDeadRegionResponse(); |
473 | } | 473 | } |
474 | CommitAgent(ref TheUser); | 474 | CommitAgent(ref TheUser); |
475 | |||
476 | return logResponse.ToXmlRpcResponse(); | 475 | return logResponse.ToXmlRpcResponse(); |
477 | 476 | ||
478 | } | 477 | } |
479 | catch (Exception E) | 478 | catch (Exception E) |
480 | { | 479 | { |
481 | Console.WriteLine(E.ToString()); | 480 | System.Console.WriteLine(E.ToString()); |
482 | } | 481 | } |
483 | //} | 482 | //} |
484 | } | 483 | } |
@@ -537,27 +536,15 @@ namespace OpenGrid.Framework.UserManagement | |||
537 | /// Returns an error message that the user could not be found in the database | 536 | /// Returns an error message that the user could not be found in the database |
538 | /// </summary> | 537 | /// </summary> |
539 | /// <returns>XML string consisting of a error element containing individual error(s)</returns> | 538 | /// <returns>XML string consisting of a error element containing individual error(s)</returns> |
540 | public string CreateUnknownUserErrorResponse() | 539 | public XmlRpcResponse CreateUnknownUserErrorResponse() |
541 | { | 540 | { |
542 | System.IO.StringWriter sw = new System.IO.StringWriter(); | 541 | XmlRpcResponse response = new XmlRpcResponse(); |
543 | XmlTextWriter xw = new XmlTextWriter(sw); | 542 | Hashtable responseData = new Hashtable(); |
544 | 543 | responseData["error_type"] = "unknown_user"; | |
545 | // Header | 544 | responseData["error_desc"] = "The user requested is not in the database"; |
546 | xw.Formatting = Formatting.Indented; | ||
547 | xw.WriteStartDocument(); | ||
548 | xw.WriteDocType("error", null, null, null); | ||
549 | xw.WriteComment("An error occured"); | ||
550 | xw.WriteStartElement("error"); | ||
551 | |||
552 | // User | ||
553 | xw.WriteElementString("unknownuser", "Unable to find a user with that name"); | ||
554 | |||
555 | // Footer | ||
556 | xw.WriteEndElement(); | ||
557 | xw.Flush(); | ||
558 | xw.Close(); | ||
559 | 545 | ||
560 | return sw.ToString(); | 546 | response.Value = responseData; |
547 | return response; | ||
561 | } | 548 | } |
562 | 549 | ||
563 | /// <summary> | 550 | /// <summary> |
@@ -565,75 +552,81 @@ namespace OpenGrid.Framework.UserManagement | |||
565 | /// </summary> | 552 | /// </summary> |
566 | /// <param name="profile">The user profile</param> | 553 | /// <param name="profile">The user profile</param> |
567 | /// <returns>A string containing an XML Document of the user profile</returns> | 554 | /// <returns>A string containing an XML Document of the user profile</returns> |
568 | public string ProfileToXml(UserProfileData profile) | 555 | public XmlRpcResponse ProfileToXmlRPCResponse(UserProfileData profile) |
569 | { | 556 | { |
570 | System.IO.StringWriter sw = new System.IO.StringWriter(); | 557 | XmlRpcResponse response = new XmlRpcResponse(); |
571 | XmlTextWriter xw = new XmlTextWriter(sw); | 558 | Hashtable responseData = new Hashtable(); |
572 | 559 | ||
573 | // Header | ||
574 | xw.Formatting = Formatting.Indented; | ||
575 | xw.WriteStartDocument(); | ||
576 | xw.WriteDocType("userprofile", null, null, null); | ||
577 | xw.WriteComment("Found user profiles matching the request"); | ||
578 | xw.WriteStartElement("users"); | ||
579 | |||
580 | // User | ||
581 | xw.WriteStartElement("user"); | ||
582 | // Account information | 560 | // Account information |
583 | xw.WriteAttributeString("firstname", profile.username); | 561 | responseData["firstname"] = profile.username; |
584 | xw.WriteAttributeString("lastname", profile.surname); | 562 | responseData["lastname"] = profile.surname; |
585 | xw.WriteAttributeString("uuid", profile.UUID.ToStringHyphenated()); | 563 | responseData["uuid"] = profile.UUID.ToStringHyphenated(); |
586 | // Server Information | 564 | // Server Information |
587 | xw.WriteAttributeString("server_inventory", profile.userInventoryURI); | 565 | responseData["server_inventory"] = profile.userInventoryURI; |
588 | xw.WriteAttributeString("server_asset", profile.userAssetURI); | 566 | responseData["server_asset"] = profile.userAssetURI; |
589 | // Profile Information | 567 | // Profile Information |
590 | xw.WriteAttributeString("profile_about", profile.profileAboutText); | 568 | responseData["profile_about"] = profile.profileAboutText; |
591 | xw.WriteAttributeString("profile_firstlife_about", profile.profileFirstText); | 569 | responseData["profile_firstlife_about"] = profile.profileFirstText; |
592 | xw.WriteAttributeString("profile_firstlife_image", profile.profileFirstImage.ToStringHyphenated()); | 570 | responseData["profile_firstlife_image"] = profile.profileFirstImage.ToStringHyphenated(); |
593 | xw.WriteAttributeString("profile_can_do", profile.profileCanDoMask.ToString()); | 571 | responseData["profile_can_do"] = profile.profileCanDoMask.ToString(); |
594 | xw.WriteAttributeString("profile_want_do", profile.profileWantDoMask.ToString()); | 572 | responseData["profile_want_do"] = profile.profileWantDoMask.ToString(); |
595 | xw.WriteAttributeString("profile_image", profile.profileImage.ToStringHyphenated()); | 573 | responseData["profile_image"] = profile.profileImage.ToStringHyphenated(); |
596 | xw.WriteAttributeString("profile_created",profile.created.ToString()); | 574 | responseData["profile_created"] = profile.created.ToString(); |
597 | xw.WriteAttributeString("profile_lastlogin",profile.lastLogin.ToString()); | 575 | responseData["profile_lastlogin"] = profile.lastLogin.ToString(); |
598 | // Home region information | 576 | // Home region information |
599 | xw.WriteAttributeString("home_coordinates", profile.homeLocation.ToString()); | 577 | responseData["home_coordinates"] = profile.homeLocation.ToString(); |
600 | xw.WriteAttributeString("home_region", profile.homeRegion.ToString()); | 578 | responseData["home_region"] = profile.homeRegion.ToString(); |
601 | xw.WriteAttributeString("home_look", profile.homeLookAt.ToString()); | 579 | responseData["home_look"] = profile.homeLookAt.ToString(); |
602 | |||
603 | xw.WriteEndElement(); | ||
604 | 580 | ||
605 | // Footer | 581 | response.Value = responseData; |
606 | xw.WriteEndElement(); | 582 | return response; |
607 | xw.Flush(); | ||
608 | xw.Close(); | ||
609 | |||
610 | return sw.ToString(); | ||
611 | } | 583 | } |
612 | 584 | ||
613 | #region REST Methods | 585 | #region XMLRPC User Methods |
614 | //should most likely move out of here and into the grid's userserver sub class | 586 | //should most likely move out of here and into the grid's userserver sub class |
615 | public string RestGetUserMethodName(string request, string path, string param) | 587 | public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request) |
616 | { | 588 | { |
617 | UserProfileData userProfile = getUserProfile(param.Trim()); | 589 | XmlRpcResponse response = new XmlRpcResponse(); |
590 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
591 | UserProfileData userProfile; | ||
618 | 592 | ||
619 | if (userProfile == null) | 593 | if (requestData.Contains("avatar_name")) |
594 | { | ||
595 | userProfile = getUserProfile((string)requestData["avatar_name"]); | ||
596 | if (userProfile == null) | ||
597 | { | ||
598 | return CreateUnknownUserErrorResponse(); | ||
599 | } | ||
600 | } | ||
601 | else | ||
620 | { | 602 | { |
621 | return CreateUnknownUserErrorResponse(); | 603 | return CreateUnknownUserErrorResponse(); |
622 | } | 604 | } |
605 | |||
623 | 606 | ||
624 | return ProfileToXml(userProfile); | 607 | return ProfileToXmlRPCResponse(userProfile); |
625 | } | 608 | } |
626 | 609 | ||
627 | public string RestGetUserMethodUUID(string request, string path, string param) | 610 | public XmlRpcResponse XmlRPCGetUserMethodUUID(XmlRpcRequest request) |
628 | { | 611 | { |
629 | UserProfileData userProfile = getUserProfile(new LLUUID(param)); | 612 | XmlRpcResponse response = new XmlRpcResponse(); |
630 | 613 | Hashtable requestData = (Hashtable)request.Params[0]; | |
631 | if (userProfile == null) | 614 | UserProfileData userProfile; |
615 | if (requestData.Contains("avatar_uuid")) | ||
616 | { | ||
617 | userProfile = getUserProfile((LLUUID)requestData["avatar_uuid"]); | ||
618 | if (userProfile == null) | ||
619 | { | ||
620 | return CreateUnknownUserErrorResponse(); | ||
621 | } | ||
622 | } | ||
623 | else | ||
632 | { | 624 | { |
633 | return CreateUnknownUserErrorResponse(); | 625 | return CreateUnknownUserErrorResponse(); |
634 | } | 626 | } |
635 | 627 | ||
636 | return ProfileToXml(userProfile); | 628 | |
629 | return ProfileToXmlRPCResponse(userProfile); | ||
637 | } | 630 | } |
638 | #endregion | 631 | #endregion |
639 | 632 | ||