aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.LocalCommunications
diff options
context:
space:
mode:
authorMW2007-06-16 14:29:11 +0000
committerMW2007-06-16 14:29:11 +0000
commit3c8daee51027c5beb857e78c1972db0936761af3 (patch)
tree1d27af6f5af1cc2085fc4f874047fdf990f0fed5 /OpenSim/OpenSim.LocalCommunications
parentVery Preliminary border crossing added to sugilite. (Note: Sugilite doesn't h... (diff)
downloadopensim-SC_OLD-3c8daee51027c5beb857e78c1972db0936761af3.zip
opensim-SC_OLD-3c8daee51027c5beb857e78c1972db0936761af3.tar.gz
opensim-SC_OLD-3c8daee51027c5beb857e78c1972db0936761af3.tar.bz2
opensim-SC_OLD-3c8daee51027c5beb857e78c1972db0936761af3.tar.xz
Some Rearranging of CommsManager.
Diffstat (limited to 'OpenSim/OpenSim.LocalCommunications')
-rw-r--r--OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs51
-rw-r--r--OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs179
-rw-r--r--OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.csproj106
-rw-r--r--OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.csproj.user12
-rw-r--r--OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.dll.build45
-rw-r--r--OpenSim/OpenSim.LocalCommunications/Properties/AssemblyInfo.cs35
6 files changed, 428 insertions, 0 deletions
diff --git a/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs b/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs
new file mode 100644
index 0000000..1cb5f6f
--- /dev/null
+++ b/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs
@@ -0,0 +1,51 @@
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 libsecondlife;
33using OpenSim.Framework;
34using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types;
36using OpenGrid.Framework.Communications;
37
38namespace OpenSim.LocalCommunications
39{
40 public class CommunicationsLocal : CommunicationsManager
41 {
42 public LocalBackEndServices SandManager = new LocalBackEndServices();
43
44 public CommunicationsLocal()
45 {
46 UserServer = null;
47 GridServer = SandManager;
48 InterSims = SandManager;
49 }
50 }
51}
diff --git a/OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs b/OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs
new file mode 100644
index 0000000..dfc4505
--- /dev/null
+++ b/OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs
@@ -0,0 +1,179 @@
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.Generic;
30using System.Text;
31using OpenGrid.Framework.Communications;
32using libsecondlife;
33using OpenSim.Framework.Types;
34using OpenSim.Framework;
35
36namespace OpenSim.LocalCommunications
37{
38
39
40 public class LocalBackEndServices : IGridServices, IInterRegionCommunications
41 {
42 protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>();
43 protected Dictionary<ulong, RegionCommsHostBase> regionHosts = new Dictionary<ulong, RegionCommsHostBase>();
44
45 public LocalBackEndServices()
46 {
47
48 }
49
50 /// <summary>
51 /// Register a region method with the BackEnd Services.
52 /// </summary>
53 /// <param name="regionInfo"></param>
54 /// <returns></returns>
55 public RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
56 {
57 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
58 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
59 {
60 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
61 this.regions.Add(regionInfo.RegionHandle, regionInfo);
62 RegionCommsHostBase regionHost = new RegionCommsHostBase();
63 this.regionHosts.Add(regionInfo.RegionHandle, regionHost);
64
65 return regionHost;
66 }
67
68 //already in our list of regions so for now lets return null
69 return null;
70 }
71
72 /// <summary>
73 /// </summary>
74 /// <param name="regionInfo"></param>
75 /// <returns></returns>
76 public List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
77 {
78 // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle);
79 List<RegionInfo> neighbours = new List<RegionInfo>();
80
81 foreach (RegionInfo reg in this.regions.Values)
82 {
83 // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY);
84 if (reg.RegionHandle != regionInfo.RegionHandle)
85 {
86 //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location");
87 if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2)))
88 {
89 if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2)))
90 {
91 neighbours.Add(reg);
92 }
93 }
94 }
95 }
96 return neighbours;
97 }
98
99 /// <summary>
100 ///
101 /// </summary>
102 /// <param name="regionHandle"></param>
103 /// <returns></returns>
104 public RegionInfo RequestNeighbourInfo(ulong regionHandle)
105 {
106 if (this.regions.ContainsKey(regionHandle))
107 {
108 return this.regions[regionHandle];
109 }
110 return null;
111 }
112
113 /// <summary>
114 /// </summary>
115 /// <param name="regionHandle"></param>
116 /// <param name="agentData"></param>
117 /// <returns></returns>
118 public bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
119 {
120 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
121 if (this.regionHosts.ContainsKey(regionHandle))
122 {
123 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
124 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData);
125 return true;
126 }
127 return false;
128 }
129
130 /// <summary>
131 ///
132 /// </summary>
133 /// <param name="regionHandle"></param>
134 /// <param name="agentID"></param>
135 /// <param name="position"></param>
136 /// <returns></returns>
137 public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
138 {
139 if (this.regionHosts.ContainsKey(regionHandle))
140 {
141 // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing");
142 this.regionHosts[regionHandle].ExpectAvatarCrossing(regionHandle, agentID, position);
143 return true;
144 }
145 return false;
146 }
147
148 /// <summary>
149 /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session
150 /// </summary>
151 /// <param name="regionHandle"></param>
152 /// <param name="loginData"></param>
153 /// <returns></returns>
154 public bool AddNewSession(ulong regionHandle, Login loginData)
155 {
156 //Console.WriteLine(" comms manager been told to expect new user");
157 AgentCircuitData agent = new AgentCircuitData();
158 agent.AgentID = loginData.Agent;
159 agent.firstname = loginData.First;
160 agent.lastname = loginData.Last;
161 agent.SessionID = loginData.Session;
162 agent.SecureSessionID = loginData.SecureSession;
163 agent.circuitcode = loginData.CircuitCode;
164 agent.BaseFolder = loginData.BaseFolder;
165 agent.InventoryFolder = loginData.InventoryFolder;
166 agent.startpos = new LLVector3(128, 128, 70);
167
168 if (this.regionHosts.ContainsKey(regionHandle))
169 {
170 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent);
171 return true;
172 }
173
174 // region not found
175 return false;
176 }
177 }
178}
179
diff --git a/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.csproj b/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.csproj
new file mode 100644
index 0000000..95c9f98
--- /dev/null
+++ b/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.csproj
@@ -0,0 +1,106 @@
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>{79CED992-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.LocalCommunications</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.LocalCommunications</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="libsecondlife.dll" >
62 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System" >
66 <HintPath>System.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Xml" >
70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 </ItemGroup>
74 <ItemGroup>
75 <ProjectReference Include="..\..\Common\OpenGrid.Framework.Communications\OpenGrid.Framework.Communications.csproj">
76 <Name>OpenGrid.Framework.Communications</Name>
77 <Project>{683344D5-0000-0000-0000-000000000000}</Project>
78 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
79 <Private>False</Private>
80 </ProjectReference>
81 <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
82 <Name>OpenSim.Framework</Name>
83 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
84 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
85 <Private>False</Private>
86 </ProjectReference>
87 </ItemGroup>
88 <ItemGroup>
89 <Compile Include="CommunicationsLocal.cs">
90 <SubType>Code</SubType>
91 </Compile>
92 <Compile Include="LocalBackEndServices.cs">
93 <SubType>Code</SubType>
94 </Compile>
95 <Compile Include="Properties\AssemblyInfo.cs">
96 <SubType>Code</SubType>
97 </Compile>
98 </ItemGroup>
99 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
100 <PropertyGroup>
101 <PreBuildEvent>
102 </PreBuildEvent>
103 <PostBuildEvent>
104 </PostBuildEvent>
105 </PropertyGroup>
106</Project>
diff --git a/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.csproj.user b/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.csproj.user
new file mode 100644
index 0000000..5941547
--- /dev/null
+++ b/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\Sugilite\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.dll.build b/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.dll.build
new file mode 100644
index 0000000..2ea6497
--- /dev/null
+++ b/OpenSim/OpenSim.LocalCommunications/OpenSim.LocalCommunications.dll.build
@@ -0,0 +1,45 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.LocalCommunications" 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="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.LocalCommunications" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="CommunicationsLocal.cs" />
15 <include name="LocalBackEndServices.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/libsecondlife.dll" />
24 <include name="../../bin/OpenGrid.Framework.Communications.dll" />
25 <include name="../../bin/OpenSim.Framework.dll" />
26 <include name="System.dll" />
27 <include name="System.Xml.dll" />
28 </references>
29 </csc>
30 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
31 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
32 <copy todir="${project::get-base-directory()}/../../bin/">
33 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
34 <include name="*.dll"/>
35 <include name="*.exe"/>
36 </fileset>
37 </copy>
38 </target>
39 <target name="clean">
40 <delete dir="${bin.dir}" failonerror="false" />
41 <delete dir="${obj.dir}" failonerror="false" />
42 </target>
43 <target name="doc" description="Creates documentation.">
44 </target>
45</project>
diff --git a/OpenSim/OpenSim.LocalCommunications/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.LocalCommunications/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8e6e711
--- /dev/null
+++ b/OpenSim/OpenSim.LocalCommunications/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
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("OpenSim.LocalCommunications")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.LocalCommunications")]
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("fb173926-bd0a-4cd0-bb45-185b2f72ddfb")]
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// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]