aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenSim.Framework
diff options
context:
space:
mode:
authorMW2007-05-31 11:28:11 +0000
committerMW2007-05-31 11:28:11 +0000
commitc35d360d44b639e96e900ef0901ae534f2f6d8c6 (patch)
treecce40adc3bb871e49d7cee1508dea574aba2399c /Common/OpenSim.Framework
parentAdded a few summary comments to OpenSim.World files (diff)
downloadopensim-SC-c35d360d44b639e96e900ef0901ae534f2f6d8c6.zip
opensim-SC-c35d360d44b639e96e900ef0901ae534f2f6d8c6.tar.gz
opensim-SC-c35d360d44b639e96e900ef0901ae534f2f6d8c6.tar.bz2
opensim-SC-c35d360d44b639e96e900ef0901ae534f2f6d8c6.tar.xz
Started work on OpenGrid.Framework.Communications
Diffstat (limited to 'Common/OpenSim.Framework')
-rw-r--r--Common/OpenSim.Framework/AuthenticateSessionBase.cs105
-rw-r--r--Common/OpenSim.Framework/IRegionCommsHost.cs13
-rw-r--r--Common/OpenSim.Framework/OpenSim.Framework.csproj2
3 files changed, 120 insertions, 0 deletions
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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Framework.Interfaces;
6using OpenSim.Framework.Types;
7
8namespace OpenSim.Framework
9{
10 public class AuthenticateSessionsBase
11 {
12 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
13
14 public AuthenticateSessionsBase()
15 {
16
17 }
18
19 public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
20 {
21 AgentCircuitData validcircuit = null;
22 if (this.AgentCircuits.ContainsKey(circuitcode))
23 {
24 validcircuit = this.AgentCircuits[circuitcode];
25 }
26 AuthenticateResponse user = new AuthenticateResponse();
27 if (validcircuit == null)
28 {
29 //don't have this circuit code in our list
30 user.Authorised = false;
31 return (user);
32 }
33
34 if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
35 {
36 user.Authorised = true;
37 user.LoginInfo = new Login();
38 user.LoginInfo.Agent = agentID;
39 user.LoginInfo.Session = sessionID;
40 user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
41 user.LoginInfo.First = validcircuit.firstname;
42 user.LoginInfo.Last = validcircuit.lastname;
43 user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
44 user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
45 }
46 else
47 {
48 // Invalid
49 user.Authorised = false;
50 }
51
52 return (user);
53 }
54
55 public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
56 {
57 if (this.AgentCircuits.ContainsKey(circuitCode))
58 {
59 this.AgentCircuits[circuitCode] = agentData;
60 }
61 else
62 {
63 this.AgentCircuits.Add(circuitCode, agentData);
64 }
65 }
66
67 public LLVector3 GetPosition(uint circuitCode)
68 {
69 LLVector3 vec = new LLVector3();
70 if (this.AgentCircuits.ContainsKey(circuitCode))
71 {
72 vec = this.AgentCircuits[circuitCode].startpos;
73 }
74 return vec;
75 }
76
77 public void UpdateAgentData(AgentCircuitData agentData)
78 {
79 if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode))
80 {
81 this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname;
82 this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname;
83 this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
84 // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
85 }
86 }
87
88 public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
89 {
90 if (this.AgentCircuits.ContainsKey(circuitcode))
91 {
92 this.AgentCircuits[circuitcode].child = childstatus;
93 }
94 }
95
96 public bool GetAgentChildStatus(uint circuitcode)
97 {
98 if (this.AgentCircuits.ContainsKey(circuitcode))
99 {
100 return this.AgentCircuits[circuitcode].child;
101 }
102 return false;
103 }
104 }
105} \ 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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework
6{
7 public delegate void ExpectUserDelegate();
8
9 public interface IRegionCommsHost
10 {
11 event ExpectUserDelegate ExpectUser;
12 }
13}
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 @@
99 <Compile Include="AgentInventory.cs"> 99 <Compile Include="AgentInventory.cs">
100 <SubType>Code</SubType> 100 <SubType>Code</SubType>
101 </Compile> 101 </Compile>
102 <Compile Include="AuthenticateSessionBase.cs" />
102 <Compile Include="BlockingQueue.cs"> 103 <Compile Include="BlockingQueue.cs">
103 <SubType>Code</SubType> 104 <SubType>Code</SubType>
104 </Compile> 105 </Compile>
106 <Compile Include="IRegionCommsHost.cs" />
105 <Compile Include="LoginService.cs"> 107 <Compile Include="LoginService.cs">
106 <SubType>Code</SubType> 108 <SubType>Code</SubType>
107 </Compile> 109 </Compile>