diff options
author | Sean Dague | 2007-07-16 15:40:11 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-16 15:40:11 +0000 |
commit | 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch) | |
tree | e3f80ad51736cf17e856547b1bcf956010927434 /OpenSim/Grid/UserServer/UserManager.cs | |
parent | *Trunk compiles now (diff) | |
download | opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2 opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz |
changed to native line ending encoding
Diffstat (limited to 'OpenSim/Grid/UserServer/UserManager.cs')
-rw-r--r-- | OpenSim/Grid/UserServer/UserManager.cs | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index f5275e2..bb7d673 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs | |||
@@ -1,100 +1,100 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using Nwc.XmlRpc; | 30 | using Nwc.XmlRpc; |
31 | using OpenSim.Framework.Data; | 31 | using OpenSim.Framework.Data; |
32 | using OpenSim.Framework.UserManagement; | 32 | using OpenSim.Framework.UserManagement; |
33 | using OpenSim.Framework.Utilities; | 33 | using OpenSim.Framework.Utilities; |
34 | 34 | ||
35 | namespace OpenSim.Grid.UserServer | 35 | namespace OpenSim.Grid.UserServer |
36 | { | 36 | { |
37 | public class UserManager : UserManagerBase | 37 | public class UserManager : UserManagerBase |
38 | { | 38 | { |
39 | public UserManager() | 39 | public UserManager() |
40 | { | 40 | { |
41 | } | 41 | } |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Customises the login response and fills in missing values. | 44 | /// Customises the login response and fills in missing values. |
45 | /// </summary> | 45 | /// </summary> |
46 | /// <param name="response">The existing response</param> | 46 | /// <param name="response">The existing response</param> |
47 | /// <param name="theUser">The user profile</param> | 47 | /// <param name="theUser">The user profile</param> |
48 | public override void CustomiseResponse( LoginResponse response, UserProfileData theUser) | 48 | public override void CustomiseResponse( LoginResponse response, UserProfileData theUser) |
49 | { | 49 | { |
50 | // Load information from the gridserver | 50 | // Load information from the gridserver |
51 | SimProfileData SimInfo = new SimProfileData(); | 51 | SimProfileData SimInfo = new SimProfileData(); |
52 | SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); | 52 | SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); |
53 | 53 | ||
54 | // Customise the response | 54 | // Customise the response |
55 | // Home Location | 55 | // Home Location |
56 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " + | 56 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " + |
57 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + | 57 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + |
58 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; | 58 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; |
59 | 59 | ||
60 | // Destination | 60 | // Destination |
61 | Console.WriteLine("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + SimInfo.regionLocY); | 61 | Console.WriteLine("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + SimInfo.regionLocY); |
62 | response.SimAddress = SimInfo.serverIP; | 62 | response.SimAddress = SimInfo.serverIP; |
63 | response.SimPort = (Int32)SimInfo.serverPort; | 63 | response.SimPort = (Int32)SimInfo.serverPort; |
64 | response.RegionX = SimInfo.regionLocX; | 64 | response.RegionX = SimInfo.regionLocX; |
65 | response.RegionY = SimInfo.regionLocY; | 65 | response.RegionY = SimInfo.regionLocY; |
66 | 66 | ||
67 | //Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI | 67 | //Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI |
68 | string capsPath = Util.GetRandomCapsPath(); | 68 | string capsPath = Util.GetRandomCapsPath(); |
69 | response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; | 69 | response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; |
70 | 70 | ||
71 | // Notify the target of an incoming user | 71 | // Notify the target of an incoming user |
72 | Console.WriteLine("Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI+ ")"); | 72 | Console.WriteLine("Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI+ ")"); |
73 | 73 | ||
74 | // Prepare notification | 74 | // Prepare notification |
75 | Hashtable SimParams = new Hashtable(); | 75 | Hashtable SimParams = new Hashtable(); |
76 | SimParams["session_id"] = theUser.currentAgent.sessionID.ToString(); | 76 | SimParams["session_id"] = theUser.currentAgent.sessionID.ToString(); |
77 | SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString(); | 77 | SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString(); |
78 | SimParams["firstname"] = theUser.username; | 78 | SimParams["firstname"] = theUser.username; |
79 | SimParams["lastname"] = theUser.surname; | 79 | SimParams["lastname"] = theUser.surname; |
80 | SimParams["agent_id"] = theUser.UUID.ToString(); | 80 | SimParams["agent_id"] = theUser.UUID.ToString(); |
81 | SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response.CircuitCode); | 81 | SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response.CircuitCode); |
82 | SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); | 82 | SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); |
83 | SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); | 83 | SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); |
84 | SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); | 84 | SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); |
85 | SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString(); | 85 | SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString(); |
86 | SimParams["caps_path"] = capsPath; | 86 | SimParams["caps_path"] = capsPath; |
87 | ArrayList SendParams = new ArrayList(); | 87 | ArrayList SendParams = new ArrayList(); |
88 | SendParams.Add(SimParams); | 88 | SendParams.Add(SimParams); |
89 | 89 | ||
90 | // Update agent with target sim | 90 | // Update agent with target sim |
91 | theUser.currentAgent.currentRegion = SimInfo.UUID; | 91 | theUser.currentAgent.currentRegion = SimInfo.UUID; |
92 | theUser.currentAgent.currentHandle = SimInfo.regionHandle; | 92 | theUser.currentAgent.currentHandle = SimInfo.regionHandle; |
93 | 93 | ||
94 | System.Console.WriteLine("Informing region --> " + SimInfo.httpServerURI); | 94 | System.Console.WriteLine("Informing region --> " + SimInfo.httpServerURI); |
95 | // Send | 95 | // Send |
96 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); | 96 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); |
97 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 3000); | 97 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 3000); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | } | 100 | } |