aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common
diff options
context:
space:
mode:
Diffstat (limited to 'Common')
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs18
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs248
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs70
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/OGSUserServices.cs25
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj144
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/Properties/AssemblyInfo.cs35
-rw-r--r--Common/OpenGrid.Framework.Communications/CommunicationsManager.cs51
-rw-r--r--Common/OpenGrid.Framework.Communications/IGridServices.cs51
-rw-r--r--Common/OpenGrid.Framework.Communications/IInterRegionCommunications.cs41
-rw-r--r--Common/OpenGrid.Framework.Communications/IUserServices.cs44
-rw-r--r--Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj112
-rw-r--r--Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.dll.build47
-rw-r--r--Common/OpenGrid.Framework.Communications/Properties/AssemblyInfo.cs62
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs166
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/DB4oManager.cs165
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs205
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj111
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.mine111
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.r858111
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.r921111
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build47
-rw-r--r--Common/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs35
-rw-r--r--Common/OpenGrid.Framework.Data/GridData.cs113
-rw-r--r--Common/OpenGrid.Framework.Data/ILogData.cs94
-rw-r--r--Common/OpenGrid.Framework.Data/IniConfig.cs100
-rw-r--r--Common/OpenGrid.Framework.Data/InventoryData.cs187
-rw-r--r--Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj116
-rw-r--r--Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.mine113
-rw-r--r--Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.r858110
-rw-r--r--Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.r921113
-rw-r--r--Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build50
-rw-r--r--Common/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs35
-rw-r--r--Common/OpenGrid.Framework.Data/ReservationData.cs51
-rw-r--r--Common/OpenGrid.Framework.Data/SimProfileData.cs114
-rw-r--r--Common/OpenGrid.Framework.Data/UserData.cs131
-rw-r--r--Common/OpenGrid.Framework.Data/UserProfileData.cs182
-rw-r--r--Common/OpenGrid.Framework.UserManager/LoginResponse.cs645
-rw-r--r--Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj125
-rw-r--r--Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj.user12
-rw-r--r--Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build50
-rw-r--r--Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.csproj122
-rw-r--r--Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.csproj.user12
-rw-r--r--Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.dll.build49
-rw-r--r--Common/OpenGrid.Framework.UserManager/UserManagerBase.cs641
-rw-r--r--Common/OpenSim.Framework.Console/AssemblyInfo.cs58
-rw-r--r--Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs39
-rw-r--r--Common/OpenSim.Framework.Console/LogBase.cs238
-rw-r--r--Common/OpenSim.Framework.Console/MainLog.cs49
-rw-r--r--Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj89
-rw-r--r--Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build42
-rw-r--r--Common/OpenSim.Framework/AgentInventory.cs267
-rw-r--r--Common/OpenSim.Framework/AuthenticateSessionBase.cs132
-rw-r--r--Common/OpenSim.Framework/BlockingQueue.cs60
-rw-r--r--Common/OpenSim.Framework/IRegionCommsListener.cs47
-rw-r--r--Common/OpenSim.Framework/Interfaces/AuthenticateResponse.cs51
-rw-r--r--Common/OpenSim.Framework/Interfaces/Config/IGenericConfig.cs42
-rw-r--r--Common/OpenSim.Framework/Interfaces/Config/IGridConfig.cs63
-rw-r--r--Common/OpenSim.Framework/Interfaces/Config/IUserConfig.cs57
-rw-r--r--Common/OpenSim.Framework/Interfaces/IAssetServer.cs69
-rw-r--r--Common/OpenSim.Framework/Interfaces/IClientAPI.cs160
-rw-r--r--Common/OpenSim.Framework/Interfaces/ILocalStorage.cs69
-rw-r--r--Common/OpenSim.Framework/Interfaces/IUserServer.cs42
-rw-r--r--Common/OpenSim.Framework/Interfaces/IWorld.cs45
-rw-r--r--Common/OpenSim.Framework/Interfaces/Scripting/IScriptAPI.cs42
-rw-r--r--Common/OpenSim.Framework/Interfaces/Scripting/IScriptEngine.cs41
-rw-r--r--Common/OpenSim.Framework/LLSDHelpers.cs246
-rw-r--r--Common/OpenSim.Framework/Logger.cs85
-rw-r--r--Common/OpenSim.Framework/LoginService.cs41
-rw-r--r--Common/OpenSim.Framework/OpenSim.Framework.csproj222
-rw-r--r--Common/OpenSim.Framework/OpenSim.Framework.dll.build83
-rw-r--r--Common/OpenSim.Framework/Properties/AssemblyInfo.cs33
-rw-r--r--Common/OpenSim.Framework/RegionCommsListener.cs69
-rw-r--r--Common/OpenSim.Framework/Remoting.cs136
-rw-r--r--Common/OpenSim.Framework/SimProfile.cs122
-rw-r--r--Common/OpenSim.Framework/Types/AgentCiruitData.cs50
-rw-r--r--Common/OpenSim.Framework/Types/AgentWearable.cs60
-rw-r--r--Common/OpenSim.Framework/Types/AssetBase.cs49
-rw-r--r--Common/OpenSim.Framework/Types/AssetLandmark.cs61
-rw-r--r--Common/OpenSim.Framework/Types/AssetStorage.cs50
-rw-r--r--Common/OpenSim.Framework/Types/EstateSettings.cs97
-rw-r--r--Common/OpenSim.Framework/Types/Login.cs52
-rw-r--r--Common/OpenSim.Framework/Types/MapBlockData.cs25
-rw-r--r--Common/OpenSim.Framework/Types/NeighbourInfo.cs50
-rw-r--r--Common/OpenSim.Framework/Types/NetworkServersInfo.cs181
-rw-r--r--Common/OpenSim.Framework/Types/ParcelData.cs115
-rw-r--r--Common/OpenSim.Framework/Types/PrimData.cs230
-rw-r--r--Common/OpenSim.Framework/Types/RegionHandle.cs120
-rw-r--r--Common/OpenSim.Framework/Types/RegionInfo.cs304
-rw-r--r--Common/OpenSim.Framework/UserProfile.cs89
-rw-r--r--Common/OpenSim.Framework/Util.cs186
-rw-r--r--Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj93
-rw-r--r--Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build42
-rw-r--r--Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs35
-rw-r--r--Common/OpenSim.GenericConfig/Xml/XmlConfig.cs123
-rw-r--r--Common/OpenSim.Servers/BaseHttpServer.cs312
-rw-r--r--Common/OpenSim.Servers/CheckSumServer.cs141
-rw-r--r--Common/OpenSim.Servers/IRestHandler.cs35
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.csproj125
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.dll.build51
-rw-r--r--Common/OpenSim.Servers/UDPServerBase.cs95
-rw-r--r--Common/OpenSim.Servers/XmlRpcMethod.cs34
-rw-r--r--Common/XmlRpcCS/Logger.cs46
-rw-r--r--Common/XmlRpcCS/SimpleHttpRequest.cs204
-rw-r--r--Common/XmlRpcCS/XMLRPC.csproj138
-rw-r--r--Common/XmlRpcCS/XMLRPC.dll.build58
-rw-r--r--Common/XmlRpcCS/XmlRpcBoxcarRequest.cs51
-rw-r--r--Common/XmlRpcCS/XmlRpcClientProxy.cs61
-rw-r--r--Common/XmlRpcCS/XmlRpcDeserializer.cs195
-rw-r--r--Common/XmlRpcCS/XmlRpcErrorCodes.cs51
-rw-r--r--Common/XmlRpcCS/XmlRpcException.cs39
-rw-r--r--Common/XmlRpcCS/XmlRpcExposedAttribute.cs60
-rw-r--r--Common/XmlRpcCS/XmlRpcRequest.cs150
-rw-r--r--Common/XmlRpcCS/XmlRpcRequestDeserializer.cs64
-rw-r--r--Common/XmlRpcCS/XmlRpcRequestSerializer.cs51
-rw-r--r--Common/XmlRpcCS/XmlRpcResponder.cs98
-rw-r--r--Common/XmlRpcCS/XmlRpcResponse.cs85
-rw-r--r--Common/XmlRpcCS/XmlRpcResponseDeserializer.cs65
-rw-r--r--Common/XmlRpcCS/XmlRpcResponseSerializer.cs57
-rw-r--r--Common/XmlRpcCS/XmlRpcSerializer.cs109
-rw-r--r--Common/XmlRpcCS/XmlRpcServer.cs239
-rw-r--r--Common/XmlRpcCS/XmlRpcSystemObject.cs252
-rw-r--r--Common/XmlRpcCS/XmlRpcXmlTokens.cs76
122 files changed, 0 insertions, 12868 deletions
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs b/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs
deleted file mode 100644
index 563eaf7..0000000
--- a/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs
+++ /dev/null
@@ -1,18 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Types;
5using OpenGrid.Framework.Communications;
6namespace OpenGrid.Framework.Communications.OGS1
7{
8 public class GridCommsManager : CommunicationsManager
9 {
10 private OGS1GridServices gridInterComms = new OGS1GridServices();
11 public GridCommsManager(NetworkServersInfo serversInfo) :base(serversInfo)
12 {
13 GridServer = gridInterComms;
14 InterRegion = gridInterComms;
15 UserServer = new OGSUserServices();
16 }
17 }
18}
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs b/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs
deleted file mode 100644
index db64f0c..0000000
--- a/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs
+++ /dev/null
@@ -1,248 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Collections;
4using System.Text;
5using System.Runtime.Remoting;
6using System.Runtime.Remoting.Channels;
7using System.Runtime.Remoting.Channels.Tcp;
8
9using OpenSim.Servers;
10using OpenSim.Framework;
11using OpenSim.Framework.Types;
12using OpenGrid.Framework.Communications;
13
14using Nwc.XmlRpc;
15using libsecondlife;
16
17namespace OpenGrid.Framework.Communications.OGS1
18{
19 public class OGS1GridServices : IGridServices, IInterRegionCommunications
20 {
21 public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>();
22 public GridInfo grid;
23 public BaseHttpServer httpListener;
24 private bool initialised = false;
25
26 public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo)
27 {
28 Hashtable GridParams = new Hashtable();
29
30 grid = gridInfo;
31
32 // Login / Authentication
33 GridParams["authkey"] = gridInfo.GridServerSendKey;
34 GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated();
35 GridParams["sim_ip"] = regionInfo.CommsExternalAddress;
36 GridParams["sim_port"] = regionInfo.CommsIPListenPort.ToString();
37
38 // Package into an XMLRPC Request
39 ArrayList SendParams = new ArrayList();
40 SendParams.Add(GridParams);
41
42 // Send Request
43 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
44 XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000);
45 Hashtable GridRespData = (Hashtable)GridResp.Value;
46 Hashtable griddatahash = GridRespData;
47
48 // Process Response
49 if (GridRespData.ContainsKey("error"))
50 {
51 string errorstring = (string)GridRespData["error"];
52 OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring);
53 return null;
54 }
55
56 if (!this.listeners.ContainsKey(regionInfo.RegionHandle))
57 {
58 // initialised = true;
59 httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort);
60 httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser);
61 httpListener.Start();
62 }
63
64 // Initialise the background listeners
65 listeners[regionInfo.RegionHandle] = new RegionCommsListener();
66
67 return listeners[regionInfo.RegionHandle];
68 }
69
70 public List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
71 {
72 Hashtable respData = MapBlockQuery((int)regionInfo.RegionLocX - 1, (int)regionInfo.RegionLocY - 1, (int)regionInfo.RegionLocX + 1, (int)regionInfo.RegionLocY + 1);
73
74 List<RegionInfo> neighbours = new List<RegionInfo>();
75
76 foreach (Hashtable n in (Hashtable)respData.Values)
77 {
78 RegionInfo neighbour = new RegionInfo();
79
80 //OGS1
81 neighbour.RegionHandle = (ulong)n["regionhandle"];
82 neighbour.RegionLocX = (uint)n["x"];
83 neighbour.RegionLocY = (uint)n["y"];
84 neighbour.RegionName = (string)n["name"];
85
86 //OGS1+
87 neighbour.CommsIPListenAddr = (string)n["sim_ip"];
88 neighbour.CommsIPListenPort = (int)n["sim_port"];
89 neighbour.CommsExternalAddress = (string)n["sim_uri"];
90 neighbour.SimUUID = (string)n["uuid"];
91
92 neighbours.Add(neighbour);
93 }
94
95 return neighbours;
96 }
97
98 public RegionInfo RequestNeighbourInfo(ulong regionHandle)
99 {
100 OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented - RequestNeighbourInfo()");
101 return null;
102 }
103
104 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
105 {
106 Hashtable respData = MapBlockQuery(minX, minY, maxX, maxY);
107
108 List<MapBlockData> neighbours = new List<MapBlockData>();
109
110 foreach (Hashtable n in (Hashtable)respData.Values)
111 {
112 MapBlockData neighbour = new MapBlockData();
113
114 neighbour.X = (ushort)n["x"];
115 neighbour.Y = (ushort)n["y"];
116
117 neighbour.Name = (string)n["name"];
118 neighbour.Access = (byte)n["access"];
119 neighbour.RegionFlags = (uint)n["region-flags"];
120 neighbour.WaterHeight = (byte)n["water-height"];
121 neighbour.MapImageId = (string)n["map-image-id"];
122
123 neighbours.Add(neighbour);
124 }
125
126 return neighbours;
127 }
128
129 /// <summary>
130 /// Performs a XML-RPC query against the grid server returning mapblock information in the specified coordinates
131 /// </summary>
132 /// <remarks>REDUNDANT - OGS1 is to be phased out in favour of OGS2</remarks>
133 /// <param name="minX">Minimum X value</param>
134 /// <param name="minY">Minimum Y value</param>
135 /// <param name="maxX">Maximum X value</param>
136 /// <param name="maxY">Maximum Y value</param>
137 /// <returns>Hashtable of hashtables containing map data elements</returns>
138 private Hashtable MapBlockQuery(int minX, int minY, int maxX, int maxY)
139 {
140 Hashtable param = new Hashtable();
141 param["xmin"] = minX;
142 param["ymin"] = minY;
143 param["xmax"] = maxX;
144 param["ymax"] = maxY;
145 IList parameters = new ArrayList();
146 parameters.Add(param);
147 XmlRpcRequest req = new XmlRpcRequest("map_block", parameters);
148 XmlRpcResponse resp = req.Send(grid.GridServerURI, 3000);
149 Hashtable respData = (Hashtable)resp.Value;
150 return respData;
151 }
152
153 // Grid Request Processing
154 public XmlRpcResponse ExpectUser(XmlRpcRequest request)
155 {
156 Hashtable requestData = (Hashtable)request.Params[0];
157 AgentCircuitData agentData = new AgentCircuitData();
158 agentData.SessionID = new LLUUID((string)requestData["session_id"]);
159 agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
160 agentData.firstname = (string)requestData["firstname"];
161 agentData.lastname = (string)requestData["lastname"];
162 agentData.AgentID = new LLUUID((string)requestData["agent_id"]);
163 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
164 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
165 {
166 agentData.child = true;
167 }
168 else
169 {
170 agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
171 agentData.child = false;
172
173 }
174
175 if (listeners.ContainsKey((ulong)requestData["regionhandle"]))
176 {
177 this.listeners[(ulong)requestData["regionhandle"]].TriggerExpectUser((ulong)requestData["regionhandle"], agentData);
178 }
179 else
180 {
181 OpenSim.Framework.Console.MainLog.Instance.Error("ExpectUser() - Unknown region " + ((ulong)requestData["regionhandle"]).ToString());
182 }
183
184 return new XmlRpcResponse();
185 }
186
187 #region InterRegion Comms
188 private void StartRemoting()
189 {
190 TcpChannel ch = new TcpChannel(8895);
191 ChannelServices.RegisterChannel(ch);
192
193 WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry( Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton);
194 RemotingConfiguration.RegisterWellKnownServiceType(wellType);
195 InterRegionSingleton.Instance.OnArrival += this.IncomingArrival;
196 InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent;
197 }
198
199 #region Methods called by regions in this instance
200 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
201 {
202 if (this.listeners.ContainsKey(regionHandle))
203 {
204 this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
205 return true;
206 }
207 //TODO need to see if we know about where this region is and use .net remoting
208 // to inform it.
209 return false;
210 }
211
212 public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
213 {
214 if (this.listeners.ContainsKey(regionHandle))
215 {
216 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
217 return true;
218 }
219 //TODO need to see if we know about where this region is and use .net remoting
220 // to inform it.
221 return false;
222 }
223 #endregion
224
225 #region Methods triggered by calls from external instances
226 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
227 {
228 if (this.listeners.ContainsKey(regionHandle))
229 {
230 this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
231 return true;
232 }
233 return false;
234 }
235
236 public bool IncomingArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
237 {
238 if (this.listeners.ContainsKey(regionHandle))
239 {
240 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
241 return true;
242 }
243 return false;
244 }
245 #endregion
246 #endregion
247 }
248}
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs b/Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs
deleted file mode 100644
index 3d74e2f..0000000
--- a/Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs
+++ /dev/null
@@ -1,70 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Types;
5using OpenGrid.Framework.Communications;
6namespace OpenGrid.Framework.Communications.OGS1
7{
8 public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData);
9 public delegate bool ExpectArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position);
10
11 public sealed class InterRegionSingleton
12 {
13 static readonly InterRegionSingleton instance = new InterRegionSingleton();
14
15 public event InformRegionChild OnChildAgent;
16 public event ExpectArrival OnArrival;
17
18 static InterRegionSingleton()
19 {
20 }
21
22 InterRegionSingleton()
23 {
24 }
25
26 public static InterRegionSingleton Instance
27 {
28 get
29 {
30 return instance;
31 }
32 }
33
34 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
35 {
36 if (OnChildAgent != null)
37 {
38 return OnChildAgent(regionHandle, agentData);
39 }
40 return false;
41 }
42
43 public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
44 {
45 if (OnArrival != null)
46 {
47 return OnArrival(regionHandle, agentID, position);
48 }
49 return false;
50 }
51 }
52
53 public class OGS1InterRegionRemoting : MarshalByRefObject
54 {
55
56 public OGS1InterRegionRemoting()
57 {
58 }
59
60 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
61 {
62 return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData);
63 }
64
65 public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
66 {
67 return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position);
68 }
69 }
70}
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OGSUserServices.cs b/Common/OpenGrid.Framework.Communications.OGS1/OGSUserServices.cs
deleted file mode 100644
index 1667e6b..0000000
--- a/Common/OpenGrid.Framework.Communications.OGS1/OGSUserServices.cs
+++ /dev/null
@@ -1,25 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Communications;
5using OpenGrid.Framework.Data;
6using libsecondlife;
7
8namespace OpenGrid.Framework.Communications.OGS1
9{
10 public class OGSUserServices :IUserServices
11 {
12 public UserProfileData GetUserProfile(string firstName, string lastName)
13 {
14 return null;
15 }
16 public UserProfileData GetUserProfile(string name)
17 {
18 return null;
19 }
20 public UserProfileData GetUserProfile(LLUUID avatarID)
21 {
22 return null;
23 }
24 }
25}
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj b/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj
deleted file mode 100644
index 804ddba..0000000
--- a/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj
+++ /dev/null
@@ -1,144 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{17442AF1-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Communications.OGS1</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Communications.OGS1</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="libsecondlife.dll" >
62 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System" >
66 <HintPath>System.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="System.Runtime.Remoting" >
74 <HintPath>System.Runtime.Remoting.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="System.Xml" >
78 <HintPath>System.Xml.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenGrid.Framework.Communications\OpenGrid.Framework.Communications.csproj">
84 <Name>OpenGrid.Framework.Communications</Name>
85 <Project>{683344D5-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
90 <Name>OpenGrid.Framework.Data</Name>
91 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private>
94 </ProjectReference>
95 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
96 <Name>OpenSim.Framework</Name>
97 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private>
100 </ProjectReference>
101 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
102 <Name>OpenSim.Framework.Console</Name>
103 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
104 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
105 <Private>False</Private>
106 </ProjectReference>
107 <ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj">
108 <Name>OpenSim.Servers</Name>
109 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
110 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
111 <Private>False</Private>
112 </ProjectReference>
113 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
114 <Name>XMLRPC</Name>
115 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
116 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
117 <Private>False</Private>
118 </ProjectReference>
119 </ItemGroup>
120 <ItemGroup>
121 <Compile Include="GridCommsManager.cs">
122 <SubType>Code</SubType>
123 </Compile>
124 <Compile Include="OGS1GridServices.cs">
125 <SubType>Code</SubType>
126 </Compile>
127 <Compile Include="OGSInterSimComms.cs">
128 <SubType>Code</SubType>
129 </Compile>
130 <Compile Include="OGSUserServices.cs">
131 <SubType>Code</SubType>
132 </Compile>
133 <Compile Include="Properties\AssemblyInfo.cs">
134 <SubType>Code</SubType>
135 </Compile>
136 </ItemGroup>
137 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
138 <PropertyGroup>
139 <PreBuildEvent>
140 </PreBuildEvent>
141 <PostBuildEvent>
142 </PostBuildEvent>
143 </PropertyGroup>
144</Project>
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/Properties/AssemblyInfo.cs b/Common/OpenGrid.Framework.Communications.OGS1/Properties/AssemblyInfo.cs
deleted file mode 100644
index 0c6f965..0000000
--- a/Common/OpenGrid.Framework.Communications.OGS1/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework.Communications.OGS1")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenGrid.Framework.Communications.OGS1")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("a8b2b39b-c83b-41e2-b0b5-7ccfc1fddae7")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs b/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs
deleted file mode 100644
index 8d8a647..0000000
--- a/Common/OpenGrid.Framework.Communications/CommunicationsManager.cs
+++ /dev/null
@@ -1,51 +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;
30using System.Collections.Generic;
31using System.Text;
32using OpenSim.Framework;
33using OpenSim.Framework.Interfaces;
34using OpenSim.Framework.Types;
35using libsecondlife;
36
37namespace OpenGrid.Framework.Communications
38{
39
40 public class CommunicationsManager
41 {
42 public IUserServices UserServer;
43 public IGridServices GridServer;
44 public IInterRegionCommunications InterRegion;
45
46 public CommunicationsManager(NetworkServersInfo serversInfo)
47 {
48
49 }
50 }
51}
diff --git a/Common/OpenGrid.Framework.Communications/IGridServices.cs b/Common/OpenGrid.Framework.Communications/IGridServices.cs
deleted file mode 100644
index d3b7c07..0000000
--- a/Common/OpenGrid.Framework.Communications/IGridServices.cs
+++ /dev/null
@@ -1,51 +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*/
28
29using System;
30using System.Collections.Generic;
31using System.Text;
32using OpenSim.Framework.Types;
33using OpenSim.Framework;
34
35namespace OpenGrid.Framework.Communications
36{
37 public class GridInfo
38 {
39 public string GridServerURI = "http://grid.deepgrid.com:8001/"; // Temporarily hardcoded.
40 public string GridServerSendKey = "badger";
41 public string GridServerRecvKey = "badger";
42 }
43
44 public interface IGridServices
45 {
46 RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo);
47 List<RegionInfo> RequestNeighbours(RegionInfo regionInfo);
48 RegionInfo RequestNeighbourInfo(ulong regionHandle);
49 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
50 }
51}
diff --git a/Common/OpenGrid.Framework.Communications/IInterRegionCommunications.cs b/Common/OpenGrid.Framework.Communications/IInterRegionCommunications.cs
deleted file mode 100644
index 4cb8a38..0000000
--- a/Common/OpenGrid.Framework.Communications/IInterRegionCommunications.cs
+++ /dev/null
@@ -1,41 +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 OpenSim.Framework.Types;
32using OpenSim.Framework;
33
34namespace OpenGrid.Framework.Communications
35{
36 public interface IInterRegionCommunications
37 {
38 bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData);
39 bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position);
40 }
41}
diff --git a/Common/OpenGrid.Framework.Communications/IUserServices.cs b/Common/OpenGrid.Framework.Communications/IUserServices.cs
deleted file mode 100644
index 3d8e791..0000000
--- a/Common/OpenGrid.Framework.Communications/IUserServices.cs
+++ /dev/null
@@ -1,44 +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;
32
33using OpenGrid.Framework.Data;
34
35namespace OpenGrid.Framework.Communications
36{
37 public interface IUserServices
38 {
39 UserProfileData GetUserProfile(string firstName, string lastName);
40 UserProfileData GetUserProfile(string name);
41 UserProfileData GetUserProfile(LLUUID avatarID);
42
43 }
44}
diff --git a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj b/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj
deleted file mode 100644
index 9a9568c..0000000
--- a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj
+++ /dev/null
@@ -1,112 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{683344D5-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Communications</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Communications</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="libsecondlife.dll" >
62 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System" >
66 <HintPath>System.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Xml" >
70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 </ItemGroup>
74 <ItemGroup>
75 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
76 <Name>OpenGrid.Framework.Data</Name>
77 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
78 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
79 <Private>False</Private>
80 </ProjectReference>
81 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
82 <Name>OpenSim.Framework</Name>
83 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
84 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
85 <Private>False</Private>
86 </ProjectReference>
87 </ItemGroup>
88 <ItemGroup>
89 <Compile Include="CommunicationsManager.cs">
90 <SubType>Code</SubType>
91 </Compile>
92 <Compile Include="IGridServices.cs">
93 <SubType>Code</SubType>
94 </Compile>
95 <Compile Include="IInterRegionCommunications.cs">
96 <SubType>Code</SubType>
97 </Compile>
98 <Compile Include="IUserServices.cs">
99 <SubType>Code</SubType>
100 </Compile>
101 <Compile Include="Properties\AssemblyInfo.cs">
102 <SubType>Code</SubType>
103 </Compile>
104 </ItemGroup>
105 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
106 <PropertyGroup>
107 <PreBuildEvent>
108 </PreBuildEvent>
109 <PostBuildEvent>
110 </PostBuildEvent>
111 </PropertyGroup>
112</Project>
diff --git a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.dll.build b/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.dll.build
deleted file mode 100644
index 392220b..0000000
--- a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.dll.build
+++ /dev/null
@@ -1,47 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Communications" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Communications" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="CommunicationsManager.cs" />
15 <include name="IGridServices.cs" />
16 <include name="IInterRegionCommunications.cs" />
17 <include name="IUserServices.cs" />
18 <include name="Properties/AssemblyInfo.cs" />
19 </sources>
20 <references basedir="${project::get-base-directory()}">
21 <lib>
22 <include name="${project::get-base-directory()}" />
23 <include name="${project::get-base-directory()}/${build.dir}" />
24 </lib>
25 <include name="../../bin/libsecondlife.dll" />
26 <include name="../../bin/OpenGrid.Framework.Data.dll" />
27 <include name="../../bin/OpenSim.Framework.dll" />
28 <include name="System.dll" />
29 <include name="System.Xml.dll" />
30 </references>
31 </csc>
32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
33 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
34 <copy todir="${project::get-base-directory()}/../../bin/">
35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
36 <include name="*.dll"/>
37 <include name="*.exe"/>
38 </fileset>
39 </copy>
40 </target>
41 <target name="clean">
42 <delete dir="${bin.dir}" failonerror="false" />
43 <delete dir="${obj.dir}" failonerror="false" />
44 </target>
45 <target name="doc" description="Creates documentation.">
46 </target>
47</project>
diff --git a/Common/OpenGrid.Framework.Communications/Properties/AssemblyInfo.cs b/Common/OpenGrid.Framework.Communications/Properties/AssemblyInfo.cs
deleted file mode 100644
index 83e7dd4..0000000
--- a/Common/OpenGrid.Framework.Communications/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,62 +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.Reflection;
29using System.Runtime.CompilerServices;
30using System.Runtime.InteropServices;
31
32// General Information about an assembly is controlled through the following
33// set of attributes. Change these attribute values to modify the information
34// associated with an assembly.
35[assembly: AssemblyTitle("OpenGrid.Framework.Communications")]
36[assembly: AssemblyDescription("")]
37[assembly: AssemblyConfiguration("")]
38[assembly: AssemblyCompany("")]
39[assembly: AssemblyProduct("OpenGrid.Framework.Communications")]
40[assembly: AssemblyCopyright("Copyright © 2007")]
41[assembly: AssemblyTrademark("")]
42[assembly: AssemblyCulture("")]
43
44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type.
47[assembly: ComVisible(false)]
48
49// The following GUID is for the ID of the typelib if this project is exposed to COM
50[assembly: Guid("13e7c396-78a9-4a5c-baf2-6f980ea75d95")]
51
52// Version information for an assembly consists of the following four values:
53//
54// Major Version
55// Minor Version
56// Build Number
57// Revision
58//
59// You can specify all the values or you can default the Revision and Build Numbers
60// by using the '*' as shown below:
61[assembly: AssemblyVersion("1.0.0.0")]
62[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs b/Common/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs
deleted file mode 100644
index 0e73ab2..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs
+++ /dev/null
@@ -1,166 +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*/
28
29using System;
30using System.Collections.Generic;
31using System.Text;
32using OpenGrid.Framework.Data;
33using libsecondlife;
34
35
36namespace OpenGrid.Framework.Data.DB4o
37{
38 /// <summary>
39 /// A grid server storage mechanism employing the DB4o database system
40 /// </summary>
41 class DB4oGridData : IGridData
42 {
43 /// <summary>
44 /// The database manager object
45 /// </summary>
46 DB4oGridManager manager;
47
48 /// <summary>
49 /// Called when the plugin is first loaded (as constructors are not called)
50 /// </summary>
51 public void Initialise() {
52 manager = new DB4oGridManager("gridserver.yap");
53 }
54
55 /// <summary>
56 /// Returns a list of regions within the specified ranges
57 /// </summary>
58 /// <param name="a">minimum X coordinate</param>
59 /// <param name="b">minimum Y coordinate</param>
60 /// <param name="c">maximum X coordinate</param>
61 /// <param name="d">maximum Y coordinate</param>
62 /// <returns>An array of region profiles</returns>
63 public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
64 {
65 return null;
66 }
67
68 /// <summary>
69 /// Returns a region located at the specified regionHandle (warning multiple regions may occupy the one spot, first found is returned)
70 /// </summary>
71 /// <param name="handle">The handle to search for</param>
72 /// <returns>A region profile</returns>
73 public SimProfileData GetProfileByHandle(ulong handle) {
74 lock (manager.simProfiles)
75 {
76 foreach (LLUUID UUID in manager.simProfiles.Keys)
77 {
78 if (manager.simProfiles[UUID].regionHandle == handle)
79 {
80 return manager.simProfiles[UUID];
81 }
82 }
83 }
84 throw new Exception("Unable to find profile with handle (" + handle.ToString() + ")");
85 }
86
87 /// <summary>
88 /// Returns a specific region
89 /// </summary>
90 /// <param name="uuid">The region ID code</param>
91 /// <returns>A region profile</returns>
92 public SimProfileData GetProfileByLLUUID(LLUUID uuid)
93 {
94 lock (manager.simProfiles)
95 {
96 if (manager.simProfiles.ContainsKey(uuid))
97 return manager.simProfiles[uuid];
98 }
99 throw new Exception("Unable to find profile with UUID (" + uuid.ToStringHyphenated() + ")");
100 }
101
102 /// <summary>
103 /// Adds a new specified region to the database
104 /// </summary>
105 /// <param name="profile">The profile to add</param>
106 /// <returns>A dataresponse enum indicating success</returns>
107 public DataResponse AddProfile(SimProfileData profile)
108 {
109 lock (manager.simProfiles)
110 {
111 if (manager.AddRow(profile))
112 {
113 return DataResponse.RESPONSE_OK;
114 }
115 else
116 {
117 return DataResponse.RESPONSE_ERROR;
118 }
119 }
120 }
121
122 /// <summary>
123 /// Authenticates a new region using the shared secrets. NOT SECURE.
124 /// </summary>
125 /// <param name="uuid">The UUID the region is authenticating with</param>
126 /// <param name="handle">The location the region is logging into (unused in Db4o)</param>
127 /// <param name="key">The shared secret</param>
128 /// <returns>Authenticated?</returns>
129 public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) {
130 if (manager.simProfiles[uuid].regionRecvKey == key)
131 return true;
132 return false;
133 }
134
135 /// <summary>
136 /// Shuts down the database
137 /// </summary>
138 public void Close()
139 {
140 manager = null;
141 }
142
143 /// <summary>
144 /// Returns the providers name
145 /// </summary>
146 /// <returns>The name of the storage system</returns>
147 public string getName()
148 {
149 return "DB4o Grid Provider";
150 }
151
152 /// <summary>
153 /// Returns the providers version
154 /// </summary>
155 /// <returns>The version of the storage system</returns>
156 public string getVersion()
157 {
158 return "0.1";
159 }
160
161 public ReservationData GetReservationAtPoint(uint x, uint y)
162 {
163 return null;
164 }
165 }
166}
diff --git a/Common/OpenGrid.Framework.Data.DB4o/DB4oManager.cs b/Common/OpenGrid.Framework.Data.DB4o/DB4oManager.cs
deleted file mode 100644
index 356a49c..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/DB4oManager.cs
+++ /dev/null
@@ -1,165 +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 Db4objects.Db4o;
32using OpenGrid.Framework.Data;
33using libsecondlife;
34
35namespace OpenGrid.Framework.Data.DB4o
36{
37 /// <summary>
38 /// A Database manager for Db4o
39 /// </summary>
40 class DB4oGridManager
41 {
42 /// <summary>
43 /// A list of the current regions connected (in-memory cache)
44 /// </summary>
45 public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>();
46 /// <summary>
47 /// Database File Name
48 /// </summary>
49 string dbfl;
50
51 /// <summary>
52 /// Creates a new grid storage manager
53 /// </summary>
54 /// <param name="db4odb">Filename to the database file</param>
55 public DB4oGridManager(string db4odb)
56 {
57 dbfl = db4odb;
58 IObjectContainer database;
59 database = Db4oFactory.OpenFile(dbfl);
60 IObjectSet result = database.Get(typeof(SimProfileData));
61 // Loads the file into the in-memory cache
62 foreach(SimProfileData row in result) {
63 simProfiles.Add(row.UUID, row);
64 }
65 database.Close();
66 }
67
68 /// <summary>
69 /// Adds a new profile to the database (Warning: Probably slow.)
70 /// </summary>
71 /// <param name="row">The profile to add</param>
72 /// <returns>Successful?</returns>
73 public bool AddRow(SimProfileData row)
74 {
75 if (simProfiles.ContainsKey(row.UUID))
76 {
77 simProfiles[row.UUID] = row;
78 }
79 else
80 {
81 simProfiles.Add(row.UUID, row);
82 }
83
84 try
85 {
86 IObjectContainer database;
87 database = Db4oFactory.OpenFile(dbfl);
88 database.Set(row);
89 database.Close();
90 return true;
91 }
92 catch (Exception e)
93 {
94 return false;
95 }
96 }
97
98
99 }
100
101 /// <summary>
102 /// A manager for the DB4o database (user profiles)
103 /// </summary>
104 class DB4oUserManager
105 {
106 /// <summary>
107 /// A list of the user profiles (in memory cache)
108 /// </summary>
109 public Dictionary<LLUUID, UserProfileData> userProfiles = new Dictionary<LLUUID, UserProfileData>();
110 /// <summary>
111 /// Database filename
112 /// </summary>
113 string dbfl;
114
115 /// <summary>
116 /// Initialises a new DB manager
117 /// </summary>
118 /// <param name="db4odb">The filename to the database</param>
119 public DB4oUserManager(string db4odb)
120 {
121 dbfl = db4odb;
122 IObjectContainer database;
123 database = Db4oFactory.OpenFile(dbfl);
124 // Load to cache
125 IObjectSet result = database.Get(typeof(UserProfileData));
126 foreach (UserProfileData row in result)
127 {
128 userProfiles.Add(row.UUID, row);
129 }
130 database.Close();
131 }
132
133 /// <summary>
134 /// Adds a new profile to the database (Warning: Probably slow.)
135 /// </summary>
136 /// <param name="row">The profile to add</param>
137 /// <returns>Successful?</returns>
138 public bool AddRow(UserProfileData row)
139 {
140 if (userProfiles.ContainsKey(row.UUID))
141 {
142 userProfiles[row.UUID] = row;
143 }
144 else
145 {
146 userProfiles.Add(row.UUID, row);
147 }
148
149 try
150 {
151 IObjectContainer database;
152 database = Db4oFactory.OpenFile(dbfl);
153 database.Set(row);
154 database.Close();
155 return true;
156 }
157 catch (Exception e)
158 {
159 return false;
160 }
161 }
162
163
164 }
165}
diff --git a/Common/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs b/Common/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs
deleted file mode 100644
index 315f48d..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs
+++ /dev/null
@@ -1,205 +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 OpenGrid.Framework.Data;
32using libsecondlife;
33
34namespace OpenGrid.Framework.Data.DB4o
35{
36 /// <summary>
37 /// A User storage interface for the DB4o database system
38 /// </summary>
39 public class DB4oUserData : IUserData
40 {
41 /// <summary>
42 /// The database manager
43 /// </summary>
44 DB4oUserManager manager;
45
46 /// <summary>
47 /// Artificial constructor called upon plugin load
48 /// </summary>
49 public void Initialise()
50 {
51 manager = new DB4oUserManager("userprofiles.yap");
52 }
53
54 /// <summary>
55 /// Loads a specified user profile from a UUID
56 /// </summary>
57 /// <param name="uuid">The users UUID</param>
58 /// <returns>A user profile</returns>
59 public UserProfileData getUserByUUID(LLUUID uuid)
60 {
61 if(manager.userProfiles.ContainsKey(uuid))
62 return manager.userProfiles[uuid];
63 return null;
64 }
65
66 /// <summary>
67 /// Returns a user by searching for its name
68 /// </summary>
69 /// <param name="name">The users account name</param>
70 /// <returns>A matching users profile</returns>
71 public UserProfileData getUserByName(string name)
72 {
73 return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
74 }
75
76 /// <summary>
77 /// Returns a user by searching for its name
78 /// </summary>
79 /// <param name="fname">The first part of the users account name</param>
80 /// <param name="lname">The second part of the users account name</param>
81 /// <returns>A matching users profile</returns>
82 public UserProfileData getUserByName(string fname, string lname)
83 {
84 foreach (UserProfileData profile in manager.userProfiles.Values)
85 {
86 if (profile.username == fname && profile.surname == lname)
87 return profile;
88 }
89 return null;
90 }
91
92 /// <summary>
93 /// Returns a user by UUID direct
94 /// </summary>
95 /// <param name="uuid">The users account ID</param>
96 /// <returns>A matching users profile</returns>
97 public UserAgentData getAgentByUUID(LLUUID uuid)
98 {
99 try
100 {
101 return getUserByUUID(uuid).currentAgent;
102 }
103 catch (Exception e)
104 {
105 return null;
106 }
107 }
108
109 /// <summary>
110 /// Returns a session by account name
111 /// </summary>
112 /// <param name="name">The account name</param>
113 /// <returns>The users session agent</returns>
114 public UserAgentData getAgentByName(string name)
115 {
116 return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
117 }
118
119 /// <summary>
120 /// Returns a session by account name
121 /// </summary>
122 /// <param name="fname">The first part of the users account name</param>
123 /// <param name="lname">The second part of the users account name</param>
124 /// <returns>A user agent</returns>
125 public UserAgentData getAgentByName(string fname, string lname)
126 {
127 try
128 {
129 return getUserByName(fname,lname).currentAgent;
130 }
131 catch (Exception e)
132 {
133 return null;
134 }
135 }
136
137 /// <summary>
138 /// Creates a new user profile
139 /// </summary>
140 /// <param name="user">The profile to add to the database</param>
141 public void addNewUserProfile(UserProfileData user)
142 {
143 try
144 {
145 manager.AddRow(user);
146 }
147 catch (Exception e)
148 {
149 Console.WriteLine(e.ToString());
150 }
151 }
152
153 /// <summary>
154 /// Creates a new user agent
155 /// </summary>
156 /// <param name="agent">The agent to add to the database</param>
157 public void addNewUserAgent(UserAgentData agent)
158 {
159 // Do nothing. yet.
160 }
161
162 /// <summary>
163 /// Transfers money between two user accounts
164 /// </summary>
165 /// <param name="from">Starting account</param>
166 /// <param name="to">End account</param>
167 /// <param name="amount">The amount to move</param>
168 /// <returns>Success?</returns>
169 public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
170 {
171 return true;
172 }
173
174 /// <summary>
175 /// Transfers inventory between two accounts
176 /// </summary>
177 /// <remarks>Move to inventory server</remarks>
178 /// <param name="from">Senders account</param>
179 /// <param name="to">Recievers account</param>
180 /// <param name="item">Inventory item</param>
181 /// <returns>Success?</returns>
182 public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
183 {
184 return true;
185 }
186
187 /// <summary>
188 /// Returns the name of the storage provider
189 /// </summary>
190 /// <returns>Storage provider name</returns>
191 public string getName()
192 {
193 return "DB4o Userdata";
194 }
195
196 /// <summary>
197 /// Returns the version of the storage provider
198 /// </summary>
199 /// <returns>Storage provider version</returns>
200 public string getVersion()
201 {
202 return "0.1";
203 }
204 }
205}
diff --git a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj b/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj
deleted file mode 100644
index d2d6140..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj
+++ /dev/null
@@ -1,111 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{39BD9497-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data.DB4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data.DB4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="Db4objects.Db4o.dll" >
62 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="libsecondlife.dll" >
66 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System" >
70 <HintPath>System.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="System.Data" >
74 <HintPath>System.Data.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="System.Xml" >
78 <HintPath>System.Xml.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
84 <Name>OpenGrid.Framework.Data</Name>
85 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 </ItemGroup>
90 <ItemGroup>
91 <Compile Include="DB4oGridData.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="DB4oManager.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="DB4oUserData.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="Properties\AssemblyInfo.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 </ItemGroup>
104 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
105 <PropertyGroup>
106 <PreBuildEvent>
107 </PreBuildEvent>
108 <PostBuildEvent>
109 </PostBuildEvent>
110 </PropertyGroup>
111</Project>
diff --git a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.mine b/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.mine
deleted file mode 100644
index 82d4f5f..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.mine
+++ /dev/null
@@ -1,111 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{39BD9497-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data.DB4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data.DB4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
84 <Name>OpenGrid.Framework.Data</Name>
85 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 </ItemGroup>
90 <ItemGroup>
91 <Compile Include="DB4oGridData.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="DB4oManager.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="DB4oUserData.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="Properties\AssemblyInfo.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 </ItemGroup>
104 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
105 <PropertyGroup>
106 <PreBuildEvent>
107 </PreBuildEvent>
108 <PostBuildEvent>
109 </PostBuildEvent>
110 </PropertyGroup>
111</Project>
diff --git a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.r858 b/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.r858
deleted file mode 100644
index d6dd03d..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.r858
+++ /dev/null
@@ -1,111 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{BC0F052F-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data.DB4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data.DB4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>False</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>True</Optimize>
35 <OutputPath>../../bin/</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE;DEBUG</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>True</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>False</Optimize>
53 <OutputPath>../../bin/</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="../OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj">
84 <Name>OpenGrid.Framework.Data</Name>
85 <Project>{12DD8EB8-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 </ItemGroup>
90 <ItemGroup>
91 <Compile Include="DB4oGridData.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="DB4oManager.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="DB4oUserData.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="Properties/AssemblyInfo.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 </ItemGroup>
104 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
105 <PropertyGroup>
106 <PreBuildEvent>
107 </PreBuildEvent>
108 <PostBuildEvent>
109 </PostBuildEvent>
110 </PropertyGroup>
111</Project>
diff --git a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.r921 b/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.r921
deleted file mode 100644
index 3b783ca..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.r921
+++ /dev/null
@@ -1,111 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{39BD9497-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data.DB4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data.DB4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
84 <Name>OpenGrid.Framework.Data</Name>
85 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 </ItemGroup>
90 <ItemGroup>
91 <Compile Include="DB4oUserData.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="DB4oManager.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="DB4oGridData.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="Properties\AssemblyInfo.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 </ItemGroup>
104 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
105 <PropertyGroup>
106 <PreBuildEvent>
107 </PreBuildEvent>
108 <PostBuildEvent>
109 </PostBuildEvent>
110 </PropertyGroup>
111</Project>
diff --git a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build b/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build
deleted file mode 100644
index d82d751..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build
+++ /dev/null
@@ -1,47 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Data.DB4o" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Data.DB4o" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="DB4oGridData.cs" />
15 <include name="DB4oManager.cs" />
16 <include name="DB4oUserData.cs" />
17 <include name="Properties/AssemblyInfo.cs" />
18 </sources>
19 <references basedir="${project::get-base-directory()}">
20 <lib>
21 <include name="${project::get-base-directory()}" />
22 <include name="${project::get-base-directory()}/${build.dir}" />
23 </lib>
24 <include name="../../bin/Db4objects.Db4o.dll" />
25 <include name="../../bin/libsecondlife.dll" />
26 <include name="../../bin/OpenGrid.Framework.Data.dll" />
27 <include name="System.dll" />
28 <include name="System.Data.dll" />
29 <include name="System.Xml.dll" />
30 </references>
31 </csc>
32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
33 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
34 <copy todir="${project::get-base-directory()}/../../bin/">
35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
36 <include name="*.dll"/>
37 <include name="*.exe"/>
38 </fileset>
39 </copy>
40 </target>
41 <target name="clean">
42 <delete dir="${bin.dir}" failonerror="false" />
43 <delete dir="${obj.dir}" failonerror="false" />
44 </target>
45 <target name="doc" description="Creates documentation.">
46 </target>
47</project>
diff --git a/Common/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs b/Common/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs
deleted file mode 100644
index dc4a9a1..0000000
--- a/Common/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework.Data.DB4o")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenGrid.Framework.Data.DB4o")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("57991e15-79da-41b7-aa06-2e6b49165a63")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenGrid.Framework.Data/GridData.cs b/Common/OpenGrid.Framework.Data/GridData.cs
deleted file mode 100644
index b2cce78..0000000
--- a/Common/OpenGrid.Framework.Data/GridData.cs
+++ /dev/null
@@ -1,113 +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;
31
32namespace OpenGrid.Framework.Data
33{
34 public enum DataResponse
35 {
36 RESPONSE_OK,
37 RESPONSE_AUTHREQUIRED,
38 RESPONSE_INVALIDCREDENTIALS,
39 RESPONSE_ERROR
40 }
41
42 /// <summary>
43 /// A standard grid interface
44 /// </summary>
45 public interface IGridData
46 {
47 /// <summary>
48 /// Returns a sim profile from a regionHandle
49 /// </summary>
50 /// <param name="regionHandle">A 64bit Region Handle</param>
51 /// <returns>A simprofile</returns>
52 SimProfileData GetProfileByHandle(ulong regionHandle);
53
54 /// <summary>
55 /// Returns a sim profile from a UUID
56 /// </summary>
57 /// <param name="UUID">A 128bit UUID</param>
58 /// <returns>A sim profile</returns>
59 SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID UUID);
60
61 /// <summary>
62 /// Returns all profiles within the specified range
63 /// </summary>
64 /// <param name="Xmin">Minimum sim coordinate (X)</param>
65 /// <param name="Ymin">Minimum sim coordinate (Y)</param>
66 /// <param name="Xmax">Maximum sim coordinate (X)</param>
67 /// <param name="Ymin">Maximum sim coordinate (Y)</param>
68 /// <returns>An array containing all the sim profiles in the specified range</returns>
69 SimProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
70
71 /// <summary>
72 /// Authenticates a sim by use of it's recv key.
73 /// WARNING: Insecure
74 /// </summary>
75 /// <param name="UUID">The UUID sent by the sim</param>
76 /// <param name="regionHandle">The regionhandle sent by the sim</param>
77 /// <param name="simrecvkey">The recieving key sent by the sim</param>
78 /// <returns>Whether the sim has been authenticated</returns>
79 bool AuthenticateSim(libsecondlife.LLUUID UUID, ulong regionHandle, string simrecvkey);
80
81 /// <summary>
82 /// Initialises the interface
83 /// </summary>
84 void Initialise();
85
86 /// <summary>
87 /// Closes the interface
88 /// </summary>
89 void Close();
90
91 /// <summary>
92 /// The plugin being loaded
93 /// </summary>
94 /// <returns>A string containing the plugin name</returns>
95 string getName();
96
97 /// <summary>
98 /// The plugins version
99 /// </summary>
100 /// <returns>A string containing the plugin version</returns>
101 string getVersion();
102
103 /// <summary>
104 /// Adds a new profile to the database
105 /// </summary>
106 /// <param name="profile">The profile to add</param>
107 /// <returns>RESPONSE_OK if successful, error if not.</returns>
108 DataResponse AddProfile(SimProfileData profile);
109
110 ReservationData GetReservationAtPoint(uint x, uint y);
111
112 }
113}
diff --git a/Common/OpenGrid.Framework.Data/ILogData.cs b/Common/OpenGrid.Framework.Data/ILogData.cs
deleted file mode 100644
index 2ac0bfe..0000000
--- a/Common/OpenGrid.Framework.Data/ILogData.cs
+++ /dev/null
@@ -1,94 +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;
31
32namespace OpenGrid.Framework.Data
33{
34 /// <summary>
35 /// The severity of an individual log message
36 /// </summary>
37 public enum LogSeverity : int
38 {
39 /// <summary>
40 /// Critical: systems failure
41 /// </summary>
42 CRITICAL = 1,
43 /// <summary>
44 /// Major: warning prior to systems failure
45 /// </summary>
46 MAJOR = 2,
47 /// <summary>
48 /// Medium: an individual non-critical task failed
49 /// </summary>
50 MEDIUM = 3,
51 /// <summary>
52 /// Low: Informational warning
53 /// </summary>
54 LOW = 4,
55 /// <summary>
56 /// Info: Information
57 /// </summary>
58 INFO = 5,
59 /// <summary>
60 /// Verbose: Debug Information
61 /// </summary>
62 VERBOSE = 6
63 }
64
65 /// <summary>
66 /// An interface to a LogData storage system
67 /// </summary>
68 public interface ILogData
69 {
70 void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,string logMessage);
71 /// <summary>
72 /// Initialises the interface
73 /// </summary>
74 void Initialise();
75
76 /// <summary>
77 /// Closes the interface
78 /// </summary>
79 void Close();
80
81 /// <summary>
82 /// The plugin being loaded
83 /// </summary>
84 /// <returns>A string containing the plugin name</returns>
85 string getName();
86
87 /// <summary>
88 /// The plugins version
89 /// </summary>
90 /// <returns>A string containing the plugin version</returns>
91 string getVersion();
92 }
93
94}
diff --git a/Common/OpenGrid.Framework.Data/IniConfig.cs b/Common/OpenGrid.Framework.Data/IniConfig.cs
deleted file mode 100644
index d17afac..0000000
--- a/Common/OpenGrid.Framework.Data/IniConfig.cs
+++ /dev/null
@@ -1,100 +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 System.IO;
32using System.Text.RegularExpressions;
33
34/*
35 Taken from public code listing at by Alex Pinsker
36 http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html
37 */
38
39namespace OpenGrid.Framework.Data
40{
41 /// <summary>
42 /// Parse settings from ini-like files
43 /// </summary>
44 public class IniFile
45 {
46 static IniFile()
47 {
48 _iniKeyValuePatternRegex = new Regex(
49 @"((\s)*(?<Key>([^\=^\s^\n]+))[\s^\n]*
50 # key part (surrounding whitespace stripped)
51 \=
52 (\s)*(?<Value>([^\n^\s]+(\n){0,1})))
53 # value part (surrounding whitespace stripped)
54 ",
55 RegexOptions.IgnorePatternWhitespace |
56 RegexOptions.Compiled |
57 RegexOptions.CultureInvariant);
58 }
59 static private Regex _iniKeyValuePatternRegex;
60
61 public IniFile(string iniFileName)
62 {
63 _iniFileName = iniFileName;
64 }
65
66 public string ParseFileReadValue(string key)
67 {
68 using (StreamReader reader =
69 new StreamReader(_iniFileName))
70 {
71 do
72 {
73 string line = reader.ReadLine();
74 Match match =
75 _iniKeyValuePatternRegex.Match(line);
76 if (match.Success)
77 {
78 string currentKey =
79 match.Groups["Key"].Value as string;
80 if (currentKey != null &&
81 currentKey.Trim().CompareTo(key) == 0)
82 {
83 string value =
84 match.Groups["Value"].Value as string;
85 return value;
86 }
87 }
88
89 }
90 while (reader.Peek() != -1);
91 }
92 return null;
93 }
94
95 public string IniFileName
96 {
97 get { return _iniFileName; }
98 } private string _iniFileName;
99 }
100}
diff --git a/Common/OpenGrid.Framework.Data/InventoryData.cs b/Common/OpenGrid.Framework.Data/InventoryData.cs
deleted file mode 100644
index 12f559b..0000000
--- a/Common/OpenGrid.Framework.Data/InventoryData.cs
+++ /dev/null
@@ -1,187 +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;
32
33namespace OpenGrid.Framework.Data
34{
35 /// <summary>
36 /// Inventory Item - contains all the properties associated with an individual inventory piece.
37 /// </summary>
38 public class InventoryItemBase
39 {
40 /// <summary>
41 /// A UUID containing the ID for the inventory item itself
42 /// </summary>
43 public LLUUID inventoryID;
44 /// <summary>
45 /// The UUID of the associated asset on the asset server
46 /// </summary>
47 public LLUUID assetID;
48 /// <summary>
49 /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
50 /// </summary>
51 public int type;
52 /// <summary>
53 /// The folder this item is contained in (NULL_KEY = Inventory Root)
54 /// </summary>
55 public LLUUID parentFolderID;
56 /// <summary>
57 /// The owner of this inventory item
58 /// </summary>
59 public LLUUID avatarID;
60 /// <summary>
61 /// The name of the inventory item (must be less than 64 characters)
62 /// </summary>
63 public string inventoryName;
64 /// <summary>
65 /// The description of the inventory item (must be less than 64 characters)
66 /// </summary>
67 public string inventoryDescription;
68 /// <summary>
69 /// A mask containing the permissions for the next owner (cannot be enforced)
70 /// </summary>
71 public uint inventoryNextPermissions;
72 /// <summary>
73 /// A mask containing permissions for the current owner (cannot be enforced)
74 /// </summary>
75 public uint inventoryCurrentPermissions;
76 }
77
78 /// <summary>
79 /// A Class for folders which contain users inventory
80 /// </summary>
81 public class InventoryFolderBase
82 {
83 /// <summary>
84 /// The name of the folder (64 characters or less)
85 /// </summary>
86 public string name;
87 /// <summary>
88 /// The agent who's inventory this is contained by
89 /// </summary>
90 public LLUUID agentID;
91 /// <summary>
92 /// The folder this folder is contained in (NULL_KEY for root)
93 /// </summary>
94 public LLUUID parentID;
95 /// <summary>
96 /// The UUID for this folder
97 /// </summary>
98 public LLUUID folderID;
99 }
100
101 /// <summary>
102 /// An interface for accessing inventory data from a storage server
103 /// </summary>
104 public interface IInventoryData
105 {
106 /// <summary>
107 /// Initialises the interface
108 /// </summary>
109 void Initialise();
110
111 /// <summary>
112 /// Closes the interface
113 /// </summary>
114 void Close();
115
116 /// <summary>
117 /// The plugin being loaded
118 /// </summary>
119 /// <returns>A string containing the plugin name</returns>
120 string getName();
121
122 /// <summary>
123 /// The plugins version
124 /// </summary>
125 /// <returns>A string containing the plugin version</returns>
126 string getVersion();
127
128 /// <summary>
129 /// Returns a list of inventory items contained within the specified folder
130 /// </summary>
131 /// <param name="folderID">The UUID of the target folder</param>
132 /// <returns>A List of InventoryItemBase items</returns>
133 List<InventoryItemBase> getInventoryInFolder(LLUUID folderID);
134
135 /// <summary>
136 /// Returns a list of folders in the users inventory root.
137 /// </summary>
138 /// <param name="user">The UUID of the user who is having inventory being returned</param>
139 /// <returns>A list of folders</returns>
140 List<InventoryFolderBase> getUserRootFolders(LLUUID user);
141
142 /// <summary>
143 /// Returns a list of inventory folders contained in the folder 'parentID'
144 /// </summary>
145 /// <param name="parentID">The folder to get subfolders for</param>
146 /// <returns>A list of inventory folders</returns>
147 List<InventoryFolderBase> getInventoryFolders(LLUUID parentID);
148
149 /// <summary>
150 /// Returns an inventory item by its UUID
151 /// </summary>
152 /// <param name="item">The UUID of the item to be returned</param>
153 /// <returns>A class containing item information</returns>
154 InventoryItemBase getInventoryItem(LLUUID item);
155
156 /// <summary>
157 /// Returns a specified inventory folder by its UUID
158 /// </summary>
159 /// <param name="folder">The UUID of the folder to be returned</param>
160 /// <returns>A class containing folder information</returns>
161 InventoryFolderBase getInventoryFolder(LLUUID folder);
162
163 /// <summary>
164 /// Creates a new inventory item based on item
165 /// </summary>
166 /// <param name="item">The item to be created</param>
167 void addInventoryItem(InventoryItemBase item);
168
169 /// <summary>
170 /// Updates an inventory item with item (updates based on ID)
171 /// </summary>
172 /// <param name="item">The updated item</param>
173 void updateInventoryItem(InventoryItemBase item);
174
175 /// <summary>
176 /// Adds a new folder specified by folder
177 /// </summary>
178 /// <param name="folder">The inventory folder</param>
179 void addInventoryFolder(InventoryFolderBase folder);
180
181 /// <summary>
182 /// Updates a folder based on its ID with folder
183 /// </summary>
184 /// <param name="folder">The inventory folder</param>
185 void updateInventoryFolder(InventoryFolderBase folder);
186 }
187}
diff --git a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj b/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj
deleted file mode 100644
index 048722a..0000000
--- a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj
+++ /dev/null
@@ -1,116 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{62CDF671-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="libsecondlife.dll" >
62 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System" >
66 <HintPath>System.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="System.Xml" >
74 <HintPath>System.Xml.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 </ItemGroup>
80 <ItemGroup>
81 <Compile Include="GridData.cs">
82 <SubType>Code</SubType>
83 </Compile>
84 <Compile Include="ILogData.cs">
85 <SubType>Code</SubType>
86 </Compile>
87 <Compile Include="IniConfig.cs">
88 <SubType>Code</SubType>
89 </Compile>
90 <Compile Include="InventoryData.cs">
91 <SubType>Code</SubType>
92 </Compile>
93 <Compile Include="ReservationData.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="SimProfileData.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 <Compile Include="UserData.cs">
100 <SubType>Code</SubType>
101 </Compile>
102 <Compile Include="UserProfileData.cs">
103 <SubType>Code</SubType>
104 </Compile>
105 <Compile Include="Properties\AssemblyInfo.cs">
106 <SubType>Code</SubType>
107 </Compile>
108 </ItemGroup>
109 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
110 <PropertyGroup>
111 <PreBuildEvent>
112 </PreBuildEvent>
113 <PostBuildEvent>
114 </PostBuildEvent>
115 </PropertyGroup>
116</Project>
diff --git a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.mine b/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.mine
deleted file mode 100644
index a572204..0000000
--- a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.mine
+++ /dev/null
@@ -1,113 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{62CDF671-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 </ItemGroup>
80 <ItemGroup>
81 <Compile Include="GridData.cs">
82 <SubType>Code</SubType>
83 </Compile>
84 <Compile Include="ILogData.cs">
85 <SubType>Code</SubType>
86 </Compile>
87 <Compile Include="IniConfig.cs">
88 <SubType>Code</SubType>
89 </Compile>
90 <Compile Include="InventoryData.cs">
91 <SubType>Code</SubType>
92 </Compile>
93 <Compile Include="SimProfileData.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="UserData.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 <Compile Include="UserProfileData.cs">
100 <SubType>Code</SubType>
101 </Compile>
102 <Compile Include="Properties\AssemblyInfo.cs">
103 <SubType>Code</SubType>
104 </Compile>
105 </ItemGroup>
106 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
107 <PropertyGroup>
108 <PreBuildEvent>
109 </PreBuildEvent>
110 <PostBuildEvent>
111 </PostBuildEvent>
112 </PropertyGroup>
113</Project>
diff --git a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.r858 b/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.r858
deleted file mode 100644
index 3b6d24d..0000000
--- a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.r858
+++ /dev/null
@@ -1,110 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{12DD8EB8-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>False</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>True</Optimize>
35 <OutputPath>../../bin/</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE;DEBUG</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>True</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>False</Optimize>
53 <OutputPath>../../bin/</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 </ItemGroup>
80 <ItemGroup>
81 <Compile Include="GridData.cs">
82 <SubType>Code</SubType>
83 </Compile>
84 <Compile Include="ILogData.cs">
85 <SubType>Code</SubType>
86 </Compile>
87 <Compile Include="IniConfig.cs">
88 <SubType>Code</SubType>
89 </Compile>
90 <Compile Include="SimProfileData.cs">
91 <SubType>Code</SubType>
92 </Compile>
93 <Compile Include="UserData.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="UserProfileData.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 <Compile Include="Properties/AssemblyInfo.cs">
100 <SubType>Code</SubType>
101 </Compile>
102 </ItemGroup>
103 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
104 <PropertyGroup>
105 <PreBuildEvent>
106 </PreBuildEvent>
107 <PostBuildEvent>
108 </PostBuildEvent>
109 </PropertyGroup>
110</Project>
diff --git a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.r921 b/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.r921
deleted file mode 100644
index 990cd16..0000000
--- a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.r921
+++ /dev/null
@@ -1,113 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{62CDF671-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 </ItemGroup>
80 <ItemGroup>
81 <Compile Include="GridData.cs">
82 <SubType>Code</SubType>
83 </Compile>
84 <Compile Include="SimProfileData.cs">
85 <SubType>Code</SubType>
86 </Compile>
87 <Compile Include="ILogData.cs">
88 <SubType>Code</SubType>
89 </Compile>
90 <Compile Include="IniConfig.cs">
91 <SubType>Code</SubType>
92 </Compile>
93 <Compile Include="InventoryData.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="UserData.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 <Compile Include="UserProfileData.cs">
100 <SubType>Code</SubType>
101 </Compile>
102 <Compile Include="Properties\AssemblyInfo.cs">
103 <SubType>Code</SubType>
104 </Compile>
105 </ItemGroup>
106 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
107 <PropertyGroup>
108 <PreBuildEvent>
109 </PreBuildEvent>
110 <PostBuildEvent>
111 </PostBuildEvent>
112 </PropertyGroup>
113</Project>
diff --git a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build b/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build
deleted file mode 100644
index 764e871..0000000
--- a/Common/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build
+++ /dev/null
@@ -1,50 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Data" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Data" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="GridData.cs" />
15 <include name="ILogData.cs" />
16 <include name="IniConfig.cs" />
17 <include name="InventoryData.cs" />
18 <include name="ReservationData.cs" />
19 <include name="SimProfileData.cs" />
20 <include name="UserData.cs" />
21 <include name="UserProfileData.cs" />
22 <include name="Properties/AssemblyInfo.cs" />
23 </sources>
24 <references basedir="${project::get-base-directory()}">
25 <lib>
26 <include name="${project::get-base-directory()}" />
27 <include name="${project::get-base-directory()}/${build.dir}" />
28 </lib>
29 <include name="../../bin/libsecondlife.dll" />
30 <include name="System.dll" />
31 <include name="System.Data.dll" />
32 <include name="System.Xml.dll" />
33 </references>
34 </csc>
35 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
36 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
37 <copy todir="${project::get-base-directory()}/../../bin/">
38 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
39 <include name="*.dll"/>
40 <include name="*.exe"/>
41 </fileset>
42 </copy>
43 </target>
44 <target name="clean">
45 <delete dir="${bin.dir}" failonerror="false" />
46 <delete dir="${obj.dir}" failonerror="false" />
47 </target>
48 <target name="doc" description="Creates documentation.">
49 </target>
50</project>
diff --git a/Common/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs b/Common/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs
deleted file mode 100644
index 1446673..0000000
--- a/Common/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework.Data")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenGrid.Framework.Data")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenGrid.Framework.Data/ReservationData.cs b/Common/OpenGrid.Framework.Data/ReservationData.cs
deleted file mode 100644
index 89c6105..0000000
--- a/Common/OpenGrid.Framework.Data/ReservationData.cs
+++ /dev/null
@@ -1,51 +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;
31
32using libsecondlife;
33
34namespace OpenGrid.Framework.Data
35{
36 public class ReservationData
37 {
38 public LLUUID userUUID = new LLUUID();
39 public int reservationMinX = 0;
40 public int reservationMinY = 0;
41 public int reservationMaxX = 65536;
42 public int reservationMaxY = 65536;
43
44 public string reservationName = "";
45 public string reservationCompany = "";
46 public bool status = true;
47
48 public string gridSendKey = "";
49 public string gridRecvKey = "";
50 }
51}
diff --git a/Common/OpenGrid.Framework.Data/SimProfileData.cs b/Common/OpenGrid.Framework.Data/SimProfileData.cs
deleted file mode 100644
index a3e7cb7..0000000
--- a/Common/OpenGrid.Framework.Data/SimProfileData.cs
+++ /dev/null
@@ -1,114 +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;
31
32namespace OpenGrid.Framework.Data
33{
34 /// <summary>
35 /// A class which contains information known to the grid server about a region
36 /// </summary>
37 public class SimProfileData
38 {
39 /// <summary>
40 /// The name of the region
41 /// </summary>
42 public string regionName = "";
43
44 /// <summary>
45 /// A 64-bit number combining map position into a (mostly) unique ID
46 /// </summary>
47 public ulong regionHandle;
48
49 /// <summary>
50 /// OGS/OpenSim Specific ID for a region
51 /// </summary>
52 public libsecondlife.LLUUID UUID;
53
54 /// <summary>
55 /// Coordinates of the region
56 /// </summary>
57 public uint regionLocX;
58 public uint regionLocY;
59 public uint regionLocZ; // Reserved (round-robin, layers, etc)
60
61 /// <summary>
62 /// Authentication secrets
63 /// </summary>
64 /// <remarks>Not very secure, needs improvement.</remarks>
65 public string regionSendKey = "";
66 public string regionRecvKey = "";
67 public string regionSecret = "";
68
69 /// <summary>
70 /// Whether the region is online
71 /// </summary>
72 public bool regionOnline;
73
74 /// <summary>
75 /// Information about the server that the region is currently hosted on
76 /// </summary>
77 public string serverIP = "";
78 public uint serverPort;
79 public string serverURI = "";
80
81 /// <summary>
82 /// Set of optional overrides. Can be used to create non-eulicidean spaces.
83 /// </summary>
84 public ulong regionNorthOverrideHandle;
85 public ulong regionSouthOverrideHandle;
86 public ulong regionEastOverrideHandle;
87 public ulong regionWestOverrideHandle;
88
89 /// <summary>
90 /// Optional: URI Location of the region database
91 /// </summary>
92 /// <remarks>Used for floating sim pools where the region data is not nessecarily coupled to a specific server</remarks>
93 public string regionDataURI = "";
94
95 /// <summary>
96 /// Region Asset Details
97 /// </summary>
98 public string regionAssetURI = "";
99 public string regionAssetSendKey = "";
100 public string regionAssetRecvKey = "";
101
102 /// <summary>
103 /// Region Userserver Details
104 /// </summary>
105 public string regionUserURI = "";
106 public string regionUserSendKey = "";
107 public string regionUserRecvKey = "";
108
109 /// <summary>
110 /// Region Map Texture Asset
111 /// </summary>
112 public libsecondlife.LLUUID regionMapTextureID = new libsecondlife.LLUUID("00000000-0000-0000-9999-000000000006");
113 }
114}
diff --git a/Common/OpenGrid.Framework.Data/UserData.cs b/Common/OpenGrid.Framework.Data/UserData.cs
deleted file mode 100644
index c2d5a72..0000000
--- a/Common/OpenGrid.Framework.Data/UserData.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;
32
33namespace OpenGrid.Framework.Data
34{
35 /// <summary>
36 /// An interface for connecting to user storage servers.
37 /// </summary>
38 public interface IUserData
39 {
40 /// <summary>
41 /// Returns a user profile from a database via their UUID
42 /// </summary>
43 /// <param name="user">The accounts UUID</param>
44 /// <returns>The user data profile</returns>
45 UserProfileData getUserByUUID(LLUUID user);
46
47 /// <summary>
48 /// Returns a users profile by searching their username
49 /// </summary>
50 /// <param name="name">The users username</param>
51 /// <returns>The user data profile</returns>
52 UserProfileData getUserByName(string name);
53
54 /// <summary>
55 /// Returns a users profile by searching their username parts
56 /// </summary>
57 /// <param name="fname">Account firstname</param>
58 /// <param name="lname">Account lastname</param>
59 /// <returns>The user data profile</returns>
60 UserProfileData getUserByName(string fname, string lname);
61
62 /// <summary>
63 /// Returns the current agent for a user searching by it's UUID
64 /// </summary>
65 /// <param name="user">The users UUID</param>
66 /// <returns>The current agent session</returns>
67 UserAgentData getAgentByUUID(LLUUID user);
68
69 /// <summary>
70 /// Returns the current session agent for a user searching by username
71 /// </summary>
72 /// <param name="name">The users account name</param>
73 /// <returns>The current agent session</returns>
74 UserAgentData getAgentByName(string name);
75
76 /// <summary>
77 /// Returns the current session agent for a user searching by username parts
78 /// </summary>
79 /// <param name="fname">The users first account name</param>
80 /// <param name="lname">The users account surname</param>
81 /// <returns>The current agent session</returns>
82 UserAgentData getAgentByName(string fname, string lname);
83
84 /// <summary>
85 /// Adds a new User profile to the database
86 /// </summary>
87 /// <param name="user">UserProfile to add</param>
88 void addNewUserProfile(UserProfileData user);
89
90 /// <summary>
91 /// Adds a new agent to the database
92 /// </summary>
93 /// <param name="agent">The agent to add</param>
94 void addNewUserAgent(UserAgentData agent);
95
96 /// <summary>
97 /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES)
98 /// </summary>
99 /// <param name="from">The account to transfer from</param>
100 /// <param name="to">The account to transfer to</param>
101 /// <param name="amount">The amount to transfer</param>
102 /// <returns>Successful?</returns>
103 bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount);
104
105 /// <summary>
106 /// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account.
107 /// </summary>
108 /// <param name="from">User to transfer from</param>
109 /// <param name="to">User to transfer to</param>
110 /// <param name="inventory">Specified inventory item</param>
111 /// <returns>Successful?</returns>
112 bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory);
113
114 /// <summary>
115 /// Returns the plugin version
116 /// </summary>
117 /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns>
118 string getVersion();
119
120 /// <summary>
121 /// Returns the plugin name
122 /// </summary>
123 /// <returns>Plugin name, eg MySQL User Provider</returns>
124 string getName();
125
126 /// <summary>
127 /// Initialises the plugin (artificial constructor)
128 /// </summary>
129 void Initialise();
130 }
131}
diff --git a/Common/OpenGrid.Framework.Data/UserProfileData.cs b/Common/OpenGrid.Framework.Data/UserProfileData.cs
deleted file mode 100644
index 82633e1..0000000
--- a/Common/OpenGrid.Framework.Data/UserProfileData.cs
+++ /dev/null
@@ -1,182 +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;
32
33namespace OpenGrid.Framework.Data
34{
35 /// <summary>
36 /// Information about a particular user known to the userserver
37 /// </summary>
38 public class UserProfileData
39 {
40 /// <summary>
41 /// The ID value for this user
42 /// </summary>
43 public LLUUID UUID;
44
45 /// <summary>
46 /// The first component of a users account name
47 /// </summary>
48 public string username;
49 /// <summary>
50 /// The second component of a users account name
51 /// </summary>
52 public string surname;
53
54 /// <summary>
55 /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt)
56 /// </summary>
57 /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks>
58 public string passwordHash;
59 /// <summary>
60 /// The salt used for the users hash, should be 32 bytes or longer
61 /// </summary>
62 public string passwordSalt;
63
64 /// <summary>
65 /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into
66 /// </summary>
67 public ulong homeRegion;
68 /// <summary>
69 /// The coordinates inside the region of the home location
70 /// </summary>
71 public LLVector3 homeLocation;
72 /// <summary>
73 /// Where the user will be looking when they rez.
74 /// </summary>
75 public LLVector3 homeLookAt;
76
77 /// <summary>
78 /// A UNIX Timestamp (seconds since epoch) for the users creation
79 /// </summary>
80 public int created;
81 /// <summary>
82 /// A UNIX Timestamp for the users last login date / time
83 /// </summary>
84 public int lastLogin;
85
86 /// <summary>
87 /// A URI to the users inventory server, used for foreigners and large grids
88 /// </summary>
89 public string userInventoryURI;
90 /// <summary>
91 /// A URI to the users asset server, used for foreigners and large grids.
92 /// </summary>
93 public string userAssetURI;
94
95 /// <summary>
96 /// A uint mask containing the "I can do" fields of the users profile
97 /// </summary>
98 public uint profileCanDoMask;
99 /// <summary>
100 /// A uint mask containing the "I want to do" part of the users profile
101 /// </summary>
102 public uint profileWantDoMask; // Profile window "I want to" mask
103
104 /// <summary>
105 /// The about text listed in a users profile.
106 /// </summary>
107 public string profileAboutText;
108 /// <summary>
109 /// The first life about text listed in a users profile
110 /// </summary>
111 public string profileFirstText;
112
113 /// <summary>
114 /// The profile image for an avatar stored on the asset server
115 /// </summary>
116 public LLUUID profileImage;
117 /// <summary>
118 /// The profile image for the users first life tab
119 /// </summary>
120 public LLUUID profileFirstImage;
121 /// <summary>
122 /// The users last registered agent (filled in on the user server)
123 /// </summary>
124 public UserAgentData currentAgent;
125 }
126
127 /// <summary>
128 /// Information about a users session
129 /// </summary>
130 public class UserAgentData
131 {
132 /// <summary>
133 /// The UUID of the users avatar (not the agent!)
134 /// </summary>
135 public LLUUID UUID;
136 /// <summary>
137 /// The IP address of the user
138 /// </summary>
139 public string agentIP;
140 /// <summary>
141 /// The port of the user
142 /// </summary>
143 public uint agentPort;
144 /// <summary>
145 /// Is the user online?
146 /// </summary>
147 public bool agentOnline;
148 /// <summary>
149 /// The session ID for the user (also the agent ID)
150 /// </summary>
151 public LLUUID sessionID;
152 /// <summary>
153 /// The "secure" session ID for the user
154 /// </summary>
155 /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks>
156 public LLUUID secureSessionID;
157 /// <summary>
158 /// The region the user logged into initially
159 /// </summary>
160 public LLUUID regionID;
161 /// <summary>
162 /// A unix timestamp from when the user logged in
163 /// </summary>
164 public int loginTime;
165 /// <summary>
166 /// When this agent expired and logged out, 0 if still online
167 /// </summary>
168 public int logoutTime;
169 /// <summary>
170 /// Current region the user is logged into
171 /// </summary>
172 public LLUUID currentRegion;
173 /// <summary>
174 /// Region handle of the current region the user is in
175 /// </summary>
176 public ulong currentHandle;
177 /// <summary>
178 /// The position of the user within the region
179 /// </summary>
180 public LLVector3 currentPos;
181 }
182}
diff --git a/Common/OpenGrid.Framework.UserManager/LoginResponse.cs b/Common/OpenGrid.Framework.UserManager/LoginResponse.cs
deleted file mode 100644
index 514ebef..0000000
--- a/Common/OpenGrid.Framework.UserManager/LoginResponse.cs
+++ /dev/null
@@ -1,645 +0,0 @@
1using System;
2using System.Text;
3using System.Text.RegularExpressions;
4using System.Threading;
5using System.Collections;
6using System.Xml;
7using libsecondlife;
8using OpenSim.Framework.Utilities;
9using OpenSim.Framework.Interfaces;
10using Nwc.XmlRpc;
11
12namespace OpenGrid.Framework.UserManagement
13{
14
15 /// <summary>
16 /// A temp class to handle login response.
17 /// Should make use of UserProfileManager where possible.
18 /// </summary>
19
20 public class LoginResponse
21 {
22 private Hashtable loginFlagsHash;
23 private Hashtable globalTexturesHash;
24 private Hashtable loginError;
25 private Hashtable eventCategoriesHash;
26 private Hashtable uiConfigHash;
27 private Hashtable classifiedCategoriesHash;
28
29 private ArrayList loginFlags;
30 private ArrayList globalTextures;
31 private ArrayList eventCategories;
32 private ArrayList uiConfig;
33 private ArrayList classifiedCategories;
34 private ArrayList inventoryRoot;
35 private ArrayList initialOutfit;
36 private ArrayList agentInventory;
37
38 private UserInfo userProfile;
39
40 private LLUUID agentID;
41 private LLUUID sessionID;
42 private LLUUID secureSessionID;
43
44 // Login Flags
45 private string dst;
46 private string stipendSinceLogin;
47 private string gendered;
48 private string everLoggedIn;
49 private string login;
50 private int simPort;
51 private string simAddress;
52 private string agentAccess;
53 private Int32 circuitCode;
54 private uint regionX;
55 private uint regionY;
56
57 // Login
58 private string firstname;
59 private string lastname;
60
61 // Global Textures
62 private string sunTexture;
63 private string cloudTexture;
64 private string moonTexture;
65
66 // Error Flags
67 private string errorReason;
68 private string errorMessage;
69
70 // Response
71 private XmlRpcResponse xmlRpcResponse;
72 private XmlRpcResponse defaultXmlRpcResponse;
73
74 private string welcomeMessage;
75 private string startLocation;
76 private string allowFirstLife;
77 private string home;
78 private string seedCapability;
79 private string lookAt;
80
81 public LoginResponse()
82 {
83 this.loginFlags = new ArrayList();
84 this.globalTextures = new ArrayList();
85 this.eventCategories = new ArrayList();
86 this.uiConfig = new ArrayList();
87 this.classifiedCategories = new ArrayList();
88
89 this.loginError = new Hashtable();
90 this.eventCategoriesHash = new Hashtable();
91 this.classifiedCategoriesHash = new Hashtable();
92 this.uiConfigHash = new Hashtable();
93
94 this.defaultXmlRpcResponse = new XmlRpcResponse();
95 this.userProfile = new UserInfo();
96 this.inventoryRoot = new ArrayList();
97 this.initialOutfit = new ArrayList();
98 this.agentInventory = new ArrayList();
99
100 this.xmlRpcResponse = new XmlRpcResponse();
101 this.defaultXmlRpcResponse = new XmlRpcResponse();
102
103 this.SetDefaultValues();
104 } // LoginServer
105
106 public void SetDefaultValues()
107 {
108 this.DST = "N";
109 this.StipendSinceLogin = "N";
110 this.Gendered = "Y";
111 this.EverLoggedIn = "Y";
112 this.login = "false";
113 this.firstname = "Test";
114 this.lastname = "User";
115 this.agentAccess = "M";
116 this.startLocation = "last";
117 this.allowFirstLife = "Y";
118
119 this.SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271";
120 this.CloudTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
121 this.MoonTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
122
123 this.ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock.";
124 this.ErrorReason = "key";
125 this.welcomeMessage = "Welcome to OpenSim!";
126 this.seedCapability = "";
127 this.home = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + this.userProfile.homepos.X.ToString() + ",r" + this.userProfile.homepos.Y.ToString() + ",r" + this.userProfile.homepos.Z.ToString() + "], 'look_at':[r" + this.userProfile.homelookat.X.ToString() + ",r" + this.userProfile.homelookat.Y.ToString() + ",r" + this.userProfile.homelookat.Z.ToString() + "]}";
128 this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]";
129 this.RegionX = (uint)255232;
130 this.RegionY = (uint)254976;
131
132 // Classifieds;
133 this.AddClassifiedCategory((Int32)1, "Shopping");
134 this.AddClassifiedCategory((Int32)2, "Land Rental");
135 this.AddClassifiedCategory((Int32)3, "Property Rental");
136 this.AddClassifiedCategory((Int32)4, "Special Attraction");
137 this.AddClassifiedCategory((Int32)5, "New Products");
138 this.AddClassifiedCategory((Int32)6, "Employment");
139 this.AddClassifiedCategory((Int32)7, "Wanted");
140 this.AddClassifiedCategory((Int32)8, "Service");
141 this.AddClassifiedCategory((Int32)9, "Personal");
142
143
144 this.SessionID = LLUUID.Random();
145 this.SecureSessionID = LLUUID.Random();
146 this.AgentID = LLUUID.Random();
147
148 Hashtable InitialOutfitHash = new Hashtable();
149 InitialOutfitHash["folder_name"] = "Nightclub Female";
150 InitialOutfitHash["gender"] = "female";
151 this.initialOutfit.Add(InitialOutfitHash);
152
153
154 } // SetDefaultValues
155
156 #region Login Failure Methods
157 public XmlRpcResponse GenerateFailureResponse(string reason, string message, string login)
158 {
159 // Overwrite any default values;
160 this.xmlRpcResponse = new XmlRpcResponse();
161
162 // Ensure Login Failed message/reason;
163 this.ErrorMessage = message;
164 this.ErrorReason = reason;
165
166 this.loginError["reason"] = this.ErrorReason;
167 this.loginError["message"] = this.ErrorMessage;
168 this.loginError["login"] = login;
169 this.xmlRpcResponse.Value = this.loginError;
170 return (this.xmlRpcResponse);
171 } // GenerateResponse
172
173 public XmlRpcResponse CreateFailedResponse()
174 {
175 return (this.CreateLoginFailedResponse());
176 } // CreateErrorConnectingToGridResponse()
177
178 public XmlRpcResponse CreateLoginFailedResponse()
179 {
180 return (this.GenerateFailureResponse("key", "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", "false"));
181 } // LoginFailedResponse
182
183 public XmlRpcResponse CreateAlreadyLoggedInResponse()
184 {
185 return (this.GenerateFailureResponse("presence", "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner", "false"));
186 } // CreateAlreadyLoggedInResponse()
187
188 public XmlRpcResponse CreateDeadRegionResponse()
189 {
190 return (this.GenerateFailureResponse("key", "The region you are attempting to log into is not responding. Please select another region and try again.", "false"));
191 }
192
193 public XmlRpcResponse CreateGridErrorResponse()
194 {
195 return (this.GenerateFailureResponse("key", "Error connecting to grid. Could not percieve credentials from login XML.", "false"));
196 }
197
198 #endregion
199
200 public XmlRpcResponse ToXmlRpcResponse()
201 {
202 try
203 {
204
205 Hashtable responseData = new Hashtable();
206
207 this.loginFlagsHash = new Hashtable();
208 this.loginFlagsHash["daylight_savings"] = this.DST;
209 this.loginFlagsHash["stipend_since_login"] = this.StipendSinceLogin;
210 this.loginFlagsHash["gendered"] = this.Gendered;
211 this.loginFlagsHash["ever_logged_in"] = this.EverLoggedIn;
212 this.loginFlags.Add(this.loginFlagsHash);
213
214 responseData["first_name"] = this.Firstname;
215 responseData["last_name"] = this.Lastname;
216 responseData["agent_access"] = this.agentAccess;
217
218 this.globalTexturesHash = new Hashtable();
219 this.globalTexturesHash["sun_texture_id"] = this.SunTexture;
220 this.globalTexturesHash["cloud_texture_id"] = this.CloudTexture;
221 this.globalTexturesHash["moon_texture_id"] = this.MoonTexture;
222 this.globalTextures.Add(this.globalTexturesHash);
223 this.eventCategories.Add(this.eventCategoriesHash);
224
225 this.AddToUIConfig("allow_first_life", this.allowFirstLife);
226 this.uiConfig.Add(this.uiConfigHash);
227
228 responseData["sim_port"] =(Int32) this.SimPort;
229 responseData["sim_ip"] = this.SimAddress;
230 responseData["agent_id"] = this.AgentID.ToStringHyphenated();
231 responseData["session_id"] = this.SessionID.ToStringHyphenated();
232 responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated();
233 responseData["circuit_code"] = this.CircuitCode;
234 responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
235 responseData["login-flags"] = this.loginFlags;
236 responseData["global-textures"] = this.globalTextures;
237 responseData["seed_capability"] = this.seedCapability;
238
239 responseData["event_categories"] = this.eventCategories;
240 responseData["event_notifications"] = new ArrayList(); // todo
241 responseData["classified_categories"] = this.classifiedCategories;
242 responseData["ui-config"] = this.uiConfig;
243
244 responseData["inventory-skeleton"] = this.agentInventory;
245 responseData["inventory-skel-lib"] = new ArrayList(); // todo
246 responseData["inventory-root"] = this.inventoryRoot;
247 responseData["gestures"] = new ArrayList(); // todo
248 responseData["inventory-lib-owner"] = new ArrayList(); // todo
249 responseData["initial-outfit"] = this.initialOutfit;
250 responseData["start_location"] = this.startLocation;
251 responseData["seed_capability"] = this.seedCapability;
252 responseData["home"] = this.home;
253 responseData["look_at"] = this.lookAt;
254 responseData["message"] = this.welcomeMessage;
255 responseData["region_x"] = (Int32)this.RegionX * 256;
256 responseData["region_y"] = (Int32)this.RegionY * 256;
257
258 //responseData["inventory-lib-root"] = new ArrayList(); // todo
259 //responseData["buddy-list"] = new ArrayList(); // todo
260
261 responseData["login"] = "true";
262 this.xmlRpcResponse.Value = responseData;
263
264 return (this.xmlRpcResponse);
265 }
266 catch (Exception e)
267 {
268 OpenSim.Framework.Console.MainLog.Instance.WriteLine(
269 OpenSim.Framework.Console.LogPriority.LOW,
270 "LoginResponse: Error creating XML-RPC Response: " + e.Message
271 );
272 return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false"));
273
274 }
275
276 } // ToXmlRpcResponse
277
278 public void SetEventCategories(string category, string value)
279 {
280 this.eventCategoriesHash[category] = value;
281 } // SetEventCategories
282
283 public void AddToUIConfig(string itemName, string item)
284 {
285 this.uiConfigHash[itemName] = item;
286 } // SetUIConfig
287
288 public void AddClassifiedCategory(Int32 ID, string categoryName)
289 {
290 this.classifiedCategoriesHash["category_name"] = categoryName;
291 this.classifiedCategoriesHash["category_id"] = ID;
292 this.classifiedCategories.Add(this.classifiedCategoriesHash);
293 // this.classifiedCategoriesHash.Clear();
294 } // SetClassifiedCategory
295
296 #region Properties
297 public string Login
298 {
299 get
300 {
301 return this.login;
302 }
303 set
304 {
305 this.login = value;
306 }
307 } // Login
308
309 public string DST
310 {
311 get
312 {
313 return this.dst;
314 }
315 set
316 {
317 this.dst = value;
318 }
319 } // DST
320
321 public string StipendSinceLogin
322 {
323 get
324 {
325 return this.stipendSinceLogin;
326 }
327 set
328 {
329 this.stipendSinceLogin = value;
330 }
331 } // StipendSinceLogin
332
333 public string Gendered
334 {
335 get
336 {
337 return this.gendered;
338 }
339 set
340 {
341 this.gendered = value;
342 }
343 } // Gendered
344
345 public string EverLoggedIn
346 {
347 get
348 {
349 return this.everLoggedIn;
350 }
351 set
352 {
353 this.everLoggedIn = value;
354 }
355 } // EverLoggedIn
356
357 public int SimPort
358 {
359 get
360 {
361 return this.simPort;
362 }
363 set
364 {
365 this.simPort = value;
366 }
367 } // SimPort
368
369 public string SimAddress
370 {
371 get
372 {
373 return this.simAddress;
374 }
375 set
376 {
377 this.simAddress = value;
378 }
379 } // SimAddress
380
381 public LLUUID AgentID
382 {
383 get
384 {
385 return this.agentID;
386 }
387 set
388 {
389 this.agentID = value;
390 }
391 } // AgentID
392
393 public LLUUID SessionID
394 {
395 get
396 {
397 return this.sessionID;
398 }
399 set
400 {
401 this.sessionID = value;
402 }
403 } // SessionID
404
405 public LLUUID SecureSessionID
406 {
407 get
408 {
409 return this.secureSessionID;
410 }
411 set
412 {
413 this.secureSessionID = value;
414 }
415 } // SecureSessionID
416
417 public Int32 CircuitCode
418 {
419 get
420 {
421 return this.circuitCode;
422 }
423 set
424 {
425 this.circuitCode = value;
426 }
427 } // CircuitCode
428
429 public uint RegionX
430 {
431 get
432 {
433 return this.regionX;
434 }
435 set
436 {
437 this.regionX = value;
438 }
439 } // RegionX
440
441 public uint RegionY
442 {
443 get
444 {
445 return this.regionY;
446 }
447 set
448 {
449 this.regionY = value;
450 }
451 } // RegionY
452
453 public string SunTexture
454 {
455 get
456 {
457 return this.sunTexture;
458 }
459 set
460 {
461 this.sunTexture = value;
462 }
463 } // SunTexture
464
465 public string CloudTexture
466 {
467 get
468 {
469 return this.cloudTexture;
470 }
471 set
472 {
473 this.cloudTexture = value;
474 }
475 } // CloudTexture
476
477 public string MoonTexture
478 {
479 get
480 {
481 return this.moonTexture;
482 }
483 set
484 {
485 this.moonTexture = value;
486 }
487 } // MoonTexture
488
489 public string Firstname
490 {
491 get
492 {
493 return this.firstname;
494 }
495 set
496 {
497 this.firstname = value;
498 }
499 } // Firstname
500
501 public string Lastname
502 {
503 get
504 {
505 return this.lastname;
506 }
507 set
508 {
509 this.lastname = value;
510 }
511 } // Lastname
512
513 public string AgentAccess
514 {
515 get
516 {
517 return this.agentAccess;
518 }
519 set
520 {
521 this.agentAccess = value;
522 }
523 }
524
525 public string StartLocation
526 {
527 get
528 {
529 return this.startLocation;
530 }
531 set
532 {
533 this.startLocation = value;
534 }
535 } // StartLocation
536
537 public string LookAt
538 {
539 get
540 {
541 return this.lookAt;
542 }
543 set
544 {
545 this.lookAt = value;
546 }
547 }
548
549 public string SeedCapability
550 {
551 get
552 {
553 return this.seedCapability;
554 }
555 set
556 {
557 this.seedCapability = value;
558 }
559 } // SeedCapability
560
561 public string ErrorReason
562 {
563 get
564 {
565 return this.errorReason;
566 }
567 set
568 {
569 this.errorReason = value;
570 }
571 } // ErrorReason
572
573 public string ErrorMessage
574 {
575 get
576 {
577 return this.errorMessage;
578 }
579 set
580 {
581 this.errorMessage = value;
582 }
583 } // ErrorMessage
584
585 public ArrayList InventoryRoot
586 {
587 get
588 {
589 return this.inventoryRoot;
590 }
591 set
592 {
593 this.inventoryRoot = value;
594 }
595 }
596
597 public ArrayList InventorySkeleton
598 {
599 get
600 {
601 return this.agentInventory;
602 }
603 set
604 {
605 this.agentInventory = value;
606 }
607 }
608
609 public string Home
610 {
611 get
612 {
613 return this.home;
614 }
615 set
616 {
617 this.home = value;
618 }
619 }
620
621 public string Message
622 {
623 get
624 {
625 return this.welcomeMessage;
626 }
627 set
628 {
629 this.welcomeMessage = value;
630 }
631 }
632 #endregion
633
634
635 public class UserInfo
636 {
637 public string firstname;
638 public string lastname;
639 public ulong homeregionhandle;
640 public LLVector3 homepos;
641 public LLVector3 homelookat;
642 }
643 }
644}
645
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj
deleted file mode 100644
index 9a3cdba..0000000
--- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj
+++ /dev/null
@@ -1,125 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{DA9A7391-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.UserManagement</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.UserManagement</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="Db4objects.Db4o.dll" >
62 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="libsecondlife.dll" >
66 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="OpenSim.Framework" >
70 <HintPath>OpenSim.Framework.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="OpenSim.Framework.Console" >
74 <HintPath>OpenSim.Framework.Console.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="OpenSim.GenericConfig.Xml" >
78 <HintPath>OpenSim.GenericConfig.Xml.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="OpenSim.Servers" >
82 <HintPath>OpenSim.Servers.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 <Reference Include="System" >
86 <HintPath>System.dll</HintPath>
87 <Private>False</Private>
88 </Reference>
89 <Reference Include="System.Data" >
90 <HintPath>System.Data.dll</HintPath>
91 <Private>False</Private>
92 </Reference>
93 <Reference Include="System.Xml" >
94 <HintPath>System.Xml.dll</HintPath>
95 <Private>False</Private>
96 </Reference>
97 <Reference Include="XMLRPC" >
98 <HintPath>XMLRPC.dll</HintPath>
99 <Private>False</Private>
100 </Reference>
101 </ItemGroup>
102 <ItemGroup>
103 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
104 <Name>OpenGrid.Framework.Data</Name>
105 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
107 <Private>False</Private>
108 </ProjectReference>
109 </ItemGroup>
110 <ItemGroup>
111 <Compile Include="LoginResponse.cs">
112 <SubType>Code</SubType>
113 </Compile>
114 <Compile Include="UserManagerBase.cs">
115 <SubType>Code</SubType>
116 </Compile>
117 </ItemGroup>
118 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
119 <PropertyGroup>
120 <PreBuildEvent>
121 </PreBuildEvent>
122 <PostBuildEvent>
123 </PostBuildEvent>
124 </PropertyGroup>
125</Project>
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj.user b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj.user
deleted file mode 100644
index ae8a33c..0000000
--- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj.user
+++ /dev/null
@@ -1,12 +0,0 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>E:\work\oslauth\sim\branches\Sugilite\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build
deleted file mode 100644
index 9dc2383..0000000
--- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build
+++ /dev/null
@@ -1,50 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.UserManagement" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.UserManagement" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="LoginResponse.cs" />
15 <include name="UserManagerBase.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="../../bin/Db4objects.Db4o.dll" />
23 <include name="../../bin/libsecondlife.dll" />
24 <include name="../../bin/OpenGrid.Framework.Data.dll" />
25 <include name="../../bin/OpenSim.Framework.dll" />
26 <include name="../../bin/OpenSim.Framework.Console.dll" />
27 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
28 <include name="../../bin/OpenSim.Servers.dll" />
29 <include name="System.dll" />
30 <include name="System.Data.dll" />
31 <include name="System.Xml.dll" />
32 <include name="../../bin/XMLRPC.dll" />
33 </references>
34 </csc>
35 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
36 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
37 <copy todir="${project::get-base-directory()}/../../bin/">
38 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
39 <include name="*.dll"/>
40 <include name="*.exe"/>
41 </fileset>
42 </copy>
43 </target>
44 <target name="clean">
45 <delete dir="${bin.dir}" failonerror="false" />
46 <delete dir="${obj.dir}" failonerror="false" />
47 </target>
48 <target name="doc" description="Creates documentation.">
49 </target>
50</project>
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.csproj b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.csproj
deleted file mode 100644
index 43f56a4..0000000
--- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.csproj
+++ /dev/null
@@ -1,122 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{D1D78B8D-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.UserManager</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.UserManager</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="Db4objects.Db4o.dll" >
62 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="libsecondlife.dll" >
66 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="OpenSim.Framework" >
70 <HintPath>OpenSim.Framework.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="OpenSim.Framework.Console" >
74 <HintPath>OpenSim.Framework.Console.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="OpenSim.GenericConfig.Xml" >
78 <HintPath>OpenSim.GenericConfig.Xml.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="OpenSim.Servers" >
82 <HintPath>OpenSim.Servers.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 <Reference Include="System" >
86 <HintPath>System.dll</HintPath>
87 <Private>False</Private>
88 </Reference>
89 <Reference Include="System.Data" >
90 <HintPath>System.Data.dll</HintPath>
91 <Private>False</Private>
92 </Reference>
93 <Reference Include="System.Xml" >
94 <HintPath>System.Xml.dll</HintPath>
95 <Private>False</Private>
96 </Reference>
97 <Reference Include="XMLRPC" >
98 <HintPath>XMLRPC.dll</HintPath>
99 <Private>False</Private>
100 </Reference>
101 </ItemGroup>
102 <ItemGroup>
103 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
104 <Name>OpenGrid.Framework.Data</Name>
105 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
107 <Private>False</Private>
108 </ProjectReference>
109 </ItemGroup>
110 <ItemGroup>
111 <Compile Include="UserManagerBase.cs">
112 <SubType>Code</SubType>
113 </Compile>
114 </ItemGroup>
115 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
116 <PropertyGroup>
117 <PreBuildEvent>
118 </PreBuildEvent>
119 <PostBuildEvent>
120 </PostBuildEvent>
121 </PropertyGroup>
122</Project>
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.csproj.user b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.csproj.user
deleted file mode 100644
index 5941547..0000000
--- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.csproj.user
+++ /dev/null
@@ -1,12 +0,0 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\Sugilite\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.dll.build b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.dll.build
deleted file mode 100644
index 81a87f5..0000000
--- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManager.dll.build
+++ /dev/null
@@ -1,49 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.UserManager" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.UserManager" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="UserManagerBase.cs" />
15 </sources>
16 <references basedir="${project::get-base-directory()}">
17 <lib>
18 <include name="${project::get-base-directory()}" />
19 <include name="${project::get-base-directory()}/${build.dir}" />
20 </lib>
21 <include name="../../bin/Db4objects.Db4o.dll" />
22 <include name="../../bin/libsecondlife.dll" />
23 <include name="../../bin/OpenGrid.Framework.Data.dll" />
24 <include name="../../bin/OpenSim.Framework.dll" />
25 <include name="../../bin/OpenSim.Framework.Console.dll" />
26 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
27 <include name="../../bin/OpenSim.Servers.dll" />
28 <include name="System.dll" />
29 <include name="System.Data.dll" />
30 <include name="System.Xml.dll" />
31 <include name="../../bin/XMLRPC.dll" />
32 </references>
33 </csc>
34 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
35 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
36 <copy todir="${project::get-base-directory()}/../../bin/">
37 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
38 <include name="*.dll"/>
39 <include name="*.exe"/>
40 </fileset>
41 </copy>
42 </target>
43 <target name="clean">
44 <delete dir="${bin.dir}" failonerror="false" />
45 <delete dir="${obj.dir}" failonerror="false" />
46 </target>
47 <target name="doc" description="Creates documentation.">
48 </target>
49</project>
diff --git a/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs b/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs
deleted file mode 100644
index 01fbf3a..0000000
--- a/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs
+++ /dev/null
@@ -1,641 +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;
30using System.Collections.Generic;
31using System.Text;
32using OpenGrid.Framework.Data;
33using libsecondlife;
34using System.Reflection;
35
36using System.Xml;
37using Nwc.XmlRpc;
38using OpenSim.Framework.Sims;
39using OpenSim.Framework.Inventory;
40using OpenSim.Framework.Utilities;
41
42using System.Security.Cryptography;
43
44namespace OpenGrid.Framework.UserManagement
45{
46 public class UserManagerBase
47 {
48 public OpenSim.Framework.Interfaces.UserConfig _config;
49 Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>();
50
51 /// <summary>
52 /// Adds a new user server plugin - user servers will be requested in the order they were loaded.
53 /// </summary>
54 /// <param name="FileName">The filename to the user server plugin DLL</param>
55 public void AddPlugin(string FileName)
56 {
57 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Userstorage: Attempting to load " + FileName);
58 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
59
60 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Userstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
61 foreach (Type pluginType in pluginAssembly.GetTypes())
62 {
63 if (!pluginType.IsAbstract)
64 {
65 Type typeInterface = pluginType.GetInterface("IUserData", true);
66
67 if (typeInterface != null)
68 {
69 IUserData plug = (IUserData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
70 plug.Initialise();
71 this._plugins.Add(plug.getName(), plug);
72 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Userstorage: Added IUserData Interface");
73 }
74
75 typeInterface = null;
76 }
77 }
78
79 pluginAssembly = null;
80 }
81
82 #region Get UserProfile
83 /// <summary>
84 /// Loads a user profile from a database by UUID
85 /// </summary>
86 /// <param name="uuid">The target UUID</param>
87 /// <returns>A user profile</returns>
88 public UserProfileData getUserProfile(LLUUID uuid)
89 {
90 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
91 {
92 try
93 {
94 UserProfileData profile = plugin.Value.getUserByUUID(uuid);
95 profile.currentAgent = getUserAgent(profile.UUID);
96 return profile;
97 }
98 catch (Exception e)
99 {
100 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
101 }
102 }
103
104 return null;
105 }
106
107
108 /// <summary>
109 /// Loads a user profile by name
110 /// </summary>
111 /// <param name="name">The target name</param>
112 /// <returns>A user profile</returns>
113 public UserProfileData getUserProfile(string name)
114 {
115 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
116 {
117 try
118 {
119 UserProfileData profile = plugin.Value.getUserByName(name);
120 profile.currentAgent = getUserAgent(profile.UUID);
121 return profile;
122 }
123 catch (Exception e)
124 {
125 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
126 }
127 }
128
129 return null;
130 }
131
132 /// <summary>
133 /// Loads a user profile by name
134 /// </summary>
135 /// <param name="fname">First name</param>
136 /// <param name="lname">Last name</param>
137 /// <returns>A user profile</returns>
138 public UserProfileData getUserProfile(string fname, string lname)
139 {
140 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
141 {
142 try
143 {
144 UserProfileData profile = plugin.Value.getUserByName(fname,lname);
145 try
146 {
147 profile.currentAgent = getUserAgent(profile.UUID);
148 }
149 catch (Exception e)
150 {
151 // Ignore
152 }
153 return profile;
154 }
155 catch (Exception e)
156 {
157 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
158 }
159 }
160
161 return null;
162 }
163 #endregion
164
165 #region Get UserAgent
166 /// <summary>
167 /// Loads a user agent by uuid (not called directly)
168 /// </summary>
169 /// <param name="uuid">The agents UUID</param>
170 /// <returns>Agent profiles</returns>
171 public UserAgentData getUserAgent(LLUUID uuid)
172 {
173 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
174 {
175 try
176 {
177 return plugin.Value.getAgentByUUID(uuid);
178 }
179 catch (Exception e)
180 {
181 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
182 }
183 }
184
185 return null;
186 }
187
188 /// <summary>
189 /// Loads a user agent by name (not called directly)
190 /// </summary>
191 /// <param name="name">The agents name</param>
192 /// <returns>A user agent</returns>
193 public UserAgentData getUserAgent(string name)
194 {
195 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
196 {
197 try
198 {
199 return plugin.Value.getAgentByName(name);
200 }
201 catch (Exception e)
202 {
203 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
204 }
205 }
206
207 return null;
208 }
209
210 /// <summary>
211 /// Loads a user agent by name (not called directly)
212 /// </summary>
213 /// <param name="fname">The agents firstname</param>
214 /// <param name="lname">The agents lastname</param>
215 /// <returns>A user agent</returns>
216 public UserAgentData getUserAgent(string fname, string lname)
217 {
218 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
219 {
220 try
221 {
222 return plugin.Value.getAgentByName(fname,lname);
223 }
224 catch (Exception e)
225 {
226 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
227 }
228 }
229
230 return null;
231 }
232
233 #endregion
234
235 #region CreateAgent
236 /// <summary>
237 /// Creates and initialises a new user agent - make sure to use CommitAgent when done to submit to the DB
238 /// </summary>
239 /// <param name="profile">The users profile</param>
240 /// <param name="request">The users loginrequest</param>
241 public void CreateAgent(ref UserProfileData profile, XmlRpcRequest request)
242 {
243 Hashtable requestData = (Hashtable)request.Params[0];
244
245 UserAgentData agent = new UserAgentData();
246
247 // User connection
248 agent.agentIP = "";
249 agent.agentOnline = true;
250 agent.agentPort = 0;
251
252 // Generate sessions
253 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
254 byte[] randDataS = new byte[16];
255 byte[] randDataSS = new byte[16];
256 rand.GetBytes(randDataS);
257 rand.GetBytes(randDataSS);
258
259 agent.secureSessionID = new LLUUID(randDataSS, 0);
260 agent.sessionID = new LLUUID(randDataS, 0);
261
262 // Profile UUID
263 agent.UUID = profile.UUID;
264
265 // Current position (from Home)
266 agent.currentHandle = profile.homeRegion;
267 agent.currentPos = profile.homeLocation;
268
269 // If user specified additional start, use that
270 if (requestData.ContainsKey("start"))
271 {
272 string startLoc = ((string)requestData["start"]).Trim();
273 if (!(startLoc == "last" || startLoc == "home"))
274 {
275 // Format: uri:Ahern&162&213&34
276 try
277 {
278 string[] parts = startLoc.Remove(0, 4).Split('&');
279 string region = parts[0];
280
281 ////////////////////////////////////////////////////
282 //SimProfile SimInfo = new SimProfile();
283 //SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey);
284 }
285 catch (Exception e)
286 {
287
288 }
289 }
290 }
291
292 // What time did the user login?
293 agent.loginTime = Util.UnixTimeSinceEpoch();
294 agent.logoutTime = 0;
295
296 // Current location
297 agent.regionID = new LLUUID(); // Fill in later
298 agent.currentRegion = new LLUUID(); // Fill in later
299
300 profile.currentAgent = agent;
301 }
302
303 /// <summary>
304 /// Saves a target agent to the database
305 /// </summary>
306 /// <param name="profile">The users profile</param>
307 /// <returns>Successful?</returns>
308 public bool CommitAgent(ref UserProfileData profile)
309 {
310 // Saves the agent to database
311 return true;
312 }
313
314 #endregion
315
316 /// <summary>
317 /// Checks a user against it's password hash
318 /// </summary>
319 /// <param name="profile">The users profile</param>
320 /// <param name="password">The supplied password</param>
321 /// <returns>Authenticated?</returns>
322 public virtual bool AuthenticateUser(ref UserProfileData profile, string password)
323 {
324 OpenSim.Framework.Console.MainLog.Instance.Verbose(
325 "Authenticating " + profile.username + " " + profile.surname);
326
327 password = password.Remove(0, 3); //remove $1$
328
329 string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
330
331 return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
332 }
333
334 #region Xml Response
335
336 /// <summary>
337 ///
338 /// </summary>
339 /// <param name="firstname"></param>
340 /// <param name="lastname"></param>
341 /// <returns></returns>
342 public virtual UserProfileData GetTheUser(string firstname, string lastname)
343 {
344 return getUserProfile(firstname, lastname);
345 }
346
347 /// <summary>
348 ///
349 /// </summary>
350 /// <returns></returns>
351 public virtual string GetMessage()
352 {
353 return _config.DefaultStartupMsg;
354 }
355
356 /// <summary>
357 /// Customises the login response and fills in missing values.
358 /// </summary>
359 /// <param name="response">The existing response</param>
360 /// <param name="theUser">The user profile</param>
361 public virtual void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser)
362 {
363
364 }
365
366 /// <summary>
367 /// Main user login function
368 /// </summary>
369 /// <param name="request">The XMLRPC request</param>
370 /// <returns>The response to send</returns>
371 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
372 {
373 XmlRpcResponse response = new XmlRpcResponse();
374 Hashtable requestData = (Hashtable)request.Params[0];
375
376 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
377 bool GoodLogin = false;
378 string firstname = "";
379 string lastname = "";
380 string passwd = "";
381
382 UserProfileData TheUser;
383 LoginResponse logResponse = new LoginResponse();
384
385 if (GoodXML)
386 {
387 firstname = (string)requestData["first"];
388 lastname = (string)requestData["last"];
389 passwd = (string)requestData["passwd"];
390
391 TheUser = GetTheUser(firstname, lastname);
392 if (TheUser == null)
393 return logResponse.CreateLoginFailedResponse();
394
395 GoodLogin = AuthenticateUser(ref TheUser, passwd);
396 }
397 else
398 {
399 return logResponse.CreateGridErrorResponse();
400 }
401
402 if (!GoodLogin)
403 {
404 return logResponse.CreateLoginFailedResponse();
405 }
406 else
407 {
408 // If we already have a session...
409 if (TheUser.currentAgent != null && TheUser.currentAgent.agentOnline)
410 {
411 // Reject the login
412 return logResponse.CreateAlreadyLoggedInResponse();
413 }
414 // Otherwise...
415 // Create a new agent session
416 CreateAgent(ref TheUser, request);
417
418 try
419 {
420
421 LLUUID AgentID = TheUser.UUID;
422
423 // Inventory Library Section
424 ArrayList AgentInventoryArray = new ArrayList();
425 Hashtable TempHash;
426
427 AgentInventory Library = new AgentInventory();
428 Library.CreateRootFolder(AgentID, true);
429
430 foreach (InventoryFolder InvFolder in Library.InventoryFolders.Values)
431 {
432 TempHash = new Hashtable();
433 TempHash["name"] = InvFolder.FolderName;
434 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
435 TempHash["version"] = (Int32)InvFolder.Version;
436 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
437 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
438 AgentInventoryArray.Add(TempHash);
439 }
440
441 Hashtable InventoryRootHash = new Hashtable();
442 InventoryRootHash["folder_id"] = Library.InventoryRoot.FolderID.ToStringHyphenated();
443 ArrayList InventoryRoot = new ArrayList();
444 InventoryRoot.Add(InventoryRootHash);
445
446 // Circuit Code
447 uint circode = (uint)(Util.RandomClass.Next());
448
449 logResponse.Lastname = TheUser.surname;
450 logResponse.Firstname = TheUser.username;
451 logResponse.AgentID = AgentID.ToStringHyphenated();
452 logResponse.SessionID = TheUser.currentAgent.sessionID.ToStringHyphenated();
453 logResponse.SecureSessionID = TheUser.currentAgent.secureSessionID.ToStringHyphenated();
454 logResponse.InventoryRoot = InventoryRoot;
455 logResponse.InventorySkeleton = AgentInventoryArray;
456 logResponse.CircuitCode = (Int32)circode;
457 logResponse.RegionX = 0; //overwritten
458 logResponse.RegionY = 0; //overwritten
459 logResponse.Home = "!!null temporary value {home}!!"; // Overwritten
460 //logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n";
461 logResponse.SimAddress = "127.0.0.1"; //overwritten
462 logResponse.SimPort = 0; //overwritten
463 logResponse.Message = this.GetMessage();
464
465 try
466 {
467 this.CustomiseResponse(ref logResponse, ref TheUser);
468 }
469 catch (Exception e)
470 {
471 Console.WriteLine(e.ToString());
472 return logResponse.CreateDeadRegionResponse();
473 }
474 CommitAgent(ref TheUser);
475
476 return logResponse.ToXmlRpcResponse();
477
478 }
479 catch (Exception E)
480 {
481 Console.WriteLine(E.ToString());
482 }
483 //}
484 }
485 return response;
486
487 }
488
489 #endregion
490
491 /// <summary>
492 /// Deletes an active agent session
493 /// </summary>
494 /// <param name="request">The request</param>
495 /// <param name="path">The path (eg /bork/narf/test)</param>
496 /// <param name="param">Parameters sent</param>
497 /// <returns>Success "OK" else error</returns>
498 public string RestDeleteUserSessionMethod(string request, string path, string param)
499 {
500 // TODO! Important!
501
502 return "OK";
503 }
504
505 /// <summary>
506 ///
507 /// </summary>
508 /// <param name="user"></param>
509 public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
510 {
511 UserProfileData user = new UserProfileData();
512 user.homeLocation = new LLVector3(128, 128, 100);
513 user.UUID = LLUUID.Random();
514 user.username = firstName;
515 user.surname = lastName;
516 user.passwordHash = pass;
517 user.passwordSalt = "";
518 user.created = Util.UnixTimeSinceEpoch();
519 user.homeLookAt = new LLVector3(100, 100, 100);
520 user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256));
521
522 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
523 {
524 try
525 {
526 plugin.Value.addNewUserProfile(user);
527
528 }
529 catch (Exception e)
530 {
531 OpenSim.Framework.Console.MainLog.Instance.Verbose("Unable to add user via " + plugin.Key + "(" + e.ToString() + ")");
532 }
533 }
534 }
535
536 /// <summary>
537 /// Returns an error message that the user could not be found in the database
538 /// </summary>
539 /// <returns>XML string consisting of a error element containing individual error(s)</returns>
540 public string CreateUnknownUserErrorResponse()
541 {
542 System.IO.StringWriter sw = new System.IO.StringWriter();
543 XmlTextWriter xw = new XmlTextWriter(sw);
544
545 // Header
546 xw.Formatting = Formatting.Indented;
547 xw.WriteStartDocument();
548 xw.WriteDocType("error", null, null, null);
549 xw.WriteComment("An error occured");
550 xw.WriteStartElement("error");
551
552 // User
553 xw.WriteElementString("unknownuser", "Unable to find a user with that name");
554
555 // Footer
556 xw.WriteEndElement();
557 xw.Flush();
558 xw.Close();
559
560 return sw.ToString();
561 }
562
563 /// <summary>
564 /// Converts a user profile to an XML element which can be returned
565 /// </summary>
566 /// <param name="profile">The user profile</param>
567 /// <returns>A string containing an XML Document of the user profile</returns>
568 public string ProfileToXml(UserProfileData profile)
569 {
570 System.IO.StringWriter sw = new System.IO.StringWriter();
571 XmlTextWriter xw = new XmlTextWriter(sw);
572
573 // Header
574 xw.Formatting = Formatting.Indented;
575 xw.WriteStartDocument();
576 xw.WriteDocType("userprofile", null, null, null);
577 xw.WriteComment("Found user profiles matching the request");
578 xw.WriteStartElement("users");
579
580 // User
581 xw.WriteStartElement("user");
582 // Account information
583 xw.WriteAttributeString("firstname", profile.username);
584 xw.WriteAttributeString("lastname", profile.surname);
585 xw.WriteAttributeString("uuid", profile.UUID.ToStringHyphenated());
586 // Server Information
587 xw.WriteAttributeString("server_inventory", profile.userInventoryURI);
588 xw.WriteAttributeString("server_asset", profile.userAssetURI);
589 // Profile Information
590 xw.WriteAttributeString("profile_about", profile.profileAboutText);
591 xw.WriteAttributeString("profile_firstlife_about", profile.profileFirstText);
592 xw.WriteAttributeString("profile_firstlife_image", profile.profileFirstImage.ToStringHyphenated());
593 xw.WriteAttributeString("profile_can_do", profile.profileCanDoMask.ToString());
594 xw.WriteAttributeString("profile_want_do", profile.profileWantDoMask.ToString());
595 xw.WriteAttributeString("profile_image", profile.profileImage.ToStringHyphenated());
596 xw.WriteAttributeString("profile_created",profile.created.ToString());
597 xw.WriteAttributeString("profile_lastlogin",profile.lastLogin.ToString());
598 // Home region information
599 xw.WriteAttributeString("home_coordinates", profile.homeLocation.ToString());
600 xw.WriteAttributeString("home_region", profile.homeRegion.ToString());
601 xw.WriteAttributeString("home_look", profile.homeLookAt.ToString());
602
603 xw.WriteEndElement();
604
605 // Footer
606 xw.WriteEndElement();
607 xw.Flush();
608 xw.Close();
609
610 return sw.ToString();
611 }
612
613 #region REST Methods
614 //should most likely move out of here and into the grid's userserver sub class
615 public string RestGetUserMethodName(string request, string path, string param)
616 {
617 UserProfileData userProfile = getUserProfile(param.Trim());
618
619 if (userProfile == null)
620 {
621 return CreateUnknownUserErrorResponse();
622 }
623
624 return ProfileToXml(userProfile);
625 }
626
627 public string RestGetUserMethodUUID(string request, string path, string param)
628 {
629 UserProfileData userProfile = getUserProfile(new LLUUID(param));
630
631 if (userProfile == null)
632 {
633 return CreateUnknownUserErrorResponse();
634 }
635
636 return ProfileToXml(userProfile);
637 }
638 #endregion
639
640 }
641}
diff --git a/Common/OpenSim.Framework.Console/AssemblyInfo.cs b/Common/OpenSim.Framework.Console/AssemblyInfo.cs
deleted file mode 100644
index 8f715d2..0000000
--- a/Common/OpenSim.Framework.Console/AssemblyInfo.cs
+++ /dev/null
@@ -1,58 +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.Reflection;
29using System.Runtime.CompilerServices;
30using System.Runtime.InteropServices;
31
32// Information about this assembly is defined by the following
33// attributes.
34//
35// change them to the information which is associated with the assembly
36// you compile.
37
38[assembly: AssemblyTitle("ServerConsole")]
39[assembly: AssemblyDescription("")]
40[assembly: AssemblyConfiguration("")]
41[assembly: AssemblyCompany("")]
42[assembly: AssemblyProduct("ServerConsole")]
43[assembly: AssemblyCopyright("")]
44[assembly: AssemblyTrademark("")]
45[assembly: AssemblyCulture("")]
46
47// This sets the default COM visibility of types in the assembly to invisible.
48// If you need to expose a type to COM, use [ComVisible(true)] on that type.
49[assembly: ComVisible(false)]
50
51// The assembly version has following format :
52//
53// Major.Minor.Build.Revision
54//
55// You can specify all values by your own or you can build default build and revision
56// numbers with the '*' character (the default):
57
58[assembly: AssemblyVersion("1.0.*")]
diff --git a/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs b/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs
deleted file mode 100644
index e3847be..0000000
--- a/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs
+++ /dev/null
@@ -1,39 +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;
31
32namespace OpenSim.Framework.Console
33{
34 public interface conscmd_callback
35 {
36 void RunCmd(string cmd, string[] cmdparams);
37 void Show(string ShowWhat);
38 }
39}
diff --git a/Common/OpenSim.Framework.Console/LogBase.cs b/Common/OpenSim.Framework.Console/LogBase.cs
deleted file mode 100644
index 1a92d8e..0000000
--- a/Common/OpenSim.Framework.Console/LogBase.cs
+++ /dev/null
@@ -1,238 +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.IO;
30
31namespace OpenSim.Framework.Console
32{
33 public enum LogPriority : int
34 {
35 CRITICAL,
36 HIGH,
37 MEDIUM,
38 NORMAL,
39 LOW,
40 VERBOSE,
41 EXTRAVERBOSE
42 }
43
44 public class LogBase
45 {
46 StreamWriter Log;
47 public conscmd_callback cmdparser;
48 public string componentname;
49 private bool m_silent;
50
51 public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent )
52 {
53 this.componentname = componentname;
54 this.cmdparser = cmdparser;
55 this.m_silent = silent;
56 System.Console.WriteLine("ServerConsole.cs - creating new local console");
57
58 if( String.IsNullOrEmpty( LogFile ) )
59 {
60 LogFile = componentname + ".log";
61 }
62
63 System.Console.WriteLine("Logs will be saved to current directory in " + LogFile);
64 Log = File.AppendText(LogFile);
65 Log.WriteLine("========================================================================");
66 Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString());
67 }
68
69 public void Close()
70 {
71 Log.WriteLine("Shutdown at " + DateTime.Now.ToString());
72 Log.Close();
73 }
74
75 public void Write(string format, params object[] args)
76 {
77 Notice(format,args);
78 return;
79 }
80
81 public void WriteLine(LogPriority importance, string format, params object[] args)
82 {
83 Log.WriteLine(format, args);
84 Log.Flush();
85 if (!m_silent)
86 {
87 System.Console.WriteLine(format, args);
88 }
89 return;
90 }
91
92 public void Warn(string format, params object[] args)
93 {
94 WriteNewLine(ConsoleColor.Yellow, format, args);
95 return;
96 }
97
98 public void Notice(string format, params object[] args)
99 {
100 WriteNewLine(ConsoleColor.White, format, args);
101 return;
102 }
103
104 public void Error(string format, params object[] args)
105 {
106 WriteNewLine(ConsoleColor.Red, format, args);
107 return;
108 }
109
110 public void Verbose(string format, params object[] args)
111 {
112 WriteNewLine(ConsoleColor.Gray, format, args);
113 return;
114 }
115
116 public void Status(string format, params object[] args)
117 {
118 WriteNewLine(ConsoleColor.Blue, format, args);
119 return;
120 }
121
122 private void WriteNewLine(System.ConsoleColor color, string format, params object[] args)
123 {
124 Log.WriteLine(format, args);
125 Log.Flush();
126 if (!m_silent)
127 {
128 try
129 {
130 System.Console.ForegroundColor = color;
131 System.Console.WriteLine(format, args);
132 System.Console.ResetColor();
133 }
134 catch (System.ArgumentNullException)
135 {
136 // Some older systems dont support coloured text.
137 System.Console.WriteLine(format, args);
138 }
139 }
140 return;
141 }
142
143 public string ReadLine()
144 {
145 string TempStr = System.Console.ReadLine();
146 Log.WriteLine(TempStr);
147 return TempStr;
148 }
149
150 public int Read()
151 {
152 int TempInt = System.Console.Read();
153 Log.Write((char)TempInt);
154 return TempInt;
155 }
156
157 // Displays a prompt and waits for the user to enter a string, then returns that string
158 // Done with no echo and suitable for passwords
159 public string PasswdPrompt(string prompt)
160 {
161 // FIXME: Needs to be better abstracted
162 Log.WriteLine(prompt);
163 this.Write(prompt);
164 ConsoleColor oldfg = System.Console.ForegroundColor;
165 System.Console.ForegroundColor = System.Console.BackgroundColor;
166 string temp = System.Console.ReadLine();
167 System.Console.ForegroundColor = oldfg;
168 return temp;
169 }
170
171 // Displays a command prompt and waits for the user to enter a string, then returns that string
172 public string CmdPrompt(string prompt)
173 {
174 this.Write(String.Format("{0}: ", prompt));
175 return this.ReadLine();
176 }
177
178 // Displays a command prompt and returns a default value if the user simply presses enter
179 public string CmdPrompt(string prompt, string defaultresponse)
180 {
181 string temp = CmdPrompt(String.Format( "{0} [{1}]", prompt, defaultresponse ));
182 if (temp == "")
183 {
184 return defaultresponse;
185 }
186 else
187 {
188 return temp;
189 }
190 }
191
192 // Displays a command prompt and returns a default value, user may only enter 1 of 2 options
193 public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB)
194 {
195 bool itisdone = false;
196 string temp = CmdPrompt(prompt, defaultresponse);
197 while (itisdone == false)
198 {
199 if ((temp == OptionA) || (temp == OptionB))
200 {
201 itisdone = true;
202 }
203 else
204 {
205 Notice("Valid options are " + OptionA + " or " + OptionB);
206 temp = CmdPrompt(prompt, defaultresponse);
207 }
208 }
209 return temp;
210 }
211
212 // Runs a command with a number of parameters
213 public Object RunCmd(string Cmd, string[] cmdparams)
214 {
215 cmdparser.RunCmd(Cmd, cmdparams);
216 return null;
217 }
218
219 // Shows data about something
220 public void ShowCommands(string ShowWhat)
221 {
222 cmdparser.Show(ShowWhat);
223 }
224
225 public void MainLogPrompt()
226 {
227 string[] tempstrarray;
228 string tempstr = this.CmdPrompt(this.componentname + "# ");
229 tempstrarray = tempstr.Split(' ');
230 string cmd = tempstrarray[0];
231 Array.Reverse(tempstrarray);
232 Array.Resize<string>(ref tempstrarray, tempstrarray.Length - 1);
233 Array.Reverse(tempstrarray);
234 string[] cmdparams = (string[])tempstrarray;
235 RunCmd(cmd, cmdparams);
236 }
237 }
238}
diff --git a/Common/OpenSim.Framework.Console/MainLog.cs b/Common/OpenSim.Framework.Console/MainLog.cs
deleted file mode 100644
index d7f945e..0000000
--- a/Common/OpenSim.Framework.Console/MainLog.cs
+++ /dev/null
@@ -1,49 +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;
29
30namespace OpenSim.Framework.Console
31{
32 public class MainLog {
33
34 private static LogBase instance;
35
36 public static LogBase Instance
37 {
38 get
39 {
40 return instance;
41 }
42 set
43 {
44 instance = value;
45 }
46 }
47 }
48
49}
diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
deleted file mode 100644
index af6c396..0000000
--- a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
+++ /dev/null
@@ -1,89 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{A7CD0630-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Framework.Console</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Framework.Console</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 </ItemGroup>
66 <ItemGroup>
67 </ItemGroup>
68 <ItemGroup>
69 <Compile Include="AssemblyInfo.cs">
70 <SubType>Code</SubType>
71 </Compile>
72 <Compile Include="ConsoleCallbacksBase.cs">
73 <SubType>Code</SubType>
74 </Compile>
75 <Compile Include="LogBase.cs">
76 <SubType>Code</SubType>
77 </Compile>
78 <Compile Include="MainLog.cs">
79 <SubType>Code</SubType>
80 </Compile>
81 </ItemGroup>
82 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
83 <PropertyGroup>
84 <PreBuildEvent>
85 </PreBuildEvent>
86 <PostBuildEvent>
87 </PostBuildEvent>
88 </PropertyGroup>
89</Project>
diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build
deleted file mode 100644
index 7ebdba1..0000000
--- a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build
+++ /dev/null
@@ -1,42 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Framework.Console" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Framework.Console" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="ConsoleCallbacksBase.cs" />
16 <include name="LogBase.cs" />
17 <include name="MainLog.cs" />
18 </sources>
19 <references basedir="${project::get-base-directory()}">
20 <lib>
21 <include name="${project::get-base-directory()}" />
22 <include name="${project::get-base-directory()}/${build.dir}" />
23 </lib>
24 <include name="System.dll" />
25 </references>
26 </csc>
27 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
28 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
29 <copy todir="${project::get-base-directory()}/../../bin/">
30 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
31 <include name="*.dll"/>
32 <include name="*.exe"/>
33 </fileset>
34 </copy>
35 </target>
36 <target name="clean">
37 <delete dir="${bin.dir}" failonerror="false" />
38 <delete dir="${obj.dir}" failonerror="false" />
39 </target>
40 <target name="doc" description="Creates documentation.">
41 </target>
42</project>
diff --git a/Common/OpenSim.Framework/AgentInventory.cs b/Common/OpenSim.Framework/AgentInventory.cs
deleted file mode 100644
index fbf4d23..0000000
--- a/Common/OpenSim.Framework/AgentInventory.cs
+++ /dev/null
@@ -1,267 +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 libsecondlife.Packets;
33using OpenSim.Framework.Types;
34using OpenSim.Framework.Utilities;
35
36namespace OpenSim.Framework.Inventory
37{
38 public class AgentInventory
39 {
40 //Holds the local copy of Inventory info for a agent
41 public Dictionary<LLUUID, InventoryFolder> InventoryFolders;
42 public Dictionary<LLUUID, InventoryItem> InventoryItems;
43 public InventoryFolder InventoryRoot;
44 public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server
45 public LLUUID AgentID;
46 public AvatarWearable[] Wearables;
47
48 public AgentInventory()
49 {
50 InventoryFolders = new Dictionary<LLUUID, InventoryFolder>();
51 InventoryItems = new Dictionary<LLUUID, InventoryItem>();
52 this.Initialise();
53 }
54
55 public virtual void Initialise()
56 {
57 Wearables = new AvatarWearable[13]; //should be 12 of these
58 for (int i = 0; i < 13; i++)
59 {
60 Wearables[i] = new AvatarWearable();
61 }
62
63 }
64
65 public bool CreateNewFolder(LLUUID folderID, ushort type)
66 {
67 InventoryFolder Folder = new InventoryFolder();
68 Folder.FolderID = folderID;
69 Folder.OwnerID = this.AgentID;
70 Folder.DefaultType = type;
71 this.InventoryFolders.Add(Folder.FolderID, Folder);
72 return (true);
73 }
74
75 public void CreateRootFolder(LLUUID newAgentID, bool createTextures)
76 {
77 this.AgentID = newAgentID;
78 InventoryRoot = new InventoryFolder();
79 InventoryRoot.FolderID = LLUUID.Random();
80 InventoryRoot.ParentID = new LLUUID();
81 InventoryRoot.Version = 1;
82 InventoryRoot.DefaultType = 8;
83 InventoryRoot.OwnerID = this.AgentID;
84 InventoryRoot.FolderName = "My Inventory";
85 InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot);
86 InventoryRoot.OwnerID = this.AgentID;
87 if (createTextures)
88 {
89 this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID);
90 }
91 }
92
93 public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName)
94 {
95 InventoryFolder Folder = new InventoryFolder();
96 Folder.FolderID = folderID;
97 Folder.OwnerID = this.AgentID;
98 Folder.DefaultType = type;
99 Folder.FolderName = folderName;
100 this.InventoryFolders.Add(Folder.FolderID, Folder);
101
102 return (true);
103 }
104
105 public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent)
106 {
107 if (!this.InventoryFolders.ContainsKey(folderID))
108 {
109 System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
110 InventoryFolder Folder = new InventoryFolder();
111 Folder.FolderID = folderID;
112 Folder.OwnerID = this.AgentID;
113 Folder.DefaultType = type;
114 Folder.FolderName = folderName;
115 Folder.ParentID = parent;
116 this.InventoryFolders.Add(Folder.FolderID, Folder);
117 }
118
119 return (true);
120 }
121
122 public bool HasFolder(LLUUID folderID)
123 {
124 if (this.InventoryFolders.ContainsKey(folderID))
125 {
126 return true;
127 }
128 return false;
129 }
130
131 public LLUUID GetFolderID(string folderName)
132 {
133 foreach (InventoryFolder inv in this.InventoryFolders.Values)
134 {
135 if (inv.FolderName == folderName)
136 {
137 return inv.FolderID;
138 }
139 }
140
141 return LLUUID.Zero;
142 }
143
144 public bool UpdateItemAsset(LLUUID itemID, AssetBase asset)
145 {
146 if(this.InventoryItems.ContainsKey(itemID))
147 {
148 InventoryItem Item = this.InventoryItems[itemID];
149 Item.AssetID = asset.FullID;
150 System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated());
151 //TODO need to update the rest of the info
152 }
153 return true;
154 }
155
156 public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
157 {
158 System.Console.WriteLine("updating inventory item details");
159 if (this.InventoryItems.ContainsKey(itemID))
160 {
161 System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name));
162 InventoryItem Item = this.InventoryItems[itemID];
163 Item.Name = Util.FieldToString(packet.Name);
164 System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated());
165 //TODO need to update the rest of the info
166 }
167 return true;
168 }
169
170 public LLUUID AddToInventory(LLUUID folderID, AssetBase asset)
171 {
172 if (this.InventoryFolders.ContainsKey(folderID))
173 {
174 LLUUID NewItemID = LLUUID.Random();
175
176 InventoryItem Item = new InventoryItem();
177 Item.FolderID = folderID;
178 Item.OwnerID = AgentID;
179 Item.AssetID = asset.FullID;
180 Item.ItemID = NewItemID;
181 Item.Type = asset.Type;
182 Item.Name = asset.Name;
183 Item.Description = asset.Description;
184 Item.InvType = asset.InvType;
185 this.InventoryItems.Add(Item.ItemID, Item);
186 InventoryFolder Folder = InventoryFolders[Item.FolderID];
187 Folder.Items.Add(Item);
188 return (Item.ItemID);
189 }
190 else
191 {
192 return (null);
193 }
194 }
195
196 public bool DeleteFromInventory(LLUUID itemID)
197 {
198 bool res = false;
199 if (this.InventoryItems.ContainsKey(itemID))
200 {
201 InventoryItem item = this.InventoryItems[itemID];
202 this.InventoryItems.Remove(itemID);
203 foreach (InventoryFolder fold in InventoryFolders.Values)
204 {
205 if (fold.Items.Contains(item))
206 {
207 fold.Items.Remove(item);
208 break;
209 }
210 }
211 res = true;
212
213 }
214 return res;
215 }
216 }
217
218 public class InventoryFolder
219 {
220 public List<InventoryItem> Items;
221 //public List<InventoryFolder> Subfolders;
222 public LLUUID FolderID;
223 public LLUUID OwnerID;
224 public LLUUID ParentID = LLUUID.Zero;
225 public string FolderName;
226 public ushort DefaultType;
227 public ushort Version;
228
229 public InventoryFolder()
230 {
231 Items = new List<InventoryItem>();
232 //Subfolders = new List<InventoryFolder>();
233 }
234
235 }
236
237 public class InventoryItem
238 {
239 public LLUUID FolderID;
240 public LLUUID OwnerID;
241 public LLUUID ItemID;
242 public LLUUID AssetID;
243 public LLUUID CreatorID;
244 public sbyte InvType;
245 public sbyte Type;
246 public string Name ="";
247 public string Description;
248
249 public InventoryItem()
250 {
251 this.CreatorID = LLUUID.Zero;
252 }
253
254 public string ExportString()
255 {
256 string typ = "notecard";
257 string result = "";
258 result += "\tinv_object\t0\n\t{\n";
259 result += "\t\tobj_id\t%s\n";
260 result += "\t\tparent_id\t"+ ItemID.ToString() +"\n";
261 result += "\t\ttype\t"+ typ +"\n";
262 result += "\t\tname\t" + Name+"|\n";
263 result += "\t}\n";
264 return result;
265 }
266 }
267}
diff --git a/Common/OpenSim.Framework/AuthenticateSessionBase.cs b/Common/OpenSim.Framework/AuthenticateSessionBase.cs
deleted file mode 100644
index 73dd3e2..0000000
--- a/Common/OpenSim.Framework/AuthenticateSessionBase.cs
+++ /dev/null
@@ -1,132 +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.Framework
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 // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
112 }
113 }
114
115 public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
116 {
117 if (this.AgentCircuits.ContainsKey(circuitcode))
118 {
119 this.AgentCircuits[circuitcode].child = childstatus;
120 }
121 }
122
123 public bool GetAgentChildStatus(uint circuitcode)
124 {
125 if (this.AgentCircuits.ContainsKey(circuitcode))
126 {
127 return this.AgentCircuits[circuitcode].child;
128 }
129 return false;
130 }
131 }
132} \ No newline at end of file
diff --git a/Common/OpenSim.Framework/BlockingQueue.cs b/Common/OpenSim.Framework/BlockingQueue.cs
deleted file mode 100644
index 667b8d8..0000000
--- a/Common/OpenSim.Framework/BlockingQueue.cs
+++ /dev/null
@@ -1,60 +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.Threading;
30using System.Collections.Generic;
31using System.Text;
32
33namespace OpenSim.Framework.Utilities
34{
35 public class BlockingQueue<T>
36 {
37 private Queue<T> _queue = new Queue<T>();
38 private object _queueSync = new object();
39
40 public void Enqueue(T value)
41 {
42 lock (_queueSync)
43 {
44 _queue.Enqueue(value);
45 Monitor.Pulse(_queueSync);
46 }
47 }
48
49 public T Dequeue()
50 {
51 lock (_queueSync)
52 {
53 if (_queue.Count < 1)
54 Monitor.Wait(_queueSync);
55
56 return _queue.Dequeue();
57 }
58 }
59 }
60}
diff --git a/Common/OpenSim.Framework/IRegionCommsListener.cs b/Common/OpenSim.Framework/IRegionCommsListener.cs
deleted file mode 100644
index 0e80941..0000000
--- a/Common/OpenSim.Framework/IRegionCommsListener.cs
+++ /dev/null
@@ -1,47 +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 OpenSim.Framework.Interfaces;
32using OpenSim.Framework.Types;
33
34namespace OpenSim.Framework
35{
36 public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent);
37 public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
38 public delegate void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position);
39
40 public interface IRegionCommsListener
41 {
42 event ExpectUserDelegate OnExpectUser;
43 event GenericCall2 OnExpectChildAgent;
44 event AgentCrossing OnAvatarCrossingIntoRegion;
45 event UpdateNeighbours OnNeighboursUpdate;
46 }
47}
diff --git a/Common/OpenSim.Framework/Interfaces/AuthenticateResponse.cs b/Common/OpenSim.Framework/Interfaces/AuthenticateResponse.cs
deleted file mode 100644
index 462e2c5..0000000
--- a/Common/OpenSim.Framework/Interfaces/AuthenticateResponse.cs
+++ /dev/null
@@ -1,51 +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;
30using System.Collections.Generic;
31using System.Net;
32using System.Net.Sockets;
33using System.IO;
34using libsecondlife;
35using OpenSim;
36using OpenSim.Framework.Types;
37
38namespace OpenSim.Framework.Interfaces
39{
40 public class AuthenticateResponse
41 {
42 public bool Authorised;
43 public Login LoginInfo;
44
45 public AuthenticateResponse()
46 {
47
48 }
49
50 }
51}
diff --git a/Common/OpenSim.Framework/Interfaces/Config/IGenericConfig.cs b/Common/OpenSim.Framework/Interfaces/Config/IGenericConfig.cs
deleted file mode 100644
index 13980fe..0000000
--- a/Common/OpenSim.Framework/Interfaces/Config/IGenericConfig.cs
+++ /dev/null
@@ -1,42 +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;
31
32namespace OpenSim.Framework.Interfaces
33{
34 public interface IGenericConfig
35 {
36 void LoadData();
37 string GetAttribute(string attributeName);
38 bool SetAttribute(string attributeName, string attributeValue);
39 void Commit();
40 void Close();
41 }
42}
diff --git a/Common/OpenSim.Framework/Interfaces/Config/IGridConfig.cs b/Common/OpenSim.Framework/Interfaces/Config/IGridConfig.cs
deleted file mode 100644
index 0fafe1a..0000000
--- a/Common/OpenSim.Framework/Interfaces/Config/IGridConfig.cs
+++ /dev/null
@@ -1,63 +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*/
28
29using System;
30using System.Collections.Generic;
31using System.IO;
32using libsecondlife;
33//using OpenSim.world;
34
35namespace OpenSim.Framework.Interfaces
36{
37 /// <summary>
38 /// </summary>
39
40
41 public abstract class GridConfig
42 {
43 public string GridOwner;
44 public string DefaultStartupMsg;
45 public string DefaultAssetServer;
46 public string AssetSendKey;
47 public string AssetRecvKey;
48 public string DefaultUserServer;
49 public string UserSendKey;
50 public string UserRecvKey;
51 public string SimSendKey;
52 public string SimRecvKey;
53
54
55 public abstract void InitConfig();
56
57 }
58
59 public interface IGridConfig
60 {
61 GridConfig GetConfigObject();
62 }
63}
diff --git a/Common/OpenSim.Framework/Interfaces/Config/IUserConfig.cs b/Common/OpenSim.Framework/Interfaces/Config/IUserConfig.cs
deleted file mode 100644
index 2f4b340..0000000
--- a/Common/OpenSim.Framework/Interfaces/Config/IUserConfig.cs
+++ /dev/null
@@ -1,57 +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*/
28
29using System;
30using System.Collections.Generic;
31using System.IO;
32using libsecondlife;
33//using OpenSim.world;
34
35namespace OpenSim.Framework.Interfaces
36{
37 /// <summary>
38 /// </summary>
39
40
41 public abstract class UserConfig
42 {
43 public string DefaultStartupMsg;
44 public string GridServerURL;
45 public string GridSendKey;
46 public string GridRecvKey;
47
48
49 public abstract void InitConfig();
50
51 }
52
53 public interface IUserConfig
54 {
55 UserConfig GetConfigObject();
56 }
57}
diff --git a/Common/OpenSim.Framework/Interfaces/IAssetServer.cs b/Common/OpenSim.Framework/Interfaces/IAssetServer.cs
deleted file mode 100644
index 826392d..0000000
--- a/Common/OpenSim.Framework/Interfaces/IAssetServer.cs
+++ /dev/null
@@ -1,69 +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.Net;
30using System.Net.Sockets;
31using System.IO;
32using System.Threading;
33using libsecondlife;
34using OpenSim.Framework.Types;
35
36namespace OpenSim.Framework.Interfaces
37{
38 /// <summary>
39 /// Description of IAssetServer.
40 /// </summary>
41
42 public interface IAssetServer
43 {
44 void SetReceiver(IAssetReceiver receiver);
45 void RequestAsset(LLUUID assetID, bool isTexture);
46 void UpdateAsset(AssetBase asset);
47 void UploadNewAsset(AssetBase asset);
48 void SetServerInfo(string ServerUrl, string ServerKey);
49 void Close();
50 }
51
52 // could change to delegate?
53 public interface IAssetReceiver
54 {
55 void AssetReceived(AssetBase asset, bool IsTexture);
56 void AssetNotFound(AssetBase asset);
57 }
58
59 public interface IAssetPlugin
60 {
61 IAssetServer GetAssetServer();
62 }
63
64 public struct ARequest
65 {
66 public LLUUID AssetID;
67 public bool IsTexture;
68 }
69}
diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
deleted file mode 100644
index 009648c..0000000
--- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
+++ /dev/null
@@ -1,160 +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 OpenSim.Framework.Inventory;
32using libsecondlife;
33using libsecondlife.Packets;
34using OpenSim.Framework.Types;
35
36namespace OpenSim.Framework.Interfaces
37{
38 public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
39 public delegate void RezObject(AssetBase primAsset, LLVector3 pos);
40 public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west);
41 public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
42 public delegate void StartAnim(LLUUID animID, int seq);
43 public delegate void LinkObjects(uint parent, List<uint> children);
44 public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY);
45 public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags);
46
47 public delegate void GenericCall(IClientAPI remoteClient);
48 public delegate void GenericCall2();
49 public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary.
50 public delegate void GenericCall4(Packet packet, IClientAPI remoteClient);
51 public delegate void GenericCall5(IClientAPI remoteClient, bool status);
52 public delegate void GenericCall6(LLUUID uid);
53
54 public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
55 public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
56 public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient);
57 public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
58 public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient);
59 public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
60 public delegate void StatusChange(bool status);
61 public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status);
62 public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation);
63 public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient);
64
65 public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);
66 public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client);
67 public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client);
68 public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); // NOTETOSELFremove the packet part
69
70 public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client);
71
72 public interface IClientAPI
73 {
74 event ChatFromViewer OnChatFromViewer;
75 event RezObject OnRezObject;
76 event ModifyTerrain OnModifyTerrain;
77 event SetAppearance OnSetAppearance;
78 event StartAnim OnStartAnim;
79 event LinkObjects OnLinkObjects;
80 event RequestMapBlocks OnRequestMapBlocks;
81 event TeleportLocationRequest OnTeleportLocationRequest;
82
83 event GenericCall4 OnDeRezObject;
84 event GenericCall OnRegionHandShakeReply;
85 event GenericCall OnRequestWearables;
86 event GenericCall2 OnCompleteMovementToRegion;
87 event UpdateAgent OnAgentUpdate;
88 event GenericCall OnRequestAvatarsData;
89 event GenericCall4 OnAddPrim;
90 event UpdateVector OnGrapObject;
91 event ObjectSelect OnDeGrapObject;
92 event MoveObject OnGrapUpdate;
93
94 event UpdateShape OnUpdatePrimShape;
95 event ObjectSelect OnObjectSelect;
96 event UpdatePrimFlags OnUpdatePrimFlags;
97 event UpdatePrimTexture OnUpdatePrimTexture;
98 event UpdateVector OnUpdatePrimPosition;
99 event UpdatePrimRotation OnUpdatePrimRotation;
100 event UpdateVector OnUpdatePrimScale;
101 event StatusChange OnChildAgentStatus;
102 event GenericCall2 OnStopMovement;
103 event NewAvatar OnNewAvatar;
104 event GenericCall6 OnRemoveAvatar;
105
106 event ParcelPropertiesRequest OnParcelPropertiesRequest;
107 event ParcelDivideRequest OnParcelDivideRequest;
108 event ParcelJoinRequest OnParcelJoinRequest;
109 event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
110
111 event EstateOwnerMessageRequest OnEstateOwnerMessage;
112
113 LLVector3 StartPos
114 {
115 get;
116 set;
117 }
118
119 LLUUID AgentId
120 {
121 get;
122 }
123
124 string FirstName
125 {
126 get;
127 }
128
129 string LastName
130 {
131 get;
132 }
133
134 void OutPacket(Packet newPack);
135 void SendWearables(AvatarWearable[] wearables);
136 void SendRegionHandshake(RegionInfo regionInfo);
137 void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
138 void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
139 void SendLayerData(float[] map);
140 void SendLayerData(int px, int py, float[] map);
141 void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);
142 void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort);
143 AgentCircuitData RequestClientInfo();
144 void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort);
145 void SendMapBlock(List<MapBlockData> mapBlocks);
146 void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags);
147 void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags);
148 void SendTeleportCancel();
149 void SendTeleportLocationStart();
150 void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance);
151
152 void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry);
153 void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity);
154
155 void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
156 void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags);
157 void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags);
158 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation);
159 }
160}
diff --git a/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs b/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs
deleted file mode 100644
index 4987d10..0000000
--- a/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs
+++ /dev/null
@@ -1,69 +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*/
28
29using System;
30using libsecondlife;
31using OpenSim.Framework.Types;
32
33namespace OpenSim.Framework.Interfaces
34{
35 /// <summary>
36 /// ILocalStorage. Really hacked together right now needs cleaning up
37 /// </summary>
38 public interface ILocalStorage
39 {
40 void Initialise(string datastore);
41
42 void StorePrim(PrimData prim);
43 void RemovePrim(LLUUID primID);
44 void LoadPrimitives(ILocalStorageReceiver receiver);
45
46 float[] LoadWorld();
47 void SaveMap(float[] heightmap);
48
49 void SaveParcels(ParcelData[] parcels);
50 void SaveParcel(ParcelData parcel);
51 void RemoveParcel(ParcelData parcel);
52 void RemoveAllParcels();
53 void LoadParcels(ILocalStorageParcelReceiver recv);
54
55 void ShutDown();
56 }
57
58 public interface ILocalStorageReceiver
59 {
60 void PrimFromStorage(PrimData prim);
61 }
62
63 public interface ILocalStorageParcelReceiver
64 {
65 void ParcelFromStorage(ParcelData data);
66 void NoParcelDataFromStorage();
67 }
68}
69
diff --git a/Common/OpenSim.Framework/Interfaces/IUserServer.cs b/Common/OpenSim.Framework/Interfaces/IUserServer.cs
deleted file mode 100644
index c6e2223..0000000
--- a/Common/OpenSim.Framework/Interfaces/IUserServer.cs
+++ /dev/null
@@ -1,42 +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 OpenSim.Framework.Inventory;
32using libsecondlife;
33
34namespace OpenSim.Framework.Interfaces
35{
36 public interface IUserServer
37 {
38 AgentInventory RequestAgentsInventory(LLUUID agentID);
39 void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
40 bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory);
41 }
42}
diff --git a/Common/OpenSim.Framework/Interfaces/IWorld.cs b/Common/OpenSim.Framework/Interfaces/IWorld.cs
deleted file mode 100644
index 4857417..0000000
--- a/Common/OpenSim.Framework/Interfaces/IWorld.cs
+++ /dev/null
@@ -1,45 +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.Types;
33
34namespace OpenSim.Framework.Interfaces
35{
36 public interface IWorld
37 {
38 void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child);
39 void RemoveClient(LLUUID agentID);
40
41 RegionInfo RegionInfo { get; }
42 object SyncRoot { get; }
43 uint NextLocalId { get; }
44 }
45}
diff --git a/Common/OpenSim.Framework/Interfaces/Scripting/IScriptAPI.cs b/Common/OpenSim.Framework/Interfaces/Scripting/IScriptAPI.cs
deleted file mode 100644
index 0c1627b..0000000
--- a/Common/OpenSim.Framework/Interfaces/Scripting/IScriptAPI.cs
+++ /dev/null
@@ -1,42 +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 OpenSim.Framework.Types;
32
33using libsecondlife;
34namespace OpenSim.Framework.Interfaces
35{
36 public interface IScriptAPI
37 {
38 LLVector3 GetEntityPosition(uint localID);
39 void SetEntityPosition(uint localID, float x, float y, float z);
40 uint GetRandomAvatarID();
41 }
42}
diff --git a/Common/OpenSim.Framework/Interfaces/Scripting/IScriptEngine.cs b/Common/OpenSim.Framework/Interfaces/Scripting/IScriptEngine.cs
deleted file mode 100644
index ca50be0..0000000
--- a/Common/OpenSim.Framework/Interfaces/Scripting/IScriptEngine.cs
+++ /dev/null
@@ -1,41 +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;
31
32namespace OpenSim.Framework.Interfaces
33{
34 public interface IScriptEngine
35 {
36 bool Init(IScriptAPI api);
37 string GetName();
38 void LoadScript(string script, string scriptName, uint entityID);
39 void OnFrame();
40 }
41}
diff --git a/Common/OpenSim.Framework/LLSDHelpers.cs b/Common/OpenSim.Framework/LLSDHelpers.cs
deleted file mode 100644
index 051520c..0000000
--- a/Common/OpenSim.Framework/LLSDHelpers.cs
+++ /dev/null
@@ -1,246 +0,0 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Text;
5using System.IO;
6using System.Xml;
7using libsecondlife;
8
9namespace OpenSim.Framework
10{
11 public class LLSDHelpers
12 {
13 public static string SerialiseLLSDReply(object obj)
14 {
15 StringWriter sw = new StringWriter();
16 XmlTextWriter writer = new XmlTextWriter(sw);
17 writer.Formatting = Formatting.None;
18 writer.WriteStartElement(String.Empty, "llsd", String.Empty);
19 LLSDHelpers.SerializeLLSDType(writer, obj);
20 writer.WriteEndElement();
21 writer.Close();
22 return sw.ToString();
23 }
24
25 public static void SerializeLLSDType(XmlTextWriter writer, object obj)
26 {
27 Type myType = obj.GetType();
28 LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false);
29 if (llsdattributes.Length > 0)
30 {
31 switch (llsdattributes[0].ObjectType)
32 {
33 case "MAP":
34 writer.WriteStartElement(String.Empty, "map", String.Empty);
35 System.Reflection.FieldInfo[] fields = myType.GetFields();
36 for (int i = 0; i < fields.Length; i++)
37 {
38 object fieldValue = fields[i].GetValue(obj);
39 LLSDType[] fieldAttributes = (LLSDType[])fieldValue.GetType().GetCustomAttributes(typeof(LLSDType), false);
40 if (fieldAttributes.Length > 0)
41 {
42 writer.WriteStartElement(String.Empty, "key", String.Empty);
43 writer.WriteString(fields[i].Name);
44 writer.WriteEndElement();
45 SerializeLLSDType(writer, fieldValue);
46 }
47 else
48 {
49 //Console.WriteLine("LLSD field name" + fields[i].Name + " , " + fields[i].GetValue(obj).GetType());
50 writer.WriteStartElement(String.Empty, "key", String.Empty);
51 writer.WriteString(fields[i].Name);
52 writer.WriteEndElement();
53 LLSD.LLSDWriteOne(writer, fieldValue);
54 }
55 }
56 writer.WriteEndElement();
57 break;
58 case "ARRAY":
59 // LLSDArray arrayObject = obj as LLSDArray;
60 // ArrayList a = arrayObject.Array;
61 ArrayList a = (ArrayList)obj.GetType().GetField("Array").GetValue(obj);
62 writer.WriteStartElement(String.Empty, "array", String.Empty);
63 foreach (object item in a)
64 {
65 SerializeLLSDType(writer, item);
66 }
67 writer.WriteEndElement();
68 break;
69 }
70 }
71 else
72 {
73 LLSD.LLSDWriteOne(writer, obj);
74 }
75 }
76
77 public static object DeserialiseLLSDMap(Hashtable llsd, object obj)
78 {
79 Type myType = obj.GetType();
80 LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false);
81 if (llsdattributes.Length > 0)
82 {
83 switch (llsdattributes[0].ObjectType)
84 {
85 case "MAP":
86 IDictionaryEnumerator enumerator = llsd.GetEnumerator();
87 while (enumerator.MoveNext())
88 {
89 System.Reflection.FieldInfo field = myType.GetField((string)enumerator.Key);
90 if (field != null)
91 {
92 if (enumerator.Value is Hashtable)
93 {
94 object fieldValue = field.GetValue(obj);
95 DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue);
96 }
97 else if (enumerator.Value is ArrayList)
98 {
99 object fieldValue = field.GetValue(obj);
100 fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value);
101 //TODO
102 // the LLSD map/array types in the array need to be deserialised
103 // but first we need to know the right class to deserialise them into.
104 }
105 else
106 {
107 field.SetValue(obj, enumerator.Value);
108 }
109 }
110 }
111 break;
112 }
113 }
114 return obj;
115 }
116 }
117
118 [LLSDType("MAP")]
119 public class LLSDMapLayerResponse
120 {
121 public LLSDMapRequest AgentData = new LLSDMapRequest();
122 public LLSDArray LayerData = new LLSDArray();
123
124 public LLSDMapLayerResponse()
125 {
126
127 }
128 }
129
130 [LLSDType("MAP")]
131 public class LLSDCapsDetails
132 {
133 public string MapLayer = "";
134 public string NewFileAgentInventory = "";
135 //public string EventQueueGet = "";
136
137 public LLSDCapsDetails()
138 {
139
140 }
141 }
142
143 [LLSDType("MAP")]
144 public class LLSDMapLayer
145 {
146 public int Left = 0;
147 public int Right = 0;
148 public int Top = 0;
149 public int Bottom = 0;
150 public LLUUID ImageID = LLUUID.Zero;
151
152 public LLSDMapLayer()
153 {
154
155 }
156 }
157
158 [LLSDType("ARRAY")]
159 public class LLSDArray
160 {
161 public ArrayList Array = new ArrayList();
162
163 public LLSDArray()
164 {
165
166 }
167 }
168
169 [LLSDType("MAP")]
170 public class LLSDMapRequest
171 {
172 public int Flags = 0;
173
174 public LLSDMapRequest()
175 {
176
177 }
178 }
179
180 [LLSDType("MAP")]
181 public class LLSDUploadReply
182 {
183 public string new_asset = "";
184 public LLUUID new_inventory_item = LLUUID.Zero;
185 public string state = "";
186
187 public LLSDUploadReply()
188 {
189
190 }
191 }
192
193 [LLSDType("MAP")]
194 public class LLSDCapEvent
195 {
196 public int id = 0;
197 public LLSDArray events = new LLSDArray();
198
199 public LLSDCapEvent()
200 {
201
202 }
203 }
204
205 [LLSDType("MAP")]
206 public class LLSDEmpty
207 {
208 public LLSDEmpty()
209 {
210
211 }
212 }
213
214 [LLSDType("MAP")]
215 public class LLSDTest
216 {
217 public int Test1 = 20;
218 public int Test2 = 10;
219
220 public LLSDTest()
221 {
222
223 }
224 }
225
226
227 [AttributeUsage(AttributeTargets.Class)]
228 public class LLSDType : Attribute
229 {
230 private string myType;
231
232 public LLSDType(string type)
233 {
234 myType = type;
235
236 }
237
238 public string ObjectType
239 {
240 get
241 {
242 return myType;
243 }
244 }
245 }
246}
diff --git a/Common/OpenSim.Framework/Logger.cs b/Common/OpenSim.Framework/Logger.cs
deleted file mode 100644
index e7eaa03..0000000
--- a/Common/OpenSim.Framework/Logger.cs
+++ /dev/null
@@ -1,85 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework
6{
7 public class Logger
8 {
9 public static Logger Instance = new Logger( false );
10
11 public delegate void LoggerMethodDelegate();
12 private delegate bool LoggerDelegate( LoggerMethodDelegate whatToDo );
13
14
15 private LoggerDelegate m_delegate;
16
17 public Logger( bool log )
18 {
19 if( log )
20 {
21 m_delegate = CatchAndLog;
22 }
23 else
24 {
25 m_delegate = DontCatch;
26 }
27 }
28
29 public bool Wrap( LoggerMethodDelegate whatToDo )
30 {
31 return m_delegate( whatToDo );
32 }
33
34
35 private bool CatchAndLog(LoggerMethodDelegate whatToDo)
36 {
37 try
38 {
39 whatToDo();
40 return true;
41 }
42 catch(Exception e)
43 {
44 System.Console.WriteLine( "Exception logged!!! Woah!!!!" );
45 return false;
46 }
47 }
48
49 private bool DontCatch(LoggerMethodDelegate whatToDo)
50 {
51 whatToDo();
52 return true;
53 }
54
55 public class LoggerExample
56 {
57 public void TryWrap()
58 {
59 // This will log and ignore
60 Logger log = new Logger(true);
61
62 log.Wrap(delegate()
63 {
64 Int16.Parse("waa!");
65 });
66
67 // This will throw;
68 try
69 {
70
71 log = new Logger(false);
72
73 log.Wrap(delegate()
74 {
75 Int16.Parse("waa!");
76 });
77 }
78 catch
79 {
80 System.Console.WriteLine("Example barfed!");
81 }
82 }
83 }
84 }
85}
diff --git a/Common/OpenSim.Framework/LoginService.cs b/Common/OpenSim.Framework/LoginService.cs
deleted file mode 100644
index f14754f..0000000
--- a/Common/OpenSim.Framework/LoginService.cs
+++ /dev/null
@@ -1,41 +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;
30using System.Collections.Generic;
31using System.Text;
32using Nwc.XmlRpc;
33using libsecondlife;
34
35namespace OpenSim.Framework.Grid
36{
37 public abstract class LoginService
38 {
39
40 }
41} \ No newline at end of file
diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj b/Common/OpenSim.Framework/OpenSim.Framework.csproj
deleted file mode 100644
index 7ebe0ee..0000000
--- a/Common/OpenSim.Framework/OpenSim.Framework.csproj
+++ /dev/null
@@ -1,222 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon>
10 </ApplicationIcon>
11 <AssemblyKeyContainerName>
12 </AssemblyKeyContainerName>
13 <AssemblyName>OpenSim.Framework</AssemblyName>
14 <DefaultClientScript>JScript</DefaultClientScript>
15 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
17 <DelaySign>false</DelaySign>
18 <OutputType>Library</OutputType>
19 <AppDesignerFolder>
20 </AppDesignerFolder>
21 <RootNamespace>OpenSim.Framework</RootNamespace>
22 <StartupObject>
23 </StartupObject>
24 <FileUpgradeFlags>
25 </FileUpgradeFlags>
26 </PropertyGroup>
27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
29 <BaseAddress>285212672</BaseAddress>
30 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
31 <ConfigurationOverrideFile>
32 </ConfigurationOverrideFile>
33 <DefineConstants>TRACE;DEBUG</DefineConstants>
34 <DocumentationFile>
35 </DocumentationFile>
36 <DebugSymbols>True</DebugSymbols>
37 <FileAlignment>4096</FileAlignment>
38 <Optimize>False</Optimize>
39 <OutputPath>..\..\bin\</OutputPath>
40 <RegisterForComInterop>False</RegisterForComInterop>
41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
43 <WarningLevel>4</WarningLevel>
44 <NoWarn>
45 </NoWarn>
46 </PropertyGroup>
47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
49 <BaseAddress>285212672</BaseAddress>
50 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
51 <ConfigurationOverrideFile>
52 </ConfigurationOverrideFile>
53 <DefineConstants>TRACE</DefineConstants>
54 <DocumentationFile>
55 </DocumentationFile>
56 <DebugSymbols>False</DebugSymbols>
57 <FileAlignment>4096</FileAlignment>
58 <Optimize>True</Optimize>
59 <OutputPath>..\..\bin\</OutputPath>
60 <RegisterForComInterop>False</RegisterForComInterop>
61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
63 <WarningLevel>4</WarningLevel>
64 <NoWarn>
65 </NoWarn>
66 </PropertyGroup>
67 <ItemGroup>
68 <Reference Include="Db4objects.Db4o.dll">
69 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
70 <Private>False</Private>
71 </Reference>
72 <Reference Include="libsecondlife.dll">
73 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
74 <Private>False</Private>
75 </Reference>
76 <Reference Include="System">
77 <HintPath>System.dll</HintPath>
78 <Private>False</Private>
79 </Reference>
80 <Reference Include="System.Xml">
81 <HintPath>System.Xml.dll</HintPath>
82 <Private>False</Private>
83 </Reference>
84 </ItemGroup>
85 <ItemGroup>
86 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
87 <Name>OpenSim.Framework.Console</Name>
88 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
89 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
90 <Private>False</Private>
91 </ProjectReference>
92 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
93 <Name>XMLRPC</Name>
94 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
95 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
96 <Private>False</Private>
97 </ProjectReference>
98 </ItemGroup>
99 <ItemGroup>
100 <Compile Include="AgentInventory.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 <Compile Include="AuthenticateSessionBase.cs">
104 <SubType>Code</SubType>
105 </Compile>
106 <Compile Include="BlockingQueue.cs">
107 <SubType>Code</SubType>
108 </Compile>
109 <Compile Include="IRegionCommsListener.cs">
110 <SubType>Code</SubType>
111 </Compile>
112 <Compile Include="LLSDHelpers.cs">
113 <SubType>Code</SubType>
114 </Compile>
115 <Compile Include="Logger.cs">
116 <SubType>Code</SubType>
117 </Compile>
118 <Compile Include="LoginService.cs">
119 <SubType>Code</SubType>
120 </Compile>
121 <Compile Include="RegionCommsListener.cs">
122 <SubType>Code</SubType>
123 </Compile>
124 <Compile Include="Remoting.cs">
125 <SubType>Code</SubType>
126 </Compile>
127 <Compile Include="SimProfile.cs">
128 <SubType>Code</SubType>
129 </Compile>
130 <Compile Include="UserProfile.cs">
131 <SubType>Code</SubType>
132 </Compile>
133 <Compile Include="Util.cs">
134 <SubType>Code</SubType>
135 </Compile>
136 <Compile Include="Interfaces\AuthenticateResponse.cs">
137 <SubType>Code</SubType>
138 </Compile>
139 <Compile Include="Interfaces\IAssetServer.cs">
140 <SubType>Code</SubType>
141 </Compile>
142 <Compile Include="Interfaces\IClientAPI.cs">
143 <SubType>Code</SubType>
144 </Compile>
145 <Compile Include="Interfaces\ILocalStorage.cs">
146 <SubType>Code</SubType>
147 </Compile>
148 <Compile Include="Interfaces\IUserServer.cs">
149 <SubType>Code</SubType>
150 </Compile>
151 <Compile Include="Interfaces\IWorld.cs">
152 <SubType>Code</SubType>
153 </Compile>
154 <Compile Include="Interfaces\Config\IGenericConfig.cs">
155 <SubType>Code</SubType>
156 </Compile>
157 <Compile Include="Interfaces\Config\IGridConfig.cs">
158 <SubType>Code</SubType>
159 </Compile>
160 <Compile Include="Interfaces\Config\IUserConfig.cs">
161 <SubType>Code</SubType>
162 </Compile>
163 <Compile Include="Interfaces\Scripting\IScriptAPI.cs">
164 <SubType>Code</SubType>
165 </Compile>
166 <Compile Include="Interfaces\Scripting\IScriptEngine.cs">
167 <SubType>Code</SubType>
168 </Compile>
169 <Compile Include="Properties\AssemblyInfo.cs">
170 <SubType>Code</SubType>
171 </Compile>
172 <Compile Include="Types\AgentCiruitData.cs">
173 <SubType>Code</SubType>
174 </Compile>
175 <Compile Include="Types\AgentWearable.cs">
176 <SubType>Code</SubType>
177 </Compile>
178 <Compile Include="Types\AssetBase.cs">
179 <SubType>Code</SubType>
180 </Compile>
181 <Compile Include="Types\AssetLandmark.cs">
182 <SubType>Code</SubType>
183 </Compile>
184 <Compile Include="Types\AssetStorage.cs">
185 <SubType>Code</SubType>
186 </Compile>
187 <Compile Include="Types\EstateSettings.cs">
188 <SubType>Code</SubType>
189 </Compile>
190 <Compile Include="Types\Login.cs">
191 <SubType>Code</SubType>
192 </Compile>
193 <Compile Include="Types\MapBlockData.cs">
194 <SubType>Code</SubType>
195 </Compile>
196 <Compile Include="Types\NeighbourInfo.cs">
197 <SubType>Code</SubType>
198 </Compile>
199 <Compile Include="Types\NetworkServersInfo.cs">
200 <SubType>Code</SubType>
201 </Compile>
202 <Compile Include="Types\ParcelData.cs">
203 <SubType>Code</SubType>
204 </Compile>
205 <Compile Include="Types\PrimData.cs">
206 <SubType>Code</SubType>
207 </Compile>
208 <Compile Include="Types\RegionHandle.cs">
209 <SubType>Code</SubType>
210 </Compile>
211 <Compile Include="Types\RegionInfo.cs">
212 <SubType>Code</SubType>
213 </Compile>
214 </ItemGroup>
215 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
216 <PropertyGroup>
217 <PreBuildEvent>
218 </PreBuildEvent>
219 <PostBuildEvent>
220 </PostBuildEvent>
221 </PropertyGroup>
222</Project> \ No newline at end of file
diff --git a/Common/OpenSim.Framework/OpenSim.Framework.dll.build b/Common/OpenSim.Framework/OpenSim.Framework.dll.build
deleted file mode 100644
index afe1aea..0000000
--- a/Common/OpenSim.Framework/OpenSim.Framework.dll.build
+++ /dev/null
@@ -1,83 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Framework" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Framework" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AgentInventory.cs" />
15 <include name="AuthenticateSessionBase.cs" />
16 <include name="BlockingQueue.cs" />
17 <include name="IRegionCommsListener.cs" />
18 <include name="LLSDHelpers.cs" />
19 <include name="Logger.cs" />
20 <include name="LoginService.cs" />
21 <include name="RegionCommsListener.cs" />
22 <include name="Remoting.cs" />
23 <include name="SimProfile.cs" />
24 <include name="UserProfile.cs" />
25 <include name="UserProfileManager.cs" />
26 <include name="UserProfileManagerBase.cs" />
27 <include name="Util.cs" />
28 <include name="Interfaces/AuthenticateResponse.cs" />
29 <include name="Interfaces/IAssetServer.cs" />
30 <include name="Interfaces/IClientAPI.cs" />
31 <include name="Interfaces/ILocalStorage.cs" />
32 <include name="Interfaces/IUserServer.cs" />
33 <include name="Interfaces/IWorld.cs" />
34 <include name="Interfaces/Config/IGenericConfig.cs" />
35 <include name="Interfaces/Config/IGridConfig.cs" />
36 <include name="Interfaces/Config/IUserConfig.cs" />
37 <include name="Interfaces/Scripting/IScriptAPI.cs" />
38 <include name="Interfaces/Scripting/IScriptEngine.cs" />
39 <include name="Properties/AssemblyInfo.cs" />
40 <include name="Types/AgentCiruitData.cs" />
41 <include name="Types/AgentWearable.cs" />
42 <include name="Types/AssetBase.cs" />
43 <include name="Types/AssetLandmark.cs" />
44 <include name="Types/AssetStorage.cs" />
45 <include name="Types/EstateSettings.cs" />
46 <include name="Types/Login.cs" />
47 <include name="Types/MapBlockData.cs" />
48 <include name="Types/NeighbourInfo.cs" />
49 <include name="Types/NetworkServersInfo.cs" />
50 <include name="Types/ParcelData.cs" />
51 <include name="Types/PrimData.cs" />
52 <include name="Types/RegionHandle.cs" />
53 <include name="Types/RegionInfo.cs" />
54 </sources>
55 <references basedir="${project::get-base-directory()}">
56 <lib>
57 <include name="${project::get-base-directory()}" />
58 <include name="${project::get-base-directory()}/${build.dir}" />
59 </lib>
60 <include name="../../bin/Db4objects.Db4o.dll" />
61 <include name="../../bin/libsecondlife.dll" />
62 <include name="../../bin/OpenSim.Framework.Console.dll" />
63 <include name="System.dll" />
64 <include name="System.Xml.dll" />
65 <include name="../../bin/XMLRPC.dll" />
66 </references>
67 </csc>
68 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
69 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
70 <copy todir="${project::get-base-directory()}/../../bin/">
71 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
72 <include name="*.dll"/>
73 <include name="*.exe"/>
74 </fileset>
75 </copy>
76 </target>
77 <target name="clean">
78 <delete dir="${bin.dir}" failonerror="false" />
79 <delete dir="${obj.dir}" failonerror="false" />
80 </target>
81 <target name="doc" description="Creates documentation.">
82 </target>
83</project>
diff --git a/Common/OpenSim.Framework/Properties/AssemblyInfo.cs b/Common/OpenSim.Framework/Properties/AssemblyInfo.cs
deleted file mode 100644
index 86f5cdb..0000000
--- a/Common/OpenSim.Framework/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.FrameWork")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.FrameWork")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenSim.Framework/RegionCommsListener.cs b/Common/OpenSim.Framework/RegionCommsListener.cs
deleted file mode 100644
index bba928f..0000000
--- a/Common/OpenSim.Framework/RegionCommsListener.cs
+++ /dev/null
@@ -1,69 +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 OpenSim.Framework.Interfaces;
32using OpenSim.Framework.Types;
33
34namespace OpenSim.Framework
35{
36 public class RegionCommsListener :IRegionCommsListener
37 {
38 public event ExpectUserDelegate OnExpectUser;
39 public event GenericCall2 OnExpectChildAgent;
40 public event AgentCrossing OnAvatarCrossingIntoRegion;
41 public event UpdateNeighbours OnNeighboursUpdate;
42
43 /// <summary>
44 ///
45 /// </summary>
46 /// <param name="agent"></param>
47 /// <returns></returns>
48 public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
49 {
50 if(OnExpectUser != null)
51 {
52 OnExpectUser(regionHandle, agent);
53 return true;
54 }
55
56 return false;
57 }
58
59 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
60 {
61 if (OnAvatarCrossingIntoRegion != null)
62 {
63 OnAvatarCrossingIntoRegion(regionHandle, agentID, position);
64 return true;
65 }
66 return false;
67 }
68 }
69}
diff --git a/Common/OpenSim.Framework/Remoting.cs b/Common/OpenSim.Framework/Remoting.cs
deleted file mode 100644
index e6fdf70..0000000
--- a/Common/OpenSim.Framework/Remoting.cs
+++ /dev/null
@@ -1,136 +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 System.Security.Cryptography;
32
33namespace OpenSim.Framework
34{
35 /// <summary>
36 /// NEEDS AUDIT.
37 /// </summary>
38 /// <remarks>
39 /// Suggested implementation
40 /// <para>Store two digests for each foreign host. A local copy of the local hash using the local challenge (when issued), and a local copy of the remote hash using the remote challenge.</para>
41 /// <para>When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message.</para>
42 /// <para>When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[].</para>
43 /// <para>Both hosts should be performing these operations for this to be effective.</para>
44 /// </remarks>
45 class RemoteDigest
46 {
47 private byte[] currentHash;
48 private byte[] secret;
49
50 private SHA512Managed SHA512;
51
52 /// <summary>
53 /// Initialises a new RemoteDigest authentication mechanism
54 /// </summary>
55 /// <remarks>Needs an audit by a cryptographic professional - was not "roll your own"'d by choice but rather a serious lack of decent authentication mechanisms in .NET remoting</remarks>
56 /// <param name="sharedSecret">The shared secret between systems (for inter-sim, this is provided in encrypted form during connection, for grid this is input manually in setup)</param>
57 /// <param name="salt">Binary salt - some common value - to be decided what</param>
58 /// <param name="challenge">The challenge key provided by the third party</param>
59 public RemoteDigest(string sharedSecret, byte[] salt, string challenge)
60 {
61 SHA512 = new SHA512Managed();
62 Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret,salt);
63 secret = RFC2898.GetBytes(512);
64 ASCIIEncoding ASCII = new ASCIIEncoding();
65
66 currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge)));
67 }
68
69 /// <summary>
70 /// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented.
71 /// </summary>
72 /// <param name="data">The incoming data</param>
73 /// <param name="digest">The remote digest</param>
74 /// <returns></returns>
75 public bool Authenticate(byte[] data, byte[] digest)
76 {
77 byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data));
78 if (digest == newHash)
79 {
80 currentHash = newHash;
81 return true;
82 }
83 else
84 {
85 throw new Exception("Hash comparison failed. Key resync required.");
86 }
87 }
88
89 /// <summary>
90 /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message.
91 /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the
92 /// hashes will get out of sync and throw an exception when validation is attempted.
93 /// </summary>
94 /// <param name="data">The outgoing data</param>
95 /// <returns>The local digest</returns>
96 public byte[] Sign(byte[] data)
97 {
98 currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data));
99 return currentHash;
100 }
101
102 /// <summary>
103 /// Generates a new challenge string to be issued to a foreign host. Challenges are 1024-bit (effective strength of less than 512-bits) messages generated using the Crytographic Random Number Generator.
104 /// </summary>
105 /// <returns>A 128-character hexadecimal string containing the challenge.</returns>
106 public static string GenerateChallenge()
107 {
108 RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider();
109 byte[] bytes = new byte[64];
110 RNG.GetBytes(bytes);
111
112 StringBuilder sb = new StringBuilder(bytes.Length * 2);
113 foreach (byte b in bytes)
114 {
115 sb.AppendFormat("{0:x2}", b);
116 }
117 return sb.ToString();
118 }
119
120 /// <summary>
121 /// Helper function, merges two byte arrays
122 /// </summary>
123 /// <remarks>Sourced from MSDN Forum</remarks>
124 /// <param name="a">A</param>
125 /// <param name="b">B</param>
126 /// <returns>C</returns>
127 private byte[] AppendArrays(byte[] a, byte[] b)
128 {
129 byte[] c = new byte[a.Length + b.Length];
130 Buffer.BlockCopy(a, 0, c, 0, a.Length);
131 Buffer.BlockCopy(b, 0, c, a.Length, b.Length);
132 return c;
133 }
134
135 }
136}
diff --git a/Common/OpenSim.Framework/SimProfile.cs b/Common/OpenSim.Framework/SimProfile.cs
deleted file mode 100644
index cfa5e50..0000000
--- a/Common/OpenSim.Framework/SimProfile.cs
+++ /dev/null
@@ -1,122 +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.Collections;
31using System.Xml;
32using System.Text;
33using libsecondlife;
34using Nwc.XmlRpc;
35
36namespace OpenSim.Framework.Sims
37{
38 public class SimProfile
39 {
40 public LLUUID UUID;
41 public ulong regionhandle;
42 public string regionname;
43 public string sim_ip;
44 public uint sim_port;
45 public string caps_url;
46 public uint RegionLocX;
47 public uint RegionLocY;
48 public string sendkey;
49 public string recvkey;
50 public bool online;
51
52 public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey)
53 {
54 try
55 {
56 Hashtable GridReqParams = new Hashtable();
57 GridReqParams["region_handle"] = region_handle.ToString();
58 GridReqParams["authkey"] = SendKey;
59 ArrayList SendParams = new ArrayList();
60 SendParams.Add(GridReqParams);
61 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
62
63 XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
64
65 Hashtable RespData = (Hashtable)GridResp.Value;
66 this.UUID = new LLUUID((string)RespData["UUID"]);
67 this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
68 this.regionname = (string)RespData["regionname"];
69 this.sim_ip = (string)RespData["sim_ip"];
70 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
71 this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
72 this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
73 this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
74 this.sendkey = SendKey;
75 this.recvkey = RecvKey;
76 }
77 catch (Exception e)
78 {
79 System.Console.WriteLine(e.ToString());
80 }
81 return this;
82 }
83
84 public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey)
85 {
86 try
87 {
88 Hashtable GridReqParams = new Hashtable();
89 GridReqParams["UUID"] = UUID.ToString();
90 GridReqParams["authkey"] = SendKey;
91 ArrayList SendParams = new ArrayList();
92 SendParams.Add(GridReqParams);
93 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
94
95 XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
96
97 Hashtable RespData = (Hashtable)GridResp.Value;
98 this.UUID = new LLUUID((string)RespData["UUID"]);
99 this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
100 this.regionname = (string)RespData["regionname"];
101 this.sim_ip = (string)RespData["sim_ip"];
102 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
103 this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
104 this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
105 this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
106 this.sendkey = SendKey;
107 this.recvkey = RecvKey;
108 }
109 catch (Exception e)
110 {
111 System.Console.WriteLine(e.ToString());
112 }
113 return this;
114 }
115
116
117 public SimProfile()
118 {
119 }
120 }
121
122}
diff --git a/Common/OpenSim.Framework/Types/AgentCiruitData.cs b/Common/OpenSim.Framework/Types/AgentCiruitData.cs
deleted file mode 100644
index a650343..0000000
--- a/Common/OpenSim.Framework/Types/AgentCiruitData.cs
+++ /dev/null
@@ -1,50 +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;
32
33namespace OpenSim.Framework.Types
34{
35 public class AgentCircuitData
36 {
37 public AgentCircuitData() { }
38 public LLUUID AgentID;
39 public LLUUID SessionID;
40 public LLUUID SecureSessionID;
41 public LLVector3 startpos;
42 public string firstname;
43 public string lastname;
44 public uint circuitcode;
45 public bool child;
46 public LLUUID InventoryFolder;
47 public LLUUID BaseFolder;
48 public string CapsPath = "";
49 }
50}
diff --git a/Common/OpenSim.Framework/Types/AgentWearable.cs b/Common/OpenSim.Framework/Types/AgentWearable.cs
deleted file mode 100644
index 4c93da7..0000000
--- a/Common/OpenSim.Framework/Types/AgentWearable.cs
+++ /dev/null
@@ -1,60 +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;
32
33namespace OpenSim.Framework.Types
34{
35 public class AvatarWearable
36 {
37 public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000");
38 public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
39
40 public AvatarWearable()
41 {
42
43 }
44
45 public static AvatarWearable[] DefaultWearables
46 {
47 get
48 {
49 AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these
50 for (int i = 0; i < 13; i++)
51 {
52 defaultWearables[i] = new AvatarWearable();
53 }
54 defaultWearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
55 defaultWearables[0].ItemID = LLUUID.Random();
56 return defaultWearables;
57 }
58 }
59 }
60}
diff --git a/Common/OpenSim.Framework/Types/AssetBase.cs b/Common/OpenSim.Framework/Types/AssetBase.cs
deleted file mode 100644
index 86586a6..0000000
--- a/Common/OpenSim.Framework/Types/AssetBase.cs
+++ /dev/null
@@ -1,49 +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;
32
33namespace OpenSim.Framework.Types
34{
35 public class AssetBase
36 {
37 public byte[] Data;
38 public LLUUID FullID;
39 public sbyte Type;
40 public sbyte InvType;
41 public string Name;
42 public string Description;
43
44 public AssetBase()
45 {
46
47 }
48 }
49}
diff --git a/Common/OpenSim.Framework/Types/AssetLandmark.cs b/Common/OpenSim.Framework/Types/AssetLandmark.cs
deleted file mode 100644
index 8a10b70..0000000
--- a/Common/OpenSim.Framework/Types/AssetLandmark.cs
+++ /dev/null
@@ -1,61 +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;
32
33namespace OpenSim.Framework.Types
34{
35 public class AssetLandmark : AssetBase
36 {
37 public int Version;
38 public LLVector3 Position;
39 public LLUUID RegionID;
40
41 public AssetLandmark(AssetBase a)
42 {
43 this.Data = a.Data;
44 this.FullID = a.FullID;
45 this.Type = a.Type;
46 this.InvType = a.InvType;
47 this.Name = a.Name;
48 this.Description = a.Description;
49 InternData();
50 }
51
52 private void InternData()
53 {
54 string temp = System.Text.Encoding.UTF8.GetString(Data).Trim();
55 string[] parts = temp.Split('\n');
56 int.TryParse(parts[0].Substring(17, 1), out Version);
57 LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID);
58 LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position);
59 }
60 }
61}
diff --git a/Common/OpenSim.Framework/Types/AssetStorage.cs b/Common/OpenSim.Framework/Types/AssetStorage.cs
deleted file mode 100644
index 8cac23a..0000000
--- a/Common/OpenSim.Framework/Types/AssetStorage.cs
+++ /dev/null
@@ -1,50 +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;
32
33namespace OpenSim.Framework.Types
34{
35 public class AssetStorage
36 {
37
38 public AssetStorage() {
39 }
40
41 public AssetStorage(LLUUID assetUUID) {
42 UUID=assetUUID;
43 }
44
45 public byte[] Data;
46 public sbyte Type;
47 public string Name;
48 public LLUUID UUID;
49 }
50}
diff --git a/Common/OpenSim.Framework/Types/EstateSettings.cs b/Common/OpenSim.Framework/Types/EstateSettings.cs
deleted file mode 100644
index 778c893..0000000
--- a/Common/OpenSim.Framework/Types/EstateSettings.cs
+++ /dev/null
@@ -1,97 +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*/
28
29using System;
30using System.Collections.Generic;
31using System.Text;
32
33using libsecondlife;
34
35namespace OpenSim.Framework.Types
36{
37 public class EstateSettings
38 {
39 //Settings to this island
40 public float billableFactor = (float)0.0;
41 public uint estateID = 0;
42 public uint parentEstateID = 0;
43
44 public byte maxAgents = 40;
45 public float objectBonusFactor = (float)1.0;
46
47 public int redirectGridX = 0; //??
48 public int redirectGridY = 0; //??
49 public libsecondlife.Simulator.RegionFlags regionFlags = libsecondlife.Simulator.RegionFlags.None; //Booleam values of various region settings
50 public libsecondlife.Simulator.SimAccess simAccess = libsecondlife.Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default.
51 public float sunHour = 0;
52
53 public float terrainRaiseLimit = 0;
54 public float terrainLowerLimit = 0;
55
56 public bool useFixedSun = false;
57 public int pricePerMeter = 1;
58
59 public ushort regionWaterHeight = 20;
60 public bool regionAllowTerraform = true;
61
62 // Region Information
63 // Low resolution 'base' textures. No longer used.
64 public LLUUID terrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default
65 public LLUUID terrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default
66 public LLUUID terrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default
67 public LLUUID terrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default
68
69 // Higher resolution terrain textures
70 public LLUUID terrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000");
71 public LLUUID terrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000");
72 public LLUUID terrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000");
73 public LLUUID terrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000");
74
75 // First quad - each point is bilinearly interpolated at each meter of terrain
76 public float terrainStartHeight0 = 10.0f;
77 public float terrainStartHeight1 = 10.0f;
78 public float terrainStartHeight2 = 10.0f;
79 public float terrainStartHeight3 = 10.0f;
80
81 // Second quad - also bilinearly interpolated.
82 // Terrain texturing is done that:
83 // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y]
84 public float terrainHeightRange0 = 60.0f; //00
85 public float terrainHeightRange1 = 60.0f; //01
86 public float terrainHeightRange2 = 60.0f; //10
87 public float terrainHeightRange3 = 60.0f; //11
88
89 // Terrain Default (Must be in F32 Format!)
90 public string terrainFile = "default.r32";
91 public double terrainMultiplier = 60.0;
92 public float waterHeight = (float)20.0;
93
94 public LLUUID terrainImageID = LLUUID.Zero; // the assetID that is the current Map image for this region
95
96 }
97}
diff --git a/Common/OpenSim.Framework/Types/Login.cs b/Common/OpenSim.Framework/Types/Login.cs
deleted file mode 100644
index 3180a16..0000000
--- a/Common/OpenSim.Framework/Types/Login.cs
+++ /dev/null
@@ -1,52 +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;
32
33namespace OpenSim.Framework.Types
34{
35 public class Login
36 {
37 public string First = "Test";
38 public string Last = "User";
39 public LLUUID Agent;
40 public LLUUID Session;
41 public LLUUID SecureSession = LLUUID.Zero;
42 public LLUUID InventoryFolder;
43 public LLUUID BaseFolder;
44 public uint CircuitCode;
45 public string CapsPath ="";
46
47 public Login()
48 {
49
50 }
51 }
52}
diff --git a/Common/OpenSim.Framework/Types/MapBlockData.cs b/Common/OpenSim.Framework/Types/MapBlockData.cs
deleted file mode 100644
index 2e6f56e..0000000
--- a/Common/OpenSim.Framework/Types/MapBlockData.cs
+++ /dev/null
@@ -1,25 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class MapBlockData
9 {
10 public uint Flags;
11 public ushort X;
12 public ushort Y;
13 public byte Agents;
14 public byte Access;
15 public byte WaterHeight;
16 public LLUUID MapImageId;
17 public String Name;
18 public uint RegionFlags;
19
20 public MapBlockData()
21 {
22
23 }
24 }
25}
diff --git a/Common/OpenSim.Framework/Types/NeighbourInfo.cs b/Common/OpenSim.Framework/Types/NeighbourInfo.cs
deleted file mode 100644
index 310fd1c..0000000
--- a/Common/OpenSim.Framework/Types/NeighbourInfo.cs
+++ /dev/null
@@ -1,50 +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 OpenSim.Framework.Interfaces;
32using OpenSim.Framework.Utilities;
33using OpenSim.Framework.Console;
34using libsecondlife;
35
36namespace OpenSim.Framework.Types
37{
38 public class NeighbourInfo
39 {
40 public NeighbourInfo()
41 {
42 }
43
44 public ulong regionhandle;
45 public uint RegionLocX;
46 public uint RegionLocY;
47 public string sim_ip;
48 public uint sim_port;
49 }
50}
diff --git a/Common/OpenSim.Framework/Types/NetworkServersInfo.cs b/Common/OpenSim.Framework/Types/NetworkServersInfo.cs
deleted file mode 100644
index 73d7811..0000000
--- a/Common/OpenSim.Framework/Types/NetworkServersInfo.cs
+++ /dev/null
@@ -1,181 +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 OpenSim.Framework.Interfaces;
32
33namespace OpenSim.Framework.Types
34{
35 public class NetworkServersInfo
36 {
37 public string AssetURL = "http://127.0.0.1:8003/";
38 public string AssetSendKey = "";
39
40 public string GridURL = "";
41 public string GridSendKey = "";
42 public string GridRecvKey = "";
43 public string UserURL = "";
44 public string UserSendKey = "";
45 public string UserRecvKey = "";
46 public bool isSandbox;
47
48 public uint DefaultHomeLocX = 0;
49 public uint DefaultHomeLocY = 0;
50
51 public int HttpListenerPort = 9000;
52 public int RemotingListenerPort = 8895;
53
54 public void InitConfig(bool sandboxMode, IGenericConfig configData)
55 {
56 this.isSandbox = sandboxMode;
57
58 try
59 {
60 string attri = "";
61
62 attri = "";
63 attri = configData.GetAttribute("HttpListenerPort");
64 if (attri == "")
65 {
66 string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Http Listener Port", "9000");
67 configData.SetAttribute("HttpListenerPort", location);
68 this.HttpListenerPort = Convert.ToInt32(location);
69 }
70 else
71 {
72 this.HttpListenerPort = Convert.ToInt32(attri);
73 }
74
75 attri = "";
76 attri = configData.GetAttribute("RemotingListenerPort");
77 if (attri == "")
78 {
79 string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895");
80 configData.SetAttribute("RemotingListenerPort", location);
81 this.RemotingListenerPort = Convert.ToInt32(location);
82 }
83 else
84 {
85 this.RemotingListenerPort = Convert.ToInt32(attri);
86 }
87
88 if (sandboxMode)
89 {
90 // default home location X
91 attri = "";
92 attri = configData.GetAttribute("DefaultLocationX");
93 if (attri == "")
94 {
95 string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location X", "1000");
96 configData.SetAttribute("DefaultLocationX", location);
97 this.DefaultHomeLocX = (uint)Convert.ToUInt32(location);
98 }
99 else
100 {
101 this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri);
102 }
103
104 // default home location Y
105 attri = "";
106 attri = configData.GetAttribute("DefaultLocationY");
107 if (attri == "")
108 {
109 string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location Y", "1000");
110 configData.SetAttribute("DefaultLocationY", location);
111 this.DefaultHomeLocY = (uint)Convert.ToUInt32(location);
112 }
113 else
114 {
115 this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri);
116 }
117 }
118 if (!isSandbox)
119 {
120 //Grid Server
121 attri = "";
122 attri = configData.GetAttribute("GridServerURL");
123 if (attri == "")
124 {
125 this.GridURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/");
126 configData.SetAttribute("GridServerURL", this.GridURL);
127 }
128 else
129 {
130 this.GridURL = attri;
131 }
132
133 //Grid Send Key
134 attri = "";
135 attri = configData.GetAttribute("GridSendKey");
136 if (attri == "")
137 {
138 this.GridSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to grid server", "null");
139 configData.SetAttribute("GridSendKey", this.GridSendKey);
140 }
141 else
142 {
143 this.GridSendKey = attri;
144 }
145
146 //Grid Receive Key
147 attri = "";
148 attri = configData.GetAttribute("GridRecvKey");
149 if (attri == "")
150 {
151 this.GridRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from grid server", "null");
152 configData.SetAttribute("GridRecvKey", this.GridRecvKey);
153 }
154 else
155 {
156 this.GridRecvKey = attri;
157 }
158
159 attri = "";
160 attri = configData.GetAttribute("AssetServerURL");
161 if (attri == "")
162 {
163 this.AssetURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/");
164 configData.SetAttribute("AssetServerURL", this.GridURL);
165 }
166 else
167 {
168 this.AssetURL = attri;
169 }
170
171 }
172 configData.Commit();
173 }
174 catch (Exception e)
175 {
176 OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured");
177 OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString());
178 }
179 }
180 }
181}
diff --git a/Common/OpenSim.Framework/Types/ParcelData.cs b/Common/OpenSim.Framework/Types/ParcelData.cs
deleted file mode 100644
index 40f128a..0000000
--- a/Common/OpenSim.Framework/Types/ParcelData.cs
+++ /dev/null
@@ -1,115 +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;
32
33namespace OpenSim.Framework.Types
34{
35
36 public class ParcelData
37 {
38 public byte[] parcelBitmapByteArray = new byte[512];
39 public string parcelName = "";
40 public string parcelDesc = "";
41 public LLUUID ownerID = new LLUUID();
42 public bool isGroupOwned = false;
43 public LLVector3 AABBMin = new LLVector3();
44 public LLVector3 AABBMax = new LLVector3();
45 public int area = 0;
46 public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned
47 public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID
48 public libsecondlife.Parcel.ParcelCategory category = new libsecondlife.Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category
49 public int claimDate = 0; //Unemplemented
50 public int claimPrice = 0; //Unemplemented
51 public LLUUID groupID = new LLUUID(); //Unemplemented
52 public int groupPrims = 0; //Unemplemented
53 public int salePrice = 0; //Unemeplemented. Parcels price.
54 public libsecondlife.Parcel.ParcelStatus parcelStatus = libsecondlife.Parcel.ParcelStatus.None;
55 public libsecondlife.Parcel.ParcelFlags parcelFlags = libsecondlife.Parcel.ParcelFlags.None;
56 public byte landingType = 0;
57 public byte mediaAutoScale = 0;
58 public LLUUID mediaID = LLUUID.Zero;
59 public int localID = 0;
60 public LLUUID globalID = new LLUUID();
61
62 public string mediaURL = "";
63 public string musicURL = "";
64 public float passHours = 0;
65 public int passPrice = 0;
66 public LLUUID snapshotID = LLUUID.Zero;
67 public LLVector3 userLocation = new LLVector3();
68 public LLVector3 userLookAt = new LLVector3();
69
70 public ParcelData()
71 {
72 globalID = LLUUID.Random();
73 }
74
75 public ParcelData Copy()
76 {
77 ParcelData parcelData = new ParcelData();
78
79 parcelData.AABBMax = this.AABBMax;
80 parcelData.AABBMin = this.AABBMin;
81 parcelData.area = this.area;
82 parcelData.auctionID = this.auctionID;
83 parcelData.authBuyerID = this.authBuyerID;
84 parcelData.category = this.category;
85 parcelData.claimDate = this.claimDate;
86 parcelData.claimPrice = this.claimPrice;
87 parcelData.globalID = this.globalID;
88 parcelData.groupID = this.groupID;
89 parcelData.groupPrims = this.groupPrims;
90 parcelData.isGroupOwned = this.isGroupOwned;
91 parcelData.localID = this.localID;
92 parcelData.landingType = this.landingType;
93 parcelData.mediaAutoScale = this.mediaAutoScale;
94 parcelData.mediaID = this.mediaID;
95 parcelData.mediaURL = this.mediaURL;
96 parcelData.musicURL = this.musicURL;
97 parcelData.ownerID = this.ownerID;
98 parcelData.parcelBitmapByteArray = (byte[])this.parcelBitmapByteArray.Clone();
99 parcelData.parcelDesc = this.parcelDesc;
100 parcelData.parcelFlags = this.parcelFlags;
101 parcelData.parcelName = this.parcelName;
102 parcelData.parcelStatus = this.parcelStatus;
103 parcelData.passHours = this.passHours;
104 parcelData.passPrice = this.passPrice;
105 parcelData.salePrice = this.salePrice;
106 parcelData.snapshotID = this.snapshotID;
107 parcelData.userLocation = this.userLocation;
108 parcelData.userLookAt = this.userLookAt;
109
110 return parcelData;
111
112 }
113 }
114
115}
diff --git a/Common/OpenSim.Framework/Types/PrimData.cs b/Common/OpenSim.Framework/Types/PrimData.cs
deleted file mode 100644
index f84ae3e..0000000
--- a/Common/OpenSim.Framework/Types/PrimData.cs
+++ /dev/null
@@ -1,230 +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;
32
33namespace OpenSim.Framework.Types
34{
35 public class PrimData
36 {
37 private const uint FULL_MASK_PERMISSIONS = 2147483647;
38
39 public LLUUID OwnerID;
40 public byte PCode;
41 public ushort PathBegin;
42 public ushort PathEnd;
43 public byte PathScaleX;
44 public byte PathScaleY;
45 public byte PathShearX;
46 public byte PathShearY;
47 public sbyte PathSkew;
48 public ushort ProfileBegin;
49 public ushort ProfileEnd;
50 public LLVector3 Scale;
51 public byte PathCurve;
52 public byte ProfileCurve;
53 public uint ParentID = 0;
54 public ushort ProfileHollow;
55 public sbyte PathRadiusOffset;
56 public byte PathRevolutions;
57 public sbyte PathTaperX;
58 public sbyte PathTaperY;
59 public sbyte PathTwist;
60 public sbyte PathTwistBegin;
61 public byte[] TextureEntry; // a LL textureEntry in byte[] format
62
63 public Int32 CreationDate;
64 public uint OwnerMask = FULL_MASK_PERMISSIONS;
65 public uint NextOwnerMask = FULL_MASK_PERMISSIONS;
66 public uint GroupMask = FULL_MASK_PERMISSIONS;
67 public uint EveryoneMask = FULL_MASK_PERMISSIONS;
68 public uint BaseMask = FULL_MASK_PERMISSIONS;
69
70 //following only used during prim storage
71 public LLVector3 Position;
72 public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0);
73 public uint LocalID;
74 public LLUUID FullID;
75
76 public PrimData()
77 {
78
79 }
80
81 public PrimData(byte[] data)
82 {
83 int i = 0;
84
85 this.OwnerID = new LLUUID(data, i); i += 16;
86 this.PCode = data[i++];
87 this.PathBegin = (ushort)(data[i++] + (data[i++] << 8));
88 this.PathEnd = (ushort)(data[i++] + (data[i++] << 8));
89 this.PathScaleX = data[i++];
90 this.PathScaleY = data[i++];
91 this.PathShearX = data[i++];
92 this.PathShearY = data[i++];
93 this.PathSkew = (sbyte)data[i++];
94 this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8));
95 this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8));
96 this.Scale = new LLVector3(data, i); i += 12;
97 this.PathCurve = data[i++];
98 this.ProfileCurve = data[i++];
99 this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
100 this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8));
101 this.PathRadiusOffset = (sbyte)data[i++];
102 this.PathRevolutions = data[i++];
103 this.PathTaperX = (sbyte)data[i++];
104 this.PathTaperY = (sbyte)data[i++];
105 this.PathTwist = (sbyte)data[i++];
106 this.PathTwistBegin = (sbyte)data[i++];
107 ushort length = (ushort)(data[i++] + (data[i++] << 8));
108 this.TextureEntry = new byte[length];
109 Array.Copy(data, i, TextureEntry, 0, length); i += length;
110 this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
111 this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
112 this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
113 this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
114 this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
115 this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
116 this.Position = new LLVector3(data, i); i += 12;
117 this.Rotation = new LLQuaternion(data, i, true); i += 12;
118 this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
119 this.FullID = new LLUUID(data, i); i += 16;
120
121 }
122
123 public byte[] ToBytes()
124 {
125 int i = 0;
126 byte[] bytes = new byte[126 + TextureEntry.Length];
127 Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
128 bytes[i++] = this.PCode;
129 bytes[i++] = (byte)(this.PathBegin % 256);
130 bytes[i++] = (byte)((this.PathBegin >> 8) % 256);
131 bytes[i++] = (byte)(this.PathEnd % 256);
132 bytes[i++] = (byte)((this.PathEnd >> 8) % 256);
133 bytes[i++] = this.PathScaleX;
134 bytes[i++] = this.PathScaleY;
135 bytes[i++] = this.PathShearX;
136 bytes[i++] = this.PathShearY;
137 bytes[i++] = (byte)this.PathSkew;
138 bytes[i++] = (byte)(this.ProfileBegin % 256);
139 bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256);
140 bytes[i++] = (byte)(this.ProfileEnd % 256);
141 bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256);
142 Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12;
143 bytes[i++] = this.PathCurve;
144 bytes[i++] = this.ProfileCurve;
145 bytes[i++] = (byte)(ParentID % 256);
146 bytes[i++] = (byte)((ParentID >> 8) % 256);
147 bytes[i++] = (byte)((ParentID >> 16) % 256);
148 bytes[i++] = (byte)((ParentID >> 24) % 256);
149 bytes[i++] = (byte)(this.ProfileHollow % 256);
150 bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256);
151 bytes[i++] = ((byte)this.PathRadiusOffset);
152 bytes[i++] = this.PathRevolutions;
153 bytes[i++] = ((byte)this.PathTaperX);
154 bytes[i++] = ((byte)this.PathTaperY);
155 bytes[i++] = ((byte)this.PathTwist);
156 bytes[i++] = ((byte)this.PathTwistBegin);
157 bytes[i++] = (byte)(TextureEntry.Length % 256);
158 bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256);
159 Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length;
160 bytes[i++] = (byte)(this.CreationDate % 256);
161 bytes[i++] = (byte)((this.CreationDate >> 8) % 256);
162 bytes[i++] = (byte)((this.CreationDate >> 16) % 256);
163 bytes[i++] = (byte)((this.CreationDate >> 24) % 256);
164 bytes[i++] = (byte)(this.OwnerMask % 256);
165 bytes[i++] = (byte)((this.OwnerMask >> 8) % 256);
166 bytes[i++] = (byte)((this.OwnerMask >> 16) % 256);
167 bytes[i++] = (byte)((this.OwnerMask >> 24) % 256);
168 bytes[i++] = (byte)(this.NextOwnerMask % 256);
169 bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256);
170 bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256);
171 bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256);
172 bytes[i++] = (byte)(this.GroupMask % 256);
173 bytes[i++] = (byte)((this.GroupMask >> 8) % 256);
174 bytes[i++] = (byte)((this.GroupMask >> 16) % 256);
175 bytes[i++] = (byte)((this.GroupMask >> 24) % 256);
176 bytes[i++] = (byte)(this.EveryoneMask % 256);
177 bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256);
178 bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256);
179 bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256);
180 bytes[i++] = (byte)(this.BaseMask % 256);
181 bytes[i++] = (byte)((this.BaseMask >> 8) % 256);
182 bytes[i++] = (byte)((this.BaseMask >> 16) % 256);
183 bytes[i++] = (byte)((this.BaseMask >> 24) % 256);
184 Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12;
185 if (this.Rotation == new LLQuaternion(0, 0, 0, 0))
186 {
187 this.Rotation = new LLQuaternion(0, 1, 0, 0);
188 }
189 Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
190 bytes[i++] = (byte)(this.LocalID % 256);
191 bytes[i++] = (byte)((this.LocalID >> 8) % 256);
192 bytes[i++] = (byte)((this.LocalID >> 16) % 256);
193 bytes[i++] = (byte)((this.LocalID >> 24) % 256);
194 Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16;
195
196 return bytes;
197 }
198
199 public static PrimData DefaultCube()
200 {
201 PrimData primData = new PrimData();
202 primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
203 primData.FullID = LLUUID.Random();
204 primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
205 primData.Rotation = new LLQuaternion(0, 0, 0, 1);
206 primData.PCode = 9;
207 primData.ParentID = 0;
208 primData.PathBegin = 0;
209 primData.PathEnd = 0;
210 primData.PathScaleX = 0;
211 primData.PathScaleY = 0;
212 primData.PathShearX = 0;
213 primData.PathShearY = 0;
214 primData.PathSkew = 0;
215 primData.ProfileBegin = 0;
216 primData.ProfileEnd = 0;
217 primData.PathCurve = 16;
218 primData.ProfileCurve = 1;
219 primData.ProfileHollow = 0;
220 primData.PathRadiusOffset = 0;
221 primData.PathRevolutions = 0;
222 primData.PathTaperX = 0;
223 primData.PathTaperY = 0;
224 primData.PathTwist = 0;
225 primData.PathTwistBegin = 0;
226
227 return primData;
228 }
229 }
230}
diff --git a/Common/OpenSim.Framework/Types/RegionHandle.cs b/Common/OpenSim.Framework/Types/RegionHandle.cs
deleted file mode 100644
index 1271d04..0000000
--- a/Common/OpenSim.Framework/Types/RegionHandle.cs
+++ /dev/null
@@ -1,120 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Net;
5
6namespace OpenSim.Framework.Types
7{
8 /// <summary>
9 /// A class for manipulating RegionHandle coordinates
10 /// </summary>
11 class RegionHandle
12 {
13 private UInt64 handle;
14
15 /// <summary>
16 /// Initialises a new grid-aware RegionHandle
17 /// </summary>
18 /// <param name="ip">IP Address of the Grid Server for this region</param>
19 /// <param name="x">Grid X Coordinate</param>
20 /// <param name="y">Grid Y Coordinate</param>
21 public RegionHandle(string ip, short x, short y)
22 {
23 IPAddress addr = IPAddress.Parse(ip);
24
25 long baseHandle = addr.Address;
26
27 // Split the IP address in half
28 short a = (short)((baseHandle << 16) & 0xFFFF);
29 short b = (short)((baseHandle << 0) & 0xFFFF);
30
31 // Raise the bounds a little
32 uint nx = (uint)x;
33 uint ny = (uint)y;
34
35 // Multiply grid coords to get region coords
36 nx *= 256;
37 ny *= 256;
38
39 // Stuff the IP address in too
40 nx = (uint)a << 16;
41 ny = (uint)b << 16;
42
43 handle = ((UInt64)nx << 32) | (uint)ny;
44 }
45
46 /// <summary>
47 /// Initialises a new RegionHandle that is not inter-grid aware
48 /// </summary>
49 /// <param name="x">Grid X Coordinate</param>
50 /// <param name="y">Grid Y Coordinate</param>
51 public RegionHandle(uint x, uint y)
52 {
53 handle = ((x * 256) << 32) | (y * 256);
54 }
55
56 /// <summary>
57 /// Initialises a new RegionHandle from an existing value
58 /// </summary>
59 /// <param name="Region">A U64 RegionHandle</param>
60 public RegionHandle(UInt64 Region)
61 {
62 handle = Region;
63 }
64
65 /// <summary>
66 /// Returns the Grid Masked RegionHandle - For use in Teleport packets and other packets where sending the grid IP address may be handy.
67 /// </summary>
68 /// <remarks>Do not use for SimulatorEnable packets. The client will choke.</remarks>
69 /// <returns>Region Handle including IP Address encoding</returns>
70 public UInt64 getTeleportHandle()
71 {
72 return handle;
73 }
74
75 /// <summary>
76 /// Returns a RegionHandle which may be used for SimulatorEnable packets. Removes the IP address encoding and returns the lower bounds.
77 /// </summary>
78 /// <returns>A U64 RegionHandle for use in SimulatorEnable packets.</returns>
79 public UInt64 getNeighbourHandle()
80 {
81 UInt64 mask = 0x0000FFFF0000FFFF;
82
83 return handle | mask;
84 }
85
86 /// <summary>
87 /// Returns the IP Address of the GridServer from a Grid-Encoded RegionHandle
88 /// </summary>
89 /// <returns>Grid Server IP Address</returns>
90 public IPAddress getGridIP()
91 {
92 uint a = (uint)((handle >> 16) & 0xFFFF);
93 uint b = (uint)((handle >> 48) & 0xFFFF);
94
95 return new IPAddress((long)(a << 16) | (long)b);
96 }
97
98 /// <summary>
99 /// Returns the X Coordinate from a Grid-Encoded RegionHandle
100 /// </summary>
101 /// <returns>X Coordinate</returns>
102 public uint getGridX()
103 {
104 uint x = (uint)((handle >> 32) & 0xFFFF);
105
106 return x;
107 }
108
109 /// <summary>
110 /// Returns the Y Coordinate from a Grid-Encoded RegionHandle
111 /// </summary>
112 /// <returns>Y Coordinate</returns>
113 public uint getGridY()
114 {
115 uint y = (uint)((handle >> 0) & 0xFFFF);
116
117 return y;
118 }
119 }
120}
diff --git a/Common/OpenSim.Framework/Types/RegionInfo.cs b/Common/OpenSim.Framework/Types/RegionInfo.cs
deleted file mode 100644
index 48e6922..0000000
--- a/Common/OpenSim.Framework/Types/RegionInfo.cs
+++ /dev/null
@@ -1,304 +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 System.Globalization;
32using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Utilities;
34using OpenSim.Framework.Console;
35using libsecondlife;
36
37namespace OpenSim.Framework.Types
38{
39 public class RegionInfo
40 {
41 public LLUUID SimUUID = new LLUUID();
42 public string RegionName = "";
43 public uint RegionLocX = 0;
44 public uint RegionLocY = 0;
45 public ulong RegionHandle = 0;
46
47 public string DataStore = "";
48 public bool isSandbox = false;
49
50 public LLUUID MasterAvatarAssignedUUID = new LLUUID();
51 public string MasterAvatarFirstName = "";
52 public string MasterAvatarLastName = "";
53 public string MasterAvatarSandboxPassword = "";
54
55 /// <summary>
56 /// Port used for listening (TCP and UDP)
57 /// </summary>
58 /// <remarks>Seperate TCP and UDP</remarks>
59 public int CommsIPListenPort = 0;
60 /// <summary>
61 /// Address used for internal listening (default: 0.0.0.0?)
62 /// </summary>
63 public string CommsIPListenAddr = "";
64 /// <summary>
65 /// Address used for external addressing (DNS or IP)
66 /// </summary>
67 public string CommsExternalAddress = "";
68
69
70 public EstateSettings estateSettings;
71
72 public RegionInfo()
73 {
74 estateSettings = new EstateSettings();
75 }
76
77
78 public void InitConfig(bool sandboxMode, IGenericConfig configData)
79 {
80 this.isSandbox = sandboxMode;
81 try
82 {
83 // Sim UUID
84 string attri = "";
85 attri = configData.GetAttribute("SimUUID");
86 if (attri == "")
87 {
88 this.SimUUID = LLUUID.Random();
89 configData.SetAttribute("SimUUID", this.SimUUID.ToString());
90 }
91 else
92 {
93 this.SimUUID = new LLUUID(attri);
94 }
95
96 // Sim name
97 attri = "";
98 attri = configData.GetAttribute("SimName");
99 if (attri == "")
100 {
101 this.RegionName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Name", "OpenSim test");
102 configData.SetAttribute("SimName", this.RegionName);
103 }
104 else
105 {
106 this.RegionName = attri;
107 }
108 // Sim/Grid location X
109 attri = "";
110 attri = configData.GetAttribute("SimLocationX");
111 if (attri == "")
112 {
113 string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location X", "997");
114 configData.SetAttribute("SimLocationX", location);
115 this.RegionLocX = (uint)Convert.ToUInt32(location);
116 }
117 else
118 {
119 this.RegionLocX = (uint)Convert.ToUInt32(attri);
120 }
121 // Sim/Grid location Y
122 attri = "";
123 attri = configData.GetAttribute("SimLocationY");
124 if (attri == "")
125 {
126 string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location Y", "996");
127 configData.SetAttribute("SimLocationY", location);
128 this.RegionLocY = (uint)Convert.ToUInt32(location);
129 }
130 else
131 {
132 this.RegionLocY = (uint)Convert.ToUInt32(attri);
133 }
134
135 // Local storage datastore
136 attri = "";
137 attri = configData.GetAttribute("Datastore");
138 if (attri == "")
139 {
140 string datastore = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Filename for local storage", "localworld.yap");
141 configData.SetAttribute("Datastore", datastore);
142 this.DataStore = datastore;
143 }
144 else
145 {
146 this.DataStore = attri;
147 }
148
149 //Sim Listen Port
150 attri = "";
151 attri = configData.GetAttribute("SimListenPort");
152 if (attri == "")
153 {
154 string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000");
155 configData.SetAttribute("SimListenPort", port);
156 this.CommsIPListenPort = Convert.ToInt32(port);
157 }
158 else
159 {
160 this.CommsIPListenPort = Convert.ToInt32(attri);
161 }
162
163 //Sim Listen Address
164 attri = "";
165 attri = configData.GetAttribute("SimListenAddress");
166 if (attri == "")
167 {
168 this.CommsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0");
169 configData.SetAttribute("SimListenAddress", this.CommsIPListenAddr);
170 }
171 else
172 {
173 // Probably belongs elsewhere, but oh well.
174 if (attri.Trim().StartsWith("SYSTEMIP"))
175 {
176 string localhostname = System.Net.Dns.GetHostName();
177 System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname);
178 try
179 {
180 this.CommsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found
181
182 foreach (System.Net.IPAddress ip in ips)
183 {
184 if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString())
185 {
186 this.CommsIPListenAddr = ip.ToString();
187 break;
188 }
189 }
190 }
191 catch (Exception e)
192 {
193 e.ToString();
194 this.CommsIPListenAddr = "0.0.0.0"; // Use the default if we fail
195 }
196 }
197 else
198 {
199 this.CommsIPListenAddr = attri;
200 }
201 }
202
203 // Sim External Address
204 attri = "";
205 attri = configData.GetAttribute("SimExternalAddress");
206 if (attri == "")
207 {
208 this.CommsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost");
209 configData.SetAttribute("SimExternalAddress", this.CommsExternalAddress);
210 }
211 else
212 {
213 this.CommsExternalAddress = attri;
214 }
215
216 attri = "";
217 attri = configData.GetAttribute("TerrainFile");
218 if (attri == "")
219 {
220 this.estateSettings.terrainFile = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32");
221 configData.SetAttribute("TerrainFile", this.estateSettings.terrainFile);
222 }
223 else
224 {
225 this.estateSettings.terrainFile = attri;
226 }
227
228 attri = "";
229 attri = configData.GetAttribute("TerrainMultiplier");
230 if (attri == "")
231 {
232 string re = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0");
233 this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture);
234 configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString());
235 }
236 else
237 {
238 this.estateSettings.terrainMultiplier = Convert.ToDouble(attri);
239 }
240
241 attri = "";
242 attri = configData.GetAttribute("MasterAvatarFirstName");
243 if (attri == "")
244 {
245 this.MasterAvatarFirstName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test");
246
247 configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName);
248 }
249 else
250 {
251 this.MasterAvatarFirstName = attri;
252 }
253
254 attri = "";
255 attri = configData.GetAttribute("MasterAvatarLastName");
256 if (attri == "")
257 {
258 this.MasterAvatarLastName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User");
259
260 configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName);
261 }
262 else
263 {
264 this.MasterAvatarLastName = attri;
265 }
266
267 if (isSandbox) //Sandbox Mode Specific Settings
268 {
269 attri = "";
270 attri = configData.GetAttribute("MasterAvatarSandboxPassword");
271 if (attri == "")
272 {
273 this.MasterAvatarSandboxPassword = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test");
274
275 //Should I store this?
276 configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword);
277 }
278 else
279 {
280 this.MasterAvatarSandboxPassword = attri;
281 }
282 }
283
284 this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
285
286 configData.Commit();
287 }
288 catch (Exception e)
289 {
290 OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured");
291 OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString());
292 }
293
294 OpenSim.Framework.Console.MainLog.Instance.Verbose("Sim settings loaded:");
295 OpenSim.Framework.Console.MainLog.Instance.Verbose( "UUID: " + this.SimUUID.ToStringHyphenated());
296 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Name: " + this.RegionName);
297 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]");
298 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Handle: " + this.RegionHandle.ToString());
299 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort);
300 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Sandbox Mode? " + isSandbox.ToString());
301
302 }
303 }
304}
diff --git a/Common/OpenSim.Framework/UserProfile.cs b/Common/OpenSim.Framework/UserProfile.cs
deleted file mode 100644
index 04ff20b..0000000
--- a/Common/OpenSim.Framework/UserProfile.cs
+++ /dev/null
@@ -1,89 +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.Inventory;
33using System.Security.Cryptography;
34
35namespace OpenSim.Framework.User
36{
37 public class UserProfile
38 {
39
40 public string firstname;
41 public string lastname;
42 public ulong homeregionhandle;
43 public LLVector3 homepos;
44 public LLVector3 homelookat;
45
46 public bool IsGridGod = false;
47 public bool IsLocal = true; // will be used in future for visitors from foreign grids
48 public string AssetURL;
49 public string MD5passwd;
50
51 public LLUUID CurrentSessionID;
52 public LLUUID CurrentSecureSessionID;
53 public LLUUID UUID;
54 public Dictionary<LLUUID, uint> Circuits = new Dictionary<LLUUID, uint>(); // tracks circuit codes
55
56 public AgentInventory Inventory;
57
58 public UserProfile()
59 {
60 Circuits = new Dictionary<LLUUID, uint>();
61 Inventory = new AgentInventory();
62 homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
63 homepos = new LLVector3();
64 homelookat = new LLVector3();
65 }
66
67 public void InitSessionData()
68 {
69 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
70
71 byte[] randDataS = new byte[16];
72 byte[] randDataSS = new byte[16];
73
74 rand.GetBytes(randDataS);
75 rand.GetBytes(randDataSS);
76
77 CurrentSecureSessionID = new LLUUID(randDataSS,0);
78 CurrentSessionID = new LLUUID(randDataS,0);
79
80 }
81
82 public void AddSimCircuit(uint circuitCode, LLUUID regionUUID)
83 {
84 if (this.Circuits.ContainsKey(regionUUID) == false)
85 this.Circuits.Add(regionUUID, circuitCode);
86 }
87
88 }
89}
diff --git a/Common/OpenSim.Framework/Util.cs b/Common/OpenSim.Framework/Util.cs
deleted file mode 100644
index 8c34c9b..0000000
--- a/Common/OpenSim.Framework/Util.cs
+++ /dev/null
@@ -1,186 +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.Security.Cryptography;
30using System.Collections.Generic;
31using System.Text;
32using libsecondlife;
33using libsecondlife.Packets;
34
35namespace OpenSim.Framework.Utilities
36{
37 public class Util
38 {
39 private static Random randomClass = new Random();
40 private static uint nextXferID = 5000;
41 private static object XferLock = new object();
42
43 public static ulong UIntsToLong(uint X, uint Y)
44 {
45 return Helpers.UIntsToLong(X, Y);
46 }
47
48 public static Random RandomClass
49 {
50 get
51 {
52 return randomClass;
53 }
54 }
55
56 public static uint GetNextXferID()
57 {
58 uint id = 0;
59 lock(XferLock)
60 {
61 id = nextXferID;
62 nextXferID++;
63 }
64 return id;
65 }
66
67 public static int UnixTimeSinceEpoch()
68 {
69 TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
70 int timestamp = (int)t.TotalSeconds;
71 return timestamp;
72 }
73
74 public static string Md5Hash(string pass)
75 {
76 MD5 md5 = MD5CryptoServiceProvider.Create();
77 byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass));
78 StringBuilder sb = new StringBuilder();
79 for (int i = 0; i < dataMd5.Length; i++)
80 sb.AppendFormat("{0:x2}", dataMd5[i]);
81 return sb.ToString();
82 }
83
84 public static string GetRandomCapsPath()
85 {
86 LLUUID caps = LLUUID.Random();
87 string capsPath = caps.ToStringHyphenated();
88 capsPath = capsPath.Remove(capsPath.Length - 4, 4);
89 return capsPath;
90 }
91
92 //public static int fast_distance2d(int x, int y)
93 //{
94 // x = System.Math.Abs(x);
95 // y = System.Math.Abs(y);
96
97 // int min = System.Math.Min(x, y);
98
99 // return (x + y - (min >> 1) - (min >> 2) + (min >> 4));
100 //}
101
102 public static string FieldToString(byte[] bytes)
103 {
104 return FieldToString(bytes, String.Empty);
105 }
106
107 /// <summary>
108 /// Convert a variable length field (byte array) to a string, with a
109 /// field name prepended to each line of the output
110 /// </summary>
111 /// <remarks>If the byte array has unprintable characters in it, a
112 /// hex dump will be put in the string instead</remarks>
113 /// <param name="bytes">The byte array to convert to a string</param>
114 /// <param name="fieldName">A field name to prepend to each line of output</param>
115 /// <returns>An ASCII string or a string containing a hex dump, minus
116 /// the null terminator</returns>
117 public static string FieldToString(byte[] bytes, string fieldName)
118 {
119 // Check for a common case
120 if (bytes.Length == 0) return String.Empty;
121
122 StringBuilder output = new StringBuilder();
123 bool printable = true;
124
125 for (int i = 0; i < bytes.Length; ++i)
126 {
127 // Check if there are any unprintable characters in the array
128 if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09
129 && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00)
130 {
131 printable = false;
132 break;
133 }
134 }
135
136 if (printable)
137 {
138 if (fieldName.Length > 0)
139 {
140 output.Append(fieldName);
141 output.Append(": ");
142 }
143
144 if (bytes[bytes.Length - 1] == 0x00)
145 output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1));
146 else
147 output.Append(UTF8Encoding.UTF8.GetString(bytes));
148 }
149 else
150 {
151 for (int i = 0; i < bytes.Length; i += 16)
152 {
153 if (i != 0)
154 output.Append(Environment.NewLine);
155 if (fieldName.Length > 0)
156 {
157 output.Append(fieldName);
158 output.Append(": ");
159 }
160
161 for (int j = 0; j < 16; j++)
162 {
163 if ((i + j) < bytes.Length)
164 output.Append(String.Format("{0:X2} ", bytes[i + j]));
165 else
166 output.Append(" ");
167 }
168
169 for (int j = 0; j < 16 && (i + j) < bytes.Length; j++)
170 {
171 if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E)
172 output.Append((char)bytes[i + j]);
173 else
174 output.Append(".");
175 }
176 }
177 }
178
179 return output.ToString();
180 }
181 public Util()
182 {
183
184 }
185 }
186}
diff --git a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj
deleted file mode 100644
index df68722..0000000
--- a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj
+++ /dev/null
@@ -1,93 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{E88EF749-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.GenericConfig.Xml</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.GenericConfig.Xml</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 </ItemGroup>
70 <ItemGroup>
71 <ProjectReference Include="..\..\OpenSim.Framework\OpenSim.Framework.csproj">
72 <Name>OpenSim.Framework</Name>
73 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
74 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
75 <Private>False</Private>
76 </ProjectReference>
77 </ItemGroup>
78 <ItemGroup>
79 <Compile Include="XmlConfig.cs">
80 <SubType>Code</SubType>
81 </Compile>
82 <Compile Include="Properties\AssemblyInfo.cs">
83 <SubType>Code</SubType>
84 </Compile>
85 </ItemGroup>
86 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
87 <PropertyGroup>
88 <PreBuildEvent>
89 </PreBuildEvent>
90 <PostBuildEvent>
91 </PostBuildEvent>
92 </PropertyGroup>
93</Project>
diff --git a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build
deleted file mode 100644
index 075ea7f..0000000
--- a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build
+++ /dev/null
@@ -1,42 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.GenericConfig.Xml" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.GenericConfig.Xml" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="XmlConfig.cs" />
15 <include name="Properties/AssemblyInfo.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="../../../bin/OpenSim.Framework.dll" />
23 <include name="System.dll" />
24 <include name="System.Xml.dll" />
25 </references>
26 </csc>
27 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
28 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
29 <copy todir="${project::get-base-directory()}/../../../bin/">
30 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
31 <include name="*.dll"/>
32 <include name="*.exe"/>
33 </fileset>
34 </copy>
35 </target>
36 <target name="clean">
37 <delete dir="${bin.dir}" failonerror="false" />
38 <delete dir="${obj.dir}" failonerror="false" />
39 </target>
40 <target name="doc" description="Creates documentation.">
41 </target>
42</project>
diff --git a/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs b/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs
deleted file mode 100644
index de5f48d..0000000
--- a/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.GenericConfig")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.GenericConfig")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("285a3047-f165-46c8-8767-b51428738a09")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs b/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs
deleted file mode 100644
index c526aec..0000000
--- a/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs
+++ /dev/null
@@ -1,123 +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 System.Xml;
32using OpenSim.Framework.Interfaces;
33
34namespace OpenSim.GenericConfig
35{
36 public class XmlConfig : IGenericConfig
37 {
38 private XmlDocument doc;
39 private XmlNode rootNode;
40 private XmlNode configNode;
41 private string fileName;
42 private bool createdFile = false;
43
44 public XmlConfig(string filename)
45 {
46 fileName = filename;
47 }
48
49 public void LoadData()
50 {
51 doc = new XmlDocument();
52
53 if (System.IO.File.Exists(fileName))
54 {
55 XmlTextReader reader = new XmlTextReader(fileName);
56 reader.WhitespaceHandling = WhitespaceHandling.None;
57 doc.Load(reader);
58 reader.Close();
59 }
60 else
61 {
62 createdFile = true;
63 rootNode = doc.CreateNode(XmlNodeType.Element, "Root", "");
64 doc.AppendChild(rootNode);
65 configNode = doc.CreateNode(XmlNodeType.Element, "Config", "");
66 rootNode.AppendChild(configNode);
67 }
68
69
70 rootNode = doc.FirstChild;
71 if (rootNode.Name != "Root")
72 throw new Exception("Error: Invalid .xml File. Missing <Root>");
73
74 configNode = rootNode.FirstChild;
75 if (configNode.Name != "Config")
76 throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
77
78 if (createdFile)
79 {
80 this.Commit();
81 }
82 }
83
84 public string GetAttribute(string attributeName)
85 {
86 string result = "";
87 if (configNode.Attributes[attributeName] != null)
88 {
89 result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value;
90 }
91 return result;
92 }
93
94 public bool SetAttribute(string attributeName, string attributeValue)
95 {
96 if (configNode.Attributes[attributeName] != null)
97 {
98 ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue;
99 }
100 else
101 {
102 XmlAttribute attri;
103 attri = doc.CreateAttribute(attributeName);
104 attri.Value = attributeValue;
105 configNode.Attributes.Append(attri);
106 }
107 return true;
108 }
109
110 public void Commit()
111 {
112 doc.Save(fileName);
113 }
114
115 public void Close()
116 {
117 configNode = null;
118 rootNode = null;
119 doc = null;
120 }
121
122 }
123}
diff --git a/Common/OpenSim.Servers/BaseHttpServer.cs b/Common/OpenSim.Servers/BaseHttpServer.cs
deleted file mode 100644
index e55e33c..0000000
--- a/Common/OpenSim.Servers/BaseHttpServer.cs
+++ /dev/null
@@ -1,312 +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.Net;
31using System.Text;
32using System.Text.RegularExpressions;
33using System.Threading;
34//using OpenSim.CAPS;
35using Nwc.XmlRpc;
36using System.Collections;
37using OpenSim.Framework.Console;
38
39namespace OpenSim.Servers
40{
41 public class BaseHttpServer
42 {
43 protected class RestMethodEntry
44 {
45 private string m_path;
46 public string Path
47 {
48 get { return m_path; }
49 }
50
51 private RestMethod m_restMethod;
52 public RestMethod RestMethod
53 {
54 get { return m_restMethod; }
55 }
56
57 public RestMethodEntry(string path, RestMethod restMethod)
58 {
59 m_path = path;
60 m_restMethod = restMethod;
61 }
62 }
63
64 protected Thread m_workerThread;
65 protected HttpListener m_httpListener;
66 protected Dictionary<string, RestMethodEntry> m_restHandlers = new Dictionary<string, RestMethodEntry>();
67 protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>();
68 protected int m_port;
69 protected bool firstcaps = true;
70
71 public BaseHttpServer(int port)
72 {
73 m_port = port;
74 }
75
76 public bool AddRestHandler(string method, string path, RestMethod handler)
77 {
78 //Console.WriteLine("adding new REST handler for path " + path);
79 string methodKey = String.Format("{0}: {1}", method, path);
80
81 if (!this.m_restHandlers.ContainsKey(methodKey))
82 {
83 this.m_restHandlers.Add(methodKey, new RestMethodEntry(path, handler));
84 return true;
85 }
86
87 //must already have a handler for that path so return false
88 return false;
89 }
90
91 public bool RemoveRestHandler(string method, string path)
92 {
93 string methodKey = String.Format("{0}: {1}", method, path);
94 if (this.m_restHandlers.ContainsKey(methodKey))
95 {
96 this.m_restHandlers.Remove(methodKey);
97 return true;
98 }
99 return false;
100 }
101
102 public bool AddXmlRPCHandler(string method, XmlRpcMethod handler)
103 {
104 if (!this.m_rpcHandlers.ContainsKey(method))
105 {
106 this.m_rpcHandlers.Add(method, handler);
107 return true;
108 }
109
110 //must already have a handler for that path so return false
111 return false;
112 }
113
114 protected virtual string ProcessXMLRPCMethod(string methodName, XmlRpcRequest request)
115 {
116 XmlRpcResponse response;
117
118 XmlRpcMethod method;
119 if (this.m_rpcHandlers.TryGetValue(methodName, out method))
120 {
121 response = method(request);
122 }
123 else
124 {
125 response = new XmlRpcResponse();
126 Hashtable unknownMethodError = new Hashtable();
127 unknownMethodError["reason"] = "XmlRequest"; ;
128 unknownMethodError["message"] = "Unknown Rpc request";
129 unknownMethodError["login"] = "false";
130 response.Value = unknownMethodError;
131 }
132
133 return XmlRpcResponseSerializer.Singleton.Serialize(response);
134 }
135
136 protected virtual string ParseREST(string request, string path, string method)
137 {
138 string response;
139
140 string requestKey = String.Format("{0}: {1}", method, path);
141
142 string bestMatch = String.Empty;
143 foreach (string currentKey in m_restHandlers.Keys)
144 {
145 if (requestKey.StartsWith(currentKey))
146 {
147 if (currentKey.Length > bestMatch.Length)
148 {
149 bestMatch = currentKey;
150 }
151 }
152 }
153
154 RestMethodEntry restMethodEntry;
155 if (m_restHandlers.TryGetValue(bestMatch, out restMethodEntry))
156 {
157 RestMethod restMethod = restMethodEntry.RestMethod;
158
159 string param = path.Substring(restMethodEntry.Path.Length);
160 response = restMethod(request, path, param);
161
162 }
163 else
164 {
165 response = String.Empty;
166 }
167
168 return response;
169 }
170
171 protected virtual string ParseLLSDXML(string requestBody)
172 {
173 // dummy function for now - IMPLEMENT ME!
174 Console.WriteLine("LLSD request "+requestBody);
175 string resp = "";
176 if (firstcaps)
177 {
178 resp = "<llsd><map><key>MapLayer</key><string>http://127.0.0.1:9000/CAPS/</string></map></llsd>";
179 firstcaps = false;
180 }
181 return resp;
182 }
183
184 protected virtual string ParseXMLRPC(string requestBody)
185 {
186 string responseString = String.Empty;
187
188 try
189 {
190 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
191
192 string methodName = request.MethodName;
193
194 responseString = ProcessXMLRPCMethod(methodName, request);
195 }
196 catch (Exception e)
197 {
198 Console.WriteLine(e.ToString());
199 }
200 return responseString;
201 }
202
203 public virtual void HandleRequest(Object stateinfo)
204 {
205 try
206 {
207 HttpListenerContext context = (HttpListenerContext)stateinfo;
208
209 HttpListenerRequest request = context.Request;
210 HttpListenerResponse response = context.Response;
211
212 response.KeepAlive = false;
213 response.SendChunked = false;
214
215 System.IO.Stream body = request.InputStream;
216 System.Text.Encoding encoding = System.Text.Encoding.UTF8;
217 System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
218
219 string requestBody = reader.ReadToEnd();
220 body.Close();
221 reader.Close();
222
223 //Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType);
224 //Console.WriteLine(requestBody);
225
226 string responseString = "";
227 // Console.WriteLine("new request " + request.ContentType +" at "+ request.RawUrl);
228 switch (request.ContentType)
229 {
230 case "text/xml":
231 // must be XML-RPC, so pass to the XML-RPC parser
232
233 responseString = ParseXMLRPC(requestBody);
234 responseString = Regex.Replace(responseString, "utf-16", "utf-8");
235
236 response.AddHeader("Content-type", "text/xml");
237 break;
238
239 case "application/xml":
240 // probably LLSD we hope, otherwise it should be ignored by the parser
241 // responseString = ParseLLSDXML(requestBody);
242 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
243 response.AddHeader("Content-type", "application/xml");
244 break;
245
246 case "application/octet-stream":
247 // probably LLSD we hope, otherwise it should be ignored by the parser
248 // responseString = ParseLLSDXML(requestBody);
249 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
250 response.AddHeader("Content-type", "application/xml");
251 break;
252
253 case "application/x-www-form-urlencoded":
254 // a form data POST so send to the REST parser
255 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
256 response.AddHeader("Content-type", "text/html");
257 break;
258
259 case null:
260 // must be REST or invalid crap, so pass to the REST parser
261 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
262 response.AddHeader("Content-type", "text/html");
263 break;
264
265 }
266
267 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
268 System.IO.Stream output = response.OutputStream;
269 response.SendChunked = false;
270 response.ContentLength64 = buffer.Length;
271 output.Write(buffer, 0, buffer.Length);
272 output.Close();
273 }
274 catch (Exception e)
275 {
276 Console.WriteLine(e.ToString());
277 }
278 }
279
280 public void Start()
281 {
282 OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server");
283
284 m_workerThread = new Thread(new ThreadStart(StartHTTP));
285 m_workerThread.IsBackground = true;
286 m_workerThread.Start();
287 }
288
289 private void StartHTTP()
290 {
291 try
292 {
293 OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK");
294 m_httpListener = new HttpListener();
295
296 m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
297 m_httpListener.Start();
298
299 HttpListenerContext context;
300 while (true)
301 {
302 context = m_httpListener.GetContext();
303 ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context);
304 }
305 }
306 catch (Exception e)
307 {
308 OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.MEDIUM, e.Message);
309 }
310 }
311 }
312}
diff --git a/Common/OpenSim.Servers/CheckSumServer.cs b/Common/OpenSim.Servers/CheckSumServer.cs
deleted file mode 100644
index a359205..0000000
--- a/Common/OpenSim.Servers/CheckSumServer.cs
+++ /dev/null
@@ -1,141 +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.Text;
30using System.IO;
31using System.Threading;
32using System.Net;
33using System.Net.Sockets;
34using System.Timers;
35using System.Reflection;
36using System.Collections;
37using System.Collections.Generic;
38using libsecondlife;
39using libsecondlife.Packets;
40using OpenSim.Framework.Console;
41
42
43namespace OpenSim.Servers
44{
45/* public class CheckSumServer : UDPServerBase
46 {
47 //protected ConsoleBase m_log;
48
49 public CheckSumServer(int port)
50 : base(port)
51 {
52 }
53
54 protected override void OnReceivedData(IAsyncResult result)
55 {
56 ipeSender = new IPEndPoint(IPAddress.Any, 0);
57 epSender = (EndPoint)ipeSender;
58 Packet packet = null;
59 int numBytes = Server.EndReceiveFrom(result, ref epSender);
60 int packetEnd = numBytes - 1;
61
62 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
63
64 if (packet.Type == PacketType.SecuredTemplateChecksumRequest)
65 {
66 SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet;
67 TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket();
68 checkreply.DataBlock.Checksum = 3220703154;//180572585;
69 checkreply.DataBlock.Flags = 0;
70 checkreply.DataBlock.MajorVersion = 1;
71 checkreply.DataBlock.MinorVersion = 15;
72 checkreply.DataBlock.PatchVersion = 0;
73 checkreply.DataBlock.ServerVersion = 0;
74 checkreply.TokenBlock.Token = checksum.TokenBlock.Token;
75 this.SendPacket(checkreply, epSender);
76
77 /*
78 //if we wanted to echo the the checksum/ version from the client (so that any client worked)
79 SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket();
80 checkrequest.TokenBlock.Token = checksum.TokenBlock.Token;
81 this.SendPacket(checkrequest, epSender);
82
83 }
84 else if (packet.Type == PacketType.TemplateChecksumReply)
85 {
86 //echo back the client checksum reply (Hegemon's method)
87 TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet;
88 TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket();
89 checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum;
90 checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags;
91 checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion;
92 checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion;
93 checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion;
94 checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion;
95 checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token;
96 this.SendPacket(checkreply2, epSender);
97 }
98 else
99 {
100 }
101
102 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
103 }
104
105 private void SendPacket(Packet Pack, EndPoint endp)
106 {
107 if (!Pack.Header.Resent)
108 {
109 Pack.Header.Sequence = 1;
110 }
111
112 byte[] ZeroOutBuffer = new byte[4096];
113 byte[] sendbuffer;
114 sendbuffer = Pack.ToBytes();
115
116 try
117 {
118 if (Pack.Header.Zerocoded)
119 {
120 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
121 this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp);
122 }
123 else
124 {
125 this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp);
126 }
127 }
128 catch (Exception)
129 {
130 OpenSim.Framework.Console.MainLog.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection ");
131
132 }
133 }
134
135 private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp)
136 {
137 this.Server.SendTo(buffer, size, flags, endp);
138 }
139 *
140 }*/
141} \ No newline at end of file
diff --git a/Common/OpenSim.Servers/IRestHandler.cs b/Common/OpenSim.Servers/IRestHandler.cs
deleted file mode 100644
index 3aa508c..0000000
--- a/Common/OpenSim.Servers/IRestHandler.cs
+++ /dev/null
@@ -1,35 +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;
31
32namespace OpenSim.Servers
33{
34 public delegate string RestMethod( string request, string path, string param );
35}
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.csproj b/Common/OpenSim.Servers/OpenSim.Servers.csproj
deleted file mode 100644
index 6e8eba7..0000000
--- a/Common/OpenSim.Servers/OpenSim.Servers.csproj
+++ /dev/null
@@ -1,125 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{8BB20F0A-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon>
10 </ApplicationIcon>
11 <AssemblyKeyContainerName>
12 </AssemblyKeyContainerName>
13 <AssemblyName>OpenSim.Servers</AssemblyName>
14 <DefaultClientScript>JScript</DefaultClientScript>
15 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
17 <DelaySign>false</DelaySign>
18 <OutputType>Library</OutputType>
19 <AppDesignerFolder>
20 </AppDesignerFolder>
21 <RootNamespace>OpenSim.Servers</RootNamespace>
22 <StartupObject>
23 </StartupObject>
24 <FileUpgradeFlags>
25 </FileUpgradeFlags>
26 </PropertyGroup>
27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
29 <BaseAddress>285212672</BaseAddress>
30 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
31 <ConfigurationOverrideFile>
32 </ConfigurationOverrideFile>
33 <DefineConstants>TRACE;DEBUG</DefineConstants>
34 <DocumentationFile>
35 </DocumentationFile>
36 <DebugSymbols>True</DebugSymbols>
37 <FileAlignment>4096</FileAlignment>
38 <Optimize>False</Optimize>
39 <OutputPath>..\..\bin\</OutputPath>
40 <RegisterForComInterop>False</RegisterForComInterop>
41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
43 <WarningLevel>4</WarningLevel>
44 <NoWarn>
45 </NoWarn>
46 </PropertyGroup>
47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
49 <BaseAddress>285212672</BaseAddress>
50 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
51 <ConfigurationOverrideFile>
52 </ConfigurationOverrideFile>
53 <DefineConstants>TRACE</DefineConstants>
54 <DocumentationFile>
55 </DocumentationFile>
56 <DebugSymbols>False</DebugSymbols>
57 <FileAlignment>4096</FileAlignment>
58 <Optimize>True</Optimize>
59 <OutputPath>..\..\bin\</OutputPath>
60 <RegisterForComInterop>False</RegisterForComInterop>
61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
63 <WarningLevel>4</WarningLevel>
64 <NoWarn>
65 </NoWarn>
66 </PropertyGroup>
67 <ItemGroup>
68 <Reference Include="libsecondlife.dll">
69 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
70 <Private>False</Private>
71 </Reference>
72 <Reference Include="System">
73 <HintPath>System.dll</HintPath>
74 <Private>False</Private>
75 </Reference>
76 <Reference Include="System.Xml">
77 <HintPath>System.Xml.dll</HintPath>
78 <Private>False</Private>
79 </Reference>
80 </ItemGroup>
81 <ItemGroup>
82 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
83 <Name>OpenSim.Framework</Name>
84 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
85 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
86 <Private>False</Private>
87 </ProjectReference>
88 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
89 <Name>OpenSim.Framework.Console</Name>
90 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
91 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
92 <Private>False</Private>
93 </ProjectReference>
94 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
95 <Name>XMLRPC</Name>
96 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
97 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
98 <Private>False</Private>
99 </ProjectReference>
100 </ItemGroup>
101 <ItemGroup>
102 <Compile Include="BaseHttpServer.cs">
103 <SubType>Code</SubType>
104 </Compile>
105 <Compile Include="CheckSumServer.cs">
106 <SubType>Code</SubType>
107 </Compile>
108 <Compile Include="IRestHandler.cs">
109 <SubType>Code</SubType>
110 </Compile>
111 <Compile Include="UDPServerBase.cs">
112 <SubType>Code</SubType>
113 </Compile>
114 <Compile Include="XmlRpcMethod.cs">
115 <SubType>Code</SubType>
116 </Compile>
117 </ItemGroup>
118 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
119 <PropertyGroup>
120 <PreBuildEvent>
121 </PreBuildEvent>
122 <PostBuildEvent>
123 </PostBuildEvent>
124 </PropertyGroup>
125</Project> \ No newline at end of file
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.dll.build b/Common/OpenSim.Servers/OpenSim.Servers.dll.build
deleted file mode 100644
index 4103e73..0000000
--- a/Common/OpenSim.Servers/OpenSim.Servers.dll.build
+++ /dev/null
@@ -1,51 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Servers" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Servers" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="BaseHttpServer.cs" />
15 <include name="CheckSumServer.cs" />
16 <include name="IRestHandler.cs" />
17 <include name="LocalUserProfileManager.cs" />
18 <include name="LoginResponse.cs" />
19 <include name="LoginServer.cs" />
20 <include name="UDPServerBase.cs" />
21 <include name="XmlRpcMethod.cs" />
22 </sources>
23 <references basedir="${project::get-base-directory()}">
24 <lib>
25 <include name="${project::get-base-directory()}" />
26 <include name="${project::get-base-directory()}/${build.dir}" />
27 </lib>
28 <include name="../../bin/libsecondlife.dll" />
29 <include name="../../bin/OpenSim.Framework.dll" />
30 <include name="../../bin/OpenSim.Framework.Console.dll" />
31 <include name="System.dll" />
32 <include name="System.Xml.dll" />
33 <include name="../../bin/XMLRPC.dll" />
34 </references>
35 </csc>
36 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
37 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
38 <copy todir="${project::get-base-directory()}/../../bin/">
39 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
40 <include name="*.dll"/>
41 <include name="*.exe"/>
42 </fileset>
43 </copy>
44 </target>
45 <target name="clean">
46 <delete dir="${bin.dir}" failonerror="false" />
47 <delete dir="${obj.dir}" failonerror="false" />
48 </target>
49 <target name="doc" description="Creates documentation.">
50 </target>
51</project>
diff --git a/Common/OpenSim.Servers/UDPServerBase.cs b/Common/OpenSim.Servers/UDPServerBase.cs
deleted file mode 100644
index b472c97..0000000
--- a/Common/OpenSim.Servers/UDPServerBase.cs
+++ /dev/null
@@ -1,95 +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.Text;
30using System.IO;
31using System.Threading;
32using System.Net;
33using System.Net.Sockets;
34using System.Timers;
35using System.Reflection;
36using System.Collections;
37using System.Collections.Generic;
38using libsecondlife;
39using libsecondlife.Packets;
40
41namespace OpenSim.Servers
42{
43 public class UDPServerBase
44 {
45 public Socket Server;
46 protected IPEndPoint ServerIncoming;
47 protected byte[] RecvBuffer = new byte[4096];
48 protected byte[] ZeroBuffer = new byte[8192];
49 protected IPEndPoint ipeSender;
50 protected EndPoint epSender;
51 protected AsyncCallback ReceivedData;
52 protected int listenPort;
53
54 public UDPServerBase(int port)
55 {
56 listenPort = port;
57 }
58
59 protected virtual void OnReceivedData(IAsyncResult result)
60 {
61 ipeSender = new IPEndPoint(IPAddress.Any, 0);
62 epSender = (EndPoint)ipeSender;
63 Packet packet = null;
64 int numBytes = Server.EndReceiveFrom(result, ref epSender);
65 int packetEnd = numBytes - 1;
66
67 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
68
69 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
70 }
71
72 protected virtual void AddNewClient(Packet packet)
73 {
74 }
75
76 public virtual void ServerListener()
77 {
78
79 ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
80 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
81 Server.Bind(ServerIncoming);
82
83 ipeSender = new IPEndPoint(IPAddress.Any, 0);
84 epSender = (EndPoint)ipeSender;
85 ReceivedData = new AsyncCallback(this.OnReceivedData);
86 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
87 }
88
89 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
90 {
91
92 }
93 }
94}
95
diff --git a/Common/OpenSim.Servers/XmlRpcMethod.cs b/Common/OpenSim.Servers/XmlRpcMethod.cs
deleted file mode 100644
index 05cbf2e..0000000
--- a/Common/OpenSim.Servers/XmlRpcMethod.cs
+++ /dev/null
@@ -1,34 +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 Nwc.XmlRpc;
30
31namespace OpenSim.Servers
32{
33 public delegate XmlRpcResponse XmlRpcMethod( XmlRpcRequest request );
34}
diff --git a/Common/XmlRpcCS/Logger.cs b/Common/XmlRpcCS/Logger.cs
deleted file mode 100644
index ebf804b..0000000
--- a/Common/XmlRpcCS/Logger.cs
+++ /dev/null
@@ -1,46 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4
5 /// <summary>Define levels of logging.</summary><remarks> This duplicates
6 /// similar enumerations in System.Diagnostics.EventLogEntryType. The
7 /// duplication was merited because .NET Compact Framework lacked the EventLogEntryType enum.</remarks>
8 public enum LogLevel
9 {
10 /// <summary>Information level, log entry for informational reasons only.</summary>
11 Information,
12 /// <summary>Warning level, indicates a possible problem.</summary>
13 Warning,
14 /// <summary>Error level, implies a significant problem.</summary>
15 Error
16 }
17
18 ///<summary>
19 ///Logging singleton with swappable output delegate.
20 ///</summary>
21 ///<remarks>
22 ///This singleton provides a centralized log. The actual WriteEntry calls are passed
23 ///off to a delegate however. Having a delegate do the actual logginh allows you to
24 ///implement different logging mechanism and have them take effect throughout the system.
25 ///</remarks>
26 public class Logger
27 {
28 ///<summary>Delegate definition for logging.</summary>
29 ///<param name="message">The message <c>String</c> to log.</param>
30 ///<param name="level">The <c>LogLevel</c> of your message.</param>
31 public delegate void LoggerDelegate(String message, LogLevel level);
32 ///<summary>The LoggerDelegate that will recieve WriteEntry requests.</summary>
33 static public LoggerDelegate Delegate = null;
34
35 ///<summary>
36 ///Method logging events are sent to.
37 ///</summary>
38 ///<param name="message">The message <c>String</c> to log.</param>
39 ///<param name="level">The <c>LogLevel</c> of your message.</param>
40 static public void WriteEntry(String message, LogLevel level)
41 {
42 if (Delegate != null)
43 Delegate(message, level);
44 }
45 }
46}
diff --git a/Common/XmlRpcCS/SimpleHttpRequest.cs b/Common/XmlRpcCS/SimpleHttpRequest.cs
deleted file mode 100644
index e5326c3..0000000
--- a/Common/XmlRpcCS/SimpleHttpRequest.cs
+++ /dev/null
@@ -1,204 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.IO;
5 using System.Net.Sockets;
6 using System.Collections;
7
8 ///<summary>Very basic HTTP request handler.</summary>
9 ///<remarks>This class is designed to accept a TcpClient and treat it as an HTTP request.
10 /// It will do some basic header parsing and manage the input and output streams associated
11 /// with the request.</remarks>
12 public class SimpleHttpRequest
13 {
14 private String _httpMethod = null;
15 private String _protocol;
16 private String _filePathFile = null;
17 private String _filePathDir = null;
18 private String __filePath;
19 private TcpClient _client;
20 private StreamReader _input;
21 private StreamWriter _output;
22 private Hashtable _headers;
23
24 /// <summary>A constructor which accepts the TcpClient.</summary>
25 /// <remarks>It creates the associated input and output streams, determines the request type,
26 /// and parses the remaining HTTP header.</remarks>
27 /// <param name="client">The <c>TcpClient</c> associated with the HTTP connection.</param>
28 public SimpleHttpRequest(TcpClient client)
29 {
30 _client = client;
31 _output = new StreamWriter(client.GetStream());
32 _input = new StreamReader(client.GetStream());
33 GetRequestMethod();
34 GetRequestHeaders();
35 }
36
37 /// <summary>The output <c>StreamWriter</c> associated with the request.</summary>
38 public StreamWriter Output
39 {
40 get { return _output; }
41 }
42
43 /// <summary>The input <c>StreamReader</c> associated with the request.</summary>
44 public StreamReader Input
45 {
46 get { return _input; }
47 }
48
49 /// <summary>The <c>TcpClient</c> with the request.</summary>
50 public TcpClient Client
51 {
52 get { return _client; }
53 }
54
55 private String _filePath
56 {
57 get { return __filePath; }
58 set
59 {
60 __filePath = value;
61 _filePathDir = null;
62 _filePathFile = null;
63 }
64 }
65
66 /// <summary>The type of HTTP request (i.e. PUT, GET, etc.).</summary>
67 public String HttpMethod
68 {
69 get { return _httpMethod; }
70 }
71
72 /// <summary>The level of the HTTP protocol.</summary>
73 public String Protocol
74 {
75 get { return _protocol; }
76 }
77
78 /// <summary>The "path" which is part of any HTTP request.</summary>
79 public String FilePath
80 {
81 get { return _filePath; }
82 }
83
84 /// <summary>The file portion of the "path" which is part of any HTTP request.</summary>
85 public String FilePathFile
86 {
87 get
88 {
89 if (_filePathFile != null)
90 return _filePathFile;
91
92 int i = FilePath.LastIndexOf("/");
93
94 if (i == -1)
95 return "";
96
97 i++;
98 _filePathFile = FilePath.Substring(i, FilePath.Length - i);
99 return _filePathFile;
100 }
101 }
102
103 /// <summary>The directory portion of the "path" which is part of any HTTP request.</summary>
104 public String FilePathDir
105 {
106 get
107 {
108 if (_filePathDir != null)
109 return _filePathDir;
110
111 int i = FilePath.LastIndexOf("/");
112
113 if (i == -1)
114 return "";
115
116 i++;
117 _filePathDir = FilePath.Substring(0, i);
118 return _filePathDir;
119 }
120 }
121
122 private void GetRequestMethod()
123 {
124 string req = _input.ReadLine();
125 if (req == null)
126 throw new ApplicationException("Void request.");
127
128 if (0 == String.Compare("GET ", req.Substring(0, 4), true))
129 _httpMethod = "GET";
130 else if (0 == String.Compare("POST ", req.Substring(0, 5), true))
131 _httpMethod = "POST";
132 else
133 throw new InvalidOperationException("Unrecognized method in query: " + req);
134
135 req = req.TrimEnd();
136 int idx = req.IndexOf(' ') + 1;
137 if (idx >= req.Length)
138 throw new ApplicationException("What do you want?");
139
140 string page_protocol = req.Substring(idx);
141 int idx2 = page_protocol.IndexOf(' ');
142 if (idx2 == -1)
143 idx2 = page_protocol.Length;
144
145 _filePath = page_protocol.Substring(0, idx2).Trim();
146 _protocol = page_protocol.Substring(idx2).Trim();
147 }
148
149 private void GetRequestHeaders()
150 {
151 String line;
152 int idx;
153
154 _headers = new Hashtable();
155
156 while ((line = _input.ReadLine()) != "")
157 {
158 if (line == null)
159 {
160 break;
161 }
162
163 idx = line.IndexOf(':');
164 if (idx == -1 || idx == line.Length - 1)
165 {
166 Logger.WriteEntry("Malformed header line: " + line, LogLevel.Information);
167 continue;
168 }
169
170 String key = line.Substring(0, idx);
171 String value = line.Substring(idx + 1);
172
173 try
174 {
175 _headers.Add(key, value);
176 }
177 catch (Exception)
178 {
179 Logger.WriteEntry("Duplicate header key in line: " + line, LogLevel.Information);
180 }
181 }
182 }
183
184 /// <summary>
185 /// Format the object contents into a useful string representation.
186 /// </summary>
187 ///<returns><c>String</c> representation of the <c>SimpleHttpRequest</c> as the <i>HttpMethod FilePath Protocol</i>.</returns>
188 override public String ToString()
189 {
190 return HttpMethod + " " + FilePath + " " + Protocol;
191 }
192
193 /// <summary>
194 /// Close the <c>SimpleHttpRequest</c>. This flushes and closes all associated io streams.
195 /// </summary>
196 public void Close()
197 {
198 _output.Flush();
199 _output.Close();
200 _input.Close();
201 _client.Close();
202 }
203 }
204}
diff --git a/Common/XmlRpcCS/XMLRPC.csproj b/Common/XmlRpcCS/XMLRPC.csproj
deleted file mode 100644
index 61f8be0..0000000
--- a/Common/XmlRpcCS/XMLRPC.csproj
+++ /dev/null
@@ -1,138 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{8E81D43C-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>XMLRPC</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>XMLRPC</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 </ItemGroup>
70 <ItemGroup>
71 </ItemGroup>
72 <ItemGroup>
73 <Compile Include="Logger.cs">
74 <SubType>Code</SubType>
75 </Compile>
76 <Compile Include="SimpleHttpRequest.cs">
77 <SubType>Code</SubType>
78 </Compile>
79 <Compile Include="XmlRpcBoxcarRequest.cs">
80 <SubType>Code</SubType>
81 </Compile>
82 <Compile Include="XmlRpcClientProxy.cs">
83 <SubType>Code</SubType>
84 </Compile>
85 <Compile Include="XmlRpcDeserializer.cs">
86 <SubType>Code</SubType>
87 </Compile>
88 <Compile Include="XmlRpcErrorCodes.cs">
89 <SubType>Code</SubType>
90 </Compile>
91 <Compile Include="XmlRpcException.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="XmlRpcExposedAttribute.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="XmlRpcRequest.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="XmlRpcRequestDeserializer.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 <Compile Include="XmlRpcRequestSerializer.cs">
104 <SubType>Code</SubType>
105 </Compile>
106 <Compile Include="XmlRpcResponder.cs">
107 <SubType>Code</SubType>
108 </Compile>
109 <Compile Include="XmlRpcResponse.cs">
110 <SubType>Code</SubType>
111 </Compile>
112 <Compile Include="XmlRpcResponseDeserializer.cs">
113 <SubType>Code</SubType>
114 </Compile>
115 <Compile Include="XmlRpcResponseSerializer.cs">
116 <SubType>Code</SubType>
117 </Compile>
118 <Compile Include="XmlRpcSerializer.cs">
119 <SubType>Code</SubType>
120 </Compile>
121 <Compile Include="XmlRpcServer.cs">
122 <SubType>Code</SubType>
123 </Compile>
124 <Compile Include="XmlRpcSystemObject.cs">
125 <SubType>Code</SubType>
126 </Compile>
127 <Compile Include="XmlRpcXmlTokens.cs">
128 <SubType>Code</SubType>
129 </Compile>
130 </ItemGroup>
131 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
132 <PropertyGroup>
133 <PreBuildEvent>
134 </PreBuildEvent>
135 <PostBuildEvent>
136 </PostBuildEvent>
137 </PropertyGroup>
138</Project>
diff --git a/Common/XmlRpcCS/XMLRPC.dll.build b/Common/XmlRpcCS/XMLRPC.dll.build
deleted file mode 100644
index 2eabfcd..0000000
--- a/Common/XmlRpcCS/XMLRPC.dll.build
+++ /dev/null
@@ -1,58 +0,0 @@
1<?xml version="1.0" ?>
2<project name="XMLRPC" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="XMLRPC" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="Logger.cs" />
15 <include name="SimpleHttpRequest.cs" />
16 <include name="XmlRpcBoxcarRequest.cs" />
17 <include name="XmlRpcClientProxy.cs" />
18 <include name="XmlRpcDeserializer.cs" />
19 <include name="XmlRpcErrorCodes.cs" />
20 <include name="XmlRpcException.cs" />
21 <include name="XmlRpcExposedAttribute.cs" />
22 <include name="XmlRpcRequest.cs" />
23 <include name="XmlRpcRequestDeserializer.cs" />
24 <include name="XmlRpcRequestSerializer.cs" />
25 <include name="XmlRpcResponder.cs" />
26 <include name="XmlRpcResponse.cs" />
27 <include name="XmlRpcResponseDeserializer.cs" />
28 <include name="XmlRpcResponseSerializer.cs" />
29 <include name="XmlRpcSerializer.cs" />
30 <include name="XmlRpcServer.cs" />
31 <include name="XmlRpcSystemObject.cs" />
32 <include name="XmlRpcXmlTokens.cs" />
33 </sources>
34 <references basedir="${project::get-base-directory()}">
35 <lib>
36 <include name="${project::get-base-directory()}" />
37 <include name="${project::get-base-directory()}/${build.dir}" />
38 </lib>
39 <include name="System.dll" />
40 <include name="System.Xml.dll" />
41 </references>
42 </csc>
43 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
44 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
45 <copy todir="${project::get-base-directory()}/../../bin/">
46 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
47 <include name="*.dll"/>
48 <include name="*.exe"/>
49 </fileset>
50 </copy>
51 </target>
52 <target name="clean">
53 <delete dir="${bin.dir}" failonerror="false" />
54 <delete dir="${obj.dir}" failonerror="false" />
55 </target>
56 <target name="doc" description="Creates documentation.">
57 </target>
58</project>
diff --git a/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs b/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs
deleted file mode 100644
index f87f7a5..0000000
--- a/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs
+++ /dev/null
@@ -1,51 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7 using System.Net;
8 using System.Text;
9 using System.Reflection;
10
11 /// <summary>Class that collects individual <c>XmlRpcRequest</c> objects and submits them as a <i>boxcarred</i> request.</summary>
12 /// <remarks>A boxcared request is when a number of request are collected before being sent via XML-RPC, and then are sent via
13 /// a single HTTP connection. This results in a speed up from reduced connection time. The results are then retuned collectively
14 /// as well.
15 ///</remarks>
16 /// <seealso cref="XmlRpcRequest"/>
17 public class XmlRpcBoxcarRequest : XmlRpcRequest
18 {
19 /// <summary>ArrayList to collect the requests to boxcar.</summary>
20 public IList Requests = new ArrayList();
21
22 /// <summary>Basic constructor.</summary>
23 public XmlRpcBoxcarRequest()
24 {
25 }
26
27 /// <summary>Returns the <c>String</c> "system.multiCall" which is the server method that handles boxcars.</summary>
28 public override String MethodName
29 {
30 get { return "system.multiCall"; }
31 }
32
33 /// <summary>The <c>ArrayList</c> of boxcarred <paramref>Requests</paramref> as properly formed parameters.</summary>
34 public override IList Params
35 {
36 get {
37 _params.Clear();
38 ArrayList reqArray = new ArrayList();
39 foreach (XmlRpcRequest request in Requests)
40 {
41 Hashtable requestEntry = new Hashtable();
42 requestEntry.Add(XmlRpcXmlTokens.METHOD_NAME, request.MethodName);
43 requestEntry.Add(XmlRpcXmlTokens.PARAMS, request.Params);
44 reqArray.Add(requestEntry);
45 }
46 _params.Add(reqArray);
47 return _params;
48 }
49 }
50 }
51}
diff --git a/Common/XmlRpcCS/XmlRpcClientProxy.cs b/Common/XmlRpcCS/XmlRpcClientProxy.cs
deleted file mode 100644
index f52273a..0000000
--- a/Common/XmlRpcCS/XmlRpcClientProxy.cs
+++ /dev/null
@@ -1,61 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Runtime.Remoting.Proxies;
5 using System.Runtime.Remoting.Messaging;
6
7 /// <summary>This class provides support for creating local proxies of XML-RPC remote objects</summary>
8 /// <remarks>
9 /// To create a local proxy you need to create a local C# interface and then, via <i>createProxy</i>
10 /// associate that interface with a remote object at a given URL.
11 /// </remarks>
12public class XmlRpcClientProxy : RealProxy
13{
14 private String _remoteObjectName;
15 private String _url;
16 private XmlRpcRequest _client = new XmlRpcRequest();
17
18 /// <summary>Factory method to create proxies.</summary>
19 /// <remarks>
20 /// To create a local proxy you need to create a local C# interface with methods that mirror those of the server object.
21 /// Next, pass that interface into <c>createProxy</c> along with the object name and URL of the remote object and
22 /// cast the resulting object to the specifice interface.
23 /// </remarks>
24 /// <param name="remoteObjectName"><c>String</c> The name of the remote object.</param>
25 /// <param name="url"><c>String</c> The URL of the remote object.</param>
26 /// <param name="anInterface"><c>Type</c> The typeof() of a C# interface.</param>
27 /// <returns><c>Object</c> A proxy for your specified interface. Cast to appropriate type.</returns>
28 public static Object createProxy(String remoteObjectName, String url, Type anInterface)
29 {
30 return new XmlRpcClientProxy(remoteObjectName, url, anInterface).GetTransparentProxy();
31 }
32
33 private XmlRpcClientProxy(String remoteObjectName, String url, Type t) : base(t)
34 {
35 _remoteObjectName = remoteObjectName;
36 _url = url;
37 }
38
39 /// <summary>The local method dispatcher - do not invoke.</summary>
40 override public IMessage Invoke(IMessage msg)
41 {
42 IMethodCallMessage methodMessage = (IMethodCallMessage)msg;
43
44 _client.MethodName = _remoteObjectName + "." + methodMessage.MethodName;
45 _client.Params.Clear();
46 foreach (Object o in methodMessage.Args)
47 _client.Params.Add(o);
48
49 try
50 {
51 Object ret = _client.Invoke(_url);
52 return new ReturnMessage(ret,null,0,
53 methodMessage.LogicalCallContext, methodMessage);
54 }
55 catch (Exception e)
56 {
57 return new ReturnMessage(e, methodMessage);
58 }
59 }
60}
61}
diff --git a/Common/XmlRpcCS/XmlRpcDeserializer.cs b/Common/XmlRpcCS/XmlRpcDeserializer.cs
deleted file mode 100644
index bd736c0..0000000
--- a/Common/XmlRpcCS/XmlRpcDeserializer.cs
+++ /dev/null
@@ -1,195 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7 using System.Globalization;
8
9 /// <summary>Parser context, we maintain contexts in a stack to avoiding recursion. </summary>
10 struct Context
11 {
12 public String Name;
13 public Object Container;
14 }
15
16 /// <summary>Basic XML-RPC data deserializer.</summary>
17 /// <remarks>Uses <c>XmlTextReader</c> to parse the XML data. This level of the class
18 /// only handles the tokens common to both Requests and Responses. This class is not useful in and of itself
19 /// but is designed to be subclassed.</remarks>
20 public class XmlRpcDeserializer : XmlRpcXmlTokens
21 {
22 private static DateTimeFormatInfo _dateFormat = new DateTimeFormatInfo();
23
24 private Object _container;
25 private Stack _containerStack;
26
27 /// <summary>Protected reference to last text.</summary>
28 protected String _text;
29 /// <summary>Protected reference to last deserialized value.</summary>
30 protected Object _value;
31 /// <summary>Protected reference to last name field.</summary>
32 protected String _name;
33
34
35 /// <summary>Basic constructor.</summary>
36 public XmlRpcDeserializer()
37 {
38 Reset();
39 _dateFormat.FullDateTimePattern = ISO_DATETIME;
40 }
41
42 /// <summary>Static method that parses XML data into a response using the Singleton.</summary>
43 /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
44 /// <returns><c>Object</c> object resulting from the deserialization.</returns>
45 virtual public Object Deserialize(TextReader xmlData)
46 {
47 return null;
48 }
49
50 /// <summary>Protected method to parse a node in an XML-RPC XML stream.</summary>
51 /// <remarks>Method deals with elements common to all XML-RPC data, subclasses of
52 /// this object deal with request/response spefic elements.</remarks>
53 /// <param name="reader"><c>XmlTextReader</c> of the in progress parsing data stream.</param>
54 protected void DeserializeNode(XmlTextReader reader)
55 {
56 switch (reader.NodeType)
57 {
58 case XmlNodeType.Element:
59 if (Logger.Delegate != null)
60 Logger.WriteEntry("START " + reader.Name, LogLevel.Information);
61 switch (reader.Name)
62 {
63 case VALUE:
64 _value = null;
65 _text = null;
66 break;
67 case STRUCT:
68 PushContext();
69 _container = new Hashtable();
70 break;
71 case ARRAY:
72 PushContext();
73 _container = new ArrayList();
74 break;
75 }
76 break;
77 case XmlNodeType.EndElement:
78 if (Logger.Delegate != null)
79 Logger.WriteEntry("END " + reader.Name, LogLevel.Information);
80 switch (reader.Name)
81 {
82 case BASE64:
83 _value = Convert.FromBase64String(_text);
84 break;
85 case BOOLEAN:
86 int val = Int16.Parse(_text);
87 if (val == 0)
88 _value = false;
89 else if (val == 1)
90 _value = true;
91 break;
92 case STRING:
93 _value = _text;
94 break;
95 case DOUBLE:
96 _value = Double.Parse(_text);
97 break;
98 case INT:
99 case ALT_INT:
100 _value = Int32.Parse(_text);
101 break;
102 case DATETIME:
103#if __MONO__
104 _value = DateParse(_text);
105#else
106 _value = DateTime.ParseExact(_text, "F", _dateFormat);
107#endif
108 break;
109 case NAME:
110 _name = _text;
111 break;
112 case VALUE:
113 if (_value == null)
114 _value = _text; // some kits don't use <string> tag, they just do <value>
115
116 if ((_container != null) && (_container is IList)) // in an array? If so add value to it.
117 ((IList)_container).Add(_value);
118 break;
119 case MEMBER:
120 if ((_container != null) && (_container is IDictionary)) // in an struct? If so add value to it.
121 ((IDictionary)_container).Add(_name, _value);
122 break;
123 case ARRAY:
124 case STRUCT:
125 _value = _container;
126 PopContext();
127 break;
128 }
129 break;
130 case XmlNodeType.Text:
131 if (Logger.Delegate != null)
132 Logger.WriteEntry("Text " + reader.Value, LogLevel.Information);
133 _text = reader.Value;
134 break;
135 default:
136 break;
137 }
138 }
139
140 /// <summary>Static method that parses XML in a <c>String</c> into a
141 /// request using the Singleton.</summary>
142 /// <param name="xmlData"><c>String</c> containing an XML-RPC request.</param>
143 /// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
144 public Object Deserialize(String xmlData)
145 {
146 StringReader sr = new StringReader(xmlData);
147 return Deserialize(sr);
148 }
149
150 /// <summary>Pop a Context of the stack, an Array or Struct has closed.</summary>
151 private void PopContext()
152 {
153 Context c = (Context)_containerStack.Pop();
154 _container = c.Container;
155 _name = c.Name;
156 }
157
158 /// <summary>Push a Context on the stack, an Array or Struct has opened.</summary>
159 private void PushContext()
160 {
161 Context context;
162
163 context.Container = _container;
164 context.Name = _name;
165
166 _containerStack.Push(context);
167 }
168
169 /// <summary>Reset the internal state of the deserializer.</summary>
170 protected void Reset()
171 {
172 _text = null;
173 _value = null;
174 _name = null;
175 _container = null;
176 _containerStack = new Stack();
177 }
178
179#if __MONO__
180 private DateTime DateParse(String str)
181 {
182 int year = Int32.Parse(str.Substring(0,4));
183 int month = Int32.Parse(str.Substring(4,2));
184 int day = Int32.Parse(str.Substring(6,2));
185 int hour = Int32.Parse(str.Substring(9,2));
186 int min = Int32.Parse(str.Substring(12,2));
187 int sec = Int32.Parse(str.Substring(15,2));
188 return new DateTime(year,month,day,hour,min,sec);
189 }
190#endif
191
192 }
193}
194
195
diff --git a/Common/XmlRpcCS/XmlRpcErrorCodes.cs b/Common/XmlRpcCS/XmlRpcErrorCodes.cs
deleted file mode 100644
index 6dec57d..0000000
--- a/Common/XmlRpcCS/XmlRpcErrorCodes.cs
+++ /dev/null
@@ -1,51 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4
5 /// <summary>Standard XML-RPC error codes.</summary>
6 public class XmlRpcErrorCodes
7 {
8 /// <summary></summary>
9 public const int PARSE_ERROR_MALFORMED = -32700;
10 /// <summary></summary>
11 public const String PARSE_ERROR_MALFORMED_MSG = "Parse Error, not well formed";
12
13 /// <summary></summary>
14 public const int PARSE_ERROR_ENCODING = -32701;
15 /// <summary></summary>
16 public const String PARSE_ERROR_ENCODING_MSG = "Parse Error, unsupported encoding";
17
18 //
19 // -32702 ---> parse error. invalid character for encoding
20 // -32600 ---> server error. invalid xml-rpc. not conforming to spec.
21 //
22
23 /// <summary></summary>
24 public const int SERVER_ERROR_METHOD = -32601;
25 /// <summary></summary>
26 public const String SERVER_ERROR_METHOD_MSG = "Server Error, requested method not found";
27
28 /// <summary></summary>
29 public const int SERVER_ERROR_PARAMS = -32602;
30 /// <summary></summary>
31 public const String SERVER_ERROR_PARAMS_MSG = "Server Error, invalid method parameters";
32
33 //
34 // -32603 ---> server error. internal xml-rpc error
35 //
36
37 /// <summary></summary>
38 public const int APPLICATION_ERROR = -32500;
39 /// <summary></summary>
40 public const String APPLICATION_ERROR_MSG = "Application Error";
41
42 //
43 // -32400 ---> system error
44 //
45
46 /// <summary></summary>
47 public const int TRANSPORT_ERROR = -32300;
48 /// <summary></summary>
49 public const String TRANSPORT_ERROR_MSG = "Transport Layer Error";
50 }
51}
diff --git a/Common/XmlRpcCS/XmlRpcException.cs b/Common/XmlRpcCS/XmlRpcException.cs
deleted file mode 100644
index fd1f4ae..0000000
--- a/Common/XmlRpcCS/XmlRpcException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4
5 /// <summary>An XML-RPC Exception.</summary>
6 /// <remarks>Maps a C# exception to an XML-RPC fault. Normal exceptions
7 /// include a message so this adds the code needed by XML-RPC.</remarks>
8 public class XmlRpcException : Exception
9 {
10 private int _code;
11
12 /// <summary>Instantiate an <c>XmlRpcException</c> with a code and message.</summary>
13 /// <param name="code"><c>Int</c> faultCode associated with this exception.</param>
14 /// <param name="message"><c>String</c> faultMessage associated with this exception.</param>
15 public XmlRpcException(int code, String message)
16 : base(message)
17 {
18 _code = code;
19 }
20
21 /// <summary>The value of the faults message, i.e. the faultString.</summary>
22 public String FaultString
23 {
24 get { return Message; }
25 }
26
27 /// <summary>The value of the faults code, i.e. the faultCode.</summary>
28 public int FaultCode
29 {
30 get { return _code; }
31 }
32
33 /// <summary>Format the message to include the code.</summary>
34 override public String ToString()
35 {
36 return "Code: " + FaultCode + " Message: " + base.ToString();
37 }
38 }
39}
diff --git a/Common/XmlRpcCS/XmlRpcExposedAttribute.cs b/Common/XmlRpcCS/XmlRpcExposedAttribute.cs
deleted file mode 100644
index 67b27ae..0000000
--- a/Common/XmlRpcCS/XmlRpcExposedAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Reflection;
5
6 /// <summary>
7 /// Simple tagging attribute to indicate participation is XML-RPC exposure.
8 /// </summary>
9 /// <remarks>
10 /// If present at the class level it indicates that this class does explicitly
11 /// expose methods. If present at the method level it denotes that the method
12 /// is exposed.
13 /// </remarks>
14 [AttributeUsage(
15 AttributeTargets.Class | AttributeTargets.Method,
16 AllowMultiple = false,
17 Inherited = true
18 )]
19 public class XmlRpcExposedAttribute : Attribute
20 {
21 /// <summary>Check if <paramref>obj</paramref> is an object utilizing the XML-RPC exposed Attribute.</summary>
22 /// <param name="obj"><c>Object</c> of a class or method to check for attribute.</param>
23 /// <returns><c>Boolean</c> true if attribute present.</returns>
24 public static Boolean ExposedObject(Object obj)
25 {
26 return IsExposed(obj.GetType());
27 }
28
29 /// <summary>Check if <paramref>obj</paramref>.<paramref>methodName</paramref> is an XML-RPC exposed method.</summary>
30 /// <remarks>A method is considered to be exposed if it exists and, either, the object does not use the XmlRpcExposed attribute,
31 /// or the object does use the XmlRpcExposed attribute and the method has the XmlRpcExposed attribute as well.</remarks>
32 /// <returns><c>Boolean</c> true if the method is exposed.</returns>
33 public static Boolean ExposedMethod(Object obj, String methodName)
34 {
35 Type type = obj.GetType();
36 MethodInfo method = type.GetMethod(methodName);
37
38 if (method == null)
39 throw new MissingMethodException("Method " + methodName + " not found.");
40
41 if (!IsExposed(type))
42 return true;
43
44 return IsExposed(method);
45 }
46
47 /// <summary>Check if <paramref>mi</paramref> is XML-RPC exposed.</summary>
48 /// <param name="mi"><c>MemberInfo</c> of a class or method to check for attribute.</param>
49 /// <returns><c>Boolean</c> true if attribute present.</returns>
50 public static Boolean IsExposed(MemberInfo mi)
51 {
52 foreach (Attribute attr in mi.GetCustomAttributes(true))
53 {
54 if (attr is XmlRpcExposedAttribute)
55 return true;
56 }
57 return false;
58 }
59 }
60}
diff --git a/Common/XmlRpcCS/XmlRpcRequest.cs b/Common/XmlRpcCS/XmlRpcRequest.cs
deleted file mode 100644
index 18d2182..0000000
--- a/Common/XmlRpcCS/XmlRpcRequest.cs
+++ /dev/null
@@ -1,150 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7 using System.Net;
8 using System.Text;
9 using System.Reflection;
10 using System.Net.Security;
11 using System.Security.Cryptography.X509Certificates;
12
13 internal class AcceptAllCertificatePolicy : ICertificatePolicy
14 {
15 public AcceptAllCertificatePolicy()
16 {
17 }
18
19 public bool CheckValidationResult(ServicePoint sPoint,
20 System.Security.Cryptography.X509Certificates.X509Certificate cert,
21 WebRequest wRequest, int certProb)
22 {
23 // Always accept
24 return true;
25 }
26 }
27
28 /// <summary>Class supporting the request side of an XML-RPC transaction.</summary>
29 public class XmlRpcRequest
30 {
31 private String _methodName = null;
32 private Encoding _encoding = new ASCIIEncoding();
33 private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer();
34 private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer();
35
36 /// <summary><c>ArrayList</c> containing the parameters.</summary>
37 protected IList _params = null;
38
39 /// <summary>Instantiate an <c>XmlRpcRequest</c></summary>
40 public XmlRpcRequest()
41 {
42 _params = new ArrayList();
43 }
44
45 /// <summary>Instantiate an <c>XmlRpcRequest</c> for a specified method and parameters.</summary>
46 /// <param name="methodName"><c>String</c> designating the <i>object.method</i> on the server the request
47 /// should be directed to.</param>
48 /// <param name="parameters"><c>ArrayList</c> of XML-RPC type parameters to invoke the request with.</param>
49 public XmlRpcRequest(String methodName, IList parameters)
50 {
51 MethodName = methodName;
52 _params = parameters;
53 }
54
55 /// <summary><c>ArrayList</c> conntaining the parameters for the request.</summary>
56 public virtual IList Params
57 {
58 get { return _params; }
59 }
60
61 /// <summary><c>String</c> conntaining the method name, both object and method, that the request will be sent to.</summary>
62 public virtual String MethodName
63 {
64 get { return _methodName; }
65 set { _methodName = value; }
66 }
67
68 /// <summary><c>String</c> object name portion of the method name.</summary>
69 public String MethodNameObject
70 {
71 get
72 {
73 int index = MethodName.IndexOf(".");
74
75 if (index == -1)
76 return MethodName;
77
78 return MethodName.Substring(0, index);
79 }
80 }
81
82 /// <summary><c>String</c> method name portion of the object.method name.</summary>
83 public String MethodNameMethod
84 {
85 get
86 {
87 int index = MethodName.IndexOf(".");
88
89 if (index == -1)
90 return MethodName;
91
92 return MethodName.Substring(index + 1, MethodName.Length - index - 1);
93 }
94 }
95
96 /// <summary>Invoke this request on the server.</summary>
97 /// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
98 /// <returns><c>Object</c> The value returned from the method invocation on the server.</returns>
99 /// <exception cref="XmlRpcException">If an exception generated on the server side.</exception>
100 public Object Invoke(String url)
101 {
102 XmlRpcResponse res = Send(url, 10000);
103
104 if (res.IsFault)
105 throw new XmlRpcException(res.FaultCode, res.FaultString);
106
107 return res.Value;
108 }
109
110 /// <summary>Send the request to the server.</summary>
111 /// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
112 /// <param name="timeout">Milliseconds before the connection times out.</param>
113 /// <returns><c>XmlRpcResponse</c> The response generated.</returns>
114 public XmlRpcResponse Send(String url, int timeout)
115 {
116 // Override SSL authentication mechanisms
117 ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
118
119 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
120 if (request == null)
121 throw new XmlRpcException(XmlRpcErrorCodes.TRANSPORT_ERROR,
122 XmlRpcErrorCodes.TRANSPORT_ERROR_MSG + ": Could not create request with " + url);
123 request.Method = "POST";
124 request.ContentType = "text/xml";
125 request.AllowWriteStreamBuffering = true;
126 request.Timeout = timeout;
127
128 Stream stream = request.GetRequestStream();
129 XmlTextWriter xml = new XmlTextWriter(stream, _encoding);
130 _serializer.Serialize(xml, this);
131 xml.Flush();
132 xml.Close();
133
134 HttpWebResponse response = (HttpWebResponse)request.GetResponse();
135 StreamReader input = new StreamReader(response.GetResponseStream());
136
137 XmlRpcResponse resp = (XmlRpcResponse)_deserializer.Deserialize(input);
138 input.Close();
139 response.Close();
140 return resp;
141 }
142
143 /// <summary>Produce <c>String</c> representation of the object.</summary>
144 /// <returns><c>String</c> representation of the object.</returns>
145 override public String ToString()
146 {
147 return _serializer.Serialize(this);
148 }
149 }
150}
diff --git a/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs b/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs
deleted file mode 100644
index 0770b7e..0000000
--- a/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs
+++ /dev/null
@@ -1,64 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.Diagnostics;
6 using System.IO;
7 using System.Xml;
8
9 /// <summary>Class to deserialize XML data representing a request.</summary>
10 public class XmlRpcRequestDeserializer : XmlRpcDeserializer
11 {
12 static private XmlRpcRequestDeserializer _singleton;
13 /// <summary>A static singleton instance of this deserializer.</summary>
14 [Obsolete("This object is now thread safe, just use an instance.", false)]
15 static public XmlRpcRequestDeserializer Singleton
16 {
17 get
18 {
19 if (_singleton == null)
20 _singleton = new XmlRpcRequestDeserializer();
21
22 return _singleton;
23 }
24 }
25
26 /// <summary>Static method that parses XML data into a request using the Singleton.</summary>
27 /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC request.</param>
28 /// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
29 override public Object Deserialize(TextReader xmlData)
30 {
31 XmlTextReader reader = new XmlTextReader(xmlData);
32 XmlRpcRequest request = new XmlRpcRequest();
33 bool done = false;
34
35 lock (this)
36 {
37 Reset();
38 while (!done && reader.Read())
39 {
40 DeserializeNode(reader); // Parent parse...
41 switch (reader.NodeType)
42 {
43 case XmlNodeType.EndElement:
44 switch (reader.Name)
45 {
46 case METHOD_NAME:
47 request.MethodName = _text;
48 break;
49 case METHOD_CALL:
50 done = true;
51 break;
52 case PARAM:
53 request.Params.Add(_value);
54 _text = null;
55 break;
56 }
57 break;
58 }
59 }
60 }
61 return request;
62 }
63 }
64}
diff --git a/Common/XmlRpcCS/XmlRpcRequestSerializer.cs b/Common/XmlRpcCS/XmlRpcRequestSerializer.cs
deleted file mode 100644
index 8099bdb..0000000
--- a/Common/XmlRpcCS/XmlRpcRequestSerializer.cs
+++ /dev/null
@@ -1,51 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.Xml;
6 using System.IO;
7
8 /// <summary>Class responsible for serializing an XML-RPC request.</summary>
9 /// <remarks>This class handles the request envelope, depending on <c>XmlRpcSerializer</c>
10 /// to serialize the payload.</remarks>
11 /// <seealso cref="XmlRpcSerializer"/>
12 public class XmlRpcRequestSerializer : XmlRpcSerializer
13 {
14 static private XmlRpcRequestSerializer _singleton;
15 /// <summary>A static singleton instance of this deserializer.</summary>
16 static public XmlRpcRequestSerializer Singleton
17 {
18 get
19 {
20 if (_singleton == null)
21 _singleton = new XmlRpcRequestSerializer();
22
23 return _singleton;
24 }
25 }
26
27 /// <summary>Serialize the <c>XmlRpcRequest</c> to the output stream.</summary>
28 /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
29 /// <param name="obj">An <c>XmlRpcRequest</c> to serialize.</param>
30 /// <seealso cref="XmlRpcRequest"/>
31 override public void Serialize(XmlTextWriter output, Object obj)
32 {
33 XmlRpcRequest request = (XmlRpcRequest)obj;
34 output.WriteStartDocument();
35 output.WriteStartElement(METHOD_CALL);
36 output.WriteElementString(METHOD_NAME, request.MethodName);
37 output.WriteStartElement(PARAMS);
38 foreach (Object param in request.Params)
39 {
40 output.WriteStartElement(PARAM);
41 output.WriteStartElement(VALUE);
42 SerializeObject(output, param);
43 output.WriteEndElement();
44 output.WriteEndElement();
45 }
46
47 output.WriteEndElement();
48 output.WriteEndElement();
49 }
50 }
51}
diff --git a/Common/XmlRpcCS/XmlRpcResponder.cs b/Common/XmlRpcCS/XmlRpcResponder.cs
deleted file mode 100644
index 0412568..0000000
--- a/Common/XmlRpcCS/XmlRpcResponder.cs
+++ /dev/null
@@ -1,98 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Xml;
5 using System.Net.Sockets;
6
7 /// <summary>The class is a container of the context of an XML-RPC dialog on the server side.</summary>
8 /// <remarks>Instances of this class maintain the context for an individual XML-RPC server
9 /// side dialog. Namely they manage an inbound deserializer and an outbound serializer. </remarks>
10 public class XmlRpcResponder
11 {
12 private XmlRpcRequestDeserializer _deserializer = new XmlRpcRequestDeserializer();
13 private XmlRpcResponseSerializer _serializer = new XmlRpcResponseSerializer();
14 private XmlRpcServer _server;
15 private TcpClient _client;
16 private SimpleHttpRequest _httpReq;
17
18 /// <summary>The SimpleHttpRequest based on the TcpClient.</summary>
19 public SimpleHttpRequest HttpReq
20 {
21 get { return _httpReq; }
22 }
23
24 /// <summary>Basic constructor.</summary>
25 /// <param name="server">XmlRpcServer that this XmlRpcResponder services.</param>
26 /// <param name="client">TcpClient with the connection.</param>
27 public XmlRpcResponder(XmlRpcServer server, TcpClient client)
28 {
29 _server = server;
30 _client = client;
31 _httpReq = new SimpleHttpRequest(_client);
32 }
33
34 /// <summary>Call close to insure proper shutdown.</summary>
35 ~XmlRpcResponder()
36 {
37 Close();
38 }
39
40 ///<summary>Respond using this responders HttpReq.</summary>
41 public void Respond()
42 {
43 Respond(HttpReq);
44 }
45
46 /// <summary>Handle an HTTP request containing an XML-RPC request.</summary>
47 /// <remarks>This method deserializes the XML-RPC request, invokes the
48 /// described method, serializes the response (or fault) and sends the XML-RPC response
49 /// back as a valid HTTP page.
50 /// </remarks>
51 /// <param name="httpReq"><c>SimpleHttpRequest</c> containing the request.</param>
52 public void Respond(SimpleHttpRequest httpReq)
53 {
54 XmlRpcRequest xmlRpcReq = (XmlRpcRequest)_deserializer.Deserialize(httpReq.Input);
55 XmlRpcResponse xmlRpcResp = new XmlRpcResponse();
56
57 try
58 {
59 xmlRpcResp.Value = _server.Invoke(xmlRpcReq);
60 }
61 catch (XmlRpcException e)
62 {
63 xmlRpcResp.SetFault(e.FaultCode, e.FaultString);
64 }
65 catch (Exception e2)
66 {
67 xmlRpcResp.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR,
68 XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message);
69 }
70
71 if (Logger.Delegate != null)
72 Logger.WriteEntry(xmlRpcResp.ToString(), LogLevel.Information);
73
74 XmlRpcServer.HttpHeader(httpReq.Protocol, "text/xml", 0, " 200 OK", httpReq.Output);
75 httpReq.Output.Flush();
76 XmlTextWriter xml = new XmlTextWriter(httpReq.Output);
77 _serializer.Serialize(xml, xmlRpcResp);
78 xml.Flush();
79 httpReq.Output.Flush();
80 }
81
82 ///<summary>Close all contained resources, both the HttpReq and client.</summary>
83 public void Close()
84 {
85 if (_httpReq != null)
86 {
87 _httpReq.Close();
88 _httpReq = null;
89 }
90
91 if (_client != null)
92 {
93 _client.Close();
94 _client = null;
95 }
96 }
97 }
98}
diff --git a/Common/XmlRpcCS/XmlRpcResponse.cs b/Common/XmlRpcCS/XmlRpcResponse.cs
deleted file mode 100644
index 8ff8354..0000000
--- a/Common/XmlRpcCS/XmlRpcResponse.cs
+++ /dev/null
@@ -1,85 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7
8 /// <summary>Class designed to represent an XML-RPC response.</summary>
9 public class XmlRpcResponse
10 {
11 private Object _value;
12 /// <summary><c>bool</c> indicating if this response represents a fault.</summary>
13 public bool IsFault;
14
15 /// <summary>Basic constructor</summary>
16 public XmlRpcResponse()
17 {
18 Value = null;
19 IsFault = false;
20 }
21
22 /// <summary>Constructor for a fault.</summary>
23 /// <param name="code"><c>int</c> the numeric faultCode value.</param>
24 /// <param name="message"><c>String</c> the faultString value.</param>
25 public XmlRpcResponse(int code, String message)
26 : this()
27 {
28 SetFault(code, message);
29 }
30
31 /// <summary>The data value of the response, may be fault data.</summary>
32 public Object Value
33 {
34 get { return _value; }
35 set
36 {
37 IsFault = false;
38 _value = value;
39 }
40 }
41
42 /// <summary>The faultCode if this is a fault.</summary>
43 public int FaultCode
44 {
45 get
46 {
47 if (!IsFault)
48 return 0;
49 else
50 return (int)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_CODE];
51 }
52 }
53
54 /// <summary>The faultString if this is a fault.</summary>
55 public String FaultString
56 {
57 get
58 {
59 if (!IsFault)
60 return "";
61 else
62 return (String)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_STRING];
63 }
64 }
65
66 /// <summary>Set this response to be a fault.</summary>
67 /// <param name="code"><c>int</c> the numeric faultCode value.</param>
68 /// <param name="message"><c>String</c> the faultString value.</param>
69 public void SetFault(int code, String message)
70 {
71 Hashtable fault = new Hashtable();
72 fault.Add("faultCode", code);
73 fault.Add("faultString", message);
74 Value = fault;
75 IsFault = true;
76 }
77
78 /// <summary>Form a useful string representation of the object, in this case the XML response.</summary>
79 /// <returns><c>String</c> The XML serialized XML-RPC response.</returns>
80 override public String ToString()
81 {
82 return XmlRpcResponseSerializer.Singleton.Serialize(this);
83 }
84 }
85}
diff --git a/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs b/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs
deleted file mode 100644
index 032d8a3..0000000
--- a/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs
+++ /dev/null
@@ -1,65 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7
8 /// <summary>Class to deserialize XML data representing a response.</summary>
9 public class XmlRpcResponseDeserializer : XmlRpcDeserializer
10 {
11 static private XmlRpcResponseDeserializer _singleton;
12 /// <summary>A static singleton instance of this deserializer.</summary>
13 [Obsolete("This object is now thread safe, just use an instance.", false)]
14 static public XmlRpcResponseDeserializer Singleton
15 {
16 get
17 {
18 if (_singleton == null)
19 _singleton = new XmlRpcResponseDeserializer();
20
21 return _singleton;
22 }
23 }
24
25 /// <summary>Static method that parses XML data into a response using the Singleton.</summary>
26 /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
27 /// <returns><c>XmlRpcResponse</c> object resulting from the parse.</returns>
28 override public Object Deserialize(TextReader xmlData)
29 {
30 XmlTextReader reader = new XmlTextReader(xmlData);
31 XmlRpcResponse response = new XmlRpcResponse();
32 bool done = false;
33
34 lock (this)
35 {
36 Reset();
37
38 while (!done && reader.Read())
39 {
40 DeserializeNode(reader); // Parent parse...
41 switch (reader.NodeType)
42 {
43 case XmlNodeType.EndElement:
44 switch (reader.Name)
45 {
46 case FAULT:
47 response.Value = _value;
48 response.IsFault = true;
49 break;
50 case PARAM:
51 response.Value = _value;
52 _value = null;
53 _text = null;
54 break;
55 }
56 break;
57 default:
58 break;
59 }
60 }
61 }
62 return response;
63 }
64 }
65}
diff --git a/Common/XmlRpcCS/XmlRpcResponseSerializer.cs b/Common/XmlRpcCS/XmlRpcResponseSerializer.cs
deleted file mode 100644
index 72ca568..0000000
--- a/Common/XmlRpcCS/XmlRpcResponseSerializer.cs
+++ /dev/null
@@ -1,57 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.Xml;
6
7 /// <summary>Class responsible for serializing an XML-RPC response.</summary>
8 /// <remarks>This class handles the response envelope, depending on XmlRpcSerializer
9 /// to serialize the payload.</remarks>
10 /// <seealso cref="XmlRpcSerializer"/>
11 public class XmlRpcResponseSerializer : XmlRpcSerializer
12 {
13 static private XmlRpcResponseSerializer _singleton;
14 /// <summary>A static singleton instance of this deserializer.</summary>
15 static public XmlRpcResponseSerializer Singleton
16 {
17 get
18 {
19 if (_singleton == null)
20 _singleton = new XmlRpcResponseSerializer();
21
22 return _singleton;
23 }
24 }
25
26 /// <summary>Serialize the <c>XmlRpcResponse</c> to the output stream.</summary>
27 /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
28 /// <param name="obj">An <c>Object</c> to serialize.</param>
29 /// <seealso cref="XmlRpcResponse"/>
30 override public void Serialize(XmlTextWriter output, Object obj)
31 {
32 XmlRpcResponse response = (XmlRpcResponse)obj;
33
34 output.WriteStartDocument();
35 output.WriteStartElement(METHOD_RESPONSE);
36
37 if (response.IsFault)
38 output.WriteStartElement(FAULT);
39 else
40 {
41 output.WriteStartElement(PARAMS);
42 output.WriteStartElement(PARAM);
43 }
44
45 output.WriteStartElement(VALUE);
46
47 SerializeObject(output, response.Value);
48
49 output.WriteEndElement();
50
51 output.WriteEndElement();
52 if (!response.IsFault)
53 output.WriteEndElement();
54 output.WriteEndElement();
55 }
56 }
57}
diff --git a/Common/XmlRpcCS/XmlRpcSerializer.cs b/Common/XmlRpcCS/XmlRpcSerializer.cs
deleted file mode 100644
index 0643d38..0000000
--- a/Common/XmlRpcCS/XmlRpcSerializer.cs
+++ /dev/null
@@ -1,109 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7
8 /// <summary>Base class of classes serializing data to XML-RPC's XML format.</summary>
9 /// <remarks>This class handles the basic type conversions like Integer to &lt;i4&gt;. </remarks>
10 /// <seealso cref="XmlRpcXmlTokens"/>
11 public class XmlRpcSerializer : XmlRpcXmlTokens
12 {
13
14 /// <summary>Serialize the <c>XmlRpcRequest</c> to the output stream.</summary>
15 /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
16 /// <param name="obj">An <c>Object</c> to serialize.</param>
17 /// <seealso cref="XmlRpcRequest"/>
18 virtual public void Serialize(XmlTextWriter output, Object obj)
19 {
20 }
21
22 /// <summary>Serialize the <c>XmlRpcRequest</c> to a String.</summary>
23 /// <remarks>Note this may represent a real memory hog for a large request.</remarks>
24 /// <param name="obj">An <c>Object</c> to serialize.</param>
25 /// <returns><c>String</c> containing XML-RPC representation of the request.</returns>
26 /// <seealso cref="XmlRpcRequest"/>
27 public String Serialize(Object obj)
28 {
29 StringWriter strBuf = new StringWriter();
30 XmlTextWriter xml = new XmlTextWriter(strBuf);
31 xml.Formatting = Formatting.Indented;
32 xml.Indentation = 4;
33 Serialize(xml, obj);
34 xml.Flush();
35 String returns = strBuf.ToString();
36 xml.Close();
37 return returns;
38 }
39
40 /// <remarks>Serialize the object to the output stream.</remarks>
41 /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
42 /// <param name="obj">An <c>Object</c> to serialize.</param>
43 public void SerializeObject(XmlTextWriter output, Object obj)
44 {
45 if (obj == null)
46 return;
47
48 if (obj is byte[])
49 {
50 byte[] ba = (byte[])obj;
51 output.WriteStartElement(BASE64);
52 output.WriteBase64(ba, 0, ba.Length);
53 output.WriteEndElement();
54 }
55 else if (obj is String)
56 {
57 output.WriteElementString(STRING, obj.ToString());
58 }
59 else if (obj is Int32)
60 {
61 output.WriteElementString(INT, obj.ToString());
62 }
63 else if (obj is DateTime)
64 {
65 output.WriteElementString(DATETIME, ((DateTime)obj).ToString(ISO_DATETIME));
66 }
67 else if (obj is Double)
68 {
69 output.WriteElementString(DOUBLE, obj.ToString());
70 }
71 else if (obj is Boolean)
72 {
73 output.WriteElementString(BOOLEAN, ((((Boolean)obj) == true) ? "1" : "0"));
74 }
75 else if (obj is IList)
76 {
77 output.WriteStartElement(ARRAY);
78 output.WriteStartElement(DATA);
79 if (((ArrayList)obj).Count > 0)
80 {
81 foreach (Object member in ((IList)obj))
82 {
83 output.WriteStartElement(VALUE);
84 SerializeObject(output, member);
85 output.WriteEndElement();
86 }
87 }
88 output.WriteEndElement();
89 output.WriteEndElement();
90 }
91 else if (obj is IDictionary)
92 {
93 IDictionary h = (IDictionary)obj;
94 output.WriteStartElement(STRUCT);
95 foreach (String key in h.Keys)
96 {
97 output.WriteStartElement(MEMBER);
98 output.WriteElementString(NAME, key);
99 output.WriteStartElement(VALUE);
100 SerializeObject(output, h[key]);
101 output.WriteEndElement();
102 output.WriteEndElement();
103 }
104 output.WriteEndElement();
105 }
106
107 }
108 }
109}
diff --git a/Common/XmlRpcCS/XmlRpcServer.cs b/Common/XmlRpcCS/XmlRpcServer.cs
deleted file mode 100644
index 1c226c1..0000000
--- a/Common/XmlRpcCS/XmlRpcServer.cs
+++ /dev/null
@@ -1,239 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Net;
7 using System.Net.Sockets;
8 using System.Text;
9 using System.Threading;
10 using System.Xml;
11
12 /// <summary>A restricted HTTP server for use with XML-RPC.</summary>
13 /// <remarks>It only handles POST requests, and only POSTs representing XML-RPC calls.
14 /// In addition to dispatching requests it also provides a registry for request handlers.
15 /// </remarks>
16 public class XmlRpcServer : IEnumerable
17 {
18#pragma warning disable 0414 // disable "private field assigned but not used"
19 const int RESPONDER_COUNT = 10;
20 private TcpListener _myListener;
21 private int _port;
22 private IPAddress _address;
23 private IDictionary _handlers;
24 private XmlRpcSystemObject _system;
25 private WaitCallback _wc;
26#pragma warning restore 0414
27
28 ///<summary>Constructor with port and address.</summary>
29 ///<remarks>This constructor sets up a TcpListener listening on the
30 ///given port and address. It also calls a Thread on the method StartListen().</remarks>
31 ///<param name="address"><c>IPAddress</c> value of the address to listen on.</param>
32 ///<param name="port"><c>Int</c> value of the port to listen on.</param>
33 public XmlRpcServer(IPAddress address, int port)
34 {
35 _port = port;
36 _address = address;
37 _handlers = new Hashtable();
38 _system = new XmlRpcSystemObject(this);
39 _wc = new WaitCallback(WaitCallback);
40 }
41
42 ///<summary>Basic constructor.</summary>
43 ///<remarks>This constructor sets up a TcpListener listening on the
44 ///given port. It also calls a Thread on the method StartListen(). IPAddress.Any
45 ///is assumed as the address here.</remarks>
46 ///<param name="port"><c>Int</c> value of the port to listen on.</param>
47 public XmlRpcServer(int port) : this(IPAddress.Any, port) { }
48
49 /// <summary>Start the server.</summary>
50 public void Start()
51 {
52 try
53 {
54 Stop();
55 //start listing on the given port
56 // IPAddress addr = IPAddress.Parse("127.0.0.1");
57 lock (this)
58 {
59 _myListener = new TcpListener(IPAddress.Any, _port);
60 _myListener.Start();
61 //start the thread which calls the method 'StartListen'
62 Thread th = new Thread(new ThreadStart(StartListen));
63 th.Start();
64 }
65 }
66 catch (Exception e)
67 {
68 Logger.WriteEntry("An Exception Occurred while Listening :" + e.ToString(), LogLevel.Error);
69 }
70 }
71
72 /// <summary>Stop the server.</summary>
73 public void Stop()
74 {
75 try
76 {
77 if (_myListener != null)
78 {
79 lock (this)
80 {
81 _myListener.Stop();
82 _myListener = null;
83 }
84 }
85 }
86 catch (Exception e)
87 {
88 Logger.WriteEntry("An Exception Occurred while stopping :" +
89 e.ToString(), LogLevel.Error);
90 }
91 }
92
93 /// <summary>Get an enumeration of my XML-RPC handlers.</summary>
94 /// <returns><c>IEnumerable</c> the handler enumeration.</returns>
95 public IEnumerator GetEnumerator()
96 {
97 return _handlers.GetEnumerator();
98 }
99
100 /// <summary>Retrieve a handler by name.</summary>
101 /// <param name="name"><c>String</c> naming a handler</param>
102 /// <returns><c>Object</c> that is the handler.</returns>
103 public Object this[String name]
104 {
105 get { return _handlers[name]; }
106 }
107
108 ///<summary>
109 ///This method Accepts new connections and dispatches them when appropriate.
110 ///</summary>
111 public void StartListen()
112 {
113 while (true && _myListener != null)
114 {
115 //Accept a new connection
116 XmlRpcResponder responder = new XmlRpcResponder(this, _myListener.AcceptTcpClient());
117 ThreadPool.QueueUserWorkItem(_wc, responder);
118 }
119 }
120
121
122 ///<summary>
123 ///Add an XML-RPC handler object by name.
124 ///</summary>
125 ///<param name="name"><c>String</c> XML-RPC dispatch name of this object.</param>
126 ///<param name="obj"><c>Object</c> The object that is the XML-RPC handler.</param>
127 public void Add(String name, Object obj)
128 {
129 _handlers.Add(name, obj);
130 }
131
132 ///<summary>Return a C# object.method name for and XML-RPC object.method name pair.</summary>
133 ///<param name="methodName">The XML-RPC object.method.</param>
134 ///<returns><c>String</c> of form object.method for the underlying C# method.</returns>
135 public String MethodName(String methodName)
136 {
137 int dotAt = methodName.LastIndexOf('.');
138
139 if (dotAt == -1)
140 {
141 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
142 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Bad method name " + methodName);
143 }
144
145 String objectName = methodName.Substring(0, dotAt);
146 Object target = _handlers[objectName];
147
148 if (target == null)
149 {
150 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
151 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found");
152 }
153
154 return target.GetType().FullName + "." + methodName.Substring(dotAt + 1);
155 }
156
157 ///<summary>Invoke a method described in a request.</summary>
158 ///<param name="req"><c>XmlRpcRequest</c> containing a method descriptions.</param>
159 /// <seealso cref="XmlRpcSystemObject.Invoke"/>
160 /// <seealso cref="XmlRpcServer.Invoke(String,String,IList)"/>
161 public Object Invoke(XmlRpcRequest req)
162 {
163 return Invoke(req.MethodNameObject, req.MethodNameMethod, req.Params);
164 }
165
166 ///<summary>Invoke a method on a named handler.</summary>
167 ///<param name="objectName"><c>String</c> The name of the handler.</param>
168 ///<param name="methodName"><c>String</c> The name of the method to invoke on the handler.</param>
169 ///<param name="parameters"><c>IList</c> The parameters to invoke the method with.</param>
170 /// <seealso cref="XmlRpcSystemObject.Invoke"/>
171 public Object Invoke(String objectName, String methodName, IList parameters)
172 {
173 Object target = _handlers[objectName];
174
175 if (target == null)
176 {
177 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
178 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found");
179 }
180
181 return XmlRpcSystemObject.Invoke(target, methodName, parameters);
182 }
183
184 /// <summary>The method the thread pool invokes when a thread is available to handle an HTTP request.</summary>
185 /// <param name="responder">TcpClient from the socket accept.</param>
186 public void WaitCallback(object responder)
187 {
188 XmlRpcResponder resp = (XmlRpcResponder)responder;
189
190 if (resp.HttpReq.HttpMethod == "POST")
191 {
192 try
193 {
194 resp.Respond();
195 }
196 catch (Exception e)
197 {
198 Logger.WriteEntry("Failed on post: " + e, LogLevel.Error);
199 }
200 }
201 else
202 {
203 Logger.WriteEntry("Only POST methods are supported: " + resp.HttpReq.HttpMethod +
204 " ignored", LogLevel.Error);
205 }
206
207 resp.Close();
208 }
209
210 /// <summary>
211 /// This function send the Header Information to the client (Browser)
212 /// </summary>
213 /// <param name="sHttpVersion">HTTP Version</param>
214 /// <param name="sMIMEHeader">Mime Type</param>
215 /// <param name="iTotBytes">Total Bytes to be sent in the body</param>
216 /// <param name="sStatusCode"></param>
217 /// <param name="output">Socket reference</param>
218 static public void HttpHeader(string sHttpVersion, string sMIMEHeader, long iTotBytes, string sStatusCode, TextWriter output)
219 {
220 String sBuffer = "";
221
222 // if Mime type is not provided set default to text/html
223 if (sMIMEHeader.Length == 0)
224 {
225 sMIMEHeader = "text/html"; // Default Mime Type is text/html
226 }
227
228 sBuffer += sHttpVersion + sStatusCode + "\r\n";
229 sBuffer += "Connection: close\r\n";
230 if (iTotBytes > 0)
231 sBuffer += "Content-Length: " + iTotBytes + "\r\n";
232 sBuffer += "Server: XmlRpcServer \r\n";
233 sBuffer += "Content-Type: " + sMIMEHeader + "\r\n";
234 sBuffer += "\r\n";
235
236 output.Write(sBuffer);
237 }
238 }
239}
diff --git a/Common/XmlRpcCS/XmlRpcSystemObject.cs b/Common/XmlRpcCS/XmlRpcSystemObject.cs
deleted file mode 100644
index 5f79951..0000000
--- a/Common/XmlRpcCS/XmlRpcSystemObject.cs
+++ /dev/null
@@ -1,252 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.Reflection;
6
7 /// <summary> XML-RPC System object implementation of extended specifications.</summary>
8 [XmlRpcExposed]
9 public class XmlRpcSystemObject
10 {
11 private XmlRpcServer _server;
12 static private IDictionary _methodHelp = new Hashtable();
13
14 /// <summary>Static <c>IDictionary</c> to hold mappings of method name to associated documentation String</summary>
15 static public IDictionary MethodHelp
16 {
17 get { return _methodHelp; }
18 }
19
20 /// <summary>Constructor.</summary>
21 /// <param name="server"><c>XmlRpcServer</c> server to be the system object for.</param>
22 public XmlRpcSystemObject(XmlRpcServer server)
23 {
24 _server = server;
25 server.Add("system", this);
26 _methodHelp.Add(this.GetType().FullName + ".methodHelp", "Return a string description.");
27 }
28
29 /// <summary>Invoke a method on a given object.</summary>
30 /// <remarks>Using reflection, and respecting the <c>XmlRpcExposed</c> attribute,
31 /// invoke the <paramref>methodName</paramref> method on the <paramref>target</paramref>
32 /// instance with the <paramref>parameters</paramref> provided. All this packages other <c>Invoke</c> methods
33 /// end up calling this.</remarks>
34 /// <returns><c>Object</c> the value the invoked method returns.</returns>
35 /// <exception cref="XmlRpcException">If method does not exist, is not exposed, parameters invalid, or invocation
36 /// results in an exception. Note, the <c>XmlRpcException.Code</c> will indicate cause.</exception>
37 static public Object Invoke(Object target, String methodName, IList parameters)
38 {
39 if (target == null)
40 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
41 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Invalid target object.");
42
43 Type type = target.GetType();
44 MethodInfo method = type.GetMethod(methodName);
45
46 try
47 {
48 if (!XmlRpcExposedAttribute.ExposedMethod(target, methodName))
49 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
50 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Method " + methodName + " is not exposed.");
51 }
52 catch (MissingMethodException me)
53 {
54 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
55 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": " + me.Message);
56 }
57
58 Object[] args = new Object[parameters.Count];
59
60 int index = 0;
61 foreach (Object arg in parameters)
62 {
63 args[index] = arg;
64 index++;
65 }
66
67 try
68 {
69 Object retValue = method.Invoke(target, args);
70 if (retValue == null)
71 throw new XmlRpcException(XmlRpcErrorCodes.APPLICATION_ERROR,
72 XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": Method returned NULL.");
73 return retValue;
74 }
75 catch (XmlRpcException e)
76 {
77 throw e;
78 }
79 catch (ArgumentException ae)
80 {
81 Logger.WriteEntry(XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": " + ae.Message,
82 LogLevel.Information);
83 String call = methodName + "( ";
84 foreach (Object o in args)
85 {
86 call += o.GetType().Name;
87 call += " ";
88 }
89 call += ")";
90 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_PARAMS,
91 XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": Arguement type mismatch invoking " + call);
92 }
93 catch (TargetParameterCountException tpce)
94 {
95 Logger.WriteEntry(XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": " + tpce.Message,
96 LogLevel.Information);
97 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_PARAMS,
98 XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": Arguement count mismatch invoking " + methodName);
99 }
100 catch (TargetInvocationException tie)
101 {
102 throw new XmlRpcException(XmlRpcErrorCodes.APPLICATION_ERROR,
103 XmlRpcErrorCodes.APPLICATION_ERROR_MSG + " Invoked method " + methodName + ": " + tie.Message);
104 }
105 }
106
107 /// <summary>List methods available on all handlers of this server.</summary>
108 /// <returns><c>IList</c> An array of <c>Strings</c>, each <c>String</c> will have form "object.method".</returns>
109 [XmlRpcExposed]
110 public IList listMethods()
111 {
112 IList methods = new ArrayList();
113 Boolean considerExposure;
114
115 foreach (DictionaryEntry handlerEntry in _server)
116 {
117 considerExposure = XmlRpcExposedAttribute.IsExposed(handlerEntry.Value.GetType());
118
119 foreach (MemberInfo mi in handlerEntry.Value.GetType().GetMembers())
120 {
121 if (mi.MemberType != MemberTypes.Method)
122 continue;
123
124 if (!((MethodInfo)mi).IsPublic)
125 continue;
126
127 if (considerExposure && !XmlRpcExposedAttribute.IsExposed(mi))
128 continue;
129
130 methods.Add(handlerEntry.Key + "." + mi.Name);
131 }
132 }
133
134 return methods;
135 }
136
137 /// <summary>Given a method name return the possible signatures for it.</summary>
138 /// <param name="name"><c>String</c> The object.method name to look up.</param>
139 /// <returns><c>IList</c> Of arrays of signatures.</returns>
140 [XmlRpcExposed]
141 public IList methodSignature(String name)
142 {
143 IList signatures = new ArrayList();
144 int index = name.IndexOf('.');
145
146 if (index < 0)
147 return signatures;
148
149 String oName = name.Substring(0, index);
150 Object obj = _server[oName];
151
152 if (obj == null)
153 return signatures;
154
155 MemberInfo[] mi = obj.GetType().GetMember(name.Substring(index + 1));
156
157 if (mi == null || mi.Length != 1) // for now we want a single signature
158 return signatures;
159
160 MethodInfo method;
161
162 try
163 {
164 method = (MethodInfo)mi[0];
165 }
166 catch (Exception e)
167 {
168 Logger.WriteEntry("Attempted methodSignature call on " + mi[0] + " caused: " + e,
169 LogLevel.Information);
170 return signatures;
171 }
172
173 if (!method.IsPublic)
174 return signatures;
175
176 IList signature = new ArrayList();
177 signature.Add(method.ReturnType.Name);
178
179 foreach (ParameterInfo param in method.GetParameters())
180 {
181 signature.Add(param.ParameterType.Name);
182 }
183
184
185 signatures.Add(signature);
186
187 return signatures;
188 }
189
190 /// <summary>Help for given method signature. Not implemented yet.</summary>
191 /// <param name="name"><c>String</c> The object.method name to look up.</param>
192 /// <returns><c>String</c> help text. Rich HTML text.</returns>
193 [XmlRpcExposed]
194 public String methodHelp(String name)
195 {
196 String help = null;
197
198 try
199 {
200 help = (String)_methodHelp[_server.MethodName(name)];
201 }
202 catch (XmlRpcException e)
203 {
204 throw e;
205 }
206 catch (Exception) { /* ignored */ };
207
208 if (help == null)
209 help = "No help available for: " + name;
210
211 return help;
212 }
213
214 /// <summary>Boxcarring support method.</summary>
215 /// <param name="calls"><c>IList</c> of calls</param>
216 /// <returns><c>ArrayList</c> of results/faults.</returns>
217 [XmlRpcExposed]
218 public IList multiCall(IList calls)
219 {
220 IList responses = new ArrayList();
221 XmlRpcResponse fault = new XmlRpcResponse();
222
223 foreach (IDictionary call in calls)
224 {
225 try
226 {
227 XmlRpcRequest req = new XmlRpcRequest((String)call[XmlRpcXmlTokens.METHOD_NAME],
228 (ArrayList)call[XmlRpcXmlTokens.PARAMS]);
229 Object results = _server.Invoke(req);
230 IList response = new ArrayList();
231 response.Add(results);
232 responses.Add(response);
233 }
234 catch (XmlRpcException e)
235 {
236 fault.SetFault(e.FaultCode, e.FaultString);
237 responses.Add(fault.Value);
238 }
239 catch (Exception e2)
240 {
241 fault.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR,
242 XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message);
243 responses.Add(fault.Value);
244 }
245 }
246
247 return responses;
248 }
249
250 }
251}
252
diff --git a/Common/XmlRpcCS/XmlRpcXmlTokens.cs b/Common/XmlRpcCS/XmlRpcXmlTokens.cs
deleted file mode 100644
index 50788bd..0000000
--- a/Common/XmlRpcCS/XmlRpcXmlTokens.cs
+++ /dev/null
@@ -1,76 +0,0 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4
5 /// <summary>Class collecting <c>String</c> tokens that are part of XML-RPC files.</summary>
6 public class XmlRpcXmlTokens
7 {
8 /// <summary>C# formatting string to describe an ISO 8601 date.</summary>
9 public const String ISO_DATETIME = "yyyyMMdd\\THH\\:mm\\:ss";
10 /// <summary>Base64 field indicator.</summary>
11 /// <remarks>Corresponds to the &lt;base64&gt; tag.</remarks>
12 public const String BASE64 = "base64";
13 /// <summary>String field indicator.</summary>
14 /// <remarks>Corresponds to the &lt;string&gt; tag.</remarks>
15 public const String STRING = "string";
16 /// <summary>Integer field integer.</summary>
17 /// <remarks>Corresponds to the &lt;i4&gt; tag.</remarks>
18 public const String INT = "i4";
19 /// <summary>Alternate integer field indicator.</summary>
20 /// <remarks>Corresponds to the &lt;int&gt; tag.</remarks>
21 public const String ALT_INT = "int";
22 /// <summary>Date field indicator.</summary>
23 /// <remarks>Corresponds to the &lt;dateTime.iso8601&gt; tag.</remarks>
24 public const String DATETIME = "dateTime.iso8601";
25 /// <summary>Boolean field indicator.</summary>
26 /// <remarks>Corresponds to the &lt;boolean&gt; tag.</remarks>
27 public const String BOOLEAN = "boolean";
28 /// <summary>Value token.</summary>
29 /// <remarks>Corresponds to the &lt;value&gt; tag.</remarks>
30 public const String VALUE = "value";
31 /// <summary>Name token.</summary>
32 /// <remarks>Corresponds to the &lt;name&gt; tag.</remarks>
33 public const String NAME = "name";
34 /// <summary>Array field indicator..</summary>
35 /// <remarks>Corresponds to the &lt;array&gt; tag.</remarks>
36 public const String ARRAY = "array";
37 /// <summary>Data token.</summary>
38 /// <remarks>Corresponds to the &lt;data&gt; tag.</remarks>
39 public const String DATA = "data";
40 /// <summary>Member token.</summary>
41 /// <remarks>Corresponds to the &lt;member&gt; tag.</remarks>
42 public const String MEMBER = "member";
43 /// <summary>Stuct field indicator.</summary>
44 /// <remarks>Corresponds to the &lt;struct&gt; tag.</remarks>
45 public const String STRUCT = "struct";
46 /// <summary>Double field indicator.</summary>
47 /// <remarks>Corresponds to the &lt;double&gt; tag.</remarks>
48 public const String DOUBLE = "double";
49 /// <summary>Param token.</summary>
50 /// <remarks>Corresponds to the &lt;param&gt; tag.</remarks>
51 public const String PARAM = "param";
52 /// <summary>Params token.</summary>
53 /// <remarks>Corresponds to the &lt;params&gt; tag.</remarks>
54 public const String PARAMS = "params";
55 /// <summary>MethodCall token.</summary>
56 /// <remarks>Corresponds to the &lt;methodCall&gt; tag.</remarks>
57 public const String METHOD_CALL = "methodCall";
58 /// <summary>MethodName token.</summary>
59 /// <remarks>Corresponds to the &lt;methodName&gt; tag.</remarks>
60 public const String METHOD_NAME = "methodName";
61 /// <summary>MethodResponse token</summary>
62 /// <remarks>Corresponds to the &lt;methodResponse&gt; tag.</remarks>
63 public const String METHOD_RESPONSE = "methodResponse";
64 /// <summary>Fault response token.</summary>
65 /// <remarks>Corresponds to the &lt;fault&gt; tag.</remarks>
66 public const String FAULT = "fault";
67 /// <summary>FaultCode token.</summary>
68 /// <remarks>Corresponds to the &lt;faultCode&gt; tag.</remarks>
69 public const String FAULT_CODE = "faultCode";
70 /// <summary>FaultString token.</summary>
71 /// <remarks>Corresponds to the &lt;faultString&gt; tag.</remarks>
72 public const String FAULT_STRING = "faultString";
73 }
74}
75
76