diff options
author | MW | 2007-02-04 11:36:35 +0000 |
---|---|---|
committer | MW | 2007-02-04 11:36:35 +0000 |
commit | 8c80d98252f376a815e522c705a3c576dfc16f75 (patch) | |
tree | 89e779435d3e9ea2a58b814d81a64e44e4067cc6 /Login_manager.cs | |
parent | Basic Inventory support and clean up (diff) | |
download | opensim-SC-8c80d98252f376a815e522c705a3c576dfc16f75.zip opensim-SC-8c80d98252f376a815e522c705a3c576dfc16f75.tar.gz opensim-SC-8c80d98252f376a815e522c705a3c576dfc16f75.tar.bz2 opensim-SC-8c80d98252f376a815e522c705a3c576dfc16f75.tar.xz |
Clean up
Diffstat (limited to 'Login_manager.cs')
-rw-r--r-- | Login_manager.cs | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/Login_manager.cs b/Login_manager.cs index dc90613..2d4f524 100644 --- a/Login_manager.cs +++ b/Login_manager.cs | |||
@@ -116,7 +116,8 @@ namespace OpenSim | |||
116 | int contentLength = 0; | 116 | int contentLength = 0; |
117 | 117 | ||
118 | // read HTTP header | 118 | // read HTTP header |
119 | do { | 119 | do |
120 | { | ||
120 | // read one line of the header | 121 | // read one line of the header |
121 | line = reader.ReadLine(); | 122 | line = reader.ReadLine(); |
122 | 123 | ||
@@ -145,72 +146,72 @@ namespace OpenSim | |||
145 | //get login name | 146 | //get login name |
146 | if(requestData.Contains("first")) | 147 | if(requestData.Contains("first")) |
147 | { | 148 | { |
148 | first=(string)requestData["first"]; | 149 | first = (string)requestData["first"]; |
149 | } | 150 | } |
150 | else | 151 | else |
151 | { | 152 | { |
152 | first="test"; | 153 | first = "test"; |
153 | } | 154 | } |
154 | if(requestData.Contains("last")) | 155 | if(requestData.Contains("last")) |
155 | { | 156 | { |
156 | last=(string)requestData["last"]; | 157 | last = (string)requestData["last"]; |
157 | } | 158 | } |
158 | else | 159 | else |
159 | { | 160 | { |
160 | last="User"+NumClients.ToString(); | 161 | last = "User"+NumClients.ToString(); |
161 | } | 162 | } |
162 | NumClients++; | 163 | NumClients++; |
163 | 164 | ||
164 | //create a agent and session LLUUID | 165 | //create a agent and session LLUUID |
165 | int AgentRand=this.RandomClass.Next(1,9999); | 166 | int AgentRand = this.RandomClass.Next(1,9999); |
166 | Agent=new LLUUID("99998888-"+AgentRand.ToString("0000")+"-4f52-8ec1-0b1d5cd6aead"); | 167 | Agent = new LLUUID("99998888-"+AgentRand.ToString("0000")+"-4f52-8ec1-0b1d5cd6aead"); |
167 | int SessionRand=this.RandomClass.Next(1,999); | 168 | int SessionRand = this.RandomClass.Next(1,999); |
168 | Session=new LLUUID("aaaabbbb-8932-"+SessionRand.ToString("0000")+"-8664-58f53e442797"); | 169 | Session = new LLUUID("aaaabbbb-8932-"+SessionRand.ToString("0000")+"-8664-58f53e442797"); |
169 | 170 | ||
170 | 171 | ||
171 | StreamReader SR; | 172 | StreamReader SR; |
172 | string ResponseString=""; | 173 | string ResponseString = ""; |
173 | string lines; | 174 | string lines; |
174 | SR=File.OpenText("new-login.dat"); | 175 | SR=File.OpenText("new-login.dat"); |
175 | 176 | ||
176 | lines=SR.ReadLine(); | 177 | lines=SR.ReadLine(); |
177 | 178 | ||
178 | while(lines!="end-mfile") | 179 | while(lines != "end-mfile") |
179 | { | 180 | { |
180 | 181 | ||
181 | ResponseString+=lines; | 182 | ResponseString += lines; |
182 | lines=SR.ReadLine(); | 183 | lines = SR.ReadLine(); |
183 | } | 184 | } |
184 | SR.Close(); | 185 | SR.Close(); |
185 | 186 | ||
186 | XmlRpcResponse response =(XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(ResponseString); | 187 | XmlRpcResponse response =(XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(ResponseString); |
187 | Hashtable responseData = (Hashtable)response.Value; | 188 | Hashtable responseData = (Hashtable)response.Value; |
188 | 189 | ||
189 | responseData["agent_id"]=Agent.ToStringHyphenated(); | 190 | responseData["agent_id"] = Agent.ToStringHyphenated(); |
190 | responseData["session_id"]=Session.ToStringHyphenated(); | 191 | responseData["session_id"] = Session.ToStringHyphenated(); |
191 | ArrayList InventoryList=(ArrayList) responseData["inventory-skeleton"]; | 192 | ArrayList InventoryList = (ArrayList) responseData["inventory-skeleton"]; |
192 | Hashtable Inventory1=(Hashtable)InventoryList[0]; | 193 | Hashtable Inventory1 = (Hashtable)InventoryList[0]; |
193 | Hashtable Inventory2=(Hashtable)InventoryList[1]; | 194 | Hashtable Inventory2 = (Hashtable)InventoryList[1]; |
194 | LLUUID BaseFolderID=LLUUID.Random(); | 195 | LLUUID BaseFolderID = LLUUID.Random(); |
195 | LLUUID InventoryFolderID=LLUUID.Random(); | 196 | LLUUID InventoryFolderID = LLUUID.Random(); |
196 | Inventory2["name"]="Base"; | 197 | Inventory2["name"] = "Base"; |
197 | Inventory2["folder_id"]=BaseFolderID.ToStringHyphenated(); | 198 | Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated(); |
198 | Inventory1["folder_id"]=InventoryFolderID.ToStringHyphenated(); | 199 | Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated(); |
199 | 200 | ||
200 | ArrayList InventoryRoot=(ArrayList) responseData["inventory-root"]; | 201 | ArrayList InventoryRoot = (ArrayList) responseData["inventory-root"]; |
201 | Hashtable Inventoryroot=(Hashtable)InventoryRoot[0]; | 202 | Hashtable Inventoryroot = (Hashtable)InventoryRoot[0]; |
202 | Inventoryroot["folder_id"]=InventoryFolderID.ToStringHyphenated(); | 203 | Inventoryroot["folder_id"] = InventoryFolderID.ToStringHyphenated(); |
203 | 204 | ||
204 | 205 | ||
205 | //copy data to login object | 206 | //copy data to login object |
206 | lock(Login) | 207 | lock(Login) |
207 | { | 208 | { |
208 | Login.first=first; | 209 | Login.First = first; |
209 | Login.last=last; | 210 | Login.Last = last; |
210 | Login.Agent=Agent; | 211 | Login.Agent = Agent; |
211 | Login.Session=Session; | 212 | Login.Session = Session; |
212 | Login.BaseFolder=BaseFolderID; | 213 | Login.BaseFolder = BaseFolderID; |
213 | Login.InventoryFolder=InventoryFolderID; | 214 | Login.InventoryFolder = InventoryFolderID; |
214 | } | 215 | } |
215 | 216 | ||
216 | // forward the XML-RPC response to the client | 217 | // forward the XML-RPC response to the client |