aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Framework
diff options
context:
space:
mode:
authorgareth2007-04-14 12:48:38 +0000
committergareth2007-04-14 12:48:38 +0000
commitba7aeb1479e2df2e376242bc8e22da5931c1354b (patch)
treeee5de07d15350565f70c3f9751a9ec9059457cac /OpenSim.Framework
parentFixed weird XML/HTTP bugs (diff)
downloadopensim-SC_OLD-ba7aeb1479e2df2e376242bc8e22da5931c1354b.zip
opensim-SC_OLD-ba7aeb1479e2df2e376242bc8e22da5931c1354b.tar.gz
opensim-SC_OLD-ba7aeb1479e2df2e376242bc8e22da5931c1354b.tar.bz2
opensim-SC_OLD-ba7aeb1479e2df2e376242bc8e22da5931c1354b.tar.xz
In the grid, there is life!
OGS now functional again, can login! w00t
Diffstat (limited to '')
-rw-r--r--OpenSim.Framework/AgentInventory.cs16
-rw-r--r--OpenSim.Framework/SimProfile.cs25
-rw-r--r--OpenSim.Framework/UserProfile.cs5
-rw-r--r--OpenSim.Framework/UserProfileManager.cs21
-rw-r--r--OpenSim.Framework/UserProfileManagerBase.cs7
5 files changed, 34 insertions, 40 deletions
diff --git a/OpenSim.Framework/AgentInventory.cs b/OpenSim.Framework/AgentInventory.cs
index 9919ec3..f715129 100644
--- a/OpenSim.Framework/AgentInventory.cs
+++ b/OpenSim.Framework/AgentInventory.cs
@@ -12,7 +12,7 @@ namespace OpenSim.Framework.Inventory
12 //Holds the local copy of Inventory info for a agent 12 //Holds the local copy of Inventory info for a agent
13 public Dictionary<LLUUID, InventoryFolder> InventoryFolders; 13 public Dictionary<LLUUID, InventoryFolder> InventoryFolders;
14 public Dictionary<LLUUID, InventoryItem> InventoryItems; 14 public Dictionary<LLUUID, InventoryItem> InventoryItems;
15 public InventoryFolder InventoryRoot = new InventoryFolder(); 15 public InventoryFolder InventoryRoot;
16 public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server 16 public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server
17 public LLUUID AgentID; 17 public LLUUID AgentID;
18 public AvatarWearable[] Wearables; 18 public AvatarWearable[] Wearables;
@@ -31,15 +31,7 @@ namespace OpenSim.Framework.Inventory
31 { 31 {
32 Wearables[i] = new AvatarWearable(); 32 Wearables[i] = new AvatarWearable();
33 } 33 }
34 34
35 InventoryRoot = new InventoryFolder();
36 InventoryRoot.FolderID = LLUUID.Random();
37 InventoryRoot.ParentID = LLUUID.Zero;
38 InventoryRoot.Version = 1;
39 InventoryRoot.DefaultType = 8;
40 InventoryRoot.OwnerID = this.AgentID;
41 InventoryRoot.FolderName = "My Inventory";
42 InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot);
43 } 35 }
44 36
45 public bool CreateNewFolder(LLUUID folderID, ushort type) 37 public bool CreateNewFolder(LLUUID folderID, ushort type)
@@ -55,14 +47,14 @@ namespace OpenSim.Framework.Inventory
55 public void CreateRootFolder(LLUUID newAgentID, bool createTextures) 47 public void CreateRootFolder(LLUUID newAgentID, bool createTextures)
56 { 48 {
57 this.AgentID = newAgentID; 49 this.AgentID = newAgentID;
58 /* InventoryRoot = new InventoryFolder(); 50 InventoryRoot = new InventoryFolder();
59 InventoryRoot.FolderID = LLUUID.Random(); 51 InventoryRoot.FolderID = LLUUID.Random();
60 InventoryRoot.ParentID = new LLUUID(); 52 InventoryRoot.ParentID = new LLUUID();
61 InventoryRoot.Version = 1; 53 InventoryRoot.Version = 1;
62 InventoryRoot.DefaultType = 8; 54 InventoryRoot.DefaultType = 8;
63 InventoryRoot.OwnerID = this.AgentID; 55 InventoryRoot.OwnerID = this.AgentID;
64 InventoryRoot.FolderName = "My Inventory-"; 56 InventoryRoot.FolderName = "My Inventory-";
65 InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot);*/ 57 InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot);
66 InventoryRoot.OwnerID = this.AgentID; 58 InventoryRoot.OwnerID = this.AgentID;
67 if (createTextures) 59 if (createTextures)
68 { 60 {
diff --git a/OpenSim.Framework/SimProfile.cs b/OpenSim.Framework/SimProfile.cs
index fd130f0..ed34863 100644
--- a/OpenSim.Framework/SimProfile.cs
+++ b/OpenSim.Framework/SimProfile.cs
@@ -25,15 +25,15 @@ namespace OpenSim.Framework.Sims
25 25
26 Hashtable RespData = (Hashtable)GridResp.Value; 26 Hashtable RespData = (Hashtable)GridResp.Value;
27 this.UUID = new LLUUID((string)RespData["UUID"]); 27 this.UUID = new LLUUID((string)RespData["UUID"]);
28 this.regionhandle = (ulong)Convert.ToUInt64(RespData["regionhandle"]); 28 this.regionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
29 this.regionname = (string)RespData["regionname"]; 29 this.regionname = (string)RespData["regionname"];
30 this.sim_ip = (string)RespData["sim_ip"]; 30 this.sim_ip = (string)RespData["sim_ip"];
31 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); 31 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
32 this.caps_url = (string)RespData["caps_url"]; 32 this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
33 this.RegionLocX = (uint)Convert.ToUInt32(RespData["RegionLocX"]); 33 this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
34 this.RegionLocY = (uint)Convert.ToUInt32(RespData["RegionLocY"]); 34 this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
35 this.sendkey = (string)RespData["sendkey"]; 35 this.sendkey = SendKey;
36 this.recvkey = (string)RespData["recvkey"]; 36 this.recvkey = RecvKey;
37 } 37 }
38 catch (Exception e) 38 catch (Exception e)
39 { 39 {
@@ -48,7 +48,6 @@ namespace OpenSim.Framework.Sims
48 { 48 {
49 Hashtable GridReqParams = new Hashtable(); 49 Hashtable GridReqParams = new Hashtable();
50 GridReqParams["UUID"] = UUID.ToString(); 50 GridReqParams["UUID"] = UUID.ToString();
51 GridReqParams["caller"] = "userserver";
52 GridReqParams["authkey"] = SendKey; 51 GridReqParams["authkey"] = SendKey;
53 ArrayList SendParams = new ArrayList(); 52 ArrayList SendParams = new ArrayList();
54 SendParams.Add(GridReqParams); 53 SendParams.Add(GridReqParams);
@@ -58,15 +57,15 @@ namespace OpenSim.Framework.Sims
58 57
59 Hashtable RespData = (Hashtable)GridResp.Value; 58 Hashtable RespData = (Hashtable)GridResp.Value;
60 this.UUID = new LLUUID((string)RespData["UUID"]); 59 this.UUID = new LLUUID((string)RespData["UUID"]);
61 this.regionhandle = (ulong)Convert.ToUInt64(RespData["regionhandle"]); 60 this.regionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
62 this.regionname = (string)RespData["regionname"]; 61 this.regionname = (string)RespData["regionname"];
63 this.sim_ip = (string)RespData["sim_ip"]; 62 this.sim_ip = (string)RespData["sim_ip"];
64 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); 63 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
65 this.caps_url = (string)RespData["caps_url"]; 64 this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
66 this.RegionLocX = (uint)Convert.ToUInt32(RespData["RegionLocX"]); 65 this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
67 this.RegionLocY = (uint)Convert.ToUInt32(RespData["RegionLocY"]); 66 this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
68 this.sendkey = (string)RespData["sendkey"]; 67 this.sendkey = SendKey;
69 this.recvkey = (string)RespData["recvkey"]; 68 this.recvkey = RecvKey;
70 } 69 }
71 catch (Exception e) 70 catch (Exception e)
72 { 71 {
diff --git a/OpenSim.Framework/UserProfile.cs b/OpenSim.Framework/UserProfile.cs
index 215f7da..04e9fd5 100644
--- a/OpenSim.Framework/UserProfile.cs
+++ b/OpenSim.Framework/UserProfile.cs
@@ -31,8 +31,9 @@ namespace OpenSim.Framework.User
31 { 31 {
32 Circuits = new Dictionary<LLUUID, uint>(); 32 Circuits = new Dictionary<LLUUID, uint>();
33 Inventory = new AgentInventory(); 33 Inventory = new AgentInventory();
34 homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256)); ; 34 homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
35 35 homepos = new LLVector3();
36 homelookat = new LLVector3();
36 } 37 }
37 38
38 public void InitSessionData() 39 public void InitSessionData()
diff --git a/OpenSim.Framework/UserProfileManager.cs b/OpenSim.Framework/UserProfileManager.cs
index 7c4fb6f..a44342c 100644
--- a/OpenSim.Framework/UserProfileManager.cs
+++ b/OpenSim.Framework/UserProfileManager.cs
@@ -106,7 +106,7 @@ namespace OpenSim.Framework.User
106 106
107 LLUUID AgentID = TheUser.UUID; 107 LLUUID AgentID = TheUser.UUID;
108 TheUser.InitSessionData(); 108 TheUser.InitSessionData();
109 109
110 //for loading data from a grid server, make any changes in CustomiseResponse() (or create a sub class of this and override that method) 110 //for loading data from a grid server, make any changes in CustomiseResponse() (or create a sub class of this and override that method)
111 //SimProfile SimInfo = new SimProfile(); 111 //SimProfile SimInfo = new SimProfile();
112 //SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey); 112 //SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
@@ -138,11 +138,12 @@ namespace OpenSim.Framework.User
138 ArrayList ClassifiedCategories = new ArrayList(); 138 ArrayList ClassifiedCategories = new ArrayList();
139 ClassifiedCategories.Add(ClassifiedCategoriesHash); 139 ClassifiedCategories.Add(ClassifiedCategoriesHash);
140 140
141 ArrayList AgentInventory = new ArrayList(); 141 ArrayList AgentInventory = new ArrayList();
142 Console.WriteLine("adding inventory to response"); 142 Console.WriteLine("adding inventory to response");
143 Hashtable TempHash;
143 foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values) 144 foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
144 { 145 {
145 Hashtable TempHash = new Hashtable(); 146 TempHash = new Hashtable();
146 Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated()); 147 Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated());
147 TempHash["name"] = InvFolder.FolderName; 148 TempHash["name"] = InvFolder.FolderName;
148 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); 149 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
@@ -192,14 +193,15 @@ namespace OpenSim.Framework.User
192 responseData["agent_id"] = AgentID.ToStringHyphenated(); 193 responseData["agent_id"] = AgentID.ToStringHyphenated();
193 responseData["region_y"] = (Int32)996 * 256; // (Int32)SimInfo.RegionLocY * 256; 194 responseData["region_y"] = (Int32)996 * 256; // (Int32)SimInfo.RegionLocY * 256;
194 responseData["region_x"] = (Int32)997 * 256; //SimInfo.RegionLocX * 256; 195 responseData["region_x"] = (Int32)997 * 256; //SimInfo.RegionLocX * 256;
195 responseData["seed_capability"] = null; 196 responseData["seed_capability"] = "";
196 responseData["agent_access"] = "M"; 197 responseData["agent_access"] = "M";
197 responseData["session_id"] = TheUser.CurrentSessionID.ToStringHyphenated(); 198 responseData["session_id"] = TheUser.CurrentSessionID.ToStringHyphenated();
198 responseData["login"] = "true"; 199 responseData["login"] = "true";
199 200
200 this.CustomiseResponse(ref responseData, TheUser); 201 this.CustomiseResponse(ref responseData, TheUser);
201 response.Value = responseData; 202 response.Value = responseData;
202 // TheUser.SendDataToSim(SimInfo); 203 // TheUser.SendDataToSim(SimInfo);
204 return response;
203 205
204 } 206 }
205 catch (Exception E) 207 catch (Exception E)
@@ -209,6 +211,7 @@ namespace OpenSim.Framework.User
209 //} 211 //}
210 } 212 }
211 return response; 213 return response;
214
212 } 215 }
213 216
214 private static XmlRpcResponse CreateErrorConnectingToGridResponse() 217 private static XmlRpcResponse CreateErrorConnectingToGridResponse()
@@ -236,13 +239,13 @@ namespace OpenSim.Framework.User
236 public virtual void CustomiseResponse(ref Hashtable response, UserProfile theUser) 239 public virtual void CustomiseResponse(ref Hashtable response, UserProfile theUser)
237 { 240 {
238 //default method set up to act as ogs user server 241 //default method set up to act as ogs user server
239 SimProfile SimInfo = new SimProfile(); 242 SimProfile SimInfo= new SimProfile();
240 //get siminfo from grid server 243 //get siminfo from grid server
241 SimInfo = SimInfo.LoadFromGrid(theUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey); 244 SimInfo = SimInfo.LoadFromGrid(theUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
242 Int32 circode = (Int32)response["circuit_code"]; 245 Int32 circode = (Int32)Convert.ToUInt32(response["circuit_code"]);
243 theUser.AddSimCircuit((uint)circode, SimInfo.UUID); 246 theUser.AddSimCircuit((uint)circode, SimInfo.UUID);
244 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() + "]}"; 247 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() + "]}";
245 response["sim_ip"] = SimInfo.sim_ip.ToString(); 248 response["sim_ip"] = SimInfo.sim_ip;
246 response["sim_port"] = (Int32)SimInfo.sim_port; 249 response["sim_port"] = (Int32)SimInfo.sim_port;
247 response["region_y"] = (Int32)SimInfo.RegionLocY * 256; 250 response["region_y"] = (Int32)SimInfo.RegionLocY * 256;
248 response["region_x"] = (Int32)SimInfo.RegionLocX * 256; 251 response["region_x"] = (Int32)SimInfo.RegionLocX * 256;
@@ -255,7 +258,7 @@ namespace OpenSim.Framework.User
255 SimParams["firstname"] = theUser.firstname; 258 SimParams["firstname"] = theUser.firstname;
256 SimParams["lastname"] = theUser.lastname; 259 SimParams["lastname"] = theUser.lastname;
257 SimParams["agent_id"] = theUser.UUID.ToString(); 260 SimParams["agent_id"] = theUser.UUID.ToString();
258 SimParams["circuit_code"] = (Int32)theUser.Circuits[SimInfo.UUID]; 261 SimParams["circuit_code"] = (Int32)circode;
259 ArrayList SendParams = new ArrayList(); 262 ArrayList SendParams = new ArrayList();
260 SendParams.Add(SimParams); 263 SendParams.Add(SimParams);
261 264
diff --git a/OpenSim.Framework/UserProfileManagerBase.cs b/OpenSim.Framework/UserProfileManagerBase.cs
index 4428831..c9fbf4c 100644
--- a/OpenSim.Framework/UserProfileManagerBase.cs
+++ b/OpenSim.Framework/UserProfileManagerBase.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Framework.User
52 { 52 {
53 foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys) 53 foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys)
54 { 54 {
55 if ((UserProfiles[UUID].firstname == firstname) && (UserProfiles[UUID].lastname == lastname)) 55 if (UserProfiles[UUID].firstname.Equals(firstname)) if (UserProfiles[UUID].lastname.Equals(lastname))
56 { 56 {
57 return UserProfiles[UUID]; 57 return UserProfiles[UUID];
58 } 58 }
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.User
73 { 73 {
74 if (TheUser.MD5passwd == passwd) 74 if (TheUser.MD5passwd == passwd)
75 { 75 {
76 Console.WriteLine("UserProfile - authorised "); 76 Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname);
77 return true; 77 return true;
78 } 78 }
79 else 79 else
@@ -103,8 +103,7 @@ namespace OpenSim.Framework.User
103 newprofile.firstname = firstname; 103 newprofile.firstname = firstname;
104 newprofile.lastname = lastname; 104 newprofile.lastname = lastname;
105 newprofile.MD5passwd = MD5passwd; 105 newprofile.MD5passwd = MD5passwd;
106 newprofile.UUID = LLUUID.Random(); 106 newprofile.UUID = LLUUID.Random(); newprofile.Inventory.CreateRootFolder(newprofile.UUID, true);
107 newprofile.Inventory.CreateRootFolder(newprofile.UUID, true);
108 this.UserProfiles.Add(newprofile.UUID, newprofile); 107 this.UserProfiles.Add(newprofile.UUID, newprofile);
109 return newprofile; 108 return newprofile;
110 } 109 }