aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices/OpenGrid.Framework.Data/GridData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenGridServices/OpenGrid.Framework.Data/GridData.cs')
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/GridData.cs110
1 files changed, 110 insertions, 0 deletions
diff --git a/OpenGridServices/OpenGrid.Framework.Data/GridData.cs b/OpenGridServices/OpenGrid.Framework.Data/GridData.cs
new file mode 100644
index 0000000..e9fb215
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/GridData.cs
@@ -0,0 +1,110 @@
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}