aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs131
1 files changed, 0 insertions, 131 deletions
diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs
deleted file mode 100644
index 6f80210..0000000
--- a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs
+++ /dev/null
@@ -1,131 +0,0 @@
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 libsecondlife;
32using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Types;
34
35namespace OpenSim.RegionServer
36{
37 public class AuthenticateSessionsBase
38 {
39 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
40
41 public AuthenticateSessionsBase()
42 {
43
44 }
45
46 public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
47 {
48 AgentCircuitData validcircuit = null;
49 if (this.AgentCircuits.ContainsKey(circuitcode))
50 {
51 validcircuit = this.AgentCircuits[circuitcode];
52 }
53 AuthenticateResponse user = new AuthenticateResponse();
54 if (validcircuit == null)
55 {
56 //don't have this circuit code in our list
57 user.Authorised = false;
58 return (user);
59 }
60
61 if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
62 {
63 user.Authorised = true;
64 user.LoginInfo = new Login();
65 user.LoginInfo.Agent = agentID;
66 user.LoginInfo.Session = sessionID;
67 user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
68 user.LoginInfo.First = validcircuit.firstname;
69 user.LoginInfo.Last = validcircuit.lastname;
70 user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
71 user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
72 }
73 else
74 {
75 // Invalid
76 user.Authorised = false;
77 }
78
79 return (user);
80 }
81
82 public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
83 {
84 if (this.AgentCircuits.ContainsKey(circuitCode))
85 {
86 this.AgentCircuits[circuitCode] = agentData;
87 }
88 else
89 {
90 this.AgentCircuits.Add(circuitCode, agentData);
91 }
92 }
93
94 public LLVector3 GetPosition(uint circuitCode)
95 {
96 LLVector3 vec = new LLVector3();
97 if (this.AgentCircuits.ContainsKey(circuitCode))
98 {
99 vec = this.AgentCircuits[circuitCode].startpos;
100 }
101 return vec;
102 }
103
104 public void UpdateAgentData(AgentCircuitData agentData)
105 {
106 if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode))
107 {
108 this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname;
109 this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname;
110 this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
111 }
112 }
113
114 public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
115 {
116 if (this.AgentCircuits.ContainsKey(circuitcode))
117 {
118 this.AgentCircuits[circuitcode].child = childstatus;
119 }
120 }
121
122 public bool GetAgentChildStatus(uint circuitcode)
123 {
124 if (this.AgentCircuits.ContainsKey(circuitcode))
125 {
126 return this.AgentCircuits[circuitcode].child;
127 }
128 return false;
129 }
130 }
131}