diff --git a/Common/OpenGrid.Framework.Communications/CommsManager.cs b/Common/OpenGrid.Framework.Communications/CommsManager.cs new file mode 100644 index 0000000000..0cc22531fb --- /dev/null +++ b/Common/OpenGrid.Framework.Communications/CommsManager.cs @@ -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() + { + + } + + /// + /// + /// + /// + /// + public virtual IRegionCommsHost RegisterRegion(RegionInfo regionInfo) + { + return null; + } + + public virtual bool InformNeighbourChildAgent() + { + return false; + } + } +} diff --git a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj b/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj new file mode 100644 index 0000000000..b53a868c1a --- /dev/null +++ b/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj @@ -0,0 +1,53 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {C9702041-922C-452A-A1B4-7880AF53149A} + Library + Properties + OpenGrid.Framework.Communications + OpenGrid.Framework.Communications + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + {8ACA2445-0000-0000-0000-000000000000} + OpenSim.Framework + + + + + \ No newline at end of file diff --git a/Common/OpenGrid.Framework.Communications/Properties/AssemblyInfo.cs b/Common/OpenGrid.Framework.Communications/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..90693d5b5d --- /dev/null +++ b/Common/OpenGrid.Framework.Communications/Properties/AssemblyInfo.cs @@ -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")] diff --git a/Common/OpenSim.Framework/AuthenticateSessionBase.cs b/Common/OpenSim.Framework/AuthenticateSessionBase.cs new file mode 100644 index 0000000000..ca20478e18 --- /dev/null +++ b/Common/OpenSim.Framework/AuthenticateSessionBase.cs @@ -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 AgentCircuits = new Dictionary(); + + 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; + } + } +} \ No newline at end of file diff --git a/Common/OpenSim.Framework/IRegionCommsHost.cs b/Common/OpenSim.Framework/IRegionCommsHost.cs new file mode 100644 index 0000000000..367ecfc3b4 --- /dev/null +++ b/Common/OpenSim.Framework/IRegionCommsHost.cs @@ -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; + } +} diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj b/Common/OpenSim.Framework/OpenSim.Framework.csproj index 6c2a8c6eeb..f83cb9dadd 100644 --- a/Common/OpenSim.Framework/OpenSim.Framework.csproj +++ b/Common/OpenSim.Framework/OpenSim.Framework.csproj @@ -99,9 +99,11 @@ Code + Code + Code diff --git a/OpenSim.sln b/OpenSim.sln index 0d4074bb15..2a00e9f7b6 100644 --- a/OpenSim.sln +++ b/OpenSim.sln @@ -38,6 +38,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GridInterfaces.Loca EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}" 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 GlobalSection(SolutionConfigurationPlatforms) = preSolution 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}.Release|Any CPU.ActiveCfg = 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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs index 99b86d4ff2..a97ecdf5d5 100644 --- a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs +++ b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs @@ -7,7 +7,7 @@ using OpenSim.Framework.Types; namespace OpenSim { - public class AuthenticateSessionsBase + /* public class AuthenticateSessionsBase { public Dictionary AgentCircuits = new Dictionary(); @@ -101,5 +101,5 @@ namespace OpenSim } return false; } - } + }*/ } diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs index 6c1c7d270c..91772f880e 100644 --- a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs +++ b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text; using libsecondlife; using OpenSim.Framework.Types; +using OpenSim.Framework; namespace OpenSim { diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs index 0802d75477..80cd9d3780 100644 --- a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs +++ b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs @@ -5,6 +5,7 @@ using System.Text; using System.Xml; using libsecondlife; using OpenSim.Framework.Types; +using OpenSim.Framework; using Nwc.XmlRpc; namespace OpenSim diff --git a/OpenSim/OpenSim.RegionServer/PacketServer.cs b/OpenSim/OpenSim.RegionServer/PacketServer.cs index d40de47333..0ab4a8d857 100644 --- a/OpenSim/OpenSim.RegionServer/PacketServer.cs +++ b/OpenSim/OpenSim.RegionServer/PacketServer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text; using libsecondlife.Packets; using OpenSim.Framework.Interfaces; +using OpenSim.Framework; using System.Net; using System.Net.Sockets; using OpenSim.Assets; diff --git a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs b/OpenSim/OpenSim.RegionServer/RegionServerBase.cs index 3b9c6e09e3..b7129c5489 100644 --- a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs +++ b/OpenSim/OpenSim.RegionServer/RegionServerBase.cs @@ -13,6 +13,7 @@ using libsecondlife.Packets; using OpenSim.Terrain; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; +using OpenSim.Framework; using OpenSim.UserServer; using OpenSim.Assets; using OpenSim.CAPS; diff --git a/OpenSim/OpenSim.RegionServer/UDPServer.cs b/OpenSim/OpenSim.RegionServer/UDPServer.cs index 8ec5af1b4c..5d8c1d8751 100644 --- a/OpenSim/OpenSim.RegionServer/UDPServer.cs +++ b/OpenSim/OpenSim.RegionServer/UDPServer.cs @@ -17,6 +17,7 @@ using OpenSim.UserServer; using OpenSim.Assets; using OpenSim.CAPS; using OpenSim.Framework.Console; +using OpenSim.Framework; using Nwc.XmlRpc; using OpenSim.Servers; using OpenSim.GenericConfig; diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs index 77af8627b1..c731dbc50a 100644 --- a/OpenSim/OpenSim.World/World.cs +++ b/OpenSim/OpenSim.World/World.cs @@ -11,6 +11,7 @@ using OpenSim.Physics.Manager; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Inventory; +using OpenSim.Framework; using OpenSim.RegionServer.world.scripting; using OpenSim.Terrain; @@ -34,6 +35,7 @@ namespace OpenSim.world private Dictionary m_scripts; private Mutex updateLock; public string m_datastore; + protected AuthenticateSessionsBase authenticateHandler; #region Properties /// @@ -59,11 +61,12 @@ namespace OpenSim.world /// Dictionary to contain client threads /// Region Handle for this region /// Region Name for this region - public World(Dictionary clientThreads, RegionInfo regInfo) + public World(Dictionary clientThreads, RegionInfo regInfo, AuthenticateSessionsBase authen) { try { updateLock = new Mutex(false); + this.authenticateHandler = authen; m_clientThreads = clientThreads; m_regInfo = regInfo; m_regionHandle = m_regInfo.RegionHandle; diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs index 0a30928318..95b8e1044d 100644 --- a/OpenSim/OpenSim/OpenSimMain.cs +++ b/OpenSim/OpenSim/OpenSimMain.cs @@ -42,6 +42,7 @@ using OpenSim.world; using OpenSim.Terrain; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; +using OpenSim.Framework; using OpenSim.UserServer; using OpenSim.Assets; using OpenSim.CAPS; @@ -233,7 +234,7 @@ namespace OpenSim 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); //LocalWorld.InventoryCache = InventoryCache; //LocalWorld.AssetCache = AssetCache;