diff options
author | MW | 2007-06-28 11:26:22 +0000 |
---|---|---|
committer | MW | 2007-06-28 11:26:22 +0000 |
commit | 1aca39a7a6148e77bc75b912ec7da5d4ed6fe427 (patch) | |
tree | 2fc3441d0357d80b6827bec32e740c21c0ba6e6b /Common/OpenSim.Framework | |
parent | * Run prebuild, and stuff. (Fixed bug) (diff) | |
download | opensim-SC_OLD-1aca39a7a6148e77bc75b912ec7da5d4ed6fe427.zip opensim-SC_OLD-1aca39a7a6148e77bc75b912ec7da5d4ed6fe427.tar.gz opensim-SC_OLD-1aca39a7a6148e77bc75b912ec7da5d4ed6fe427.tar.bz2 opensim-SC_OLD-1aca39a7a6148e77bc75b912ec7da5d4ed6fe427.tar.xz |
Deleted some files that are no longer in use. (I am sure I deleted these yesterday but they seem to have returned).
Diffstat (limited to 'Common/OpenSim.Framework')
-rw-r--r-- | Common/OpenSim.Framework/OpenSim.Framework.csproj | 43 | ||||
-rw-r--r-- | Common/OpenSim.Framework/UserProfileManager.cs | 299 | ||||
-rw-r--r-- | Common/OpenSim.Framework/UserProfileManagerBase.cs | 151 |
3 files changed, 22 insertions, 471 deletions
diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj b/Common/OpenSim.Framework/OpenSim.Framework.csproj index 3b938cb..7ebe0ee 100644 --- a/Common/OpenSim.Framework/OpenSim.Framework.csproj +++ b/Common/OpenSim.Framework/OpenSim.Framework.csproj | |||
@@ -1,4 +1,4 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
2 | <PropertyGroup> | 2 | <PropertyGroup> |
3 | <ProjectType>Local</ProjectType> | 3 | <ProjectType>Local</ProjectType> |
4 | <ProductVersion>8.0.50727</ProductVersion> | 4 | <ProductVersion>8.0.50727</ProductVersion> |
@@ -6,7 +6,8 @@ | |||
6 | <ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid> | 6 | <ProjectGuid>{8ACA2445-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> |
10 | </ApplicationIcon> | ||
10 | <AssemblyKeyContainerName> | 11 | <AssemblyKeyContainerName> |
11 | </AssemblyKeyContainerName> | 12 | </AssemblyKeyContainerName> |
12 | <AssemblyName>OpenSim.Framework</AssemblyName> | 13 | <AssemblyName>OpenSim.Framework</AssemblyName> |
@@ -15,9 +16,11 @@ | |||
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | 16 | <DefaultTargetSchema>IE50</DefaultTargetSchema> |
16 | <DelaySign>false</DelaySign> | 17 | <DelaySign>false</DelaySign> |
17 | <OutputType>Library</OutputType> | 18 | <OutputType>Library</OutputType> |
18 | <AppDesignerFolder></AppDesignerFolder> | 19 | <AppDesignerFolder> |
20 | </AppDesignerFolder> | ||
19 | <RootNamespace>OpenSim.Framework</RootNamespace> | 21 | <RootNamespace>OpenSim.Framework</RootNamespace> |
20 | <StartupObject></StartupObject> | 22 | <StartupObject> |
23 | </StartupObject> | ||
21 | <FileUpgradeFlags> | 24 | <FileUpgradeFlags> |
22 | </FileUpgradeFlags> | 25 | </FileUpgradeFlags> |
23 | </PropertyGroup> | 26 | </PropertyGroup> |
@@ -28,7 +31,8 @@ | |||
28 | <ConfigurationOverrideFile> | 31 | <ConfigurationOverrideFile> |
29 | </ConfigurationOverrideFile> | 32 | </ConfigurationOverrideFile> |
30 | <DefineConstants>TRACE;DEBUG</DefineConstants> | 33 | <DefineConstants>TRACE;DEBUG</DefineConstants> |
31 | <DocumentationFile></DocumentationFile> | 34 | <DocumentationFile> |
35 | </DocumentationFile> | ||
32 | <DebugSymbols>True</DebugSymbols> | 36 | <DebugSymbols>True</DebugSymbols> |
33 | <FileAlignment>4096</FileAlignment> | 37 | <FileAlignment>4096</FileAlignment> |
34 | <Optimize>False</Optimize> | 38 | <Optimize>False</Optimize> |
@@ -37,7 +41,8 @@ | |||
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | 41 | <RemoveIntegerChecks>False</RemoveIntegerChecks> |
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | 42 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
39 | <WarningLevel>4</WarningLevel> | 43 | <WarningLevel>4</WarningLevel> |
40 | <NoWarn></NoWarn> | 44 | <NoWarn> |
45 | </NoWarn> | ||
41 | </PropertyGroup> | 46 | </PropertyGroup> |
42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | 47 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
43 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | 48 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
@@ -46,7 +51,8 @@ | |||
46 | <ConfigurationOverrideFile> | 51 | <ConfigurationOverrideFile> |
47 | </ConfigurationOverrideFile> | 52 | </ConfigurationOverrideFile> |
48 | <DefineConstants>TRACE</DefineConstants> | 53 | <DefineConstants>TRACE</DefineConstants> |
49 | <DocumentationFile></DocumentationFile> | 54 | <DocumentationFile> |
55 | </DocumentationFile> | ||
50 | <DebugSymbols>False</DebugSymbols> | 56 | <DebugSymbols>False</DebugSymbols> |
51 | <FileAlignment>4096</FileAlignment> | 57 | <FileAlignment>4096</FileAlignment> |
52 | <Optimize>True</Optimize> | 58 | <Optimize>True</Optimize> |
@@ -55,22 +61,23 @@ | |||
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | 61 | <RemoveIntegerChecks>False</RemoveIntegerChecks> |
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | 62 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
57 | <WarningLevel>4</WarningLevel> | 63 | <WarningLevel>4</WarningLevel> |
58 | <NoWarn></NoWarn> | 64 | <NoWarn> |
65 | </NoWarn> | ||
59 | </PropertyGroup> | 66 | </PropertyGroup> |
60 | <ItemGroup> | 67 | <ItemGroup> |
61 | <Reference Include="Db4objects.Db4o.dll" > | 68 | <Reference Include="Db4objects.Db4o.dll"> |
62 | <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath> | 69 | <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath> |
63 | <Private>False</Private> | 70 | <Private>False</Private> |
64 | </Reference> | 71 | </Reference> |
65 | <Reference Include="libsecondlife.dll" > | 72 | <Reference Include="libsecondlife.dll"> |
66 | <HintPath>..\..\bin\libsecondlife.dll</HintPath> | 73 | <HintPath>..\..\bin\libsecondlife.dll</HintPath> |
67 | <Private>False</Private> | 74 | <Private>False</Private> |
68 | </Reference> | 75 | </Reference> |
69 | <Reference Include="System" > | 76 | <Reference Include="System"> |
70 | <HintPath>System.dll</HintPath> | 77 | <HintPath>System.dll</HintPath> |
71 | <Private>False</Private> | 78 | <Private>False</Private> |
72 | </Reference> | 79 | </Reference> |
73 | <Reference Include="System.Xml" > | 80 | <Reference Include="System.Xml"> |
74 | <HintPath>System.Xml.dll</HintPath> | 81 | <HintPath>System.Xml.dll</HintPath> |
75 | <Private>False</Private> | 82 | <Private>False</Private> |
76 | </Reference> | 83 | </Reference> |
@@ -80,13 +87,13 @@ | |||
80 | <Name>OpenSim.Framework.Console</Name> | 87 | <Name>OpenSim.Framework.Console</Name> |
81 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> | 88 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> |
82 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 89 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
83 | <Private>False</Private> | 90 | <Private>False</Private> |
84 | </ProjectReference> | 91 | </ProjectReference> |
85 | <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj"> | 92 | <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj"> |
86 | <Name>XMLRPC</Name> | 93 | <Name>XMLRPC</Name> |
87 | <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> | 94 | <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> |
88 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 95 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
89 | <Private>False</Private> | 96 | <Private>False</Private> |
90 | </ProjectReference> | 97 | </ProjectReference> |
91 | </ItemGroup> | 98 | </ItemGroup> |
92 | <ItemGroup> | 99 | <ItemGroup> |
@@ -123,12 +130,6 @@ | |||
123 | <Compile Include="UserProfile.cs"> | 130 | <Compile Include="UserProfile.cs"> |
124 | <SubType>Code</SubType> | 131 | <SubType>Code</SubType> |
125 | </Compile> | 132 | </Compile> |
126 | <Compile Include="UserProfileManager.cs"> | ||
127 | <SubType>Code</SubType> | ||
128 | </Compile> | ||
129 | <Compile Include="UserProfileManagerBase.cs"> | ||
130 | <SubType>Code</SubType> | ||
131 | </Compile> | ||
132 | <Compile Include="Util.cs"> | 133 | <Compile Include="Util.cs"> |
133 | <SubType>Code</SubType> | 134 | <SubType>Code</SubType> |
134 | </Compile> | 135 | </Compile> |
@@ -218,4 +219,4 @@ | |||
218 | <PostBuildEvent> | 219 | <PostBuildEvent> |
219 | </PostBuildEvent> | 220 | </PostBuildEvent> |
220 | </PropertyGroup> | 221 | </PropertyGroup> |
221 | </Project> | 222 | </Project> \ No newline at end of file |
diff --git a/Common/OpenSim.Framework/UserProfileManager.cs b/Common/OpenSim.Framework/UserProfileManager.cs deleted file mode 100644 index 64e830f..0000000 --- a/Common/OpenSim.Framework/UserProfileManager.cs +++ /dev/null | |||
@@ -1,299 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Collections; | ||
31 | using System.Text; | ||
32 | using System.Text.RegularExpressions; | ||
33 | using System.Xml; | ||
34 | using libsecondlife; | ||
35 | using Nwc.XmlRpc; | ||
36 | using OpenSim.Framework.Sims; | ||
37 | using OpenSim.Framework.Inventory; | ||
38 | using OpenSim.Framework.Utilities; | ||
39 | |||
40 | namespace OpenSim.Framework.User | ||
41 | { | ||
42 | public class UserProfileManager : UserProfileManagerBase | ||
43 | { | ||
44 | public string GridURL; | ||
45 | public string GridSendKey; | ||
46 | public string GridRecvKey; | ||
47 | public string DefaultStartupMsg; | ||
48 | |||
49 | public UserProfileManager() | ||
50 | { | ||
51 | |||
52 | } | ||
53 | |||
54 | public void SetKeys(string sendKey, string recvKey, string url, string message) | ||
55 | { | ||
56 | GridRecvKey = recvKey; | ||
57 | GridSendKey = sendKey; | ||
58 | GridURL = url; | ||
59 | DefaultStartupMsg = message; | ||
60 | } | ||
61 | |||
62 | public virtual string ParseXMLRPC(string requestBody) | ||
63 | { | ||
64 | |||
65 | XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); | ||
66 | |||
67 | switch (request.MethodName) | ||
68 | { | ||
69 | case "login_to_simulator": | ||
70 | XmlRpcResponse response = XmlRpcLoginMethod(request); | ||
71 | |||
72 | return (Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(response), "utf-16", "utf-8")); | ||
73 | } | ||
74 | |||
75 | return ""; | ||
76 | } | ||
77 | |||
78 | public string RestDeleteUserSessionMethod( string request, string path, string param ) | ||
79 | { | ||
80 | LLUUID sessionid = new LLUUID(param); // get usersessions/sessionid | ||
81 | foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys) | ||
82 | { | ||
83 | if ( UserProfiles[UUID].CurrentSessionID == sessionid) | ||
84 | { | ||
85 | UserProfiles[UUID].CurrentSessionID = null; | ||
86 | UserProfiles[UUID].CurrentSecureSessionID = null; | ||
87 | UserProfiles[UUID].Circuits.Clear(); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | return "OK"; | ||
92 | } | ||
93 | |||
94 | public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) | ||
95 | { | ||
96 | XmlRpcResponse response = new XmlRpcResponse(); | ||
97 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
98 | |||
99 | bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd")); | ||
100 | bool GoodLogin = false; | ||
101 | string firstname = ""; | ||
102 | string lastname = ""; | ||
103 | string passwd = ""; | ||
104 | |||
105 | if (GoodXML) | ||
106 | { | ||
107 | firstname = (string)requestData["first"]; | ||
108 | lastname = (string)requestData["last"]; | ||
109 | passwd = (string)requestData["passwd"]; | ||
110 | GoodLogin = AuthenticateUser(firstname, lastname, passwd); | ||
111 | } | ||
112 | |||
113 | |||
114 | if (!(GoodXML && GoodLogin)) | ||
115 | { | ||
116 | response = CreateErrorConnectingToGridResponse(); | ||
117 | } | ||
118 | else | ||
119 | { | ||
120 | UserProfile TheUser = GetProfileByName(firstname, lastname); | ||
121 | //we need to sort out how sessions are logged out , currently the sim tells the gridserver | ||
122 | //but if as this suggests the userserver handles it then please have the sim telling the userserver instead | ||
123 | //as it really makes things messy for sandbox mode | ||
124 | //if (!((TheUser.CurrentSessionID == null) && (TheUser.CurrentSecureSessionID == null))) | ||
125 | // { | ||
126 | // response = CreateAlreadyLoggedInResponse(); | ||
127 | // } | ||
128 | //else | ||
129 | //{ | ||
130 | try | ||
131 | { | ||
132 | Hashtable responseData = new Hashtable(); | ||
133 | |||
134 | LLUUID AgentID = TheUser.UUID; | ||
135 | TheUser.InitSessionData(); | ||
136 | |||
137 | //for loading data from a grid server, make any changes in CustomiseResponse() (or create a sub class of this and override that method) | ||
138 | //SimProfile SimInfo = new SimProfile(); | ||
139 | //SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey); | ||
140 | |||
141 | |||
142 | Hashtable GlobalT = new Hashtable(); | ||
143 | GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271"; | ||
144 | GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; | ||
145 | GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; | ||
146 | ArrayList GlobalTextures = new ArrayList(); | ||
147 | GlobalTextures.Add(GlobalT); | ||
148 | |||
149 | Hashtable LoginFlagsHash = new Hashtable(); | ||
150 | LoginFlagsHash["daylight_savings"] = "N"; | ||
151 | LoginFlagsHash["stipend_since_login"] = "N"; | ||
152 | LoginFlagsHash["gendered"] = "Y"; | ||
153 | LoginFlagsHash["ever_logged_in"] = "Y"; | ||
154 | ArrayList LoginFlags = new ArrayList(); | ||
155 | LoginFlags.Add(LoginFlagsHash); | ||
156 | |||
157 | Hashtable uiconfig = new Hashtable(); | ||
158 | uiconfig["allow_first_life"] = "Y"; | ||
159 | ArrayList ui_config = new ArrayList(); | ||
160 | ui_config.Add(uiconfig); | ||
161 | |||
162 | Hashtable ClassifiedCategoriesHash = new Hashtable(); | ||
163 | ClassifiedCategoriesHash["category_name"] = "bla bla"; | ||
164 | ClassifiedCategoriesHash["category_id"] = (Int32)1; | ||
165 | ArrayList ClassifiedCategories = new ArrayList(); | ||
166 | ClassifiedCategories.Add(ClassifiedCategoriesHash); | ||
167 | |||
168 | ArrayList AgentInventory = new ArrayList(); | ||
169 | System.Console.WriteLine("adding inventory to response"); | ||
170 | Hashtable TempHash; | ||
171 | foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values) | ||
172 | { | ||
173 | TempHash = new Hashtable(); | ||
174 | System.Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated()); | ||
175 | TempHash["name"] = InvFolder.FolderName; | ||
176 | TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); | ||
177 | TempHash["version"] = (Int32)InvFolder.Version; | ||
178 | TempHash["type_default"] = (Int32)InvFolder.DefaultType; | ||
179 | TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); | ||
180 | AgentInventory.Add(TempHash); | ||
181 | } | ||
182 | |||
183 | Hashtable InventoryRootHash = new Hashtable(); | ||
184 | InventoryRootHash["folder_id"] = TheUser.Inventory.InventoryRoot.FolderID.ToStringHyphenated(); | ||
185 | ArrayList InventoryRoot = new ArrayList(); | ||
186 | InventoryRoot.Add(InventoryRootHash); | ||
187 | |||
188 | Hashtable InitialOutfitHash = new Hashtable(); | ||
189 | InitialOutfitHash["folder_name"] = "Nightclub Female"; | ||
190 | InitialOutfitHash["gender"] = "female"; | ||
191 | ArrayList InitialOutfit = new ArrayList(); | ||
192 | InitialOutfit.Add(InitialOutfitHash); | ||
193 | |||
194 | uint circode = (uint)(Util.RandomClass.Next()); | ||
195 | //TheUser.AddSimCircuit(circode, SimInfo.UUID); | ||
196 | |||
197 | responseData["last_name"] = TheUser.lastname; | ||
198 | responseData["ui-config"] = ui_config; | ||
199 | responseData["sim_ip"] = "127.0.0.1"; //SimInfo.sim_ip.ToString(); | ||
200 | responseData["login-flags"] = LoginFlags; | ||
201 | responseData["global-textures"] = GlobalTextures; | ||
202 | responseData["classified_categories"] = ClassifiedCategories; | ||
203 | responseData["event_categories"] = new ArrayList(); | ||
204 | responseData["inventory-skeleton"] = AgentInventory; | ||
205 | responseData["inventory-skel-lib"] = new ArrayList(); | ||
206 | responseData["inventory-root"] = InventoryRoot; | ||
207 | responseData["event_notifications"] = new ArrayList(); | ||
208 | responseData["gestures"] = new ArrayList(); | ||
209 | responseData["inventory-lib-owner"] = new ArrayList(); | ||
210 | responseData["initial-outfit"] = InitialOutfit; | ||
211 | responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
212 | responseData["start_location"] = "last"; | ||
213 | responseData["home"] = "{'region_handle':[r" + (0 * 256).ToString() + ",r" + (0 * 256).ToString() + "], 'position':[r" + TheUser.homepos.X.ToString() + ",r" + TheUser.homepos.Y.ToString() + ",r" + TheUser.homepos.Z.ToString() + "], 'look_at':[r" + TheUser.homelookat.X.ToString() + ",r" + TheUser.homelookat.Y.ToString() + ",r" + TheUser.homelookat.Z.ToString() + "]}"; | ||
214 | responseData["message"] = DefaultStartupMsg; | ||
215 | responseData["first_name"] = TheUser.firstname; | ||
216 | responseData["circuit_code"] = (Int32)circode; | ||
217 | responseData["sim_port"] = 0; //(Int32)SimInfo.sim_port; | ||
218 | responseData["secure_session_id"] = TheUser.CurrentSecureSessionID.ToStringHyphenated(); | ||
219 | responseData["look_at"] = "\n[r" + TheUser.homelookat.X.ToString() + ",r" + TheUser.homelookat.Y.ToString() + ",r" + TheUser.homelookat.Z.ToString() + "]\n"; | ||
220 | responseData["agent_id"] = AgentID.ToStringHyphenated(); | ||
221 | responseData["region_y"] = (Int32)0 * 256; // (Int32)SimInfo.RegionLocY * 256; | ||
222 | responseData["region_x"] = (Int32)0 * 256; //SimInfo.RegionLocX * 256; | ||
223 | responseData["seed_capability"] = ""; | ||
224 | responseData["agent_access"] = "M"; | ||
225 | responseData["session_id"] = TheUser.CurrentSessionID.ToStringHyphenated(); | ||
226 | responseData["login"] = "true"; | ||
227 | |||
228 | this.CustomiseResponse(ref responseData, TheUser); | ||
229 | response.Value = responseData; | ||
230 | // TheUser.SendDataToSim(SimInfo); | ||
231 | return response; | ||
232 | |||
233 | } | ||
234 | catch (Exception E) | ||
235 | { | ||
236 | System.Console.WriteLine(E.ToString()); | ||
237 | } | ||
238 | //} | ||
239 | } | ||
240 | return response; | ||
241 | |||
242 | } | ||
243 | |||
244 | private static XmlRpcResponse CreateErrorConnectingToGridResponse() | ||
245 | { | ||
246 | XmlRpcResponse response = new XmlRpcResponse(); | ||
247 | Hashtable ErrorRespData = new Hashtable(); | ||
248 | ErrorRespData["reason"] = "key"; | ||
249 | ErrorRespData["message"] = "Error connecting to grid. Please double check your login details and check with the grid owner if you are sure these are correct"; | ||
250 | ErrorRespData["login"] = "false"; | ||
251 | response.Value = ErrorRespData; | ||
252 | return response; | ||
253 | } | ||
254 | |||
255 | private static XmlRpcResponse CreateAlreadyLoggedInResponse() | ||
256 | { | ||
257 | XmlRpcResponse response = new XmlRpcResponse(); | ||
258 | Hashtable PresenceErrorRespData = new Hashtable(); | ||
259 | PresenceErrorRespData["reason"] = "presence"; | ||
260 | PresenceErrorRespData["message"] = "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner"; | ||
261 | PresenceErrorRespData["login"] = "false"; | ||
262 | response.Value = PresenceErrorRespData; | ||
263 | return response; | ||
264 | } | ||
265 | |||
266 | public virtual void CustomiseResponse(ref Hashtable response, UserProfile theUser) | ||
267 | { | ||
268 | //default method set up to act as ogs user server | ||
269 | SimProfile SimInfo= new SimProfile(); | ||
270 | //get siminfo from grid server | ||
271 | SimInfo = SimInfo.LoadFromGrid(theUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey); | ||
272 | Int32 circode = (Int32)Convert.ToUInt32(response["circuit_code"]); | ||
273 | theUser.AddSimCircuit((uint)circode, SimInfo.UUID); | ||
274 | response["home"] = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; | ||
275 | response["sim_ip"] = SimInfo.sim_ip; | ||
276 | response["sim_port"] = (Int32)SimInfo.sim_port; | ||
277 | response["region_y"] = (Int32)SimInfo.RegionLocY * 256; | ||
278 | response["region_x"] = (Int32)SimInfo.RegionLocX * 256; | ||
279 | |||
280 | //default is ogs user server, so let the sim know about the user via a XmlRpcRequest | ||
281 | System.Console.WriteLine(SimInfo.caps_url); | ||
282 | Hashtable SimParams = new Hashtable(); | ||
283 | SimParams["session_id"] = theUser.CurrentSessionID.ToString(); | ||
284 | SimParams["secure_session_id"] = theUser.CurrentSecureSessionID.ToString(); | ||
285 | SimParams["firstname"] = theUser.firstname; | ||
286 | SimParams["lastname"] = theUser.lastname; | ||
287 | SimParams["agent_id"] = theUser.UUID.ToString(); | ||
288 | SimParams["circuit_code"] = (Int32)circode; | ||
289 | SimParams["startpos_x"] = theUser.homepos.X.ToString(); | ||
290 | SimParams["startpos_y"] = theUser.homepos.Y.ToString(); | ||
291 | SimParams["startpos_z"] = theUser.homepos.Z.ToString(); | ||
292 | ArrayList SendParams = new ArrayList(); | ||
293 | SendParams.Add(SimParams); | ||
294 | |||
295 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); | ||
296 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000); | ||
297 | } | ||
298 | } | ||
299 | } | ||
diff --git a/Common/OpenSim.Framework/UserProfileManagerBase.cs b/Common/OpenSim.Framework/UserProfileManagerBase.cs deleted file mode 100644 index 638077e..0000000 --- a/Common/OpenSim.Framework/UserProfileManagerBase.cs +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | using OpenSim.Framework.Utilities; | ||
33 | using OpenSim.Framework.Inventory; | ||
34 | using Db4objects.Db4o; | ||
35 | |||
36 | namespace OpenSim.Framework.User | ||
37 | { | ||
38 | public class UserProfileManagerBase | ||
39 | { | ||
40 | |||
41 | public Dictionary<LLUUID, UserProfile> UserProfiles = new Dictionary<LLUUID, UserProfile>(); | ||
42 | |||
43 | public UserProfileManagerBase() | ||
44 | { | ||
45 | } | ||
46 | |||
47 | public virtual void InitUserProfiles() | ||
48 | { | ||
49 | IObjectContainer db; | ||
50 | db = Db4oFactory.OpenFile("userprofiles.yap"); | ||
51 | IObjectSet result = db.Get(typeof(UserProfile)); | ||
52 | foreach (UserProfile userprof in result) | ||
53 | { | ||
54 | UserProfiles.Add(userprof.UUID, userprof); | ||
55 | } | ||
56 | System.Console.WriteLine("UserProfiles.Cs:InitUserProfiles() - Successfully loaded " + result.Count.ToString() + " from database"); | ||
57 | db.Close(); | ||
58 | } | ||
59 | |||
60 | public virtual void SaveUserProfiles() // ZOMG! INEFFICIENT! | ||
61 | { | ||
62 | IObjectContainer db; | ||
63 | db = Db4oFactory.OpenFile("userprofiles.yap"); | ||
64 | IObjectSet result = db.Get(typeof(UserProfile)); | ||
65 | foreach (UserProfile userprof in result) | ||
66 | { | ||
67 | db.Delete(userprof); | ||
68 | db.Commit(); | ||
69 | } | ||
70 | foreach (UserProfile userprof in UserProfiles.Values) | ||
71 | { | ||
72 | db.Set(userprof); | ||
73 | db.Commit(); | ||
74 | } | ||
75 | db.Close(); | ||
76 | } | ||
77 | |||
78 | public UserProfile GetProfileByName(string firstname, string lastname) | ||
79 | { | ||
80 | foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys) | ||
81 | { | ||
82 | if (UserProfiles[UUID].firstname.Equals(firstname)) if (UserProfiles[UUID].lastname.Equals(lastname)) | ||
83 | { | ||
84 | return UserProfiles[UUID]; | ||
85 | } | ||
86 | } | ||
87 | return null; | ||
88 | } | ||
89 | |||
90 | public UserProfile GetProfileByLLUUID(LLUUID ProfileLLUUID) | ||
91 | { | ||
92 | return UserProfiles[ProfileLLUUID]; | ||
93 | } | ||
94 | |||
95 | public virtual bool AuthenticateUser(string firstname, string lastname, string passwd) | ||
96 | { | ||
97 | UserProfile TheUser = GetProfileByName(firstname, lastname); | ||
98 | passwd = passwd.Remove(0, 3); //remove $1$ | ||
99 | if (TheUser != null) | ||
100 | { | ||
101 | if (TheUser.MD5passwd == passwd) | ||
102 | { | ||
103 | System.Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname); | ||
104 | return true; | ||
105 | } | ||
106 | else | ||
107 | { | ||
108 | System.Console.WriteLine("UserProfile - not authorised, password not match " + TheUser.MD5passwd + " and " + passwd); | ||
109 | return false; | ||
110 | } | ||
111 | } | ||
112 | else | ||
113 | { | ||
114 | System.Console.WriteLine("UserProfile - not authorised , unkown: " + firstname + " , " + lastname); | ||
115 | return false; | ||
116 | } | ||
117 | |||
118 | } | ||
119 | |||
120 | public void SetGod(LLUUID GodID) | ||
121 | { | ||
122 | this.UserProfiles[GodID].IsGridGod = true; | ||
123 | } | ||
124 | |||
125 | public virtual UserProfile CreateNewProfile(string firstname, string lastname, string MD5passwd) | ||
126 | { | ||
127 | System.Console.WriteLine("creating new profile for : " + firstname + " , " + lastname); | ||
128 | UserProfile newprofile = new UserProfile(); | ||
129 | newprofile.homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256)); | ||
130 | newprofile.firstname = firstname; | ||
131 | newprofile.lastname = lastname; | ||
132 | newprofile.MD5passwd = MD5passwd; | ||
133 | newprofile.UUID = LLUUID.Random(); | ||
134 | newprofile.Inventory.CreateRootFolder(newprofile.UUID, true); | ||
135 | this.UserProfiles.Add(newprofile.UUID, newprofile); | ||
136 | return newprofile; | ||
137 | } | ||
138 | |||
139 | public virtual AgentInventory GetUsersInventory(LLUUID agentID) | ||
140 | { | ||
141 | UserProfile user = this.GetProfileByLLUUID(agentID); | ||
142 | if (user != null) | ||
143 | { | ||
144 | return user.Inventory; | ||
145 | } | ||
146 | |||
147 | return null; | ||
148 | } | ||
149 | |||
150 | } | ||
151 | } | ||