aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer
diff options
context:
space:
mode:
authorlbsa712007-06-29 13:51:21 +0000
committerlbsa712007-06-29 13:51:21 +0000
commitf6deaf8a65693d022f58961a007f2492c9ac97fa (patch)
tree7428eccc93a3f64f46e08d7269bc337f3d26d8a8 /OpenSim/Grid/UserServer
parentDeleted some files that are no longer in use. (I am sure I deleted these yest... (diff)
parent*Hopefully fixed the empty dialog box error on client when logging in on sand... (diff)
downloadopensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.zip
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.gz
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.bz2
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.xz
Switched in NameSpaceChanges
Diffstat (limited to 'OpenSim/Grid/UserServer')
-rw-r--r--OpenSim/Grid/UserServer/Main.cs219
-rw-r--r--OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj134
-rw-r--r--OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build52
-rw-r--r--OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Grid/UserServer/UserManager.cs104
5 files changed, 542 insertions, 0 deletions
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
new file mode 100644
index 0000000..640f91a
--- /dev/null
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -0,0 +1,219 @@
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
29using System;
30using System.Collections;
31using System.Collections.Generic;
32using System.Reflection;
33using System.IO;
34using System.Text;
35using libsecondlife;
36using OpenSim.Framework.User;
37using OpenSim.Framework.Sims;
38using OpenSim.Framework.Inventory;
39using OpenSim.Framework.Interfaces;
40using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers;
42using OpenSim.Framework.Utilities;
43using OpenSim.GenericConfig;
44
45namespace OpenSim.Grid.UserServer
46{
47 /// <summary>
48 /// </summary>
49 public class OpenUser_Main : conscmd_callback
50 {
51 private string ConfigDll = "OpenSim.Grid.UserServer.Config.dll";
52 private string StorageDll = "OpenSim.Framework.Data.MySQL.dll";
53 private UserConfig Cfg;
54 protected IGenericConfig localXMLConfig;
55
56 public UserManager m_userManager;
57
58 public Dictionary<LLUUID, UserProfile> UserSessions = new Dictionary<LLUUID, UserProfile>();
59
60 LogBase m_console;
61
62 [STAThread]
63 public static void Main(string[] args)
64 {
65 Console.WriteLine("Launching UserServer...");
66
67 OpenUser_Main userserver = new OpenUser_Main();
68
69 userserver.Startup();
70 userserver.Work();
71 }
72
73 private OpenUser_Main()
74 {
75 m_console = new LogBase("opengrid-userserver-console.log", "OpenUser", this , false);
76 OpenSim.Framework.Console.MainLog.Instance = m_console;
77 }
78
79 private void Work()
80 {
81 m_console.Notice("Enter help for a list of commands\n");
82
83 while (true)
84 {
85 m_console.MainLogPrompt();
86 }
87 }
88
89 public void Startup()
90 {
91 this.localXMLConfig = new XmlConfig("UserServerConfig.xml");
92 this.localXMLConfig.LoadData();
93 this.ConfigDB(this.localXMLConfig);
94 this.localXMLConfig.Close();
95
96 OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Loading configuration");
97 Cfg = this.LoadConfigDll(this.ConfigDll);
98 Cfg.InitConfig();
99
100 OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Establishing data connection");
101 m_userManager = new UserManager();
102 m_userManager._config = Cfg;
103 m_userManager.AddPlugin(StorageDll);
104
105 OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process");
106 BaseHttpServer httpServer = new BaseHttpServer(8002);
107
108 httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod);
109
110 httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName);
111 httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID);
112
113 httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod);
114
115 httpServer.Start();
116 m_console.Status("Userserver 0.3 - Startup complete");
117 }
118
119
120 public void do_create(string what)
121 {
122 switch (what)
123 {
124 case "user":
125 string tempfirstname;
126 string templastname;
127 string tempMD5Passwd;
128 uint regX = 997;
129 uint regY = 996;
130
131 tempfirstname = m_console.CmdPrompt("First name");
132 templastname = m_console.CmdPrompt("Last name");
133 tempMD5Passwd = m_console.PasswdPrompt("Password");
134 regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X"));
135 regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y"));
136
137 tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + "");
138
139 m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
140 break;
141 }
142 }
143
144 public void RunCmd(string cmd, string[] cmdparams)
145 {
146 switch (cmd)
147 {
148 case "help":
149 m_console.Notice("create user - create a new user");
150 m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)");
151 break;
152
153 case "create":
154 do_create(cmdparams[0]);
155 break;
156
157 case "shutdown":
158 m_console.Close();
159 Environment.Exit(0);
160 break;
161 }
162 }
163
164 private void ConfigDB(IGenericConfig configData)
165 {
166 try
167 {
168 string attri = "";
169 attri = configData.GetAttribute("DataBaseProvider");
170 if (attri == "")
171 {
172 StorageDll = "OpenSim.Framework.Data.DB4o.dll";
173 configData.SetAttribute("DataBaseProvider", "OpenSim.Framework.Data.DB4o.dll");
174 }
175 else
176 {
177 StorageDll = attri;
178 }
179 configData.Commit();
180 }
181 catch (Exception e)
182 {
183
184 }
185 }
186
187 private UserConfig LoadConfigDll(string dllName)
188 {
189 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
190 UserConfig config = null;
191
192 foreach (Type pluginType in pluginAssembly.GetTypes())
193 {
194 if (pluginType.IsPublic)
195 {
196 if (!pluginType.IsAbstract)
197 {
198 Type typeInterface = pluginType.GetInterface("IUserConfig", true);
199
200 if (typeInterface != null)
201 {
202 IUserConfig plug = (IUserConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
203 config = plug.GetConfigObject();
204 break;
205 }
206
207 typeInterface = null;
208 }
209 }
210 }
211 pluginAssembly = null;
212 return config;
213 }
214
215 public void Show(string ShowWhat)
216 {
217 }
218 }
219}
diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj
new file mode 100644
index 0000000..1146b17
--- /dev/null
+++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj
@@ -0,0 +1,134 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{2FC96F92-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Grid.UserServer</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Exe</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Grid.UserServer</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="Db4objects.Db4o.dll" >
62 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="libsecondlife.dll" >
66 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="OpenSim.Framework" >
70 <HintPath>OpenSim.Framework.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="OpenSim.Framework.Console" >
74 <HintPath>OpenSim.Framework.Console.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="OpenSim.Framework.GenericConfig.Xml" >
78 <HintPath>OpenSim.Framework.GenericConfig.Xml.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="OpenSim.Framework.Servers" >
82 <HintPath>OpenSim.Framework.Servers.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 <Reference Include="System" >
86 <HintPath>System.dll</HintPath>
87 <Private>False</Private>
88 </Reference>
89 <Reference Include="System.Data" >
90 <HintPath>System.Data.dll</HintPath>
91 <Private>False</Private>
92 </Reference>
93 <Reference Include="System.Xml" >
94 <HintPath>System.Xml.dll</HintPath>
95 <Private>False</Private>
96 </Reference>
97 <Reference Include="XMLRPC.dll" >
98 <HintPath>..\..\..\bin\XMLRPC.dll</HintPath>
99 <Private>False</Private>
100 </Reference>
101 </ItemGroup>
102 <ItemGroup>
103 <ProjectReference Include="..\..\Framework\Data\OpenSim.Framework.Data.csproj">
104 <Name>OpenSim.Framework.Data</Name>
105 <Project>{36B72A9B-0000-0000-0000-000000000000}</Project>
106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
107 <Private>False</Private>
108 </ProjectReference>
109 <ProjectReference Include="..\..\Framework\UserManager\OpenSim.Framework.UserManagement.csproj">
110 <Name>OpenSim.Framework.UserManagement</Name>
111 <Project>{586E2916-0000-0000-0000-000000000000}</Project>
112 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
113 <Private>False</Private>
114 </ProjectReference>
115 </ItemGroup>
116 <ItemGroup>
117 <Compile Include="Main.cs">
118 <SubType>Code</SubType>
119 </Compile>
120 <Compile Include="UserManager.cs">
121 <SubType>Code</SubType>
122 </Compile>
123 <Compile Include="Properties\AssemblyInfo.cs">
124 <SubType>Code</SubType>
125 </Compile>
126 </ItemGroup>
127 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
128 <PropertyGroup>
129 <PreBuildEvent>
130 </PreBuildEvent>
131 <PostBuildEvent>
132 </PostBuildEvent>
133 </PropertyGroup>
134</Project>
diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build
new file mode 100644
index 0000000..8bc1fc1
--- /dev/null
+++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build
@@ -0,0 +1,52 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Grid.UserServer" 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="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="OpenSim.Grid.UserServer" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="Main.cs" />
15 <include name="UserManager.cs" />
16 <include name="Properties/AssemblyInfo.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="../../../bin/Db4objects.Db4o.dll" />
24 <include name="../../../bin/libsecondlife.dll" />
25 <include name="OpenSim.Framework.dll" />
26 <include name="OpenSim.Framework.Console.dll" />
27 <include name="../../../bin/OpenSim.Framework.Data.dll" />
28 <include name="OpenSim.Framework.GenericConfig.Xml.dll" />
29 <include name="OpenSim.Framework.Servers.dll" />
30 <include name="../../../bin/OpenSim.Framework.UserManagement.dll" />
31 <include name="System.dll" />
32 <include name="System.Data.dll" />
33 <include name="System.Xml.dll" />
34 <include name="../../../bin/XMLRPC.dll" />
35 </references>
36 </csc>
37 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
38 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
39 <copy todir="${project::get-base-directory()}/../../../bin/">
40 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
41 <include name="*.dll"/>
42 <include name="*.exe"/>
43 </fileset>
44 </copy>
45 </target>
46 <target name="clean">
47 <delete dir="${bin.dir}" failonerror="false" />
48 <delete dir="${obj.dir}" failonerror="false" />
49 </target>
50 <target name="doc" description="Creates documentation.">
51 </target>
52</project>
diff --git a/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..5d5ce8d
--- /dev/null
+++ b/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OGS-UserServer")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OGS-UserServer")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("e266513a-090b-4d38-80f6-8599eef68c8c")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
new file mode 100644
index 0000000..c99cf87
--- /dev/null
+++ b/OpenSim/Grid/UserServer/UserManager.cs
@@ -0,0 +1,104 @@
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*/
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Text;
32using OpenSim.Framework.Data;
33using libsecondlife;
34using System.Reflection;
35
36using System.Xml;
37using Nwc.XmlRpc;
38using OpenSim.Framework.Sims;
39using OpenSim.Framework.Inventory;
40using OpenSim.Framework.Utilities;
41
42using OpenSim.Framework.UserManagement;
43
44using System.Security.Cryptography;
45
46namespace OpenSim.Grid.UserServer
47{
48 public class UserManager : UserManagerBase
49 {
50 public UserManager()
51 {
52 }
53
54 /// <summary>
55 /// Customises the login response and fills in missing values.
56 /// </summary>
57 /// <param name="response">The existing response</param>
58 /// <param name="theUser">The user profile</param>
59 public override void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser)
60 {
61 // Load information from the gridserver
62 SimProfile SimInfo = new SimProfile();
63 SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey);
64
65 // Customise the response
66 // Home Location
67 response.Home = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], " +
68 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
69 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
70
71 // Destination
72 response.SimAddress = SimInfo.sim_ip;
73 response.SimPort = (Int32)SimInfo.sim_port;
74 response.RegionX = SimInfo.RegionLocY ;
75 response.RegionY = SimInfo.RegionLocX ;
76
77 // Notify the target of an incoming user
78 Console.WriteLine("Notifying " + SimInfo.regionname + " (" + SimInfo.caps_url + ")");
79
80 // Prepare notification
81 Hashtable SimParams = new Hashtable();
82 SimParams["session_id"] = theUser.currentAgent.sessionID.ToString();
83 SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString();
84 SimParams["firstname"] = theUser.username;
85 SimParams["lastname"] = theUser.surname;
86 SimParams["agent_id"] = theUser.UUID.ToString();
87 SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response.CircuitCode);
88 SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString();
89 SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString();
90 SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString();
91 SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString();
92 ArrayList SendParams = new ArrayList();
93 SendParams.Add(SimParams);
94
95 // Update agent with target sim
96 theUser.currentAgent.currentRegion = SimInfo.UUID;
97 theUser.currentAgent.currentHandle = SimInfo.regionhandle;
98
99 // Send
100 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
101 XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000);
102 }
103 }
104}