Started work on OpenGrid.Framework.Communications

merge
MW 2007-05-31 11:28:11 +00:00
parent f1e1346806
commit c35d360d44
15 changed files with 260 additions and 4 deletions

View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
namespace OpenGrid.Framework.Communications
{
public class CommsManager
{
public CommsManager()
{
}
/// <summary>
///
/// </summary>
/// <param name="regionInfo"></param>
/// <returns></returns>
public virtual IRegionCommsHost RegisterRegion(RegionInfo regionInfo)
{
return null;
}
public virtual bool InformNeighbourChildAgent()
{
return false;
}
}
}

View File

@ -0,0 +1,53 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C9702041-922C-452A-A1B4-7880AF53149A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Communications</RootNamespace>
<AssemblyName>OpenGrid.Framework.Communications</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CommsManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
<Name>OpenSim.Framework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenGrid.Framework.Communications")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenGrid.Framework.Communications")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("13e7c396-78a9-4a5c-baf2-6f980ea75d95")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
namespace OpenSim.Framework
{
public class AuthenticateSessionsBase
{
public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
public AuthenticateSessionsBase()
{
}
public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
{
AgentCircuitData validcircuit = null;
if (this.AgentCircuits.ContainsKey(circuitcode))
{
validcircuit = this.AgentCircuits[circuitcode];
}
AuthenticateResponse user = new AuthenticateResponse();
if (validcircuit == null)
{
//don't have this circuit code in our list
user.Authorised = false;
return (user);
}
if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
{
user.Authorised = true;
user.LoginInfo = new Login();
user.LoginInfo.Agent = agentID;
user.LoginInfo.Session = sessionID;
user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
user.LoginInfo.First = validcircuit.firstname;
user.LoginInfo.Last = validcircuit.lastname;
user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
}
else
{
// Invalid
user.Authorised = false;
}
return (user);
}
public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
{
if (this.AgentCircuits.ContainsKey(circuitCode))
{
this.AgentCircuits[circuitCode] = agentData;
}
else
{
this.AgentCircuits.Add(circuitCode, agentData);
}
}
public LLVector3 GetPosition(uint circuitCode)
{
LLVector3 vec = new LLVector3();
if (this.AgentCircuits.ContainsKey(circuitCode))
{
vec = this.AgentCircuits[circuitCode].startpos;
}
return vec;
}
public void UpdateAgentData(AgentCircuitData agentData)
{
if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode))
{
this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname;
this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname;
this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
// Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
}
}
public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
{
if (this.AgentCircuits.ContainsKey(circuitcode))
{
this.AgentCircuits[circuitcode].child = childstatus;
}
}
public bool GetAgentChildStatus(uint circuitcode)
{
if (this.AgentCircuits.ContainsKey(circuitcode))
{
return this.AgentCircuits[circuitcode].child;
}
return false;
}
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework
{
public delegate void ExpectUserDelegate();
public interface IRegionCommsHost
{
event ExpectUserDelegate ExpectUser;
}
}

View File

@ -99,9 +99,11 @@
<Compile Include="AgentInventory.cs"> <Compile Include="AgentInventory.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="AuthenticateSessionBase.cs" />
<Compile Include="BlockingQueue.cs"> <Compile Include="BlockingQueue.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="IRegionCommsHost.cs" />
<Compile Include="LoginService.cs"> <Compile Include="LoginService.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>

View File

@ -38,6 +38,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GridInterfaces.Loca
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Communications", "Common\OpenGrid.Framework.Communications\OpenGrid.Framework.Communications.csproj", "{C9702041-922C-452A-A1B4-7880AF53149A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -120,6 +122,10 @@ Global
{8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU {8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{C9702041-922C-452A-A1B4-7880AF53149A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9702041-922C-452A-A1B4-7880AF53149A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9702041-922C-452A-A1B4-7880AF53149A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9702041-922C-452A-A1B4-7880AF53149A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -7,7 +7,7 @@ using OpenSim.Framework.Types;
namespace OpenSim namespace OpenSim
{ {
public class AuthenticateSessionsBase /* public class AuthenticateSessionsBase
{ {
public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
@ -101,5 +101,5 @@ namespace OpenSim
} }
return false; return false;
} }
} }*/
} }

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using libsecondlife; using libsecondlife;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework;
namespace OpenSim namespace OpenSim
{ {

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Xml; using System.Xml;
using libsecondlife; using libsecondlife;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework;
using Nwc.XmlRpc; using Nwc.XmlRpc;
namespace OpenSim namespace OpenSim

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using libsecondlife.Packets; using libsecondlife.Packets;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using OpenSim.Assets; using OpenSim.Assets;

View File

@ -13,6 +13,7 @@ using libsecondlife.Packets;
using OpenSim.Terrain; using OpenSim.Terrain;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework;
using OpenSim.UserServer; using OpenSim.UserServer;
using OpenSim.Assets; using OpenSim.Assets;
using OpenSim.CAPS; using OpenSim.CAPS;

View File

@ -17,6 +17,7 @@ using OpenSim.UserServer;
using OpenSim.Assets; using OpenSim.Assets;
using OpenSim.CAPS; using OpenSim.CAPS;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Framework;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using OpenSim.Servers; using OpenSim.Servers;
using OpenSim.GenericConfig; using OpenSim.GenericConfig;

View File

@ -11,6 +11,7 @@ using OpenSim.Physics.Manager;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework.Inventory; using OpenSim.Framework.Inventory;
using OpenSim.Framework;
using OpenSim.RegionServer.world.scripting; using OpenSim.RegionServer.world.scripting;
using OpenSim.Terrain; using OpenSim.Terrain;
@ -34,6 +35,7 @@ namespace OpenSim.world
private Dictionary<string, ScriptFactory> m_scripts; private Dictionary<string, ScriptFactory> m_scripts;
private Mutex updateLock; private Mutex updateLock;
public string m_datastore; public string m_datastore;
protected AuthenticateSessionsBase authenticateHandler;
#region Properties #region Properties
/// <summary> /// <summary>
@ -59,11 +61,12 @@ namespace OpenSim.world
/// <param name="clientThreads">Dictionary to contain client threads</param> /// <param name="clientThreads">Dictionary to contain client threads</param>
/// <param name="regionHandle">Region Handle for this region</param> /// <param name="regionHandle">Region Handle for this region</param>
/// <param name="regionName">Region Name for this region</param> /// <param name="regionName">Region Name for this region</param>
public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo) public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo, AuthenticateSessionsBase authen)
{ {
try try
{ {
updateLock = new Mutex(false); updateLock = new Mutex(false);
this.authenticateHandler = authen;
m_clientThreads = clientThreads; m_clientThreads = clientThreads;
m_regInfo = regInfo; m_regInfo = regInfo;
m_regionHandle = m_regInfo.RegionHandle; m_regionHandle = m_regInfo.RegionHandle;

View File

@ -42,6 +42,7 @@ using OpenSim.world;
using OpenSim.Terrain; using OpenSim.Terrain;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework;
using OpenSim.UserServer; using OpenSim.UserServer;
using OpenSim.Assets; using OpenSim.Assets;
using OpenSim.CAPS; using OpenSim.CAPS;
@ -233,7 +234,7 @@ namespace OpenSim
m_console.componentname = "Region " + regionData.RegionName; m_console.componentname = "Region " + regionData.RegionName;
*/ */
LocalWorld = new World(udpServer.PacketServer.ClientAPIs, regionDat); LocalWorld = new World(udpServer.PacketServer.ClientAPIs, regionDat, authenBase);
this.m_localWorld.Add(LocalWorld); this.m_localWorld.Add(LocalWorld);
//LocalWorld.InventoryCache = InventoryCache; //LocalWorld.InventoryCache = InventoryCache;
//LocalWorld.AssetCache = AssetCache; //LocalWorld.AssetCache = AssetCache;