From c35d360d44b639e96e900ef0901ae534f2f6d8c6 Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 31 May 2007 11:28:11 +0000 Subject: Started work on OpenGrid.Framework.Communications --- .../CommsManager.cs | 33 +++++++ .../OpenGrid.Framework.Communications.csproj | 53 +++++++++++ .../Properties/AssemblyInfo.cs | 35 +++++++ .../OpenSim.Framework/AuthenticateSessionBase.cs | 105 +++++++++++++++++++++ Common/OpenSim.Framework/IRegionCommsHost.cs | 13 +++ Common/OpenSim.Framework/OpenSim.Framework.csproj | 2 + 6 files changed, 241 insertions(+) create mode 100644 Common/OpenGrid.Framework.Communications/CommsManager.cs create mode 100644 Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj create mode 100644 Common/OpenGrid.Framework.Communications/Properties/AssemblyInfo.cs create mode 100644 Common/OpenSim.Framework/AuthenticateSessionBase.cs create mode 100644 Common/OpenSim.Framework/IRegionCommsHost.cs (limited to 'Common') diff --git a/Common/OpenGrid.Framework.Communications/CommsManager.cs b/Common/OpenGrid.Framework.Communications/CommsManager.cs new file mode 100644 index 0000000..0cc2253 --- /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 0000000..b53a868 --- /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 0000000..90693d5 --- /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 0000000..ca20478 --- /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 0000000..367ecfc --- /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 6c2a8c6..f83cb9d 100644 --- a/Common/OpenSim.Framework/OpenSim.Framework.csproj +++ b/Common/OpenSim.Framework/OpenSim.Framework.csproj @@ -99,9 +99,11 @@ Code + Code + Code -- cgit v1.1