diff options
author | lbsa71 | 2007-10-31 07:28:23 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-31 07:28:23 +0000 |
commit | 064404ab409ddd0a3b25027a98582696295c46fd (patch) | |
tree | bd84ec2e23930f76e7cc81c8529ef71936c86dd9 /OpenSim/Framework/General | |
parent | made illogical bitwise operations logical (diff) | |
download | opensim-SC_OLD-064404ab409ddd0a3b25027a98582696295c46fd.zip opensim-SC_OLD-064404ab409ddd0a3b25027a98582696295c46fd.tar.gz opensim-SC_OLD-064404ab409ddd0a3b25027a98582696295c46fd.tar.bz2 opensim-SC_OLD-064404ab409ddd0a3b25027a98582696295c46fd.tar.xz |
* Moved OpenSim/Framework/General to OpenSim/Framework for great justice.
Diffstat (limited to 'OpenSim/Framework/General')
43 files changed, 0 insertions, 6091 deletions
diff --git a/OpenSim/Framework/General/ACL.cs b/OpenSim/Framework/General/ACL.cs deleted file mode 100644 index 8f9c6e7..0000000 --- a/OpenSim/Framework/General/ACL.cs +++ /dev/null | |||
@@ -1,263 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | // ACL Class | ||
34 | // Modelled after the structure of the Zend ACL Framework Library | ||
35 | // with one key difference - the tree will search for all matching | ||
36 | // permissions rather than just the first. Deny permissions will | ||
37 | // override all others. | ||
38 | |||
39 | #region ACL Core Class | ||
40 | |||
41 | /// <summary> | ||
42 | /// Access Control List Engine | ||
43 | /// </summary> | ||
44 | public class ACL | ||
45 | { | ||
46 | private Dictionary<string, Role> Roles = new Dictionary<string, Role>(); | ||
47 | private Dictionary<string, Resource> Resources = new Dictionary<string, Resource>(); | ||
48 | |||
49 | public ACL AddRole(Role role) | ||
50 | { | ||
51 | if (Roles.ContainsKey(role.Name)) | ||
52 | throw new AlreadyContainsRoleException(role); | ||
53 | |||
54 | Roles.Add(role.Name, role); | ||
55 | |||
56 | return this; | ||
57 | } | ||
58 | |||
59 | public ACL AddResource(Resource resource) | ||
60 | { | ||
61 | Resources.Add(resource.Name, resource); | ||
62 | |||
63 | return this; | ||
64 | } | ||
65 | |||
66 | public Permission HasPermission(string role, string resource) | ||
67 | { | ||
68 | if (!Roles.ContainsKey(role)) | ||
69 | throw new KeyNotFoundException(); | ||
70 | |||
71 | if (!Resources.ContainsKey(resource)) | ||
72 | throw new KeyNotFoundException(); | ||
73 | |||
74 | return Roles[role].RequestPermission(resource); | ||
75 | } | ||
76 | |||
77 | public ACL GrantPermission(string role, string resource) | ||
78 | { | ||
79 | if (!Roles.ContainsKey(role)) | ||
80 | throw new KeyNotFoundException(); | ||
81 | |||
82 | if (!Resources.ContainsKey(resource)) | ||
83 | throw new KeyNotFoundException(); | ||
84 | |||
85 | Roles[role].GivePermission(resource, Permission.Allow); | ||
86 | |||
87 | return this; | ||
88 | } | ||
89 | |||
90 | public ACL DenyPermission(string role, string resource) | ||
91 | { | ||
92 | if (!Roles.ContainsKey(role)) | ||
93 | throw new KeyNotFoundException(); | ||
94 | |||
95 | if (!Resources.ContainsKey(resource)) | ||
96 | throw new KeyNotFoundException(); | ||
97 | |||
98 | Roles[role].GivePermission(resource, Permission.Deny); | ||
99 | |||
100 | return this; | ||
101 | } | ||
102 | |||
103 | public ACL ResetPermission(string role, string resource) | ||
104 | { | ||
105 | if (!Roles.ContainsKey(role)) | ||
106 | throw new KeyNotFoundException(); | ||
107 | |||
108 | if (!Resources.ContainsKey(resource)) | ||
109 | throw new KeyNotFoundException(); | ||
110 | |||
111 | Roles[role].GivePermission(resource, Permission.None); | ||
112 | |||
113 | return this; | ||
114 | } | ||
115 | } | ||
116 | |||
117 | #endregion | ||
118 | |||
119 | #region Exceptions | ||
120 | |||
121 | /// <summary> | ||
122 | /// Thrown when an ACL attempts to add a duplicate role. | ||
123 | /// </summary> | ||
124 | public class AlreadyContainsRoleException : Exception | ||
125 | { | ||
126 | protected Role m_role; | ||
127 | |||
128 | public Role ErrorRole | ||
129 | { | ||
130 | get { return m_role; } | ||
131 | } | ||
132 | |||
133 | public AlreadyContainsRoleException(Role role) | ||
134 | { | ||
135 | m_role = role; | ||
136 | } | ||
137 | |||
138 | public override string ToString() | ||
139 | { | ||
140 | return "This ACL already contains a role called '" + m_role.Name + "'."; | ||
141 | } | ||
142 | } | ||
143 | |||
144 | #endregion | ||
145 | |||
146 | #region Roles and Resources | ||
147 | |||
148 | /// <summary> | ||
149 | /// Does this Role have permission to access a specified Resource? | ||
150 | /// </summary> | ||
151 | public enum Permission | ||
152 | { | ||
153 | Deny, | ||
154 | None, | ||
155 | Allow | ||
156 | } ; | ||
157 | |||
158 | /// <summary> | ||
159 | /// A role class, for use with Users or Groups | ||
160 | /// </summary> | ||
161 | public class Role | ||
162 | { | ||
163 | private string m_name; | ||
164 | private Role[] m_parents; | ||
165 | private Dictionary<string, Permission> m_resources = new Dictionary<string, Permission>(); | ||
166 | |||
167 | public string Name | ||
168 | { | ||
169 | get { return m_name; } | ||
170 | } | ||
171 | |||
172 | public Permission RequestPermission(string resource) | ||
173 | { | ||
174 | return RequestPermission(resource, Permission.None); | ||
175 | } | ||
176 | |||
177 | public Permission RequestPermission(string resource, Permission current) | ||
178 | { | ||
179 | // Deny permissions always override any others | ||
180 | if (current == Permission.Deny) | ||
181 | return current; | ||
182 | |||
183 | Permission temp = Permission.None; | ||
184 | |||
185 | // Pickup non-None permissions | ||
186 | if (m_resources.ContainsKey(resource) && m_resources[resource] != Permission.None) | ||
187 | temp = m_resources[resource]; | ||
188 | |||
189 | if (m_parents != null) | ||
190 | { | ||
191 | foreach (Role parent in m_parents) | ||
192 | { | ||
193 | temp = parent.RequestPermission(resource, temp); | ||
194 | } | ||
195 | } | ||
196 | |||
197 | return temp; | ||
198 | } | ||
199 | |||
200 | public void GivePermission(string resource, Permission perm) | ||
201 | { | ||
202 | m_resources[resource] = perm; | ||
203 | } | ||
204 | |||
205 | public Role(string name) | ||
206 | { | ||
207 | m_name = name; | ||
208 | m_parents = null; | ||
209 | } | ||
210 | |||
211 | public Role(string name, Role[] parents) | ||
212 | { | ||
213 | m_name = name; | ||
214 | m_parents = parents; | ||
215 | } | ||
216 | } | ||
217 | |||
218 | public class Resource | ||
219 | { | ||
220 | private string m_name; | ||
221 | |||
222 | public string Name | ||
223 | { | ||
224 | get { return m_name; } | ||
225 | } | ||
226 | |||
227 | public Resource(string name) | ||
228 | { | ||
229 | m_name = name; | ||
230 | } | ||
231 | } | ||
232 | |||
233 | #endregion | ||
234 | |||
235 | #region Tests | ||
236 | |||
237 | internal class ACLTester | ||
238 | { | ||
239 | public ACLTester() | ||
240 | { | ||
241 | ACL acl = new ACL(); | ||
242 | |||
243 | Role Guests = new Role("Guests"); | ||
244 | acl.AddRole(Guests); | ||
245 | |||
246 | Role[] parents = new Role[0]; | ||
247 | parents[0] = Guests; | ||
248 | |||
249 | Role JoeGuest = new Role("JoeGuest", parents); | ||
250 | acl.AddRole(JoeGuest); | ||
251 | |||
252 | Resource CanBuild = new Resource("CanBuild"); | ||
253 | acl.AddResource(CanBuild); | ||
254 | |||
255 | |||
256 | acl.GrantPermission("Guests", "CanBuild"); | ||
257 | |||
258 | acl.HasPermission("JoeGuest", "CanBuild"); | ||
259 | } | ||
260 | } | ||
261 | |||
262 | #endregion | ||
263 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AgentCircuitManager.cs b/OpenSim/Framework/General/AgentCircuitManager.cs deleted file mode 100644 index 3658feb..0000000 --- a/OpenSim/Framework/General/AgentCircuitManager.cs +++ /dev/null | |||
@@ -1,127 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System.Collections.Generic; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | public class AgentCircuitManager | ||
34 | { | ||
35 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); | ||
36 | |||
37 | public AgentCircuitManager() | ||
38 | { | ||
39 | } | ||
40 | |||
41 | public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) | ||
42 | { | ||
43 | AgentCircuitData validcircuit = null; | ||
44 | if (AgentCircuits.ContainsKey(circuitcode)) | ||
45 | { | ||
46 | validcircuit = AgentCircuits[circuitcode]; | ||
47 | } | ||
48 | AuthenticateResponse user = new AuthenticateResponse(); | ||
49 | if (validcircuit == null) | ||
50 | { | ||
51 | //don't have this circuit code in our list | ||
52 | user.Authorised = false; | ||
53 | return (user); | ||
54 | } | ||
55 | |||
56 | if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) | ||
57 | { | ||
58 | user.Authorised = true; | ||
59 | user.LoginInfo = new Login(); | ||
60 | user.LoginInfo.Agent = agentID; | ||
61 | user.LoginInfo.Session = sessionID; | ||
62 | user.LoginInfo.SecureSession = validcircuit.SecureSessionID; | ||
63 | user.LoginInfo.First = validcircuit.firstname; | ||
64 | user.LoginInfo.Last = validcircuit.lastname; | ||
65 | user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; | ||
66 | user.LoginInfo.BaseFolder = validcircuit.BaseFolder; | ||
67 | } | ||
68 | else | ||
69 | { | ||
70 | // Invalid | ||
71 | user.Authorised = false; | ||
72 | } | ||
73 | |||
74 | return (user); | ||
75 | } | ||
76 | |||
77 | public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) | ||
78 | { | ||
79 | if (AgentCircuits.ContainsKey(circuitCode)) | ||
80 | { | ||
81 | AgentCircuits[circuitCode] = agentData; | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | AgentCircuits.Add(circuitCode, agentData); | ||
86 | } | ||
87 | } | ||
88 | |||
89 | public LLVector3 GetPosition(uint circuitCode) | ||
90 | { | ||
91 | LLVector3 vec = new LLVector3(); | ||
92 | if (AgentCircuits.ContainsKey(circuitCode)) | ||
93 | { | ||
94 | vec = AgentCircuits[circuitCode].startpos; | ||
95 | } | ||
96 | return vec; | ||
97 | } | ||
98 | |||
99 | public void UpdateAgentData(AgentCircuitData agentData) | ||
100 | { | ||
101 | if (AgentCircuits.ContainsKey((uint) agentData.circuitcode)) | ||
102 | { | ||
103 | AgentCircuits[(uint) agentData.circuitcode].firstname = agentData.firstname; | ||
104 | AgentCircuits[(uint) agentData.circuitcode].lastname = agentData.lastname; | ||
105 | AgentCircuits[(uint) agentData.circuitcode].startpos = agentData.startpos; | ||
106 | // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); | ||
107 | } | ||
108 | } | ||
109 | |||
110 | public void UpdateAgentChildStatus(uint circuitcode, bool childstatus) | ||
111 | { | ||
112 | if (AgentCircuits.ContainsKey(circuitcode)) | ||
113 | { | ||
114 | AgentCircuits[circuitcode].child = childstatus; | ||
115 | } | ||
116 | } | ||
117 | |||
118 | public bool GetAgentChildStatus(uint circuitcode) | ||
119 | { | ||
120 | if (AgentCircuits.ContainsKey(circuitcode)) | ||
121 | { | ||
122 | return AgentCircuits[circuitcode].child; | ||
123 | } | ||
124 | return false; | ||
125 | } | ||
126 | } | ||
127 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AgentCiruitData.cs b/OpenSim/Framework/General/AgentCiruitData.cs deleted file mode 100644 index 3f17ca8..0000000 --- a/OpenSim/Framework/General/AgentCiruitData.cs +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | [Serializable] | ||
34 | public class AgentCircuitData | ||
35 | { | ||
36 | public AgentCircuitData() | ||
37 | { | ||
38 | } | ||
39 | |||
40 | public LLUUID AgentID; | ||
41 | public LLUUID SessionID; | ||
42 | public LLUUID SecureSessionID; | ||
43 | public LLVector3 startpos; | ||
44 | public string firstname; | ||
45 | public string lastname; | ||
46 | public uint circuitcode; | ||
47 | public bool child; | ||
48 | public LLUUID InventoryFolder; | ||
49 | public LLUUID BaseFolder; | ||
50 | public string CapsPath = ""; | ||
51 | } | ||
52 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AgentInventory.cs b/OpenSim/Framework/General/AgentInventory.cs deleted file mode 100644 index 7a1174a..0000000 --- a/OpenSim/Framework/General/AgentInventory.cs +++ /dev/null | |||
@@ -1,258 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System.Collections.Generic; | ||
29 | using libsecondlife; | ||
30 | using libsecondlife.Packets; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | public class AgentInventory | ||
35 | { | ||
36 | //Holds the local copy of Inventory info for a agent | ||
37 | public Dictionary<LLUUID, InventoryFolder> InventoryFolders; | ||
38 | public Dictionary<LLUUID, InventoryItem> InventoryItems; | ||
39 | public InventoryFolder InventoryRoot; | ||
40 | public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server | ||
41 | public LLUUID AgentID; | ||
42 | public AvatarWearable[] Wearables; | ||
43 | |||
44 | public AgentInventory() | ||
45 | { | ||
46 | InventoryFolders = new Dictionary<LLUUID, InventoryFolder>(); | ||
47 | InventoryItems = new Dictionary<LLUUID, InventoryItem>(); | ||
48 | Initialise(); | ||
49 | } | ||
50 | |||
51 | public virtual void Initialise() | ||
52 | { | ||
53 | Wearables = new AvatarWearable[13]; | ||
54 | for (int i = 0; i < 13; i++) | ||
55 | { | ||
56 | Wearables[i] = new AvatarWearable(); | ||
57 | } | ||
58 | } | ||
59 | |||
60 | public bool CreateNewFolder(LLUUID folderID, ushort type) | ||
61 | { | ||
62 | InventoryFolder Folder = new InventoryFolder(); | ||
63 | Folder.FolderID = folderID; | ||
64 | Folder.OwnerID = AgentID; | ||
65 | Folder.DefaultType = type; | ||
66 | InventoryFolders.Add(Folder.FolderID, Folder); | ||
67 | return (true); | ||
68 | } | ||
69 | |||
70 | public void CreateRootFolder(LLUUID newAgentID, bool createTextures) | ||
71 | { | ||
72 | AgentID = newAgentID; | ||
73 | InventoryRoot = new InventoryFolder(); | ||
74 | InventoryRoot.FolderID = LLUUID.Random(); | ||
75 | InventoryRoot.ParentID = new LLUUID(); | ||
76 | InventoryRoot.Version = 1; | ||
77 | InventoryRoot.DefaultType = 8; | ||
78 | InventoryRoot.OwnerID = AgentID; | ||
79 | InventoryRoot.FolderName = "My Inventory"; | ||
80 | InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot); | ||
81 | InventoryRoot.OwnerID = AgentID; | ||
82 | if (createTextures) | ||
83 | { | ||
84 | CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID); | ||
85 | } | ||
86 | } | ||
87 | |||
88 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName) | ||
89 | { | ||
90 | InventoryFolder Folder = new InventoryFolder(); | ||
91 | Folder.FolderID = folderID; | ||
92 | Folder.OwnerID = AgentID; | ||
93 | Folder.DefaultType = type; | ||
94 | Folder.FolderName = folderName; | ||
95 | InventoryFolders.Add(Folder.FolderID, Folder); | ||
96 | return (true); | ||
97 | } | ||
98 | |||
99 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parentID) | ||
100 | { | ||
101 | if (!InventoryFolders.ContainsKey(folderID)) | ||
102 | { | ||
103 | System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory"); | ||
104 | InventoryFolder Folder = new InventoryFolder(); | ||
105 | Folder.FolderID = folderID; | ||
106 | Folder.OwnerID = AgentID; | ||
107 | Folder.DefaultType = type; | ||
108 | Folder.FolderName = folderName; | ||
109 | Folder.ParentID = parentID; | ||
110 | InventoryFolders.Add(Folder.FolderID, Folder); | ||
111 | } | ||
112 | return (true); | ||
113 | } | ||
114 | |||
115 | public bool HasFolder(LLUUID folderID) | ||
116 | { | ||
117 | if (InventoryFolders.ContainsKey(folderID)) | ||
118 | { | ||
119 | return true; | ||
120 | } | ||
121 | return false; | ||
122 | } | ||
123 | |||
124 | public LLUUID GetFolderID(string folderName) | ||
125 | { | ||
126 | foreach (InventoryFolder inv in InventoryFolders.Values) | ||
127 | { | ||
128 | if (inv.FolderName == folderName) | ||
129 | { | ||
130 | return inv.FolderID; | ||
131 | } | ||
132 | } | ||
133 | return LLUUID.Zero; | ||
134 | } | ||
135 | |||
136 | public bool UpdateItemAsset(LLUUID itemID, AssetBase asset) | ||
137 | { | ||
138 | if (InventoryItems.ContainsKey(itemID)) | ||
139 | { | ||
140 | InventoryItem Item = InventoryItems[itemID]; | ||
141 | Item.AssetID = asset.FullID; | ||
142 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + | ||
143 | " so it now is set to asset " + asset.FullID.ToStringHyphenated()); | ||
144 | //TODO need to update the rest of the info | ||
145 | } | ||
146 | return true; | ||
147 | } | ||
148 | |||
149 | public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) | ||
150 | { | ||
151 | System.Console.WriteLine("updating inventory item details"); | ||
152 | if (InventoryItems.ContainsKey(itemID)) | ||
153 | { | ||
154 | System.Console.WriteLine("changing name to " + Util.FieldToString(packet.Name)); | ||
155 | InventoryItem Item = InventoryItems[itemID]; | ||
156 | Item.Name = Util.FieldToString(packet.Name); | ||
157 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated()); | ||
158 | //TODO need to update the rest of the info | ||
159 | } | ||
160 | return true; | ||
161 | } | ||
162 | |||
163 | public LLUUID AddToInventory(LLUUID folderID, AssetBase asset) | ||
164 | { | ||
165 | if (InventoryFolders.ContainsKey(folderID)) | ||
166 | { | ||
167 | LLUUID NewItemID = LLUUID.Random(); | ||
168 | |||
169 | InventoryItem Item = new InventoryItem(); | ||
170 | Item.FolderID = folderID; | ||
171 | Item.OwnerID = AgentID; | ||
172 | Item.AssetID = asset.FullID; | ||
173 | Item.ItemID = NewItemID; | ||
174 | Item.Type = asset.Type; | ||
175 | Item.Name = asset.Name; | ||
176 | Item.Description = asset.Description; | ||
177 | Item.InvType = asset.InvType; | ||
178 | InventoryItems.Add(Item.ItemID, Item); | ||
179 | InventoryFolder Folder = InventoryFolders[Item.FolderID]; | ||
180 | Folder.Items.Add(Item); | ||
181 | return (Item.ItemID); | ||
182 | } | ||
183 | else | ||
184 | { | ||
185 | return (null); | ||
186 | } | ||
187 | } | ||
188 | |||
189 | public bool DeleteFromInventory(LLUUID itemID) | ||
190 | { | ||
191 | bool res = false; | ||
192 | if (InventoryItems.ContainsKey(itemID)) | ||
193 | { | ||
194 | InventoryItem item = InventoryItems[itemID]; | ||
195 | InventoryItems.Remove(itemID); | ||
196 | foreach (InventoryFolder fold in InventoryFolders.Values) | ||
197 | { | ||
198 | if (fold.Items.Contains(item)) | ||
199 | { | ||
200 | fold.Items.Remove(item); | ||
201 | break; | ||
202 | } | ||
203 | } | ||
204 | res = true; | ||
205 | } | ||
206 | return res; | ||
207 | } | ||
208 | } | ||
209 | |||
210 | public class InventoryFolder | ||
211 | { | ||
212 | public List<InventoryItem> Items; | ||
213 | //public List<InventoryFolder> Subfolders; | ||
214 | public LLUUID FolderID; | ||
215 | public LLUUID OwnerID; | ||
216 | public LLUUID ParentID = LLUUID.Zero; | ||
217 | public string FolderName; | ||
218 | public ushort DefaultType; | ||
219 | public ushort Version; | ||
220 | |||
221 | public InventoryFolder() | ||
222 | { | ||
223 | Items = new List<InventoryItem>(); | ||
224 | //Subfolders = new List<InventoryFolder>(); | ||
225 | } | ||
226 | } | ||
227 | |||
228 | public class InventoryItem | ||
229 | { | ||
230 | public LLUUID FolderID; | ||
231 | public LLUUID OwnerID; | ||
232 | public LLUUID ItemID; | ||
233 | public LLUUID AssetID; | ||
234 | public LLUUID CreatorID; | ||
235 | public sbyte InvType; | ||
236 | public sbyte Type; | ||
237 | public string Name = ""; | ||
238 | public string Description; | ||
239 | |||
240 | public InventoryItem() | ||
241 | { | ||
242 | CreatorID = LLUUID.Zero; | ||
243 | } | ||
244 | |||
245 | public string ExportString() | ||
246 | { | ||
247 | string typ = "notecard"; | ||
248 | string result = ""; | ||
249 | result += "\tinv_object\t0\n\t{\n"; | ||
250 | result += "\t\tobj_id\t%s\n"; | ||
251 | result += "\t\tparent_id\t" + ItemID.ToString() + "\n"; | ||
252 | result += "\t\ttype\t" + typ + "\n"; | ||
253 | result += "\t\tname\t" + Name + "|\n"; | ||
254 | result += "\t}\n"; | ||
255 | return result; | ||
256 | } | ||
257 | } | ||
258 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AgentWearable.cs b/OpenSim/Framework/General/AgentWearable.cs deleted file mode 100644 index a324cb3..0000000 --- a/OpenSim/Framework/General/AgentWearable.cs +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public class AvatarWearable | ||
33 | { | ||
34 | public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
35 | public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
36 | |||
37 | public AvatarWearable() | ||
38 | { | ||
39 | } | ||
40 | |||
41 | public AvatarWearable(LLUUID itemId, LLUUID assetId) | ||
42 | { | ||
43 | AssetID = assetId; | ||
44 | ItemID = itemId; | ||
45 | } | ||
46 | |||
47 | public static AvatarWearable[] DefaultWearables | ||
48 | { | ||
49 | get | ||
50 | { | ||
51 | AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these | ||
52 | for (int i = 0; i < 13; i++) | ||
53 | { | ||
54 | defaultWearables[i] = new AvatarWearable(); | ||
55 | } | ||
56 | defaultWearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | ||
57 | defaultWearables[0].ItemID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9"); | ||
58 | |||
59 | defaultWearables[1].ItemID = new LLUUID("77c41e39-38f9-f75a-024e-585989bfabc9"); | ||
60 | defaultWearables[1].AssetID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"); | ||
61 | |||
62 | defaultWearables[4].ItemID = new LLUUID("77c41e39-38f9-f75a-0000-585989bf0000"); | ||
63 | defaultWearables[4].AssetID = new LLUUID("00000000-38f9-1111-024e-222222111110"); | ||
64 | |||
65 | defaultWearables[5].ItemID = new LLUUID("77c41e39-38f9-f75a-0000-5859892f1111"); | ||
66 | defaultWearables[5].AssetID = new LLUUID("00000000-38f9-1111-024e-222222111120"); | ||
67 | return defaultWearables; | ||
68 | } | ||
69 | } | ||
70 | } | ||
71 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AssetBase.cs b/OpenSim/Framework/General/AssetBase.cs deleted file mode 100644 index ef1ee71..0000000 --- a/OpenSim/Framework/General/AssetBase.cs +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | [Serializable] | ||
34 | public class AssetBase | ||
35 | { | ||
36 | public byte[] Data; | ||
37 | public LLUUID FullID; | ||
38 | public sbyte Type; | ||
39 | public sbyte InvType; | ||
40 | public string Name = ""; | ||
41 | public string Description = ""; | ||
42 | public bool Local = false; | ||
43 | public bool Temporary = false; | ||
44 | |||
45 | public AssetBase() | ||
46 | { | ||
47 | } | ||
48 | |||
49 | public AssetBase(LLUUID assetId, string name) | ||
50 | { | ||
51 | FullID = assetId; | ||
52 | Name = name; | ||
53 | } | ||
54 | } | ||
55 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AssetConfig.cs b/OpenSim/Framework/General/AssetConfig.cs deleted file mode 100644 index fe77ab8..0000000 --- a/OpenSim/Framework/General/AssetConfig.cs +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | namespace OpenSim.Framework | ||
30 | { | ||
31 | /// <summary> | ||
32 | /// UserConfig -- For User Server Configuration | ||
33 | /// </summary> | ||
34 | public class AssetConfig | ||
35 | { | ||
36 | public string DefaultStartupMsg = ""; | ||
37 | |||
38 | public string DatabaseProvider = ""; | ||
39 | |||
40 | public static uint DefaultHttpPort = 8003; | ||
41 | public uint HttpPort = DefaultHttpPort; | ||
42 | |||
43 | private ConfigurationMember configMember; | ||
44 | |||
45 | public AssetConfig(string description, string filename) | ||
46 | { | ||
47 | configMember = | ||
48 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); | ||
49 | configMember.performConfigurationRetrieve(); | ||
50 | } | ||
51 | |||
52 | public void loadConfigurationOptions() | ||
53 | { | ||
54 | configMember.addConfigurationOption("default_startup_message", | ||
55 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
56 | "Default Startup Message", "Welcome to OGS", false); | ||
57 | |||
58 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
59 | "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | ||
60 | |||
61 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
62 | "Http Listener port", DefaultHttpPort.ToString(), false); | ||
63 | } | ||
64 | |||
65 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
66 | { | ||
67 | switch (configuration_key) | ||
68 | { | ||
69 | case "default_startup_message": | ||
70 | DefaultStartupMsg = (string) configuration_result; | ||
71 | break; | ||
72 | case "database_provider": | ||
73 | DatabaseProvider = (string) configuration_result; | ||
74 | break; | ||
75 | case "http_port": | ||
76 | HttpPort = (uint) configuration_result; | ||
77 | break; | ||
78 | } | ||
79 | |||
80 | return true; | ||
81 | } | ||
82 | } | ||
83 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AssetLandmark.cs b/OpenSim/Framework/General/AssetLandmark.cs deleted file mode 100644 index 4422331..0000000 --- a/OpenSim/Framework/General/AssetLandmark.cs +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System.Text; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | public class AssetLandmark : AssetBase | ||
34 | { | ||
35 | public int Version; | ||
36 | public LLVector3 Position; | ||
37 | public LLUUID RegionID; | ||
38 | |||
39 | public AssetLandmark(AssetBase a) | ||
40 | { | ||
41 | Data = a.Data; | ||
42 | FullID = a.FullID; | ||
43 | Type = a.Type; | ||
44 | InvType = a.InvType; | ||
45 | Name = a.Name; | ||
46 | Description = a.Description; | ||
47 | InternData(); | ||
48 | } | ||
49 | |||
50 | private void InternData() | ||
51 | { | ||
52 | string temp = Encoding.UTF8.GetString(Data).Trim(); | ||
53 | string[] parts = temp.Split('\n'); | ||
54 | int.TryParse(parts[0].Substring(17, 1), out Version); | ||
55 | LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID); | ||
56 | LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position); | ||
57 | } | ||
58 | } | ||
59 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AssetStorage.cs b/OpenSim/Framework/General/AssetStorage.cs deleted file mode 100644 index 9d3de5b..0000000 --- a/OpenSim/Framework/General/AssetStorage.cs +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public class AssetStorage | ||
33 | { | ||
34 | public AssetStorage() | ||
35 | { | ||
36 | } | ||
37 | |||
38 | public AssetStorage(LLUUID assetUUID) | ||
39 | { | ||
40 | UUID = assetUUID; | ||
41 | } | ||
42 | |||
43 | public byte[] Data; | ||
44 | public sbyte Type; | ||
45 | public string Name; | ||
46 | public LLUUID UUID; | ||
47 | } | ||
48 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/AuthenticateResponse.cs b/OpenSim/Framework/General/AuthenticateResponse.cs deleted file mode 100644 index 88a8713..0000000 --- a/OpenSim/Framework/General/AuthenticateResponse.cs +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | namespace OpenSim.Framework | ||
29 | { | ||
30 | public class AuthenticateResponse | ||
31 | { | ||
32 | public bool Authorised; | ||
33 | public Login LoginInfo; | ||
34 | |||
35 | public AuthenticateResponse() | ||
36 | { | ||
37 | } | ||
38 | } | ||
39 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/BlockingQueue.cs b/OpenSim/Framework/General/BlockingQueue.cs deleted file mode 100644 index 006fbc8..0000000 --- a/OpenSim/Framework/General/BlockingQueue.cs +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System.Collections.Generic; | ||
29 | using System.Threading; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | public class BlockingQueue<T> | ||
34 | { | ||
35 | private Queue<T> _queue = new Queue<T>(); | ||
36 | private object _queueSync = new object(); | ||
37 | |||
38 | public void Enqueue(T value) | ||
39 | { | ||
40 | lock (_queueSync) | ||
41 | { | ||
42 | _queue.Enqueue(value); | ||
43 | Monitor.Pulse(_queueSync); | ||
44 | } | ||
45 | } | ||
46 | |||
47 | public T Dequeue() | ||
48 | { | ||
49 | lock (_queueSync) | ||
50 | { | ||
51 | if (_queue.Count < 1) | ||
52 | Monitor.Wait(_queueSync); | ||
53 | |||
54 | return _queue.Dequeue(); | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs deleted file mode 100644 index e34c051..0000000 --- a/OpenSim/Framework/General/ClientManager.cs +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System.Collections.Generic; | ||
30 | using libsecondlife; | ||
31 | using libsecondlife.Packets; | ||
32 | |||
33 | namespace OpenSim.Framework | ||
34 | { | ||
35 | public delegate void ForEachClientDelegate(IClientAPI client); | ||
36 | |||
37 | public class ClientManager | ||
38 | { | ||
39 | private Dictionary<uint, IClientAPI> m_clients; | ||
40 | |||
41 | public void ForEachClient(ForEachClientDelegate whatToDo) | ||
42 | { | ||
43 | foreach (IClientAPI client in m_clients.Values) | ||
44 | { | ||
45 | whatToDo(client); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | public ClientManager() | ||
50 | { | ||
51 | m_clients = new Dictionary<uint, IClientAPI>(); | ||
52 | } | ||
53 | |||
54 | private void Remove(uint id) | ||
55 | { | ||
56 | m_clients.Remove(id); | ||
57 | } | ||
58 | |||
59 | public void Add(uint id, IClientAPI client) | ||
60 | { | ||
61 | m_clients.Add(id, client); | ||
62 | } | ||
63 | |||
64 | public void InPacket(uint circuitCode, Packet packet) | ||
65 | { | ||
66 | IClientAPI client; | ||
67 | |||
68 | if (m_clients.TryGetValue(circuitCode, out client)) | ||
69 | { | ||
70 | client.InPacket(packet); | ||
71 | } | ||
72 | } | ||
73 | |||
74 | public void CloseAllAgents(uint circuitCode) | ||
75 | { | ||
76 | IClientAPI client; | ||
77 | |||
78 | if (m_clients.TryGetValue(circuitCode, out client)) | ||
79 | { | ||
80 | CloseAllCircuits(client.AgentId); | ||
81 | } | ||
82 | } | ||
83 | |||
84 | public void CloseAllCircuits(LLUUID agentId) | ||
85 | { | ||
86 | uint[] circuits = GetAllCircuits(agentId); | ||
87 | foreach (uint circuit in circuits) | ||
88 | { | ||
89 | IClientAPI client; | ||
90 | if (m_clients.TryGetValue(circuit, out client)) | ||
91 | { | ||
92 | Remove(circuit); | ||
93 | client.Close(); | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | |||
98 | private uint[] GetAllCircuits(LLUUID agentId) | ||
99 | { | ||
100 | List<uint> circuits = new List<uint>(); | ||
101 | |||
102 | foreach (KeyValuePair<uint, IClientAPI> pair in m_clients) | ||
103 | { | ||
104 | if (pair.Value.AgentId == agentId) | ||
105 | { | ||
106 | circuits.Add(pair.Key); | ||
107 | } | ||
108 | } | ||
109 | |||
110 | return circuits.ToArray(); | ||
111 | } | ||
112 | |||
113 | |||
114 | public void ViewerEffectHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock) | ||
115 | { | ||
116 | ViewerEffectPacket packet = new ViewerEffectPacket(); | ||
117 | packet.Effect = effectBlock; | ||
118 | |||
119 | foreach (IClientAPI client in m_clients.Values) | ||
120 | { | ||
121 | if (client.AgentId != sender.AgentId) | ||
122 | { | ||
123 | packet.AgentData.AgentID = client.AgentId; | ||
124 | packet.AgentData.SessionID = client.SessionId; | ||
125 | client.OutPacket(packet); | ||
126 | } | ||
127 | } | ||
128 | } | ||
129 | |||
130 | public bool TryGetClient(uint circuitId, out IClientAPI user) | ||
131 | { | ||
132 | return m_clients.TryGetValue(circuitId, out user); | ||
133 | } | ||
134 | } | ||
135 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/ConfigurationMember.cs b/OpenSim/Framework/General/ConfigurationMember.cs deleted file mode 100644 index b68896c..0000000 --- a/OpenSim/Framework/General/ConfigurationMember.cs +++ /dev/null | |||
@@ -1,440 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Globalization; | ||
32 | using System.Net; | ||
33 | using System.Reflection; | ||
34 | using libsecondlife; | ||
35 | using OpenSim.Framework.Console; | ||
36 | |||
37 | namespace OpenSim.Framework | ||
38 | { | ||
39 | public class ConfigurationMember | ||
40 | { | ||
41 | public delegate bool ConfigurationOptionResult(string configuration_key, object configuration_result); | ||
42 | |||
43 | public delegate void ConfigurationOptionsLoad(); | ||
44 | |||
45 | private List<ConfigurationOption> configurationOptions = new List<ConfigurationOption>(); | ||
46 | private string configurationFilename = ""; | ||
47 | private string configurationDescription = ""; | ||
48 | |||
49 | private ConfigurationOptionsLoad loadFunction; | ||
50 | private ConfigurationOptionResult resultFunction; | ||
51 | |||
52 | private IGenericConfig configurationPlugin = null; | ||
53 | |||
54 | /// <summary> | ||
55 | /// This is the default configuration DLL loaded | ||
56 | /// </summary> | ||
57 | private string configurationPluginFilename = "OpenSim.Framework.Configuration.XML.dll"; | ||
58 | |||
59 | public ConfigurationMember(string configuration_filename, string configuration_description, | ||
60 | ConfigurationOptionsLoad load_function, ConfigurationOptionResult result_function) | ||
61 | { | ||
62 | configurationFilename = configuration_filename; | ||
63 | configurationDescription = configuration_description; | ||
64 | loadFunction = load_function; | ||
65 | resultFunction = result_function; | ||
66 | } | ||
67 | |||
68 | public void setConfigurationFilename(string filename) | ||
69 | { | ||
70 | configurationFilename = filename; | ||
71 | } | ||
72 | |||
73 | public void setConfigurationDescription(string desc) | ||
74 | { | ||
75 | configurationDescription = desc; | ||
76 | } | ||
77 | |||
78 | public void setConfigurationResultFunction(ConfigurationOptionResult result) | ||
79 | { | ||
80 | resultFunction = result; | ||
81 | } | ||
82 | |||
83 | public void forceConfigurationPluginLibrary(string dll_filename) | ||
84 | { | ||
85 | configurationPluginFilename = dll_filename; | ||
86 | } | ||
87 | |||
88 | public void addConfigurationOption(string configuration_key, | ||
89 | ConfigurationOption.ConfigurationTypes configuration_type, | ||
90 | string configuration_question, string configuration_default, | ||
91 | bool use_default_no_prompt) | ||
92 | { | ||
93 | ConfigurationOption configOption = new ConfigurationOption(); | ||
94 | configOption.configurationKey = configuration_key; | ||
95 | configOption.configurationQuestion = configuration_question; | ||
96 | configOption.configurationDefault = configuration_default; | ||
97 | configOption.configurationType = configuration_type; | ||
98 | configOption.configurationUseDefaultNoPrompt = use_default_no_prompt; | ||
99 | |||
100 | if ((configuration_key != "" && configuration_question != "") || | ||
101 | (configuration_key != "" && use_default_no_prompt)) | ||
102 | { | ||
103 | if (!configurationOptions.Contains(configOption)) | ||
104 | { | ||
105 | configurationOptions.Add(configOption); | ||
106 | } | ||
107 | } | ||
108 | else | ||
109 | { | ||
110 | MainLog.Instance.Notice( | ||
111 | "Required fields for adding a configuration option is invalid. Will not add this option (" + | ||
112 | configuration_key + ")"); | ||
113 | } | ||
114 | } | ||
115 | |||
116 | public void performConfigurationRetrieve() | ||
117 | { | ||
118 | configurationPlugin = LoadConfigDll(configurationPluginFilename); | ||
119 | configurationOptions.Clear(); | ||
120 | if (loadFunction == null) | ||
121 | { | ||
122 | MainLog.Instance.Error("Load Function for '" + configurationDescription + | ||
123 | "' is null. Refusing to run configuration."); | ||
124 | return; | ||
125 | } | ||
126 | |||
127 | if (resultFunction == null) | ||
128 | { | ||
129 | MainLog.Instance.Error("Result Function for '" + configurationDescription + | ||
130 | "' is null. Refusing to run configuration."); | ||
131 | return; | ||
132 | } | ||
133 | |||
134 | MainLog.Instance.Verbose("Calling Configuration Load Function..."); | ||
135 | loadFunction(); | ||
136 | |||
137 | if (configurationOptions.Count <= 0) | ||
138 | { | ||
139 | MainLog.Instance.Error("No configuration options were specified for '" + configurationOptions + | ||
140 | "'. Refusing to continue configuration."); | ||
141 | return; | ||
142 | } | ||
143 | |||
144 | bool useFile = true; | ||
145 | if (configurationPlugin == null) | ||
146 | { | ||
147 | MainLog.Instance.Error("Configuration Plugin NOT LOADED!"); | ||
148 | return; | ||
149 | } | ||
150 | |||
151 | if (configurationFilename.Trim() != "") | ||
152 | { | ||
153 | configurationPlugin.SetFileName(configurationFilename); | ||
154 | configurationPlugin.LoadData(); | ||
155 | useFile = true; | ||
156 | } | ||
157 | else | ||
158 | { | ||
159 | MainLog.Instance.Notice("XML Configuration Filename is not valid; will not save to the file."); | ||
160 | useFile = false; | ||
161 | } | ||
162 | |||
163 | foreach (ConfigurationOption configOption in configurationOptions) | ||
164 | { | ||
165 | bool convertSuccess = false; | ||
166 | object return_result = null; | ||
167 | string errorMessage = ""; | ||
168 | bool ignoreNextFromConfig = false; | ||
169 | while (convertSuccess == false) | ||
170 | { | ||
171 | string console_result = ""; | ||
172 | string attribute = null; | ||
173 | if (useFile) | ||
174 | { | ||
175 | if (!ignoreNextFromConfig) | ||
176 | { | ||
177 | attribute = configurationPlugin.GetAttribute(configOption.configurationKey); | ||
178 | } | ||
179 | else | ||
180 | { | ||
181 | ignoreNextFromConfig = false; | ||
182 | } | ||
183 | } | ||
184 | |||
185 | if (attribute == null) | ||
186 | { | ||
187 | if (configOption.configurationUseDefaultNoPrompt) | ||
188 | { | ||
189 | console_result = configOption.configurationDefault; | ||
190 | } | ||
191 | else | ||
192 | { | ||
193 | if (configurationDescription.Trim() != "") | ||
194 | { | ||
195 | console_result = | ||
196 | MainLog.Instance.CmdPrompt( | ||
197 | configurationDescription + ": " + configOption.configurationQuestion, | ||
198 | configOption.configurationDefault); | ||
199 | } | ||
200 | else | ||
201 | { | ||
202 | console_result = | ||
203 | MainLog.Instance.CmdPrompt(configOption.configurationQuestion, | ||
204 | configOption.configurationDefault); | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | else | ||
209 | { | ||
210 | console_result = attribute; | ||
211 | } | ||
212 | |||
213 | switch (configOption.configurationType) | ||
214 | { | ||
215 | case ConfigurationOption.ConfigurationTypes.TYPE_STRING: | ||
216 | return_result = console_result; | ||
217 | convertSuccess = true; | ||
218 | break; | ||
219 | case ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY: | ||
220 | if (console_result.Length > 0) | ||
221 | { | ||
222 | return_result = console_result; | ||
223 | convertSuccess = true; | ||
224 | } | ||
225 | errorMessage = "a string that is not empty"; | ||
226 | break; | ||
227 | case ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN: | ||
228 | bool boolResult; | ||
229 | if (Boolean.TryParse(console_result, out boolResult)) | ||
230 | { | ||
231 | convertSuccess = true; | ||
232 | return_result = boolResult; | ||
233 | } | ||
234 | errorMessage = "'true' or 'false' (Boolean)"; | ||
235 | break; | ||
236 | case ConfigurationOption.ConfigurationTypes.TYPE_BYTE: | ||
237 | byte byteResult; | ||
238 | if (Byte.TryParse(console_result, out byteResult)) | ||
239 | { | ||
240 | convertSuccess = true; | ||
241 | return_result = byteResult; | ||
242 | } | ||
243 | errorMessage = "a byte (Byte)"; | ||
244 | break; | ||
245 | case ConfigurationOption.ConfigurationTypes.TYPE_CHARACTER: | ||
246 | char charResult; | ||
247 | if (Char.TryParse(console_result, out charResult)) | ||
248 | { | ||
249 | convertSuccess = true; | ||
250 | return_result = charResult; | ||
251 | } | ||
252 | errorMessage = "a character (Char)"; | ||
253 | break; | ||
254 | case ConfigurationOption.ConfigurationTypes.TYPE_INT16: | ||
255 | short shortResult; | ||
256 | if (Int16.TryParse(console_result, out shortResult)) | ||
257 | { | ||
258 | convertSuccess = true; | ||
259 | return_result = shortResult; | ||
260 | } | ||
261 | errorMessage = "a signed 32 bit integer (short)"; | ||
262 | break; | ||
263 | case ConfigurationOption.ConfigurationTypes.TYPE_INT32: | ||
264 | int intResult; | ||
265 | if (Int32.TryParse(console_result, out intResult)) | ||
266 | { | ||
267 | convertSuccess = true; | ||
268 | return_result = intResult; | ||
269 | } | ||
270 | errorMessage = "a signed 32 bit integer (int)"; | ||
271 | break; | ||
272 | case ConfigurationOption.ConfigurationTypes.TYPE_INT64: | ||
273 | long longResult; | ||
274 | if (Int64.TryParse(console_result, out longResult)) | ||
275 | { | ||
276 | convertSuccess = true; | ||
277 | return_result = longResult; | ||
278 | } | ||
279 | errorMessage = "a signed 32 bit integer (long)"; | ||
280 | break; | ||
281 | case ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS: | ||
282 | IPAddress ipAddressResult; | ||
283 | if (IPAddress.TryParse(console_result, out ipAddressResult)) | ||
284 | { | ||
285 | convertSuccess = true; | ||
286 | return_result = ipAddressResult; | ||
287 | } | ||
288 | errorMessage = "an IP Address (IPAddress)"; | ||
289 | break; | ||
290 | case ConfigurationOption.ConfigurationTypes.TYPE_LLUUID: | ||
291 | LLUUID uuidResult; | ||
292 | if (LLUUID.TryParse(console_result, out uuidResult)) | ||
293 | { | ||
294 | convertSuccess = true; | ||
295 | return_result = uuidResult; | ||
296 | } | ||
297 | errorMessage = "a UUID (LLUUID)"; | ||
298 | break; | ||
299 | case ConfigurationOption.ConfigurationTypes.TYPE_LLVECTOR3: | ||
300 | LLVector3 vectorResult; | ||
301 | if (LLVector3.TryParse(console_result, out vectorResult)) | ||
302 | { | ||
303 | convertSuccess = true; | ||
304 | return_result = vectorResult; | ||
305 | } | ||
306 | errorMessage = "a vector (LLVector3)"; | ||
307 | break; | ||
308 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT16: | ||
309 | ushort ushortResult; | ||
310 | if (UInt16.TryParse(console_result, out ushortResult)) | ||
311 | { | ||
312 | convertSuccess = true; | ||
313 | return_result = ushortResult; | ||
314 | } | ||
315 | errorMessage = "an unsigned 16 bit integer (ushort)"; | ||
316 | break; | ||
317 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT32: | ||
318 | uint uintResult; | ||
319 | if (UInt32.TryParse(console_result, out uintResult)) | ||
320 | { | ||
321 | convertSuccess = true; | ||
322 | return_result = uintResult; | ||
323 | } | ||
324 | errorMessage = "an unsigned 32 bit integer (uint)"; | ||
325 | break; | ||
326 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT64: | ||
327 | ulong ulongResult; | ||
328 | if (UInt64.TryParse(console_result, out ulongResult)) | ||
329 | { | ||
330 | convertSuccess = true; | ||
331 | return_result = ulongResult; | ||
332 | } | ||
333 | errorMessage = "an unsigned 64 bit integer (ulong)"; | ||
334 | break; | ||
335 | case ConfigurationOption.ConfigurationTypes.TYPE_FLOAT: | ||
336 | float floatResult; | ||
337 | if ( | ||
338 | float.TryParse(console_result, NumberStyles.AllowDecimalPoint, Culture.NumberFormatInfo, | ||
339 | out floatResult)) | ||
340 | { | ||
341 | convertSuccess = true; | ||
342 | return_result = floatResult; | ||
343 | } | ||
344 | errorMessage = "a single-precision floating point number (float)"; | ||
345 | break; | ||
346 | case ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE: | ||
347 | double doubleResult; | ||
348 | if ( | ||
349 | Double.TryParse(console_result, NumberStyles.AllowDecimalPoint, Culture.NumberFormatInfo, | ||
350 | out doubleResult)) | ||
351 | { | ||
352 | convertSuccess = true; | ||
353 | return_result = doubleResult; | ||
354 | } | ||
355 | errorMessage = "an double-precision floating point number (double)"; | ||
356 | break; | ||
357 | } | ||
358 | |||
359 | if (convertSuccess) | ||
360 | { | ||
361 | if (useFile) | ||
362 | { | ||
363 | configurationPlugin.SetAttribute(configOption.configurationKey, console_result); | ||
364 | } | ||
365 | |||
366 | |||
367 | if (!resultFunction(configOption.configurationKey, return_result)) | ||
368 | { | ||
369 | MainLog.Instance.Notice( | ||
370 | "The handler for the last configuration option denied that input, please try again."); | ||
371 | convertSuccess = false; | ||
372 | ignoreNextFromConfig = true; | ||
373 | } | ||
374 | } | ||
375 | else | ||
376 | { | ||
377 | if (configOption.configurationUseDefaultNoPrompt) | ||
378 | { | ||
379 | MainLog.Instance.Error("CONFIG", | ||
380 | string.Format( | ||
381 | "[{3}]:[{1}] is not valid default for parameter [{0}].\nThe configuration result must be parsable to {2}.\n", | ||
382 | configOption.configurationKey, console_result, errorMessage, | ||
383 | configurationFilename)); | ||
384 | convertSuccess = true; | ||
385 | } | ||
386 | else | ||
387 | { | ||
388 | MainLog.Instance.Warn("CONFIG", | ||
389 | string.Format( | ||
390 | "[{3}]:[{1}] is not a valid value [{0}].\nThe configuration result must be parsable to {2}.\n", | ||
391 | configOption.configurationKey, console_result, errorMessage, | ||
392 | configurationFilename)); | ||
393 | ignoreNextFromConfig = true; | ||
394 | } | ||
395 | } | ||
396 | } | ||
397 | } | ||
398 | |||
399 | if (useFile) | ||
400 | { | ||
401 | configurationPlugin.Commit(); | ||
402 | configurationPlugin.Close(); | ||
403 | } | ||
404 | } | ||
405 | |||
406 | private IGenericConfig LoadConfigDll(string dllName) | ||
407 | { | ||
408 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); | ||
409 | IGenericConfig plug = null; | ||
410 | |||
411 | foreach (Type pluginType in pluginAssembly.GetTypes()) | ||
412 | { | ||
413 | if (pluginType.IsPublic) | ||
414 | { | ||
415 | if (!pluginType.IsAbstract) | ||
416 | { | ||
417 | Type typeInterface = pluginType.GetInterface("IGenericConfig", true); | ||
418 | |||
419 | if (typeInterface != null) | ||
420 | { | ||
421 | plug = | ||
422 | (IGenericConfig) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
423 | } | ||
424 | } | ||
425 | } | ||
426 | } | ||
427 | |||
428 | pluginAssembly = null; | ||
429 | return plug; | ||
430 | } | ||
431 | |||
432 | public void forceSetConfigurationOption(string configuration_key, string configuration_value) | ||
433 | { | ||
434 | configurationPlugin.LoadData(); | ||
435 | configurationPlugin.SetAttribute(configuration_key, configuration_value); | ||
436 | configurationPlugin.Commit(); | ||
437 | configurationPlugin.Close(); | ||
438 | } | ||
439 | } | ||
440 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/ConfigurationOption.cs b/OpenSim/Framework/General/ConfigurationOption.cs deleted file mode 100644 index ec39d3d..0000000 --- a/OpenSim/Framework/General/ConfigurationOption.cs +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | namespace OpenSim.Framework | ||
30 | { | ||
31 | public class ConfigurationOption | ||
32 | { | ||
33 | public enum ConfigurationTypes | ||
34 | { | ||
35 | TYPE_STRING, | ||
36 | TYPE_STRING_NOT_EMPTY, | ||
37 | TYPE_UINT16, | ||
38 | TYPE_UINT32, | ||
39 | TYPE_UINT64, | ||
40 | TYPE_INT16, | ||
41 | TYPE_INT32, | ||
42 | TYPE_INT64, | ||
43 | TYPE_IP_ADDRESS, | ||
44 | TYPE_CHARACTER, | ||
45 | TYPE_BOOLEAN, | ||
46 | TYPE_BYTE, | ||
47 | TYPE_LLUUID, | ||
48 | TYPE_LLVECTOR3, | ||
49 | TYPE_FLOAT, | ||
50 | TYPE_DOUBLE | ||
51 | } ; | ||
52 | |||
53 | public string configurationKey = ""; | ||
54 | public string configurationQuestion = ""; | ||
55 | public string configurationDefault = ""; | ||
56 | |||
57 | public ConfigurationTypes configurationType = ConfigurationTypes.TYPE_STRING; | ||
58 | public bool configurationUseDefaultNoPrompt = false; | ||
59 | } | ||
60 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/Culture.cs b/OpenSim/Framework/General/Culture.cs deleted file mode 100644 index f8cadfe..0000000 --- a/OpenSim/Framework/General/Culture.cs +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System; | ||
30 | using System.Globalization; | ||
31 | using System.Threading; | ||
32 | |||
33 | namespace OpenSim.Framework | ||
34 | { | ||
35 | public class Culture | ||
36 | { | ||
37 | private static readonly CultureInfo m_cultureInfo = new CultureInfo("en-US", true); | ||
38 | |||
39 | public static NumberFormatInfo NumberFormatInfo | ||
40 | { | ||
41 | get { return m_cultureInfo.NumberFormat; } | ||
42 | } | ||
43 | |||
44 | public static IFormatProvider FormatProvider | ||
45 | { | ||
46 | get { return m_cultureInfo; } | ||
47 | } | ||
48 | |||
49 | public static void SetCurrentCulture() | ||
50 | { | ||
51 | Thread.CurrentThread.CurrentCulture = m_cultureInfo; | ||
52 | } | ||
53 | } | ||
54 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/EstateSettings.cs b/OpenSim/Framework/General/EstateSettings.cs deleted file mode 100644 index 63b62c6..0000000 --- a/OpenSim/Framework/General/EstateSettings.cs +++ /dev/null | |||
@@ -1,707 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using System.IO; | ||
30 | using libsecondlife; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | public class EstateSettings | ||
35 | { | ||
36 | //Settings to this island | ||
37 | private float m_billableFactor; | ||
38 | |||
39 | public float billableFactor | ||
40 | { | ||
41 | get { return m_billableFactor; } | ||
42 | set | ||
43 | { | ||
44 | m_billableFactor = value; | ||
45 | configMember.forceSetConfigurationOption("billable_factor", m_billableFactor.ToString()); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | |||
50 | private uint m_estateID; | ||
51 | |||
52 | public uint estateID | ||
53 | { | ||
54 | get { return m_estateID; } | ||
55 | set | ||
56 | { | ||
57 | m_estateID = value; | ||
58 | configMember.forceSetConfigurationOption("estate_id", m_estateID.ToString()); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | |||
63 | private uint m_parentEstateID; | ||
64 | |||
65 | public uint parentEstateID | ||
66 | { | ||
67 | get { return m_parentEstateID; } | ||
68 | set | ||
69 | { | ||
70 | m_parentEstateID = value; | ||
71 | configMember.forceSetConfigurationOption("parent_estate_id", m_parentEstateID.ToString()); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | private byte m_maxAgents; | ||
76 | |||
77 | public byte maxAgents | ||
78 | { | ||
79 | get { return m_maxAgents; } | ||
80 | set | ||
81 | { | ||
82 | m_maxAgents = value; | ||
83 | configMember.forceSetConfigurationOption("max_agents", m_maxAgents.ToString()); | ||
84 | } | ||
85 | } | ||
86 | |||
87 | private float m_objectBonusFactor; | ||
88 | |||
89 | public float objectBonusFactor | ||
90 | { | ||
91 | get { return m_objectBonusFactor; } | ||
92 | set | ||
93 | { | ||
94 | m_objectBonusFactor = value; | ||
95 | configMember.forceSetConfigurationOption("object_bonus_factor", m_objectBonusFactor.ToString()); | ||
96 | } | ||
97 | } | ||
98 | |||
99 | private int m_redirectGridX; | ||
100 | |||
101 | public int redirectGridX | ||
102 | { | ||
103 | get { return m_redirectGridX; } | ||
104 | set | ||
105 | { | ||
106 | m_redirectGridX = value; | ||
107 | configMember.forceSetConfigurationOption("redirect_grid_x", m_redirectGridX.ToString()); | ||
108 | } | ||
109 | } | ||
110 | |||
111 | private int m_redirectGridY; | ||
112 | |||
113 | public int redirectGridY | ||
114 | { | ||
115 | get { return m_redirectGridY; } | ||
116 | set | ||
117 | { | ||
118 | m_redirectGridY = value; | ||
119 | configMember.forceSetConfigurationOption("redirect_grid_y", m_redirectGridY.ToString()); | ||
120 | } | ||
121 | } | ||
122 | |||
123 | private Simulator.RegionFlags m_regionFlags; | ||
124 | |||
125 | public Simulator.RegionFlags regionFlags | ||
126 | { | ||
127 | get { return m_regionFlags; } | ||
128 | set | ||
129 | { | ||
130 | m_regionFlags = value; | ||
131 | configMember.forceSetConfigurationOption("region_flags", m_regionFlags.ToString()); | ||
132 | } | ||
133 | } | ||
134 | |||
135 | |||
136 | private Simulator.SimAccess m_simAccess; | ||
137 | |||
138 | public Simulator.SimAccess simAccess | ||
139 | { | ||
140 | get { return m_simAccess; } | ||
141 | set | ||
142 | { | ||
143 | m_simAccess = value; | ||
144 | configMember.forceSetConfigurationOption("sim_access", m_simAccess.ToString()); | ||
145 | } | ||
146 | } | ||
147 | |||
148 | private float m_sunHour; | ||
149 | |||
150 | public float sunHour | ||
151 | { | ||
152 | get { return m_sunHour; } | ||
153 | set | ||
154 | { | ||
155 | m_sunHour = value; | ||
156 | configMember.forceSetConfigurationOption("sun_hour", m_sunHour.ToString()); | ||
157 | } | ||
158 | } | ||
159 | |||
160 | private float m_terrainRaiseLimit; | ||
161 | |||
162 | public float terrainRaiseLimit | ||
163 | { | ||
164 | get { return m_terrainRaiseLimit; } | ||
165 | set | ||
166 | { | ||
167 | m_terrainRaiseLimit = value; | ||
168 | configMember.forceSetConfigurationOption("terrain_raise_limit", m_terrainRaiseLimit.ToString()); | ||
169 | } | ||
170 | } | ||
171 | |||
172 | private float m_terrainLowerLimit; | ||
173 | |||
174 | public float terrainLowerLimit | ||
175 | { | ||
176 | get { return m_terrainLowerLimit; } | ||
177 | set | ||
178 | { | ||
179 | m_terrainLowerLimit = value; | ||
180 | configMember.forceSetConfigurationOption("terrain_lower_limit", m_terrainLowerLimit.ToString()); | ||
181 | } | ||
182 | } | ||
183 | |||
184 | private bool m_useFixedSun; | ||
185 | |||
186 | public bool useFixedSun | ||
187 | { | ||
188 | get { return m_useFixedSun; } | ||
189 | set | ||
190 | { | ||
191 | m_useFixedSun = value; | ||
192 | configMember.forceSetConfigurationOption("use_fixed_sun", m_useFixedSun.ToString()); | ||
193 | } | ||
194 | } | ||
195 | |||
196 | |||
197 | private int m_pricePerMeter; | ||
198 | |||
199 | public int pricePerMeter | ||
200 | { | ||
201 | get { return m_pricePerMeter; } | ||
202 | set | ||
203 | { | ||
204 | m_pricePerMeter = value; | ||
205 | configMember.forceSetConfigurationOption("price_per_meter", m_pricePerMeter.ToString()); | ||
206 | } | ||
207 | } | ||
208 | |||
209 | |||
210 | private ushort m_regionWaterHeight; | ||
211 | |||
212 | public ushort regionWaterHeight | ||
213 | { | ||
214 | get { return m_regionWaterHeight; } | ||
215 | set | ||
216 | { | ||
217 | m_regionWaterHeight = value; | ||
218 | configMember.forceSetConfigurationOption("region_water_height", m_regionWaterHeight.ToString()); | ||
219 | } | ||
220 | } | ||
221 | |||
222 | |||
223 | private bool m_regionAllowTerraform; | ||
224 | |||
225 | public bool regionAllowTerraform | ||
226 | { | ||
227 | get { return m_regionAllowTerraform; } | ||
228 | set | ||
229 | { | ||
230 | m_regionAllowTerraform = value; | ||
231 | configMember.forceSetConfigurationOption("region_allow_terraform", m_regionAllowTerraform.ToString()); | ||
232 | } | ||
233 | } | ||
234 | |||
235 | |||
236 | // Region Information | ||
237 | // Low resolution 'base' textures. No longer used. | ||
238 | private LLUUID m_terrainBase0; | ||
239 | |||
240 | public LLUUID terrainBase0 | ||
241 | { | ||
242 | get { return m_terrainBase0; } | ||
243 | set | ||
244 | { | ||
245 | m_terrainBase0 = value; | ||
246 | configMember.forceSetConfigurationOption("terrain_base_0", m_terrainBase0.ToString()); | ||
247 | } | ||
248 | } | ||
249 | |||
250 | private LLUUID m_terrainBase1; | ||
251 | |||
252 | public LLUUID terrainBase1 | ||
253 | { | ||
254 | get { return m_terrainBase1; } | ||
255 | set | ||
256 | { | ||
257 | m_terrainBase1 = value; | ||
258 | configMember.forceSetConfigurationOption("terrain_base_1", m_terrainBase1.ToString()); | ||
259 | } | ||
260 | } | ||
261 | |||
262 | private LLUUID m_terrainBase2; | ||
263 | |||
264 | public LLUUID terrainBase2 | ||
265 | { | ||
266 | get { return m_terrainBase2; } | ||
267 | set | ||
268 | { | ||
269 | m_terrainBase2 = value; | ||
270 | configMember.forceSetConfigurationOption("terrain_base_2", m_terrainBase2.ToString()); | ||
271 | } | ||
272 | } | ||
273 | |||
274 | private LLUUID m_terrainBase3; | ||
275 | |||
276 | public LLUUID terrainBase3 | ||
277 | { | ||
278 | get { return m_terrainBase3; } | ||
279 | set | ||
280 | { | ||
281 | m_terrainBase3 = value; | ||
282 | configMember.forceSetConfigurationOption("terrain_base_3", m_terrainBase3.ToString()); | ||
283 | } | ||
284 | } | ||
285 | |||
286 | |||
287 | // Higher resolution terrain textures | ||
288 | private LLUUID m_terrainDetail0; | ||
289 | |||
290 | public LLUUID terrainDetail0 | ||
291 | { | ||
292 | get { return m_terrainDetail0; } | ||
293 | set | ||
294 | { | ||
295 | m_terrainDetail0 = value; | ||
296 | configMember.forceSetConfigurationOption("terrain_detail_0", m_terrainDetail0.ToString()); | ||
297 | } | ||
298 | } | ||
299 | |||
300 | private LLUUID m_terrainDetail1; | ||
301 | |||
302 | public LLUUID terrainDetail1 | ||
303 | { | ||
304 | get { return m_terrainDetail1; } | ||
305 | set | ||
306 | { | ||
307 | m_terrainDetail1 = value; | ||
308 | configMember.forceSetConfigurationOption("terrain_detail_1", m_terrainDetail1.ToString()); | ||
309 | } | ||
310 | } | ||
311 | |||
312 | private LLUUID m_terrainDetail2; | ||
313 | |||
314 | public LLUUID terrainDetail2 | ||
315 | { | ||
316 | get { return m_terrainDetail2; } | ||
317 | set | ||
318 | { | ||
319 | m_terrainDetail2 = value; | ||
320 | configMember.forceSetConfigurationOption("terrain_detail_2", m_terrainDetail2.ToString()); | ||
321 | } | ||
322 | } | ||
323 | |||
324 | private LLUUID m_terrainDetail3; | ||
325 | |||
326 | public LLUUID terrainDetail3 | ||
327 | { | ||
328 | get { return m_terrainDetail3; } | ||
329 | set | ||
330 | { | ||
331 | m_terrainDetail3 = value; | ||
332 | configMember.forceSetConfigurationOption("terrain_detail_3", m_terrainDetail3.ToString()); | ||
333 | } | ||
334 | } | ||
335 | |||
336 | // First quad - each point is bilinearly interpolated at each meter of terrain | ||
337 | private float m_terrainStartHeight0; | ||
338 | |||
339 | public float terrainStartHeight0 | ||
340 | { | ||
341 | get { return m_terrainStartHeight0; } | ||
342 | set | ||
343 | { | ||
344 | m_terrainStartHeight0 = value; | ||
345 | configMember.forceSetConfigurationOption("terrain_start_height_0", m_terrainStartHeight0.ToString()); | ||
346 | } | ||
347 | } | ||
348 | |||
349 | |||
350 | private float m_terrainStartHeight1; | ||
351 | |||
352 | public float terrainStartHeight1 | ||
353 | { | ||
354 | get { return m_terrainStartHeight1; } | ||
355 | set | ||
356 | { | ||
357 | m_terrainStartHeight1 = value; | ||
358 | configMember.forceSetConfigurationOption("terrain_start_height_1", m_terrainStartHeight1.ToString()); | ||
359 | } | ||
360 | } | ||
361 | |||
362 | private float m_terrainStartHeight2; | ||
363 | |||
364 | public float terrainStartHeight2 | ||
365 | { | ||
366 | get { return m_terrainStartHeight2; } | ||
367 | set | ||
368 | { | ||
369 | m_terrainStartHeight2 = value; | ||
370 | configMember.forceSetConfigurationOption("terrain_start_height_2", m_terrainStartHeight2.ToString()); | ||
371 | } | ||
372 | } | ||
373 | |||
374 | private float m_terrainStartHeight3; | ||
375 | |||
376 | public float terrainStartHeight3 | ||
377 | { | ||
378 | get { return m_terrainStartHeight3; } | ||
379 | set | ||
380 | { | ||
381 | m_terrainStartHeight3 = value; | ||
382 | configMember.forceSetConfigurationOption("terrain_start_height_3", m_terrainStartHeight3.ToString()); | ||
383 | } | ||
384 | } | ||
385 | |||
386 | // Second quad - also bilinearly interpolated. | ||
387 | // Terrain texturing is done that: | ||
388 | // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y] | ||
389 | private float m_terrainHeightRange0; | ||
390 | |||
391 | public float terrainHeightRange0 | ||
392 | { | ||
393 | get { return m_terrainHeightRange0; } | ||
394 | set | ||
395 | { | ||
396 | m_terrainHeightRange0 = value; | ||
397 | configMember.forceSetConfigurationOption("terrain_height_range_0", m_terrainHeightRange0.ToString()); | ||
398 | } | ||
399 | } | ||
400 | |||
401 | private float m_terrainHeightRange1; | ||
402 | |||
403 | public float terrainHeightRange1 | ||
404 | { | ||
405 | get { return m_terrainHeightRange1; } | ||
406 | set | ||
407 | { | ||
408 | m_terrainHeightRange1 = value; | ||
409 | configMember.forceSetConfigurationOption("terrain_height_range_1", m_terrainHeightRange1.ToString()); | ||
410 | } | ||
411 | } | ||
412 | |||
413 | private float m_terrainHeightRange2; | ||
414 | |||
415 | public float terrainHeightRange2 | ||
416 | { | ||
417 | get { return m_terrainHeightRange2; } | ||
418 | set | ||
419 | { | ||
420 | m_terrainHeightRange2 = value; | ||
421 | configMember.forceSetConfigurationOption("terrain_height_range_2", m_terrainHeightRange2.ToString()); | ||
422 | } | ||
423 | } | ||
424 | |||
425 | private float m_terrainHeightRange3; | ||
426 | |||
427 | public float terrainHeightRange3 | ||
428 | { | ||
429 | get { return m_terrainHeightRange3; } | ||
430 | set | ||
431 | { | ||
432 | m_terrainHeightRange3 = value; | ||
433 | configMember.forceSetConfigurationOption("terrain_height_range_3", m_terrainHeightRange3.ToString()); | ||
434 | } | ||
435 | } | ||
436 | |||
437 | // Terrain Default (Must be in F32 Format!) | ||
438 | private string m_terrainFile; | ||
439 | |||
440 | public string terrainFile | ||
441 | { | ||
442 | get { return m_terrainFile; } | ||
443 | set | ||
444 | { | ||
445 | m_terrainFile = value; | ||
446 | configMember.forceSetConfigurationOption("terrain_file", m_terrainFile.ToString()); | ||
447 | } | ||
448 | } | ||
449 | |||
450 | private double m_terrainMultiplier; | ||
451 | |||
452 | public double terrainMultiplier | ||
453 | { | ||
454 | get { return m_terrainMultiplier; } | ||
455 | set | ||
456 | { | ||
457 | m_terrainMultiplier = value; | ||
458 | configMember.forceSetConfigurationOption("terrain_multiplier", m_terrainMultiplier.ToString()); | ||
459 | } | ||
460 | } | ||
461 | |||
462 | private float m_waterHeight; | ||
463 | |||
464 | public float waterHeight | ||
465 | { | ||
466 | get { return m_waterHeight; } | ||
467 | set | ||
468 | { | ||
469 | m_waterHeight = value; | ||
470 | configMember.forceSetConfigurationOption("water_height", m_waterHeight.ToString()); | ||
471 | } | ||
472 | } | ||
473 | |||
474 | private LLUUID m_terrainImageID; | ||
475 | |||
476 | public LLUUID terrainImageID | ||
477 | { | ||
478 | get { return m_terrainImageID; } | ||
479 | set | ||
480 | { | ||
481 | m_terrainImageID = value; | ||
482 | configMember.forceSetConfigurationOption("terrain_image_id", m_terrainImageID.ToString()); | ||
483 | } | ||
484 | } | ||
485 | |||
486 | private ConfigurationMember configMember; | ||
487 | |||
488 | public EstateSettings() | ||
489 | { | ||
490 | // Temporary hack to prevent multiple loadings. | ||
491 | if (configMember == null) | ||
492 | { | ||
493 | configMember = | ||
494 | new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", | ||
495 | loadConfigurationOptions, handleIncomingConfiguration); | ||
496 | configMember.performConfigurationRetrieve(); | ||
497 | } | ||
498 | } | ||
499 | |||
500 | public void loadConfigurationOptions() | ||
501 | { | ||
502 | configMember.addConfigurationOption("billable_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", | ||
503 | "0.0", true); | ||
504 | configMember.addConfigurationOption("estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "", "0", | ||
505 | true); | ||
506 | configMember.addConfigurationOption("parent_estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
507 | "", "0", true); | ||
508 | configMember.addConfigurationOption("max_agents", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, "", "40", | ||
509 | true); | ||
510 | |||
511 | configMember.addConfigurationOption("object_bonus_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, | ||
512 | "", "1.0", true); | ||
513 | configMember.addConfigurationOption("redirect_grid_x", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "", | ||
514 | "0", true); | ||
515 | configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "", | ||
516 | "0", true); | ||
517 | configMember.addConfigurationOption("region_flags", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "", | ||
518 | "0", true); | ||
519 | configMember.addConfigurationOption("sim_access", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, "", "21", | ||
520 | true); | ||
521 | configMember.addConfigurationOption("sun_hour", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "0", | ||
522 | true); | ||
523 | configMember.addConfigurationOption("terrain_raise_limit", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, | ||
524 | "", "0", true); | ||
525 | configMember.addConfigurationOption("terrain_lower_limit", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, | ||
526 | "", "0", true); | ||
527 | configMember.addConfigurationOption("use_fixed_sun", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "", | ||
528 | "false", true); | ||
529 | configMember.addConfigurationOption("price_per_meter", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
530 | "", "1", true); | ||
531 | configMember.addConfigurationOption("region_water_height", | ||
532 | ConfigurationOption.ConfigurationTypes.TYPE_UINT16, "", "20", true); | ||
533 | configMember.addConfigurationOption("region_allow_terraform", | ||
534 | ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "", "true", true); | ||
535 | |||
536 | configMember.addConfigurationOption("terrain_base_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "", | ||
537 | "b8d3965a-ad78-bf43-699b-bff8eca6c975", true); | ||
538 | configMember.addConfigurationOption("terrain_base_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "", | ||
539 | "abb783e6-3e93-26c0-248a-247666855da3", true); | ||
540 | configMember.addConfigurationOption("terrain_base_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "", | ||
541 | "179cdabd-398a-9b6b-1391-4dc333ba321f", true); | ||
542 | configMember.addConfigurationOption("terrain_base_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "", | ||
543 | "beb169c7-11ea-fff2-efe5-0f24dc881df2", true); | ||
544 | |||
545 | configMember.addConfigurationOption("terrain_detail_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | ||
546 | "", "00000000-0000-0000-0000-000000000000", true); | ||
547 | configMember.addConfigurationOption("terrain_detail_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | ||
548 | "", "00000000-0000-0000-0000-000000000000", true); | ||
549 | configMember.addConfigurationOption("terrain_detail_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | ||
550 | "", "00000000-0000-0000-0000-000000000000", true); | ||
551 | configMember.addConfigurationOption("terrain_detail_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | ||
552 | "", "00000000-0000-0000-0000-000000000000", true); | ||
553 | |||
554 | configMember.addConfigurationOption("terrain_start_height_0", | ||
555 | ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "10.0", true); | ||
556 | configMember.addConfigurationOption("terrain_start_height_1", | ||
557 | ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "10.0", true); | ||
558 | configMember.addConfigurationOption("terrain_start_height_2", | ||
559 | ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "10.0", true); | ||
560 | configMember.addConfigurationOption("terrain_start_height_3", | ||
561 | ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "10.0", true); | ||
562 | |||
563 | configMember.addConfigurationOption("terrain_height_range_0", | ||
564 | ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "60.0", true); | ||
565 | configMember.addConfigurationOption("terrain_height_range_1", | ||
566 | ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "60.0", true); | ||
567 | configMember.addConfigurationOption("terrain_height_range_2", | ||
568 | ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "60.0", true); | ||
569 | configMember.addConfigurationOption("terrain_height_range_3", | ||
570 | ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "60.0", true); | ||
571 | |||
572 | configMember.addConfigurationOption("terrain_file", | ||
573 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "", | ||
574 | "default.r32", true); | ||
575 | configMember.addConfigurationOption("terrain_multiplier", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, | ||
576 | "", "60.0", true); | ||
577 | configMember.addConfigurationOption("water_height", ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, "", | ||
578 | "20.0", true); | ||
579 | configMember.addConfigurationOption("terrain_image_id", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | ||
580 | "", "00000000-0000-0000-0000-000000000000", true); | ||
581 | } | ||
582 | |||
583 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
584 | { | ||
585 | switch (configuration_key) | ||
586 | { | ||
587 | case "billable_factor": | ||
588 | m_billableFactor = (float) configuration_result; | ||
589 | break; | ||
590 | case "estate_id": | ||
591 | m_estateID = (uint) configuration_result; | ||
592 | break; | ||
593 | case "parent_estate_id": | ||
594 | m_parentEstateID = (uint) configuration_result; | ||
595 | break; | ||
596 | case "max_agents": | ||
597 | m_maxAgents = (byte) configuration_result; | ||
598 | break; | ||
599 | |||
600 | case "object_bonus_factor": | ||
601 | m_objectBonusFactor = (float) configuration_result; | ||
602 | break; | ||
603 | case "redirect_grid_x": | ||
604 | m_redirectGridX = (int) configuration_result; | ||
605 | break; | ||
606 | case "redirect_grid_y": | ||
607 | m_redirectGridY = (int) configuration_result; | ||
608 | break; | ||
609 | case "region_flags": | ||
610 | m_regionFlags = (Simulator.RegionFlags) ((uint) configuration_result); | ||
611 | break; | ||
612 | case "sim_access": | ||
613 | m_simAccess = (Simulator.SimAccess) ((byte) configuration_result); | ||
614 | break; | ||
615 | case "sun_hour": | ||
616 | m_sunHour = (float) configuration_result; | ||
617 | break; | ||
618 | case "terrain_raise_limit": | ||
619 | m_terrainRaiseLimit = (float) configuration_result; | ||
620 | break; | ||
621 | case "terrain_lower_limit": | ||
622 | m_terrainLowerLimit = (float) configuration_result; | ||
623 | break; | ||
624 | case "use_fixed_sun": | ||
625 | m_useFixedSun = (bool) configuration_result; | ||
626 | break; | ||
627 | case "price_per_meter": | ||
628 | m_pricePerMeter = Convert.ToInt32(configuration_result); | ||
629 | break; | ||
630 | case "region_water_height": | ||
631 | m_regionWaterHeight = (ushort) configuration_result; | ||
632 | break; | ||
633 | case "region_allow_terraform": | ||
634 | m_regionAllowTerraform = (bool) configuration_result; | ||
635 | break; | ||
636 | |||
637 | case "terrain_base_0": | ||
638 | m_terrainBase0 = (LLUUID) configuration_result; | ||
639 | break; | ||
640 | case "terrain_base_1": | ||
641 | m_terrainBase1 = (LLUUID) configuration_result; | ||
642 | break; | ||
643 | case "terrain_base_2": | ||
644 | m_terrainBase2 = (LLUUID) configuration_result; | ||
645 | break; | ||
646 | case "terrain_base_3": | ||
647 | m_terrainBase3 = (LLUUID) configuration_result; | ||
648 | break; | ||
649 | |||
650 | case "terrain_detail_0": | ||
651 | m_terrainDetail0 = (LLUUID) configuration_result; | ||
652 | break; | ||
653 | case "terrain_detail_1": | ||
654 | m_terrainDetail1 = (LLUUID) configuration_result; | ||
655 | break; | ||
656 | case "terrain_detail_2": | ||
657 | m_terrainDetail2 = (LLUUID) configuration_result; | ||
658 | break; | ||
659 | case "terrain_detail_3": | ||
660 | m_terrainDetail3 = (LLUUID) configuration_result; | ||
661 | break; | ||
662 | |||
663 | case "terrain_start_height_0": | ||
664 | m_terrainStartHeight0 = (float) configuration_result; | ||
665 | break; | ||
666 | case "terrain_start_height_1": | ||
667 | m_terrainStartHeight1 = (float) configuration_result; | ||
668 | break; | ||
669 | case "terrain_start_height_2": | ||
670 | m_terrainStartHeight2 = (float) configuration_result; | ||
671 | break; | ||
672 | case "terrain_start_height_3": | ||
673 | m_terrainStartHeight3 = (float) configuration_result; | ||
674 | break; | ||
675 | |||
676 | case "terrain_height_range_0": | ||
677 | m_terrainHeightRange0 = (float) configuration_result; | ||
678 | break; | ||
679 | case "terrain_height_range_1": | ||
680 | m_terrainHeightRange1 = (float) configuration_result; | ||
681 | break; | ||
682 | case "terrain_height_range_2": | ||
683 | m_terrainHeightRange2 = (float) configuration_result; | ||
684 | break; | ||
685 | case "terrain_height_range_3": | ||
686 | m_terrainHeightRange3 = (float) configuration_result; | ||
687 | break; | ||
688 | |||
689 | case "terrain_file": | ||
690 | m_terrainFile = (string) configuration_result; | ||
691 | break; | ||
692 | case "terrain_multiplier": | ||
693 | m_terrainMultiplier = Convert.ToDouble(configuration_result); | ||
694 | break; | ||
695 | case "water_height": | ||
696 | double tmpVal = (double) configuration_result; | ||
697 | m_waterHeight = (float) tmpVal; | ||
698 | break; | ||
699 | case "terrain_image_id": | ||
700 | m_terrainImageID = (LLUUID) configuration_result; | ||
701 | break; | ||
702 | } | ||
703 | |||
704 | return true; | ||
705 | } | ||
706 | } | ||
707 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/GridConfig.cs b/OpenSim/Framework/General/GridConfig.cs deleted file mode 100644 index 021e6c5..0000000 --- a/OpenSim/Framework/General/GridConfig.cs +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | namespace OpenSim.Framework | ||
30 | { | ||
31 | public class GridConfig | ||
32 | { | ||
33 | public string GridOwner = ""; | ||
34 | public string DefaultAssetServer = ""; | ||
35 | public string AssetSendKey = ""; | ||
36 | public string AssetRecvKey = ""; | ||
37 | |||
38 | public string DefaultUserServer = ""; | ||
39 | public string UserSendKey = ""; | ||
40 | public string UserRecvKey = ""; | ||
41 | |||
42 | public string SimSendKey = ""; | ||
43 | public string SimRecvKey = ""; | ||
44 | |||
45 | public string DatabaseProvider = ""; | ||
46 | |||
47 | public static uint DefaultHttpPort = 8001; | ||
48 | public uint HttpPort = DefaultHttpPort; | ||
49 | |||
50 | private ConfigurationMember configMember; | ||
51 | |||
52 | public GridConfig(string description, string filename) | ||
53 | { | ||
54 | configMember = | ||
55 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); | ||
56 | configMember.performConfigurationRetrieve(); | ||
57 | } | ||
58 | |||
59 | public void loadConfigurationOptions() | ||
60 | { | ||
61 | configMember.addConfigurationOption("grid_owner", | ||
62 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
63 | "OGS Grid Owner", "OGS development team", false); | ||
64 | configMember.addConfigurationOption("default_asset_server", | ||
65 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
66 | "Default Asset Server URI", | ||
67 | "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/", | ||
68 | false); | ||
69 | configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
70 | "Key to send to asset server", "null", false); | ||
71 | configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
72 | "Key to expect from asset server", "null", false); | ||
73 | |||
74 | configMember.addConfigurationOption("default_user_server", | ||
75 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
76 | "Default User Server URI", | ||
77 | "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/", false); | ||
78 | configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
79 | "Key to send to user server", "null", false); | ||
80 | configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
81 | "Key to expect from user server", "null", false); | ||
82 | |||
83 | configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
84 | "Key to send to a simulator", "null", false); | ||
85 | configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
86 | "Key to expect from a simulator", "null", false); | ||
87 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
88 | "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | ||
89 | |||
90 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
91 | "Http Listener port", DefaultHttpPort.ToString(), false); | ||
92 | } | ||
93 | |||
94 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
95 | { | ||
96 | switch (configuration_key) | ||
97 | { | ||
98 | case "grid_owner": | ||
99 | GridOwner = (string) configuration_result; | ||
100 | break; | ||
101 | case "default_asset_server": | ||
102 | DefaultAssetServer = (string) configuration_result; | ||
103 | break; | ||
104 | case "asset_send_key": | ||
105 | AssetSendKey = (string) configuration_result; | ||
106 | break; | ||
107 | case "asset_recv_key": | ||
108 | AssetRecvKey = (string) configuration_result; | ||
109 | break; | ||
110 | case "default_user_server": | ||
111 | DefaultUserServer = (string) configuration_result; | ||
112 | break; | ||
113 | case "user_send_key": | ||
114 | UserSendKey = (string) configuration_result; | ||
115 | break; | ||
116 | case "user_recv_key": | ||
117 | UserRecvKey = (string) configuration_result; | ||
118 | break; | ||
119 | case "sim_send_key": | ||
120 | SimSendKey = (string) configuration_result; | ||
121 | break; | ||
122 | case "sim_recv_key": | ||
123 | SimRecvKey = (string) configuration_result; | ||
124 | break; | ||
125 | case "database_provider": | ||
126 | DatabaseProvider = (string) configuration_result; | ||
127 | break; | ||
128 | case "http_port": | ||
129 | HttpPort = (uint) configuration_result; | ||
130 | break; | ||
131 | } | ||
132 | |||
133 | return true; | ||
134 | } | ||
135 | } | ||
136 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IAssetProvider.cs b/OpenSim/Framework/General/IAssetProvider.cs deleted file mode 100644 index ad1cf66..0000000 --- a/OpenSim/Framework/General/IAssetProvider.cs +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | public interface IAssetProvider : IPlugin | ||
34 | { | ||
35 | AssetBase FetchAsset(LLUUID uuid); | ||
36 | void CreateAsset(AssetBase asset); | ||
37 | void UpdateAsset(AssetBase asset); | ||
38 | bool ExistsAsset(LLUUID uuid); | ||
39 | void CommitAssets(); // force a sync to the database | ||
40 | } | ||
41 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IAssetServer.cs b/OpenSim/Framework/General/IAssetServer.cs deleted file mode 100644 index 9a7dbab..0000000 --- a/OpenSim/Framework/General/IAssetServer.cs +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using libsecondlife; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | /// <summary> | ||
35 | /// Description of IAssetServer. | ||
36 | /// </summary> | ||
37 | public interface IAssetServer | ||
38 | { | ||
39 | void SetReceiver(IAssetReceiver receiver); | ||
40 | void FetchAsset(LLUUID assetID, bool isTexture); | ||
41 | void UpdateAsset(AssetBase asset); | ||
42 | void StoreAndCommitAsset(AssetBase asset); | ||
43 | void Close(); | ||
44 | void LoadAsset(AssetBase info, bool image, string filename); | ||
45 | List<AssetBase> GetDefaultAssets(); | ||
46 | AssetBase CreateImageAsset(string assetIdStr, string name, string filename); | ||
47 | void ForEachDefaultAsset(Action<AssetBase> action); | ||
48 | AssetBase CreateAsset(string assetIdStr, string name, string filename, bool isImage); | ||
49 | void ForEachXmlAsset(Action<AssetBase> action); | ||
50 | } | ||
51 | |||
52 | // could change to delegate? | ||
53 | public interface IAssetReceiver | ||
54 | { | ||
55 | void AssetReceived(AssetBase asset, bool IsTexture); | ||
56 | void AssetNotFound(LLUUID assetID); | ||
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 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IClientAPI.cs b/OpenSim/Framework/General/IClientAPI.cs deleted file mode 100644 index 4482ae6..0000000 --- a/OpenSim/Framework/General/IClientAPI.cs +++ /dev/null | |||
@@ -1,447 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Net; | ||
31 | using libsecondlife; | ||
32 | using libsecondlife.Packets; | ||
33 | |||
34 | namespace OpenSim.Framework | ||
35 | { | ||
36 | // Base Args Interface | ||
37 | public interface IEventArgs | ||
38 | { | ||
39 | IScene Scene { get; set; } | ||
40 | |||
41 | IClientAPI Sender { get; set; } | ||
42 | } | ||
43 | |||
44 | public delegate void ViewerEffectEventHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock); | ||
45 | |||
46 | public delegate void ChatFromViewer(Object sender, ChatFromViewerArgs e); | ||
47 | |||
48 | public enum ChatTypeEnum | ||
49 | { | ||
50 | Whisper = 0, | ||
51 | Say = 1, | ||
52 | Shout = 2, | ||
53 | Broadcast = 0xFF | ||
54 | } ; | ||
55 | |||
56 | /// <summary> | ||
57 | /// ChatFromViewer Arguments | ||
58 | /// </summary> | ||
59 | public class ChatFromViewerArgs : EventArgs, IEventArgs | ||
60 | { | ||
61 | protected string m_message; | ||
62 | protected ChatTypeEnum m_type; | ||
63 | protected int m_channel; | ||
64 | protected LLVector3 m_position; | ||
65 | protected string m_from; | ||
66 | |||
67 | protected IClientAPI m_sender; | ||
68 | protected IScene m_scene; | ||
69 | |||
70 | /// <summary> | ||
71 | /// The message sent by the user | ||
72 | /// </summary> | ||
73 | public string Message | ||
74 | { | ||
75 | get { return m_message; } | ||
76 | set { m_message = value; } | ||
77 | } | ||
78 | |||
79 | /// <summary> | ||
80 | /// The type of message, eg say, shout, broadcast. | ||
81 | /// </summary> | ||
82 | public ChatTypeEnum Type | ||
83 | { | ||
84 | get { return m_type; } | ||
85 | set { m_type = value; } | ||
86 | } | ||
87 | |||
88 | /// <summary> | ||
89 | /// Which channel was this message sent on? Different channels may have different listeners. Public chat is on channel zero. | ||
90 | /// </summary> | ||
91 | public int Channel | ||
92 | { | ||
93 | get { return m_channel; } | ||
94 | set { m_channel = value; } | ||
95 | } | ||
96 | |||
97 | /// <summary> | ||
98 | /// The position of the sender at the time of the message broadcast. | ||
99 | /// </summary> | ||
100 | public LLVector3 Position | ||
101 | { | ||
102 | get { return m_position; } | ||
103 | set { m_position = value; } | ||
104 | } | ||
105 | |||
106 | /// <summary> | ||
107 | /// The name of the sender (needed for scripts) | ||
108 | /// </summary> | ||
109 | public string From | ||
110 | { | ||
111 | get { return m_from; } | ||
112 | set { m_from = value; } | ||
113 | } | ||
114 | |||
115 | /// <summary> | ||
116 | /// The client responsible for sending the message, or null. | ||
117 | /// </summary> | ||
118 | public IClientAPI Sender | ||
119 | { | ||
120 | get { return m_sender; } | ||
121 | set { m_sender = value; } | ||
122 | } | ||
123 | |||
124 | public IScene Scene | ||
125 | { | ||
126 | get { return m_scene; } | ||
127 | set { m_scene = value; } | ||
128 | } | ||
129 | |||
130 | public ChatFromViewerArgs() | ||
131 | { | ||
132 | m_position = new LLVector3(); | ||
133 | } | ||
134 | } | ||
135 | |||
136 | public class TextureRequestArgs : EventArgs | ||
137 | { | ||
138 | protected LLUUID m_requestedAssetID; | ||
139 | private sbyte m_discardLevel; | ||
140 | private uint m_packetNumber; | ||
141 | |||
142 | public uint PacketNumber | ||
143 | { | ||
144 | get { return m_packetNumber; } | ||
145 | set { m_packetNumber = value; } | ||
146 | } | ||
147 | |||
148 | public sbyte DiscardLevel | ||
149 | { | ||
150 | get { return m_discardLevel; } | ||
151 | set { m_discardLevel = value; } | ||
152 | } | ||
153 | |||
154 | public LLUUID RequestedAssetID | ||
155 | { | ||
156 | get { return m_requestedAssetID; } | ||
157 | set { m_requestedAssetID = value; } | ||
158 | } | ||
159 | } | ||
160 | |||
161 | public delegate void TextureRequest(Object sender, TextureRequestArgs e); | ||
162 | |||
163 | public delegate void ImprovedInstantMessage( | ||
164 | LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, | ||
165 | string fromAgentName, string message, byte dialog); // Cut down from full list | ||
166 | public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos); | ||
167 | |||
168 | public delegate void ModifyTerrain( | ||
169 | float height, float seconds, byte size, byte action, float north, float west, IClientAPI remoteClient); | ||
170 | |||
171 | public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); | ||
172 | |||
173 | public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID, int seq); | ||
174 | |||
175 | public delegate void LinkObjects(uint parent, List<uint> children); | ||
176 | |||
177 | public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); | ||
178 | |||
179 | public delegate void TeleportLocationRequest( | ||
180 | IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); | ||
181 | |||
182 | public delegate void DisconnectUser(); | ||
183 | |||
184 | public delegate void RequestAvatarProperties(IClientAPI remoteClient, LLUUID avatarID); | ||
185 | |||
186 | public delegate void GenericCall(IClientAPI remoteClient); | ||
187 | |||
188 | public delegate void GenericCall2(); | ||
189 | |||
190 | public delegate void GenericCall3(Packet packet); | ||
191 | |||
192 | // really don't want to be passing packets in these events, so this is very temporary. | ||
193 | public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); | ||
194 | |||
195 | public delegate void GenericCall5(IClientAPI remoteClient, bool status); | ||
196 | |||
197 | public delegate void GenericCall6(LLUUID uid); | ||
198 | |||
199 | public delegate void GenericCall7(uint localID, string message); | ||
200 | |||
201 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); | ||
202 | |||
203 | public delegate void ObjectExtraParams(uint localID, ushort type, bool inUse, byte[] data); | ||
204 | |||
205 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); | ||
206 | |||
207 | public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient); | ||
208 | |||
209 | public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); | ||
210 | |||
211 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); | ||
212 | |||
213 | public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); | ||
214 | |||
215 | public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); | ||
216 | |||
217 | public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); | ||
218 | |||
219 | public delegate void UpdatePrimGroupRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); | ||
220 | |||
221 | public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags); | ||
222 | |||
223 | public delegate void StatusChange(bool status); | ||
224 | |||
225 | public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); | ||
226 | |||
227 | public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); | ||
228 | |||
229 | public delegate void AgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset); | ||
230 | |||
231 | public delegate void AgentSit(IClientAPI remoteClient, LLUUID agentID); | ||
232 | |||
233 | public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient); | ||
234 | |||
235 | public delegate void ParcelPropertiesRequest( | ||
236 | int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); | ||
237 | |||
238 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); | ||
239 | |||
240 | public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); | ||
241 | |||
242 | public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); | ||
243 | |||
244 | public delegate void ParcelSelectObjects(int land_local_id, int request_type, IClientAPI remote_client); | ||
245 | |||
246 | public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client); | ||
247 | |||
248 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); | ||
249 | |||
250 | public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); | ||
251 | |||
252 | public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape); | ||
253 | |||
254 | public delegate void CreateInventoryFolder( | ||
255 | IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID); | ||
256 | |||
257 | public delegate void CreateNewInventoryItem( | ||
258 | IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, | ||
259 | sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask); | ||
260 | |||
261 | public delegate void FetchInventoryDescendents( | ||
262 | IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); | ||
263 | |||
264 | public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID); | ||
265 | |||
266 | public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID); | ||
267 | |||
268 | public delegate void UpdateInventoryItemTransaction( | ||
269 | IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, LLUUID itemID); | ||
270 | |||
271 | public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID); | ||
272 | |||
273 | public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); | ||
274 | |||
275 | public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID); | ||
276 | |||
277 | public delegate void UDPAssetUploadRequest( | ||
278 | IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal); | ||
279 | |||
280 | public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data); | ||
281 | |||
282 | public delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName); | ||
283 | |||
284 | public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID); | ||
285 | |||
286 | public interface IClientAPI | ||
287 | { | ||
288 | event ImprovedInstantMessage OnInstantMessage; | ||
289 | event ChatFromViewer OnChatFromViewer; | ||
290 | event TextureRequest OnRequestTexture; | ||
291 | event RezObject OnRezObject; | ||
292 | event ModifyTerrain OnModifyTerrain; | ||
293 | event SetAppearance OnSetAppearance; | ||
294 | event StartAnim OnStartAnim; | ||
295 | event LinkObjects OnLinkObjects; | ||
296 | event RequestMapBlocks OnRequestMapBlocks; | ||
297 | event TeleportLocationRequest OnTeleportLocationRequest; | ||
298 | event DisconnectUser OnDisconnectUser; | ||
299 | event RequestAvatarProperties OnRequestAvatarProperties; | ||
300 | |||
301 | event GenericCall4 OnDeRezObject; | ||
302 | event GenericCall OnRegionHandShakeReply; | ||
303 | event GenericCall OnRequestWearables; | ||
304 | event GenericCall2 OnCompleteMovementToRegion; | ||
305 | event UpdateAgent OnAgentUpdate; | ||
306 | event AgentRequestSit OnAgentRequestSit; | ||
307 | event AgentSit OnAgentSit; | ||
308 | event GenericCall OnRequestAvatarsData; | ||
309 | event AddNewPrim OnAddPrim; | ||
310 | event ObjectDuplicate OnObjectDuplicate; | ||
311 | event UpdateVector OnGrabObject; | ||
312 | event ObjectSelect OnDeGrabObject; | ||
313 | event MoveObject OnGrabUpdate; | ||
314 | |||
315 | event UpdateShape OnUpdatePrimShape; | ||
316 | event ObjectExtraParams OnUpdateExtraParams; | ||
317 | event ObjectSelect OnObjectSelect; | ||
318 | event ObjectDeselect OnObjectDeselect; | ||
319 | event GenericCall7 OnObjectDescription; | ||
320 | event GenericCall7 OnObjectName; | ||
321 | event UpdatePrimFlags OnUpdatePrimFlags; | ||
322 | event UpdatePrimTexture OnUpdatePrimTexture; | ||
323 | event UpdateVector OnUpdatePrimGroupPosition; | ||
324 | event UpdateVector OnUpdatePrimSinglePosition; | ||
325 | event UpdatePrimRotation OnUpdatePrimGroupRotation; | ||
326 | event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | ||
327 | event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; | ||
328 | event UpdateVector OnUpdatePrimScale; | ||
329 | event StatusChange OnChildAgentStatus; | ||
330 | event GenericCall2 OnStopMovement; | ||
331 | event GenericCall6 OnRemoveAvatar; | ||
332 | |||
333 | event CreateNewInventoryItem OnCreateNewInventoryItem; | ||
334 | event CreateInventoryFolder OnCreateNewInventoryFolder; | ||
335 | event FetchInventoryDescendents OnFetchInventoryDescendents; | ||
336 | event FetchInventory OnFetchInventory; | ||
337 | event RequestTaskInventory OnRequestTaskInventory; | ||
338 | event UpdateInventoryItemTransaction OnUpdateInventoryItem; | ||
339 | event UDPAssetUploadRequest OnAssetUploadRequest; | ||
340 | event XferReceive OnXferReceive; | ||
341 | event RequestXfer OnRequestXfer; | ||
342 | event ConfirmXfer OnConfirmXfer; | ||
343 | event RezScript OnRezScript; | ||
344 | event UpdateTaskInventory OnUpdateTaskInventory; | ||
345 | event RemoveTaskInventory OnRemoveTaskItem; | ||
346 | |||
347 | event UUIDNameRequest OnNameFromUUIDRequest; | ||
348 | |||
349 | event ParcelPropertiesRequest OnParcelPropertiesRequest; | ||
350 | event ParcelDivideRequest OnParcelDivideRequest; | ||
351 | event ParcelJoinRequest OnParcelJoinRequest; | ||
352 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | ||
353 | event ParcelSelectObjects OnParcelSelectObjects; | ||
354 | event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | ||
355 | event EstateOwnerMessageRequest OnEstateOwnerMessage; | ||
356 | |||
357 | LLVector3 StartPos { get; set; } | ||
358 | |||
359 | LLUUID AgentId { get; } | ||
360 | |||
361 | LLUUID SessionId { get; } | ||
362 | |||
363 | string FirstName { get; } | ||
364 | |||
365 | string LastName { get; } | ||
366 | |||
367 | uint CircuitCode { get; set; } | ||
368 | |||
369 | void OutPacket(Packet newPack); | ||
370 | void SendWearables(AvatarWearable[] wearables); | ||
371 | void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry); | ||
372 | void SendStartPingCheck(byte seq); | ||
373 | void SendKillObject(ulong regionHandle, uint localID); | ||
374 | void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); | ||
375 | void SendRegionHandshake(RegionInfo regionInfo); | ||
376 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | ||
377 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | ||
378 | |||
379 | void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, | ||
380 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp); | ||
381 | |||
382 | void SendLayerData(float[] map); | ||
383 | void SendLayerData(int px, int py, float[] map); | ||
384 | void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); | ||
385 | void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint); | ||
386 | AgentCircuitData RequestClientInfo(); | ||
387 | |||
388 | void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint, | ||
389 | string capsURL); | ||
390 | |||
391 | void SendMapBlock(List<MapBlockData> mapBlocks); | ||
392 | void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); | ||
393 | |||
394 | void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, | ||
395 | uint flags, string capsURL); | ||
396 | |||
397 | void SendTeleportCancel(); | ||
398 | void SendTeleportLocationStart(); | ||
399 | void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); | ||
400 | |||
401 | void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, | ||
402 | LLVector3 Pos, byte[] textureEntry, uint parentID); | ||
403 | |||
404 | void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, | ||
405 | LLVector3 velocity, LLQuaternion rotation); | ||
406 | |||
407 | void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations); | ||
408 | |||
409 | void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); | ||
410 | |||
411 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, | ||
412 | LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, | ||
413 | uint parentID, byte[] particleSystem, LLQuaternion rotation); | ||
414 | |||
415 | void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, | ||
416 | LLQuaternion rotation); | ||
417 | |||
418 | void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items); | ||
419 | void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item); | ||
420 | void SendInventoryItemUpdate(InventoryItemBase Item); | ||
421 | void SendRemoveInventoryItem(LLUUID itemID); | ||
422 | void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName); | ||
423 | void SendXferPacket(ulong xferID, uint packet, byte[] data); | ||
424 | |||
425 | void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID); | ||
426 | void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags); | ||
427 | |||
428 | void SendNameReply(LLUUID profileId, string firstname, string lastname); | ||
429 | void SendAlertMessage(string message); | ||
430 | void SendAgentAlertMessage(string message, bool modal); | ||
431 | void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url); | ||
432 | bool AddMoney(int debit); | ||
433 | |||
434 | void SendViewerTime(int phase); | ||
435 | |||
436 | void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, | ||
437 | uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID); | ||
438 | |||
439 | void SetDebug(int newDebug); | ||
440 | void InPacket(Packet NewPack); | ||
441 | void Close(); | ||
442 | event ViewerEffectEventHandler OnViewerEffect; | ||
443 | event Action<IClientAPI> OnLogout; | ||
444 | event Action<IClientAPI> OnConnectionClosed; | ||
445 | void SendLogoutPacket(); | ||
446 | } | ||
447 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IGenericConfig.cs b/OpenSim/Framework/General/IGenericConfig.cs deleted file mode 100644 index 889d178..0000000 --- a/OpenSim/Framework/General/IGenericConfig.cs +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | namespace OpenSim.Framework | ||
29 | { | ||
30 | public interface IGenericConfig | ||
31 | { | ||
32 | void SetFileName(string fileName); | ||
33 | void LoadData(); | ||
34 | void LoadDataFromString(string data); | ||
35 | string GetAttribute(string attributeName); | ||
36 | bool SetAttribute(string attributeName, string attributeValue); | ||
37 | void Commit(); | ||
38 | void Close(); | ||
39 | } | ||
40 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IPlugin.cs b/OpenSim/Framework/General/IPlugin.cs deleted file mode 100644 index e649274..0000000 --- a/OpenSim/Framework/General/IPlugin.cs +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | namespace OpenSim.Framework | ||
30 | { | ||
31 | /// <summary> | ||
32 | /// This interface, describes a generic plugin | ||
33 | /// </summary> | ||
34 | public interface IPlugin | ||
35 | { | ||
36 | /// <summary> | ||
37 | /// Returns the plugin version | ||
38 | /// </summary> | ||
39 | /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns> | ||
40 | string Version { get; } | ||
41 | |||
42 | /// <summary> | ||
43 | /// Returns the plugin name | ||
44 | /// </summary> | ||
45 | /// <returns>Plugin name, eg MySQL User Provider</returns> | ||
46 | string Name { get; } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Initialises the plugin (artificial constructor) | ||
50 | /// </summary> | ||
51 | void Initialise(); | ||
52 | } | ||
53 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IRegionCommsListener.cs b/OpenSim/Framework/General/IRegionCommsListener.cs deleted file mode 100644 index 1a24469..0000000 --- a/OpenSim/Framework/General/IRegionCommsListener.cs +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System.Collections.Generic; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); | ||
34 | |||
35 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); | ||
36 | |||
37 | public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); | ||
38 | |||
39 | public delegate void AcknowledgeAgentCross(ulong regionHandle, LLUUID agentID); | ||
40 | |||
41 | public interface IRegionCommsListener | ||
42 | { | ||
43 | event ExpectUserDelegate OnExpectUser; | ||
44 | event GenericCall2 OnExpectChildAgent; | ||
45 | event AgentCrossing OnAvatarCrossingIntoRegion; | ||
46 | event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; | ||
47 | event UpdateNeighbours OnNeighboursUpdate; | ||
48 | } | ||
49 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IScene.cs b/OpenSim/Framework/General/IScene.cs deleted file mode 100644 index 3d6ca1c..0000000 --- a/OpenSim/Framework/General/IScene.cs +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public interface IScene | ||
33 | { | ||
34 | void AddNewClient(IClientAPI client, bool child); | ||
35 | void RemoveClient(LLUUID agentID); | ||
36 | |||
37 | RegionInfo RegionInfo { get; } | ||
38 | object SyncRoot { get; } | ||
39 | uint NextLocalId { get; } | ||
40 | |||
41 | ClientManager ClientManager { get; } | ||
42 | } | ||
43 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IUserData.cs b/OpenSim/Framework/General/IUserData.cs deleted file mode 100644 index cb2502a..0000000 --- a/OpenSim/Framework/General/IUserData.cs +++ /dev/null | |||
@@ -1,134 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | /// <summary> | ||
33 | /// An interface for connecting to user storage servers. | ||
34 | /// </summary> | ||
35 | public interface IUserData | ||
36 | { | ||
37 | /// <summary> | ||
38 | /// Returns a user profile from a database via their UUID | ||
39 | /// </summary> | ||
40 | /// <param name="user">The accounts UUID</param> | ||
41 | /// <returns>The user data profile</returns> | ||
42 | UserProfileData GetUserByUUID(LLUUID user); | ||
43 | |||
44 | /// <summary> | ||
45 | /// Returns a users profile by searching their username | ||
46 | /// </summary> | ||
47 | /// <param name="name">The users username</param> | ||
48 | /// <returns>The user data profile</returns> | ||
49 | UserProfileData GetUserByName(string name); | ||
50 | |||
51 | /// <summary> | ||
52 | /// Returns a users profile by searching their username parts | ||
53 | /// </summary> | ||
54 | /// <param name="fname">Account firstname</param> | ||
55 | /// <param name="lname">Account lastname</param> | ||
56 | /// <returns>The user data profile</returns> | ||
57 | UserProfileData GetUserByName(string fname, string lname); | ||
58 | |||
59 | /// <summary> | ||
60 | /// Returns the current agent for a user searching by it's UUID | ||
61 | /// </summary> | ||
62 | /// <param name="user">The users UUID</param> | ||
63 | /// <returns>The current agent session</returns> | ||
64 | UserAgentData GetAgentByUUID(LLUUID user); | ||
65 | |||
66 | /// <summary> | ||
67 | /// Returns the current session agent for a user searching by username | ||
68 | /// </summary> | ||
69 | /// <param name="name">The users account name</param> | ||
70 | /// <returns>The current agent session</returns> | ||
71 | UserAgentData GetAgentByName(string name); | ||
72 | |||
73 | /// <summary> | ||
74 | /// Returns the current session agent for a user searching by username parts | ||
75 | /// </summary> | ||
76 | /// <param name="fname">The users first account name</param> | ||
77 | /// <param name="lname">The users account surname</param> | ||
78 | /// <returns>The current agent session</returns> | ||
79 | UserAgentData GetAgentByName(string fname, string lname); | ||
80 | |||
81 | /// <summary> | ||
82 | /// Adds a new User profile to the database | ||
83 | /// </summary> | ||
84 | /// <param name="user">UserProfile to add</param> | ||
85 | void AddNewUserProfile(UserProfileData user); | ||
86 | |||
87 | /// <summary> | ||
88 | /// Updates an existing user profile | ||
89 | /// </summary> | ||
90 | /// <param name="user">UserProfile to update</param> | ||
91 | bool UpdateUserProfile(UserProfileData user); | ||
92 | |||
93 | /// <summary> | ||
94 | /// Adds a new agent to the database | ||
95 | /// </summary> | ||
96 | /// <param name="agent">The agent to add</param> | ||
97 | void AddNewUserAgent(UserAgentData agent); | ||
98 | |||
99 | /// <summary> | ||
100 | /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES) | ||
101 | /// </summary> | ||
102 | /// <param name="from">The account to transfer from</param> | ||
103 | /// <param name="to">The account to transfer to</param> | ||
104 | /// <param name="amount">The amount to transfer</param> | ||
105 | /// <returns>Successful?</returns> | ||
106 | bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount); | ||
107 | |||
108 | /// <summary> | ||
109 | /// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account. | ||
110 | /// </summary> | ||
111 | /// <param name="from">User to transfer from</param> | ||
112 | /// <param name="to">User to transfer to</param> | ||
113 | /// <param name="inventory">Specified inventory item</param> | ||
114 | /// <returns>Successful?</returns> | ||
115 | bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory); | ||
116 | |||
117 | /// <summary> | ||
118 | /// Returns the plugin version | ||
119 | /// </summary> | ||
120 | /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns> | ||
121 | string GetVersion(); | ||
122 | |||
123 | /// <summary> | ||
124 | /// Returns the plugin name | ||
125 | /// </summary> | ||
126 | /// <returns>Plugin name, eg MySQL User Provider</returns> | ||
127 | string getName(); | ||
128 | |||
129 | /// <summary> | ||
130 | /// Initialises the plugin (artificial constructor) | ||
131 | /// </summary> | ||
132 | void Initialise(); | ||
133 | } | ||
134 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/IUserService.cs b/OpenSim/Framework/General/IUserService.cs deleted file mode 100644 index ed9032b..0000000 --- a/OpenSim/Framework/General/IUserService.cs +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework.Interfaces | ||
31 | { | ||
32 | public interface IUserService | ||
33 | { | ||
34 | UserProfileData GetUserProfile(string firstName, string lastName); | ||
35 | UserProfileData GetUserProfile(string name); | ||
36 | UserProfileData GetUserProfile(LLUUID userId); | ||
37 | void clearUserAgent(LLUUID avatarID); | ||
38 | |||
39 | UserProfileData SetupMasterUser(string firstName, string lastName); | ||
40 | UserProfileData SetupMasterUser(string firstName, string lastName, string password); | ||
41 | |||
42 | /// <summary> | ||
43 | /// | ||
44 | /// </summary> | ||
45 | /// <param name="user"></param> | ||
46 | void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); | ||
47 | } | ||
48 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/InventoryConfig.cs b/OpenSim/Framework/General/InventoryConfig.cs deleted file mode 100644 index 8e64b68..0000000 --- a/OpenSim/Framework/General/InventoryConfig.cs +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework | ||
6 | { | ||
7 | /// <summary> | ||
8 | /// UserConfig -- For User Server Configuration | ||
9 | /// </summary> | ||
10 | public class InventoryConfig | ||
11 | { | ||
12 | public string DefaultStartupMsg = ""; | ||
13 | public string UserServerURL = ""; | ||
14 | public string UserSendKey = ""; | ||
15 | public string UserRecvKey = ""; | ||
16 | |||
17 | public string DatabaseProvider = ""; | ||
18 | public static uint DefaultHttpPort = 8004; | ||
19 | |||
20 | public int HttpPort = 8004; | ||
21 | |||
22 | private ConfigurationMember configMember; | ||
23 | |||
24 | public InventoryConfig(string description, string filename) | ||
25 | { | ||
26 | configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); | ||
27 | configMember.performConfigurationRetrieve(); | ||
28 | } | ||
29 | |||
30 | public void loadConfigurationOptions() | ||
31 | { | ||
32 | configMember.addConfigurationOption("default_startup_message", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Startup Message", "Welcome to OGS", false); | ||
33 | configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString(), false); | ||
34 | configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false); | ||
35 | configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false); | ||
36 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | ||
37 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Http Listener port", DefaultHttpPort.ToString(), false); | ||
38 | } | ||
39 | |||
40 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
41 | { | ||
42 | switch (configuration_key) | ||
43 | { | ||
44 | case "default_startup_message": | ||
45 | this.DefaultStartupMsg = (string)configuration_result; | ||
46 | break; | ||
47 | case "default_user_server": | ||
48 | this.UserServerURL = (string)configuration_result; | ||
49 | break; | ||
50 | case "user_send_key": | ||
51 | this.UserSendKey = (string)configuration_result; | ||
52 | break; | ||
53 | case "user_recv_key": | ||
54 | this.UserRecvKey = (string)configuration_result; | ||
55 | break; | ||
56 | case "database_provider": | ||
57 | this.DatabaseProvider = (string)configuration_result; | ||
58 | break; | ||
59 | case "http_port": | ||
60 | HttpPort = (int)configuration_result; | ||
61 | break; | ||
62 | } | ||
63 | |||
64 | return true; | ||
65 | } | ||
66 | } | ||
67 | } | ||
diff --git a/OpenSim/Framework/General/InventoryItemBase.cs b/OpenSim/Framework/General/InventoryItemBase.cs deleted file mode 100644 index 331013f..0000000 --- a/OpenSim/Framework/General/InventoryItemBase.cs +++ /dev/null | |||
@@ -1,273 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using System.Xml.Serialization; | ||
30 | using System.Collections; | ||
31 | using System.Collections.Generic; | ||
32 | using libsecondlife; | ||
33 | |||
34 | namespace OpenSim.Framework | ||
35 | { | ||
36 | /// <summary> | ||
37 | /// Inventory Item - contains all the properties associated with an individual inventory piece. | ||
38 | /// </summary> | ||
39 | public class InventoryItemBase | ||
40 | { | ||
41 | /// <summary> | ||
42 | /// A UUID containing the ID for the inventory item itself | ||
43 | /// </summary> | ||
44 | public LLUUID inventoryID; | ||
45 | |||
46 | /// <summary> | ||
47 | /// The UUID of the associated asset on the asset server | ||
48 | /// </summary> | ||
49 | public LLUUID assetID; | ||
50 | |||
51 | /// <summary> | ||
52 | /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) | ||
53 | /// </summary> | ||
54 | public int assetType; | ||
55 | |||
56 | /// <summary> | ||
57 | /// The type of inventory item. (Can be slightly different to the asset type | ||
58 | /// </summary> | ||
59 | public int invType; | ||
60 | |||
61 | /// <summary> | ||
62 | /// The folder this item is contained in | ||
63 | /// </summary> | ||
64 | public LLUUID parentFolderID; | ||
65 | |||
66 | /// <summary> | ||
67 | /// The owner of this inventory item | ||
68 | /// </summary> | ||
69 | public LLUUID avatarID; | ||
70 | |||
71 | /// <summary> | ||
72 | /// The creator of this item | ||
73 | /// </summary> | ||
74 | public LLUUID creatorsID; | ||
75 | |||
76 | /// <summary> | ||
77 | /// The name of the inventory item (must be less than 64 characters) | ||
78 | /// </summary> | ||
79 | public string inventoryName; | ||
80 | |||
81 | /// <summary> | ||
82 | /// The description of the inventory item (must be less than 64 characters) | ||
83 | /// </summary> | ||
84 | public string inventoryDescription; | ||
85 | |||
86 | /// <summary> | ||
87 | /// A mask containing the permissions for the next owner (cannot be enforced) | ||
88 | /// </summary> | ||
89 | public uint inventoryNextPermissions; | ||
90 | |||
91 | /// <summary> | ||
92 | /// A mask containing permissions for the current owner (cannot be enforced) | ||
93 | /// </summary> | ||
94 | public uint inventoryCurrentPermissions; | ||
95 | |||
96 | /// <summary> | ||
97 | /// | ||
98 | /// </summary> | ||
99 | public uint inventoryBasePermissions; | ||
100 | |||
101 | /// <summary> | ||
102 | /// | ||
103 | /// </summary> | ||
104 | public uint inventoryEveryOnePermissions; | ||
105 | } | ||
106 | |||
107 | /// <summary> | ||
108 | /// A Class for folders which contain users inventory | ||
109 | /// </summary> | ||
110 | public class InventoryFolderBase | ||
111 | { | ||
112 | /// <summary> | ||
113 | /// The name of the folder (64 characters or less) | ||
114 | /// </summary> | ||
115 | public string name; | ||
116 | |||
117 | /// <summary> | ||
118 | /// The agent who's inventory this is contained by | ||
119 | /// </summary> | ||
120 | public LLUUID agentID; | ||
121 | |||
122 | /// <summary> | ||
123 | /// The folder this folder is contained in | ||
124 | /// </summary> | ||
125 | public LLUUID parentID; | ||
126 | |||
127 | /// <summary> | ||
128 | /// The UUID for this folder | ||
129 | /// </summary> | ||
130 | public LLUUID folderID; | ||
131 | |||
132 | /// <summary> | ||
133 | /// Tyep of Items normally stored in this folder | ||
134 | /// </summary> | ||
135 | public short type; | ||
136 | |||
137 | /// <summary> | ||
138 | /// | ||
139 | /// </summary> | ||
140 | public ushort version; | ||
141 | } | ||
142 | |||
143 | /// <summary> | ||
144 | /// An interface for accessing inventory data from a storage server | ||
145 | /// </summary> | ||
146 | public interface IInventoryData | ||
147 | { | ||
148 | /// <summary> | ||
149 | /// Initialises the interface | ||
150 | /// </summary> | ||
151 | void Initialise(); | ||
152 | |||
153 | /// <summary> | ||
154 | /// Closes the interface | ||
155 | /// </summary> | ||
156 | void Close(); | ||
157 | |||
158 | /// <summary> | ||
159 | /// The plugin being loaded | ||
160 | /// </summary> | ||
161 | /// <returns>A string containing the plugin name</returns> | ||
162 | string getName(); | ||
163 | |||
164 | /// <summary> | ||
165 | /// The plugins version | ||
166 | /// </summary> | ||
167 | /// <returns>A string containing the plugin version</returns> | ||
168 | string getVersion(); | ||
169 | |||
170 | /// <summary> | ||
171 | /// Returns a list of inventory items contained within the specified folder | ||
172 | /// </summary> | ||
173 | /// <param name="folderID">The UUID of the target folder</param> | ||
174 | /// <returns>A List of InventoryItemBase items</returns> | ||
175 | List<InventoryItemBase> getInventoryInFolder(LLUUID folderID); | ||
176 | |||
177 | /// <summary> | ||
178 | /// Returns a list of the root folders within a users inventory | ||
179 | /// </summary> | ||
180 | /// <param name="user">The user whos inventory is to be searched</param> | ||
181 | /// <returns>A list of folder objects</returns> | ||
182 | List<InventoryFolderBase> getUserRootFolders(LLUUID user); | ||
183 | |||
184 | /// <summary> | ||
185 | /// Returns the users inventory root folder. | ||
186 | /// </summary> | ||
187 | /// <param name="user">The UUID of the user who is having inventory being returned</param> | ||
188 | /// <returns>Root inventory folder</returns> | ||
189 | InventoryFolderBase getUserRootFolder(LLUUID user); | ||
190 | |||
191 | /// <summary> | ||
192 | /// Returns a list of inventory folders contained in the folder 'parentID' | ||
193 | /// </summary> | ||
194 | /// <param name="parentID">The folder to get subfolders for</param> | ||
195 | /// <returns>A list of inventory folders</returns> | ||
196 | List<InventoryFolderBase> getInventoryFolders(LLUUID parentID); | ||
197 | |||
198 | /// <summary> | ||
199 | /// Returns an inventory item by its UUID | ||
200 | /// </summary> | ||
201 | /// <param name="item">The UUID of the item to be returned</param> | ||
202 | /// <returns>A class containing item information</returns> | ||
203 | InventoryItemBase getInventoryItem(LLUUID item); | ||
204 | |||
205 | /// <summary> | ||
206 | /// Returns a specified inventory folder by its UUID | ||
207 | /// </summary> | ||
208 | /// <param name="folder">The UUID of the folder to be returned</param> | ||
209 | /// <returns>A class containing folder information</returns> | ||
210 | InventoryFolderBase getInventoryFolder(LLUUID folder); | ||
211 | |||
212 | /// <summary> | ||
213 | /// Creates a new inventory item based on item | ||
214 | /// </summary> | ||
215 | /// <param name="item">The item to be created</param> | ||
216 | void addInventoryItem(InventoryItemBase item); | ||
217 | |||
218 | /// <summary> | ||
219 | /// Updates an inventory item with item (updates based on ID) | ||
220 | /// </summary> | ||
221 | /// <param name="item">The updated item</param> | ||
222 | void updateInventoryItem(InventoryItemBase item); | ||
223 | |||
224 | /// <summary> | ||
225 | /// | ||
226 | /// </summary> | ||
227 | /// <param name="item"></param> | ||
228 | void deleteInventoryItem(LLUUID item); | ||
229 | |||
230 | /// <summary> | ||
231 | /// Adds a new folder specified by folder | ||
232 | /// </summary> | ||
233 | /// <param name="folder">The inventory folder</param> | ||
234 | void addInventoryFolder(InventoryFolderBase folder); | ||
235 | |||
236 | /// <summary> | ||
237 | /// Updates a folder based on its ID with folder | ||
238 | /// </summary> | ||
239 | /// <param name="folder">The inventory folder</param> | ||
240 | void updateInventoryFolder(InventoryFolderBase folder); | ||
241 | |||
242 | /// <summary> | ||
243 | /// Deletes a folder based on its ID with folder | ||
244 | /// </summary> | ||
245 | /// <param name="folder">The id of the folder</param> | ||
246 | void deleteInventoryFolder(LLUUID folder); | ||
247 | } | ||
248 | |||
249 | /* | ||
250 | * .Net has some issues, serializing a dictionary, so we cannot reuse the InventoryFolder | ||
251 | * class defined in Communications.Framework.Communications.Caches. So we serialize/deserialize | ||
252 | * into this simpler class, and then use that. | ||
253 | */ | ||
254 | [XmlRoot(ElementName = "inventory", IsNullable = true)] | ||
255 | public class SerializableInventory | ||
256 | { | ||
257 | [XmlRoot(ElementName = "folder", IsNullable = true)] | ||
258 | public class SerializableFolder : InventoryFolderBase | ||
259 | { | ||
260 | [XmlArray(ElementName = "folders", IsNullable = true)] | ||
261 | [XmlArrayItem(ElementName = "folder", IsNullable = true, Type = typeof(SerializableFolder))] | ||
262 | public ArrayList SubFolders; | ||
263 | |||
264 | [XmlArray(ElementName = "items", IsNullable = true)] | ||
265 | [XmlArrayItem(ElementName = "item", IsNullable = true, Type = typeof(InventoryItemBase))] | ||
266 | public ArrayList Items; | ||
267 | } | ||
268 | |||
269 | [XmlElement(ElementName = "folder", IsNullable = true)] | ||
270 | public SerializableFolder root; | ||
271 | } | ||
272 | |||
273 | } | ||
diff --git a/OpenSim/Framework/General/LandData.cs b/OpenSim/Framework/General/LandData.cs deleted file mode 100644 index ca948ef..0000000 --- a/OpenSim/Framework/General/LandData.cs +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public class LandData | ||
33 | { | ||
34 | public byte[] landBitmapByteArray = new byte[512]; | ||
35 | public string landName = "Your Parcel"; | ||
36 | public string landDesc = ""; | ||
37 | public LLUUID ownerID = new LLUUID(); | ||
38 | public bool isGroupOwned = false; | ||
39 | public LLVector3 AABBMin = new LLVector3(); | ||
40 | public LLVector3 AABBMax = new LLVector3(); | ||
41 | public int area = 0; | ||
42 | public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned | ||
43 | public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID | ||
44 | public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category | ||
45 | public int claimDate = 0; //Unemplemented | ||
46 | public int claimPrice = 0; //Unemplemented | ||
47 | public LLUUID groupID = new LLUUID(); //Unemplemented | ||
48 | public int groupPrims = 0; | ||
49 | public int otherPrims = 0; | ||
50 | public int ownerPrims = 0; | ||
51 | public int selectedPrims = 0; | ||
52 | public int simwidePrims = 0; | ||
53 | public int simwideArea = 0; | ||
54 | public int salePrice = 0; //Unemeplemented. Parcels price. | ||
55 | public Parcel.ParcelStatus landStatus = Parcel.ParcelStatus.Leased; | ||
56 | |||
57 | public uint landFlags = (uint) Parcel.ParcelFlags.AllowFly | (uint) Parcel.ParcelFlags.AllowLandmark | | ||
58 | (uint) Parcel.ParcelFlags.AllowAllObjectEntry | | ||
59 | (uint) Parcel.ParcelFlags.AllowDeedToGroup | (uint) Parcel.ParcelFlags.AllowTerraform | | ||
60 | (uint) Parcel.ParcelFlags.CreateObjects | (uint) Parcel.ParcelFlags.AllowOtherScripts | | ||
61 | (uint) Parcel.ParcelFlags.SoundLocal; | ||
62 | |||
63 | public byte landingType = 0; | ||
64 | public byte mediaAutoScale = 0; | ||
65 | public LLUUID mediaID = LLUUID.Zero; | ||
66 | public int localID = 0; | ||
67 | public LLUUID globalID = new LLUUID(); | ||
68 | |||
69 | public string mediaURL = ""; | ||
70 | public string musicURL = ""; | ||
71 | public float passHours = 0; | ||
72 | public int passPrice = 0; | ||
73 | public LLUUID snapshotID = LLUUID.Zero; | ||
74 | public LLVector3 userLocation = new LLVector3(); | ||
75 | public LLVector3 userLookAt = new LLVector3(); | ||
76 | |||
77 | public LandData() | ||
78 | { | ||
79 | globalID = LLUUID.Random(); | ||
80 | } | ||
81 | |||
82 | public LandData Copy() | ||
83 | { | ||
84 | LandData landData = new LandData(); | ||
85 | |||
86 | landData.AABBMax = AABBMax; | ||
87 | landData.AABBMin = AABBMin; | ||
88 | landData.area = area; | ||
89 | landData.auctionID = auctionID; | ||
90 | landData.authBuyerID = authBuyerID; | ||
91 | landData.category = category; | ||
92 | landData.claimDate = claimDate; | ||
93 | landData.claimPrice = claimPrice; | ||
94 | landData.globalID = globalID; | ||
95 | landData.groupID = groupID; | ||
96 | landData.groupPrims = groupPrims; | ||
97 | landData.otherPrims = otherPrims; | ||
98 | landData.ownerPrims = ownerPrims; | ||
99 | landData.selectedPrims = selectedPrims; | ||
100 | landData.isGroupOwned = isGroupOwned; | ||
101 | landData.localID = localID; | ||
102 | landData.landingType = landingType; | ||
103 | landData.mediaAutoScale = mediaAutoScale; | ||
104 | landData.mediaID = mediaID; | ||
105 | landData.mediaURL = mediaURL; | ||
106 | landData.musicURL = musicURL; | ||
107 | landData.ownerID = ownerID; | ||
108 | landData.landBitmapByteArray = (byte[]) landBitmapByteArray.Clone(); | ||
109 | landData.landDesc = landDesc; | ||
110 | landData.landFlags = landFlags; | ||
111 | landData.landName = landName; | ||
112 | landData.landStatus = landStatus; | ||
113 | landData.passHours = passHours; | ||
114 | landData.passPrice = passPrice; | ||
115 | landData.salePrice = salePrice; | ||
116 | landData.snapshotID = snapshotID; | ||
117 | landData.userLocation = userLocation; | ||
118 | landData.userLookAt = userLookAt; | ||
119 | |||
120 | return landData; | ||
121 | } | ||
122 | } | ||
123 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/Login.cs b/OpenSim/Framework/General/Login.cs deleted file mode 100644 index 7ceed19..0000000 --- a/OpenSim/Framework/General/Login.cs +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public class Login | ||
33 | { | ||
34 | public string First = "Test"; | ||
35 | public string Last = "User"; | ||
36 | public LLUUID Agent; | ||
37 | public LLUUID Session; | ||
38 | public LLUUID SecureSession = LLUUID.Zero; | ||
39 | public LLUUID InventoryFolder; | ||
40 | public LLUUID BaseFolder; | ||
41 | public uint CircuitCode; | ||
42 | public string CapsPath = ""; | ||
43 | public LLVector3 StartPos; | ||
44 | |||
45 | public Login() | ||
46 | { | ||
47 | StartPos = new LLVector3(128, 128, 70); | ||
48 | } | ||
49 | } | ||
50 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/MapBlockData.cs b/OpenSim/Framework/General/MapBlockData.cs deleted file mode 100644 index 8609533..0000000 --- a/OpenSim/Framework/General/MapBlockData.cs +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System; | ||
30 | using libsecondlife; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | public class MapBlockData | ||
35 | { | ||
36 | public uint Flags; | ||
37 | public ushort X; | ||
38 | public ushort Y; | ||
39 | public byte Agents; | ||
40 | public byte Access; | ||
41 | public byte WaterHeight; | ||
42 | public LLUUID MapImageId; | ||
43 | public String Name; | ||
44 | public uint RegionFlags; | ||
45 | |||
46 | public MapBlockData() | ||
47 | { | ||
48 | } | ||
49 | } | ||
50 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/NeighbourInfo.cs b/OpenSim/Framework/General/NeighbourInfo.cs deleted file mode 100644 index d5a0a2f..0000000 --- a/OpenSim/Framework/General/NeighbourInfo.cs +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | namespace OpenSim.Framework | ||
29 | { | ||
30 | public class NeighbourInfo | ||
31 | { | ||
32 | public NeighbourInfo() | ||
33 | { | ||
34 | } | ||
35 | |||
36 | public ulong regionhandle; | ||
37 | public uint RegionLocX; | ||
38 | public uint RegionLocY; | ||
39 | public string sim_ip; | ||
40 | public uint sim_port; | ||
41 | } | ||
42 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/NetworkServersInfo.cs b/OpenSim/Framework/General/NetworkServersInfo.cs deleted file mode 100644 index b9ce143..0000000 --- a/OpenSim/Framework/General/NetworkServersInfo.cs +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using Nini.Config; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | public class NetworkServersInfo | ||
34 | { | ||
35 | public string AssetURL = "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/"; | ||
36 | public string AssetSendKey = ""; | ||
37 | |||
38 | public string GridURL = ""; | ||
39 | public string GridSendKey = ""; | ||
40 | public string GridRecvKey = ""; | ||
41 | public string UserURL = ""; | ||
42 | public string UserSendKey = ""; | ||
43 | public string UserRecvKey = ""; | ||
44 | public bool isSandbox; | ||
45 | |||
46 | public string InventoryURL = ""; | ||
47 | |||
48 | public static int DefaultHttpListenerPort = 9000; | ||
49 | public int HttpListenerPort = DefaultHttpListenerPort; | ||
50 | |||
51 | public static int RemotingListenerPort = 8895; | ||
52 | |||
53 | |||
54 | public NetworkServersInfo() | ||
55 | { | ||
56 | } | ||
57 | |||
58 | public NetworkServersInfo(uint defaultHomeLocX, uint defaultHomeLocY) | ||
59 | { | ||
60 | m_defaultHomeLocX = defaultHomeLocX; | ||
61 | m_defaultHomeLocY = defaultHomeLocY; | ||
62 | } | ||
63 | |||
64 | private uint? m_defaultHomeLocX; | ||
65 | |||
66 | public uint DefaultHomeLocX | ||
67 | { | ||
68 | get { return m_defaultHomeLocX.Value; } | ||
69 | } | ||
70 | |||
71 | private uint? m_defaultHomeLocY; | ||
72 | |||
73 | public uint DefaultHomeLocY | ||
74 | { | ||
75 | get { return m_defaultHomeLocY.Value; } | ||
76 | } | ||
77 | |||
78 | public void loadFromConfiguration(IConfigSource config) | ||
79 | { | ||
80 | m_defaultHomeLocX = (uint) config.Configs["StandAlone"].GetInt("default_location_x", 1000); | ||
81 | m_defaultHomeLocY = (uint) config.Configs["StandAlone"].GetInt("default_location_y", 1000); | ||
82 | |||
83 | HttpListenerPort = config.Configs["Network"].GetInt("http_listener_port", DefaultHttpListenerPort); | ||
84 | RemotingListenerPort = config.Configs["Network"].GetInt("remoting_listener_port", RemotingListenerPort); | ||
85 | GridURL = | ||
86 | config.Configs["Network"].GetString("grid_server_url", | ||
87 | "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString()); | ||
88 | GridSendKey = config.Configs["Network"].GetString("grid_send_key", "null"); | ||
89 | GridRecvKey = config.Configs["Network"].GetString("grid_recv_key", "null"); | ||
90 | UserURL = | ||
91 | config.Configs["Network"].GetString("user_server_url", | ||
92 | "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString()); | ||
93 | UserSendKey = config.Configs["Network"].GetString("user_send_key", "null"); | ||
94 | UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null"); | ||
95 | AssetURL = config.Configs["Network"].GetString("asset_server_url", AssetURL); | ||
96 | InventoryURL = config.Configs["Network"].GetString("inventory_server_url", | ||
97 | "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString()); | ||
98 | } | ||
99 | } | ||
100 | } | ||
diff --git a/OpenSim/Framework/General/PrimitiveBaseShape.cs b/OpenSim/Framework/General/PrimitiveBaseShape.cs deleted file mode 100644 index 5cdbfb2..0000000 --- a/OpenSim/Framework/General/PrimitiveBaseShape.cs +++ /dev/null | |||
@@ -1,214 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System.Xml.Serialization; | ||
30 | using libsecondlife; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | public enum ProfileShape : byte | ||
35 | { | ||
36 | Circle = 0, | ||
37 | Square = 1, | ||
38 | IsometricTriangle = 2, | ||
39 | EquilateralTriangle = 3, | ||
40 | RightTriangle = 4, | ||
41 | HalfCircle = 5 | ||
42 | } | ||
43 | |||
44 | public enum HollowShape : byte | ||
45 | { | ||
46 | Same = 0, | ||
47 | Circle = 16, | ||
48 | Square = 32, | ||
49 | Triangle = 48 | ||
50 | } | ||
51 | |||
52 | public enum PCodeEnum : byte | ||
53 | { | ||
54 | Primitive = 9, | ||
55 | Avatar = 47 | ||
56 | } | ||
57 | |||
58 | public enum Extrusion : byte | ||
59 | { | ||
60 | Straight = 16, | ||
61 | Curve1 = 32, | ||
62 | Curve2 = 48, | ||
63 | Flexible = 128 | ||
64 | } | ||
65 | |||
66 | public class PrimitiveBaseShape | ||
67 | { | ||
68 | private static byte[] m_defaultTextureEntry; | ||
69 | |||
70 | public byte PCode; | ||
71 | public ushort PathBegin; | ||
72 | public ushort PathEnd; | ||
73 | public byte PathScaleX; | ||
74 | public byte PathScaleY; | ||
75 | public byte PathShearX; | ||
76 | public byte PathShearY; | ||
77 | public sbyte PathSkew; | ||
78 | public ushort ProfileBegin; | ||
79 | public ushort ProfileEnd; | ||
80 | public LLVector3 Scale; | ||
81 | public byte PathCurve; | ||
82 | public byte ProfileCurve; | ||
83 | public ushort ProfileHollow; | ||
84 | public sbyte PathRadiusOffset; | ||
85 | public byte PathRevolutions; | ||
86 | public sbyte PathTaperX; | ||
87 | public sbyte PathTaperY; | ||
88 | public sbyte PathTwist; | ||
89 | public sbyte PathTwistBegin; | ||
90 | public byte[] TextureEntry; // a LL textureEntry in byte[] format | ||
91 | public byte[] ExtraParams; | ||
92 | |||
93 | public ProfileShape ProfileShape | ||
94 | { | ||
95 | get { return (ProfileShape) (ProfileCurve & 0xf); } | ||
96 | set | ||
97 | { | ||
98 | byte oldValueMasked = (byte) (ProfileCurve & 0xf0); | ||
99 | ProfileCurve = (byte) (oldValueMasked | (byte) value); | ||
100 | } | ||
101 | } | ||
102 | |||
103 | [XmlIgnore] | ||
104 | public HollowShape HollowShape | ||
105 | { | ||
106 | get { return (HollowShape) (ProfileHollow & 0xf0); } | ||
107 | set | ||
108 | { | ||
109 | byte oldValueMasked = (byte) (ProfileHollow & 0xf0); | ||
110 | ProfileHollow = (byte) (oldValueMasked | (byte) value); | ||
111 | } | ||
112 | } | ||
113 | |||
114 | public LLVector3 PrimScale | ||
115 | { | ||
116 | get { return Scale; } | ||
117 | } | ||
118 | |||
119 | static PrimitiveBaseShape() | ||
120 | { | ||
121 | m_defaultTextureEntry = | ||
122 | new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")).ToBytes(); | ||
123 | } | ||
124 | |||
125 | public PrimitiveBaseShape() | ||
126 | { | ||
127 | PCode = (byte) PCodeEnum.Primitive; | ||
128 | ExtraParams = new byte[1]; | ||
129 | TextureEntry = m_defaultTextureEntry; | ||
130 | } | ||
131 | |||
132 | //void returns need to change of course | ||
133 | public virtual void GetMesh() | ||
134 | { | ||
135 | } | ||
136 | |||
137 | public PrimitiveBaseShape Copy() | ||
138 | { | ||
139 | return (PrimitiveBaseShape) MemberwiseClone(); | ||
140 | } | ||
141 | } | ||
142 | |||
143 | public class GenericShape : PrimitiveBaseShape | ||
144 | { | ||
145 | public GenericShape() | ||
146 | : base() | ||
147 | { | ||
148 | } | ||
149 | } | ||
150 | |||
151 | public class BoxShape : PrimitiveBaseShape | ||
152 | { | ||
153 | public BoxShape() | ||
154 | : base() | ||
155 | { | ||
156 | PathCurve = (byte) Extrusion.Straight; | ||
157 | ProfileShape = ProfileShape.Square; | ||
158 | PathScaleX = 100; | ||
159 | PathScaleY = 100; | ||
160 | } | ||
161 | |||
162 | public BoxShape(float side) | ||
163 | : this() | ||
164 | { | ||
165 | SetSide(side); | ||
166 | } | ||
167 | |||
168 | public void SetSide(float side) | ||
169 | { | ||
170 | Scale = new LLVector3(side, side, side); | ||
171 | } | ||
172 | |||
173 | public static BoxShape Default | ||
174 | { | ||
175 | get | ||
176 | { | ||
177 | BoxShape boxShape = new BoxShape(); | ||
178 | |||
179 | boxShape.SetSide(0.5f); | ||
180 | |||
181 | return boxShape; | ||
182 | } | ||
183 | } | ||
184 | } | ||
185 | |||
186 | public class CylinderShape : PrimitiveBaseShape | ||
187 | { | ||
188 | public CylinderShape() | ||
189 | : base() | ||
190 | { | ||
191 | PathCurve = (byte) Extrusion.Straight; | ||
192 | ProfileShape = ProfileShape.Circle; | ||
193 | PathScaleX = 100; | ||
194 | PathScaleY = 100; | ||
195 | } | ||
196 | |||
197 | public CylinderShape(float radius, float heigth) | ||
198 | : this() | ||
199 | { | ||
200 | SetRadius(radius); | ||
201 | SetHeigth(heigth); | ||
202 | } | ||
203 | |||
204 | private void SetHeigth(float heigth) | ||
205 | { | ||
206 | Scale.Z = heigth; | ||
207 | } | ||
208 | |||
209 | private void SetRadius(float radius) | ||
210 | { | ||
211 | Scale.X = Scale.Y = radius*2f; | ||
212 | } | ||
213 | } | ||
214 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/Properties/AssemblyInfo.cs b/OpenSim/Framework/General/Properties/AssemblyInfo.cs deleted file mode 100644 index b3206a7..0000000 --- a/OpenSim/Framework/General/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.InteropServices; | ||
3 | |||
4 | // General Information about an assembly is controlled through the following | ||
5 | // set of attributes. Change these attribute values to modify the information | ||
6 | // associated with an assembly. | ||
7 | |||
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 | |||
21 | [assembly : ComVisible(false)] | ||
22 | |||
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
24 | |||
25 | [assembly : Guid("a08e20c7-f191-4137-b1f0-9291408fa521")] | ||
26 | |||
27 | // Version information for an assembly consists of the following four values: | ||
28 | // | ||
29 | // Major Version | ||
30 | // Minor Version | ||
31 | // Build Number | ||
32 | // Revision | ||
33 | // | ||
34 | |||
35 | [assembly : AssemblyVersion("1.0.0.0")] | ||
36 | [assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/RegionCommsListener.cs b/OpenSim/Framework/General/RegionCommsListener.cs deleted file mode 100644 index ee0d503..0000000 --- a/OpenSim/Framework/General/RegionCommsListener.cs +++ /dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System.Collections.Generic; | ||
30 | using libsecondlife; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | public class RegionCommsListener : IRegionCommsListener | ||
35 | { | ||
36 | public event ExpectUserDelegate OnExpectUser; | ||
37 | public event GenericCall2 OnExpectChildAgent; | ||
38 | public event AgentCrossing OnAvatarCrossingIntoRegion; | ||
39 | public event UpdateNeighbours OnNeighboursUpdate; | ||
40 | public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; | ||
41 | |||
42 | /// <summary> | ||
43 | /// | ||
44 | /// </summary> | ||
45 | /// <param name="agent"></param> | ||
46 | /// <returns></returns> | ||
47 | public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) | ||
48 | { | ||
49 | if (OnExpectUser != null) | ||
50 | { | ||
51 | OnExpectUser(regionHandle, agent); | ||
52 | return true; | ||
53 | } | ||
54 | |||
55 | return false; | ||
56 | } | ||
57 | |||
58 | public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, | ||
59 | bool isFlying) | ||
60 | { | ||
61 | if (OnAvatarCrossingIntoRegion != null) | ||
62 | { | ||
63 | OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); | ||
64 | return true; | ||
65 | } | ||
66 | return false; | ||
67 | } | ||
68 | |||
69 | public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID) | ||
70 | { | ||
71 | if (OnAcknowledgeAgentCrossed != null) | ||
72 | { | ||
73 | OnAcknowledgeAgentCrossed(regionHandle, agentID); | ||
74 | return true; | ||
75 | } | ||
76 | return false; | ||
77 | } | ||
78 | |||
79 | /// <summary> | ||
80 | /// | ||
81 | /// </summary> | ||
82 | /// <remarks>TODO: Doesnt take any args??</remarks> | ||
83 | /// <returns></returns> | ||
84 | public virtual bool TriggerExpectChildAgent() | ||
85 | { | ||
86 | if (OnExpectChildAgent != null) | ||
87 | { | ||
88 | OnExpectChildAgent(); | ||
89 | return true; | ||
90 | } | ||
91 | |||
92 | return false; | ||
93 | } | ||
94 | |||
95 | /// <summary> | ||
96 | /// | ||
97 | /// </summary> | ||
98 | /// <remarks>Added to avoid a unused compiler warning on OnNeighboursUpdate, TODO: Check me</remarks> | ||
99 | /// <param name="neighbours"></param> | ||
100 | /// <returns></returns> | ||
101 | public virtual bool TriggerOnNeighboursUpdate(List<RegionInfo> neighbours) | ||
102 | { | ||
103 | if (OnNeighboursUpdate != null) | ||
104 | { | ||
105 | OnNeighboursUpdate(neighbours); | ||
106 | return true; | ||
107 | } | ||
108 | |||
109 | return false; | ||
110 | } | ||
111 | } | ||
112 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/RegionHandle.cs b/OpenSim/Framework/General/RegionHandle.cs deleted file mode 100644 index 440aaf6..0000000 --- a/OpenSim/Framework/General/RegionHandle.cs +++ /dev/null | |||
@@ -1,150 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System; | ||
30 | using System.Net; | ||
31 | using System.Net.Sockets; | ||
32 | |||
33 | namespace OpenSim.Framework | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// A class for manipulating RegionHandle coordinates | ||
37 | /// </summary> | ||
38 | internal class RegionHandle | ||
39 | { | ||
40 | private UInt64 handle; | ||
41 | |||
42 | /// <summary> | ||
43 | /// Initialises a new grid-aware RegionHandle | ||
44 | /// </summary> | ||
45 | /// <param name="ip">IP Address of the Grid Server for this region</param> | ||
46 | /// <param name="x">Grid X Coordinate</param> | ||
47 | /// <param name="y">Grid Y Coordinate</param> | ||
48 | public RegionHandle(string ip, short x, short y) | ||
49 | { | ||
50 | IPAddress addr = IPAddress.Parse(ip); | ||
51 | |||
52 | if (addr.AddressFamily != AddressFamily.InterNetwork) | ||
53 | throw new Exception("Bad RegionHandle Parameter - must be an IPv4 address"); | ||
54 | |||
55 | uint baseHandle = BitConverter.ToUInt32(addr.GetAddressBytes(), 0); | ||
56 | |||
57 | // Split the IP address in half | ||
58 | short a = (short) ((baseHandle << 16) & 0xFFFF); | ||
59 | short b = (short) ((baseHandle << 0) & 0xFFFF); | ||
60 | |||
61 | // Raise the bounds a little | ||
62 | uint nx = (uint) x; | ||
63 | uint ny = (uint) y; | ||
64 | |||
65 | // Multiply grid coords to get region coords | ||
66 | nx *= 256; | ||
67 | ny *= 256; | ||
68 | |||
69 | // Stuff the IP address in too | ||
70 | nx = (uint) a << 16; | ||
71 | ny = (uint) b << 16; | ||
72 | |||
73 | handle = ((UInt64) nx << 32) | (uint) ny; | ||
74 | } | ||
75 | |||
76 | /// <summary> | ||
77 | /// Initialises a new RegionHandle that is not inter-grid aware | ||
78 | /// </summary> | ||
79 | /// <param name="x">Grid X Coordinate</param> | ||
80 | /// <param name="y">Grid Y Coordinate</param> | ||
81 | public RegionHandle(uint x, uint y) | ||
82 | { | ||
83 | handle = ((x*256) << 32) | (y*256); | ||
84 | } | ||
85 | |||
86 | /// <summary> | ||
87 | /// Initialises a new RegionHandle from an existing value | ||
88 | /// </summary> | ||
89 | /// <param name="Region">A U64 RegionHandle</param> | ||
90 | public RegionHandle(UInt64 Region) | ||
91 | { | ||
92 | handle = Region; | ||
93 | } | ||
94 | |||
95 | /// <summary> | ||
96 | /// Returns the Grid Masked RegionHandle - For use in Teleport packets and other packets where sending the grid IP address may be handy. | ||
97 | /// </summary> | ||
98 | /// <remarks>Do not use for SimulatorEnable packets. The client will choke.</remarks> | ||
99 | /// <returns>Region Handle including IP Address encoding</returns> | ||
100 | public UInt64 getTeleportHandle() | ||
101 | { | ||
102 | return handle; | ||
103 | } | ||
104 | |||
105 | /// <summary> | ||
106 | /// Returns a RegionHandle which may be used for SimulatorEnable packets. Removes the IP address encoding and returns the lower bounds. | ||
107 | /// </summary> | ||
108 | /// <returns>A U64 RegionHandle for use in SimulatorEnable packets.</returns> | ||
109 | public UInt64 getNeighbourHandle() | ||
110 | { | ||
111 | UInt64 mask = 0x0000FFFF0000FFFF; | ||
112 | |||
113 | return handle | mask; | ||
114 | } | ||
115 | |||
116 | /// <summary> | ||
117 | /// Returns the IP Address of the GridServer from a Grid-Encoded RegionHandle | ||
118 | /// </summary> | ||
119 | /// <returns>Grid Server IP Address</returns> | ||
120 | public IPAddress getGridIP() | ||
121 | { | ||
122 | uint a = (uint) ((handle >> 16) & 0xFFFF); | ||
123 | uint b = (uint) ((handle >> 48) & 0xFFFF); | ||
124 | |||
125 | return new IPAddress((long) (a << 16) | (long) b); | ||
126 | } | ||
127 | |||
128 | /// <summary> | ||
129 | /// Returns the X Coordinate from a Grid-Encoded RegionHandle | ||
130 | /// </summary> | ||
131 | /// <returns>X Coordinate</returns> | ||
132 | public uint getGridX() | ||
133 | { | ||
134 | uint x = (uint) ((handle >> 32) & 0xFFFF); | ||
135 | |||
136 | return x; | ||
137 | } | ||
138 | |||
139 | /// <summary> | ||
140 | /// Returns the Y Coordinate from a Grid-Encoded RegionHandle | ||
141 | /// </summary> | ||
142 | /// <returns>Y Coordinate</returns> | ||
143 | public uint getGridY() | ||
144 | { | ||
145 | uint y = (uint) ((handle >> 0) & 0xFFFF); | ||
146 | |||
147 | return y; | ||
148 | } | ||
149 | } | ||
150 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/RegionInfo.cs b/OpenSim/Framework/General/RegionInfo.cs deleted file mode 100644 index 1257849..0000000 --- a/OpenSim/Framework/General/RegionInfo.cs +++ /dev/null | |||
@@ -1,328 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using System.Net; | ||
30 | using System.Net.Sockets; | ||
31 | using libsecondlife; | ||
32 | using Nini.Config; | ||
33 | |||
34 | namespace OpenSim.Framework | ||
35 | { | ||
36 | public class SimpleRegionInfo | ||
37 | { | ||
38 | public SimpleRegionInfo() | ||
39 | { | ||
40 | } | ||
41 | |||
42 | public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) | ||
43 | { | ||
44 | m_regionLocX = regionLocX; | ||
45 | m_regionLocY = regionLocY; | ||
46 | |||
47 | m_internalEndPoint = internalEndPoint; | ||
48 | m_externalHostName = externalUri; | ||
49 | } | ||
50 | |||
51 | public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, int port) | ||
52 | { | ||
53 | m_regionLocX = regionLocX; | ||
54 | m_regionLocY = regionLocY; | ||
55 | |||
56 | m_externalHostName = externalUri; | ||
57 | |||
58 | m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port); | ||
59 | } | ||
60 | |||
61 | public LLUUID RegionID = new LLUUID(); | ||
62 | |||
63 | private uint m_remotingPort; | ||
64 | |||
65 | public uint RemotingPort | ||
66 | { | ||
67 | get { return m_remotingPort; } | ||
68 | set { m_remotingPort = value; } | ||
69 | } | ||
70 | |||
71 | public string RemotingAddress; | ||
72 | |||
73 | |||
74 | public IPEndPoint ExternalEndPoint | ||
75 | { | ||
76 | get | ||
77 | { | ||
78 | // Old one defaults to IPv6 | ||
79 | //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); | ||
80 | |||
81 | IPAddress ia = null; | ||
82 | // If it is already an IP, don't resolve it - just return directly | ||
83 | if (IPAddress.TryParse(m_externalHostName, out ia)) | ||
84 | return new IPEndPoint(ia, m_internalEndPoint.Port); | ||
85 | |||
86 | // Reset for next check | ||
87 | ia = null; | ||
88 | |||
89 | |||
90 | // New method favors IPv4 | ||
91 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) | ||
92 | { | ||
93 | if (ia == null) | ||
94 | ia = Adr; | ||
95 | |||
96 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | ||
97 | { | ||
98 | ia = Adr; | ||
99 | break; | ||
100 | } | ||
101 | } | ||
102 | |||
103 | return new IPEndPoint(ia, m_internalEndPoint.Port); | ||
104 | } | ||
105 | |||
106 | set { m_externalHostName = value.ToString(); } | ||
107 | } | ||
108 | |||
109 | protected string m_externalHostName; | ||
110 | |||
111 | public string ExternalHostName | ||
112 | { | ||
113 | get { return m_externalHostName; } | ||
114 | set { m_externalHostName = value; } | ||
115 | } | ||
116 | |||
117 | protected IPEndPoint m_internalEndPoint; | ||
118 | |||
119 | public IPEndPoint InternalEndPoint | ||
120 | { | ||
121 | get { return m_internalEndPoint; } | ||
122 | set { m_internalEndPoint = value; } | ||
123 | } | ||
124 | |||
125 | protected uint? m_regionLocX; | ||
126 | |||
127 | public uint RegionLocX | ||
128 | { | ||
129 | get { return m_regionLocX.Value; } | ||
130 | set { m_regionLocX = value; } | ||
131 | } | ||
132 | |||
133 | protected uint? m_regionLocY; | ||
134 | |||
135 | public uint RegionLocY | ||
136 | { | ||
137 | get { return m_regionLocY.Value; } | ||
138 | set { m_regionLocY = value; } | ||
139 | } | ||
140 | |||
141 | public ulong RegionHandle | ||
142 | { | ||
143 | get { return Util.UIntsToLong((RegionLocX*256), (RegionLocY*256)); } | ||
144 | } | ||
145 | } | ||
146 | |||
147 | public class RegionInfo : SimpleRegionInfo | ||
148 | { | ||
149 | public string RegionName = ""; | ||
150 | |||
151 | public string DataStore = ""; | ||
152 | public bool isSandbox = false; | ||
153 | |||
154 | public LLUUID MasterAvatarAssignedUUID = new LLUUID(); | ||
155 | public string MasterAvatarFirstName = ""; | ||
156 | public string MasterAvatarLastName = ""; | ||
157 | public string MasterAvatarSandboxPassword = ""; | ||
158 | |||
159 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. | ||
160 | private static EstateSettings m_estateSettings; | ||
161 | |||
162 | public EstateSettings EstateSettings | ||
163 | { | ||
164 | get | ||
165 | { | ||
166 | if (m_estateSettings == null) | ||
167 | { | ||
168 | m_estateSettings = new EstateSettings(); | ||
169 | } | ||
170 | |||
171 | return m_estateSettings; | ||
172 | } | ||
173 | } | ||
174 | |||
175 | public ConfigurationMember configMember; | ||
176 | |||
177 | public RegionInfo(string description, string filename) | ||
178 | { | ||
179 | configMember = | ||
180 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); | ||
181 | configMember.performConfigurationRetrieve(); | ||
182 | } | ||
183 | |||
184 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) : | ||
185 | base(regionLocX, regionLocY, internalEndPoint, externalUri) | ||
186 | { | ||
187 | } | ||
188 | |||
189 | public RegionInfo() | ||
190 | { | ||
191 | } | ||
192 | |||
193 | //not in use, should swap to nini though. | ||
194 | public void LoadFromNiniSource(IConfigSource source) | ||
195 | { | ||
196 | LoadFromNiniSource(source, "RegionInfo"); | ||
197 | } | ||
198 | |||
199 | //not in use, should swap to nini though. | ||
200 | public void LoadFromNiniSource(IConfigSource source, string sectionName) | ||
201 | { | ||
202 | string errorMessage = ""; | ||
203 | RegionID = | ||
204 | new LLUUID(source.Configs[sectionName].GetString("Region_ID", LLUUID.Random().ToStringHyphenated())); | ||
205 | RegionName = source.Configs[sectionName].GetString("sim_name", "OpenSim Test"); | ||
206 | m_regionLocX = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_x", "1000")); | ||
207 | m_regionLocY = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_y", "1000")); | ||
208 | DataStore = source.Configs[sectionName].GetString("datastore", "OpenSim.db"); | ||
209 | |||
210 | string ipAddress = source.Configs[sectionName].GetString("internal_ip_address", "0.0.0.0"); | ||
211 | IPAddress ipAddressResult; | ||
212 | if (IPAddress.TryParse(ipAddress, out ipAddressResult)) | ||
213 | { | ||
214 | m_internalEndPoint = new IPEndPoint(ipAddressResult, 0); | ||
215 | } | ||
216 | else | ||
217 | { | ||
218 | errorMessage = "needs an IP Address (IPAddress)"; | ||
219 | } | ||
220 | m_internalEndPoint.Port = | ||
221 | source.Configs[sectionName].GetInt("internal_ip_port", NetworkServersInfo.DefaultHttpListenerPort); | ||
222 | |||
223 | string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1"); | ||
224 | if (externalHost != "SYSTEMIP") | ||
225 | { | ||
226 | m_externalHostName = externalHost; | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | m_externalHostName = Util.GetLocalHost().ToString(); | ||
231 | } | ||
232 | |||
233 | MasterAvatarFirstName = source.Configs[sectionName].GetString("master_avatar_first", "Test"); | ||
234 | MasterAvatarLastName = source.Configs[sectionName].GetString("master_avatar_last", "User"); | ||
235 | MasterAvatarSandboxPassword = source.Configs[sectionName].GetString("master_avatar_pass", "test"); | ||
236 | |||
237 | if (errorMessage != "") | ||
238 | { | ||
239 | // a error | ||
240 | } | ||
241 | } | ||
242 | |||
243 | public void loadConfigurationOptions() | ||
244 | { | ||
245 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | ||
246 | "UUID of Region (Default is recommended, random UUID)", | ||
247 | LLUUID.Random().ToString(), true); | ||
248 | configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
249 | "Region Name", "OpenSim Test", false); | ||
250 | configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
251 | "Grid Location (X Axis)", "1000", false); | ||
252 | configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
253 | "Grid Location (Y Axis)", "1000", false); | ||
254 | configMember.addConfigurationOption("datastore", | ||
255 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
256 | "Filename for local storage", "OpenSim.db", false); | ||
257 | configMember.addConfigurationOption("internal_ip_address", | ||
258 | ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, | ||
259 | "Internal IP Address for incoming UDP client connections", "0.0.0.0", | ||
260 | false); | ||
261 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
262 | "Internal IP Port for incoming UDP client connections", | ||
263 | NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); | ||
264 | configMember.addConfigurationOption("external_host_name", | ||
265 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
266 | "External Host Name", "127.0.0.1", false); | ||
267 | configMember.addConfigurationOption("master_avatar_first", | ||
268 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
269 | "First Name of Master Avatar", "Test", false); | ||
270 | configMember.addConfigurationOption("master_avatar_last", | ||
271 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
272 | "Last Name of Master Avatar", "User", false); | ||
273 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
274 | "(Sandbox Mode Only)Password for Master Avatar account", "test", false); | ||
275 | } | ||
276 | |||
277 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
278 | { | ||
279 | switch (configuration_key) | ||
280 | { | ||
281 | case "sim_UUID": | ||
282 | RegionID = (LLUUID) configuration_result; | ||
283 | break; | ||
284 | case "sim_name": | ||
285 | RegionName = (string) configuration_result; | ||
286 | break; | ||
287 | case "sim_location_x": | ||
288 | m_regionLocX = (uint) configuration_result; | ||
289 | break; | ||
290 | case "sim_location_y": | ||
291 | m_regionLocY = (uint) configuration_result; | ||
292 | break; | ||
293 | case "datastore": | ||
294 | DataStore = (string) configuration_result; | ||
295 | break; | ||
296 | case "internal_ip_address": | ||
297 | IPAddress address = (IPAddress) configuration_result; | ||
298 | m_internalEndPoint = new IPEndPoint(address, 0); | ||
299 | break; | ||
300 | case "internal_ip_port": | ||
301 | m_internalEndPoint.Port = (int) configuration_result; | ||
302 | break; | ||
303 | case "external_host_name": | ||
304 | if ((string) configuration_result != "SYSTEMIP") | ||
305 | { | ||
306 | m_externalHostName = (string) configuration_result; | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | m_externalHostName = Util.GetLocalHost().ToString(); | ||
311 | } | ||
312 | break; | ||
313 | case "master_avatar_first": | ||
314 | MasterAvatarFirstName = (string) configuration_result; | ||
315 | break; | ||
316 | case "master_avatar_last": | ||
317 | MasterAvatarLastName = (string) configuration_result; | ||
318 | break; | ||
319 | case "master_avatar_pass": | ||
320 | string tempMD5Passwd = (string) configuration_result; | ||
321 | MasterAvatarSandboxPassword = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + ""); | ||
322 | break; | ||
323 | } | ||
324 | |||
325 | return true; | ||
326 | } | ||
327 | } | ||
328 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/Remoting.cs b/OpenSim/Framework/General/Remoting.cs deleted file mode 100644 index 667ae69..0000000 --- a/OpenSim/Framework/General/Remoting.cs +++ /dev/null | |||
@@ -1,134 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using System.Security.Cryptography; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | /// <summary> | ||
35 | /// NEEDS AUDIT. | ||
36 | /// </summary> | ||
37 | /// <remarks> | ||
38 | /// Suggested implementation | ||
39 | /// <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> | ||
40 | /// <para>When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message.</para> | ||
41 | /// <para>When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[].</para> | ||
42 | /// <para>Both hosts should be performing these operations for this to be effective.</para> | ||
43 | /// </remarks> | ||
44 | internal class RemoteDigest | ||
45 | { | ||
46 | private byte[] currentHash; | ||
47 | private byte[] secret; | ||
48 | |||
49 | private SHA512Managed SHA512; | ||
50 | |||
51 | /// <summary> | ||
52 | /// Initialises a new RemoteDigest authentication mechanism | ||
53 | /// </summary> | ||
54 | /// <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> | ||
55 | /// <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> | ||
56 | /// <param name="salt">Binary salt - some common value - to be decided what</param> | ||
57 | /// <param name="challenge">The challenge key provided by the third party</param> | ||
58 | public RemoteDigest(string sharedSecret, byte[] salt, string challenge) | ||
59 | { | ||
60 | SHA512 = new SHA512Managed(); | ||
61 | Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret, salt); | ||
62 | secret = RFC2898.GetBytes(512); | ||
63 | ASCIIEncoding ASCII = new ASCIIEncoding(); | ||
64 | |||
65 | currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge))); | ||
66 | } | ||
67 | |||
68 | /// <summary> | ||
69 | /// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented. | ||
70 | /// </summary> | ||
71 | /// <param name="data">The incoming data</param> | ||
72 | /// <param name="digest">The remote digest</param> | ||
73 | /// <returns></returns> | ||
74 | public bool Authenticate(byte[] data, byte[] digest) | ||
75 | { | ||
76 | byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); | ||
77 | if (digest == newHash) | ||
78 | { | ||
79 | currentHash = newHash; | ||
80 | return true; | ||
81 | } | ||
82 | else | ||
83 | { | ||
84 | throw new Exception("Hash comparison failed. Key resync required."); | ||
85 | } | ||
86 | } | ||
87 | |||
88 | /// <summary> | ||
89 | /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message. | ||
90 | /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the | ||
91 | /// hashes will get out of sync and throw an exception when validation is attempted. | ||
92 | /// </summary> | ||
93 | /// <param name="data">The outgoing data</param> | ||
94 | /// <returns>The local digest</returns> | ||
95 | public byte[] Sign(byte[] data) | ||
96 | { | ||
97 | currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); | ||
98 | return currentHash; | ||
99 | } | ||
100 | |||
101 | /// <summary> | ||
102 | /// 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. | ||
103 | /// </summary> | ||
104 | /// <returns>A 128-character hexadecimal string containing the challenge.</returns> | ||
105 | public static string GenerateChallenge() | ||
106 | { | ||
107 | RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider(); | ||
108 | byte[] bytes = new byte[64]; | ||
109 | RNG.GetBytes(bytes); | ||
110 | |||
111 | StringBuilder sb = new StringBuilder(bytes.Length*2); | ||
112 | foreach (byte b in bytes) | ||
113 | { | ||
114 | sb.AppendFormat("{0:x2}", b); | ||
115 | } | ||
116 | return sb.ToString(); | ||
117 | } | ||
118 | |||
119 | /// <summary> | ||
120 | /// Helper function, merges two byte arrays | ||
121 | /// </summary> | ||
122 | /// <remarks>Sourced from MSDN Forum</remarks> | ||
123 | /// <param name="a">A</param> | ||
124 | /// <param name="b">B</param> | ||
125 | /// <returns>C</returns> | ||
126 | private byte[] AppendArrays(byte[] a, byte[] b) | ||
127 | { | ||
128 | byte[] c = new byte[a.Length + b.Length]; | ||
129 | Buffer.BlockCopy(a, 0, c, 0, a.Length); | ||
130 | Buffer.BlockCopy(b, 0, c, a.Length, b.Length); | ||
131 | return c; | ||
132 | } | ||
133 | } | ||
134 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/UUID.cs b/OpenSim/Framework/General/UUID.cs deleted file mode 100644 index 3b292b1..0000000 --- a/OpenSim/Framework/General/UUID.cs +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System; | ||
30 | using libsecondlife; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | internal class UUID | ||
35 | { | ||
36 | public LLUUID llUUID; | ||
37 | |||
38 | public UUID(string uuid) | ||
39 | { | ||
40 | llUUID = new LLUUID(uuid); | ||
41 | } | ||
42 | |||
43 | public UUID(byte[] uuid) | ||
44 | { | ||
45 | llUUID = new LLUUID(uuid, 0); | ||
46 | } | ||
47 | |||
48 | public UUID(byte[] uuid, int offset) | ||
49 | { | ||
50 | llUUID = new LLUUID(uuid, offset); | ||
51 | } | ||
52 | |||
53 | public UUID() | ||
54 | { | ||
55 | llUUID = LLUUID.Zero; | ||
56 | } | ||
57 | |||
58 | public UUID(ulong uuid) | ||
59 | { | ||
60 | llUUID = new LLUUID(uuid); | ||
61 | } | ||
62 | |||
63 | public UUID(UInt32 first, UInt32 second, UInt32 third, UInt32 fourth) | ||
64 | { | ||
65 | byte[] uuid = new byte[16]; | ||
66 | |||
67 | byte[] n = BitConverter.GetBytes(first); | ||
68 | n.CopyTo(uuid, 0); | ||
69 | n = BitConverter.GetBytes(second); | ||
70 | n.CopyTo(uuid, 4); | ||
71 | n = BitConverter.GetBytes(third); | ||
72 | n.CopyTo(uuid, 8); | ||
73 | n = BitConverter.GetBytes(fourth); | ||
74 | n.CopyTo(uuid, 12); | ||
75 | |||
76 | llUUID = new LLUUID(uuid, 0); | ||
77 | } | ||
78 | |||
79 | public override string ToString() | ||
80 | { | ||
81 | return llUUID.ToString(); | ||
82 | } | ||
83 | |||
84 | public string ToStringHyphenated() | ||
85 | { | ||
86 | return llUUID.ToStringHyphenated(); | ||
87 | } | ||
88 | |||
89 | public byte[] GetBytes() | ||
90 | { | ||
91 | return llUUID.GetBytes(); | ||
92 | } | ||
93 | |||
94 | public UInt32[] GetInts() | ||
95 | { | ||
96 | UInt32[] ints = new UInt32[4]; | ||
97 | ints[0] = BitConverter.ToUInt32(llUUID.Data, 0); | ||
98 | ints[1] = BitConverter.ToUInt32(llUUID.Data, 4); | ||
99 | ints[2] = BitConverter.ToUInt32(llUUID.Data, 8); | ||
100 | ints[3] = BitConverter.ToUInt32(llUUID.Data, 12); | ||
101 | |||
102 | return ints; | ||
103 | } | ||
104 | |||
105 | public LLUUID GetLLUUID() | ||
106 | { | ||
107 | return llUUID; | ||
108 | } | ||
109 | |||
110 | public uint CRC() | ||
111 | { | ||
112 | return llUUID.CRC(); | ||
113 | } | ||
114 | |||
115 | public override int GetHashCode() | ||
116 | { | ||
117 | return llUUID.GetHashCode(); | ||
118 | } | ||
119 | |||
120 | public void Combine(UUID other) | ||
121 | { | ||
122 | llUUID.Combine(other.GetLLUUID()); | ||
123 | } | ||
124 | |||
125 | public void Combine(LLUUID other) | ||
126 | { | ||
127 | llUUID.Combine(other); | ||
128 | } | ||
129 | |||
130 | public override bool Equals(Object other) | ||
131 | { | ||
132 | return llUUID.Equals(other); | ||
133 | } | ||
134 | |||
135 | public static bool operator ==(UUID a, UUID b) | ||
136 | { | ||
137 | return a.llUUID.Equals(b.GetLLUUID()); | ||
138 | } | ||
139 | |||
140 | public static bool operator !=(UUID a, UUID b) | ||
141 | { | ||
142 | return !a.llUUID.Equals(b.GetLLUUID()); | ||
143 | } | ||
144 | |||
145 | public static bool operator ==(UUID a, LLUUID b) | ||
146 | { | ||
147 | return a.Equals(b); | ||
148 | } | ||
149 | |||
150 | public static bool operator !=(UUID a, LLUUID b) | ||
151 | { | ||
152 | return !a.Equals(b); | ||
153 | } | ||
154 | } | ||
155 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/UserConfig.cs b/OpenSim/Framework/General/UserConfig.cs deleted file mode 100644 index fdb8f82..0000000 --- a/OpenSim/Framework/General/UserConfig.cs +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | namespace OpenSim.Framework | ||
30 | { | ||
31 | /// <summary> | ||
32 | /// UserConfig -- For User Server Configuration | ||
33 | /// </summary> | ||
34 | public class UserConfig | ||
35 | { | ||
36 | public string DefaultStartupMsg = ""; | ||
37 | public string GridServerURL = ""; | ||
38 | public string GridSendKey = ""; | ||
39 | public string GridRecvKey = ""; | ||
40 | |||
41 | public string DatabaseProvider = ""; | ||
42 | |||
43 | public static uint DefaultHttpPort = 8002; | ||
44 | public uint HttpPort = DefaultHttpPort; | ||
45 | |||
46 | private ConfigurationMember configMember; | ||
47 | |||
48 | public UserConfig(string description, string filename) | ||
49 | { | ||
50 | configMember = | ||
51 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); | ||
52 | configMember.performConfigurationRetrieve(); | ||
53 | } | ||
54 | |||
55 | public void loadConfigurationOptions() | ||
56 | { | ||
57 | configMember.addConfigurationOption("default_startup_message", | ||
58 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
59 | "Default Startup Message", "Welcome to OGS", false); | ||
60 | |||
61 | configMember.addConfigurationOption("default_grid_server", | ||
62 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
63 | "Default Grid Server URI", | ||
64 | "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/", false); | ||
65 | configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
66 | "Key to send to grid server", "null", false); | ||
67 | configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
68 | "Key to expect from grid server", "null", false); | ||
69 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
70 | "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | ||
71 | |||
72 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
73 | "Http Listener port", DefaultHttpPort.ToString(), false); | ||
74 | } | ||
75 | |||
76 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
77 | { | ||
78 | switch (configuration_key) | ||
79 | { | ||
80 | case "default_startup_message": | ||
81 | DefaultStartupMsg = (string) configuration_result; | ||
82 | break; | ||
83 | case "default_grid_server": | ||
84 | GridServerURL = (string) configuration_result; | ||
85 | break; | ||
86 | case "grid_send_key": | ||
87 | GridSendKey = (string) configuration_result; | ||
88 | break; | ||
89 | case "grid_recv_key": | ||
90 | GridRecvKey = (string) configuration_result; | ||
91 | break; | ||
92 | case "database_provider": | ||
93 | DatabaseProvider = (string) configuration_result; | ||
94 | break; | ||
95 | case "http_port": | ||
96 | HttpPort = (uint) configuration_result; | ||
97 | break; | ||
98 | } | ||
99 | |||
100 | return true; | ||
101 | } | ||
102 | } | ||
103 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/UserProfileData.cs b/OpenSim/Framework/General/UserProfileData.cs deleted file mode 100644 index d10aa36..0000000 --- a/OpenSim/Framework/General/UserProfileData.cs +++ /dev/null | |||
@@ -1,214 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | using System; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | /// <summary> | ||
34 | /// Information about a particular user known to the userserver | ||
35 | /// </summary> | ||
36 | public class UserProfileData | ||
37 | { | ||
38 | /// <summary> | ||
39 | /// The ID value for this user | ||
40 | /// </summary> | ||
41 | public LLUUID UUID; | ||
42 | |||
43 | /// <summary> | ||
44 | /// The first component of a users account name | ||
45 | /// </summary> | ||
46 | public string username; | ||
47 | |||
48 | /// <summary> | ||
49 | /// The second component of a users account name | ||
50 | /// </summary> | ||
51 | public string surname; | ||
52 | |||
53 | /// <summary> | ||
54 | /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) | ||
55 | /// </summary> | ||
56 | /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks> | ||
57 | public string passwordHash; | ||
58 | |||
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 | { | ||
69 | get { return Helpers.UIntsToLong((homeRegionX*256), (homeRegionY*256)); } | ||
70 | set | ||
71 | { | ||
72 | homeRegionX = (uint) (value >> 40); | ||
73 | homeRegionY = (((uint) (value)) >> 8); | ||
74 | } | ||
75 | } | ||
76 | |||
77 | public uint homeRegionX; | ||
78 | public uint homeRegionY; | ||
79 | |||
80 | /// <summary> | ||
81 | /// The coordinates inside the region of the home location | ||
82 | /// </summary> | ||
83 | public LLVector3 homeLocation; | ||
84 | |||
85 | /// <summary> | ||
86 | /// Where the user will be looking when they rez. | ||
87 | /// </summary> | ||
88 | public LLVector3 homeLookAt; | ||
89 | |||
90 | /// <summary> | ||
91 | /// A UNIX Timestamp (seconds since epoch) for the users creation | ||
92 | /// </summary> | ||
93 | public int created; | ||
94 | |||
95 | /// <summary> | ||
96 | /// A UNIX Timestamp for the users last login date / time | ||
97 | /// </summary> | ||
98 | public int lastLogin; | ||
99 | |||
100 | public LLUUID rootInventoryFolderID; | ||
101 | |||
102 | /// <summary> | ||
103 | /// A URI to the users inventory server, used for foreigners and large grids | ||
104 | /// </summary> | ||
105 | public string userInventoryURI = String.Empty; | ||
106 | |||
107 | /// <summary> | ||
108 | /// A URI to the users asset server, used for foreigners and large grids. | ||
109 | /// </summary> | ||
110 | public string userAssetURI = String.Empty; | ||
111 | |||
112 | /// <summary> | ||
113 | /// A uint mask containing the "I can do" fields of the users profile | ||
114 | /// </summary> | ||
115 | public uint profileCanDoMask; | ||
116 | |||
117 | /// <summary> | ||
118 | /// A uint mask containing the "I want to do" part of the users profile | ||
119 | /// </summary> | ||
120 | public uint profileWantDoMask; // Profile window "I want to" mask | ||
121 | |||
122 | /// <summary> | ||
123 | /// The about text listed in a users profile. | ||
124 | /// </summary> | ||
125 | public string profileAboutText = String.Empty; | ||
126 | |||
127 | /// <summary> | ||
128 | /// The first life about text listed in a users profile | ||
129 | /// </summary> | ||
130 | public string profileFirstText = String.Empty; | ||
131 | |||
132 | /// <summary> | ||
133 | /// The profile image for an avatar stored on the asset server | ||
134 | /// </summary> | ||
135 | public LLUUID profileImage; | ||
136 | |||
137 | /// <summary> | ||
138 | /// The profile image for the users first life tab | ||
139 | /// </summary> | ||
140 | public LLUUID profileFirstImage; | ||
141 | |||
142 | /// <summary> | ||
143 | /// The users last registered agent (filled in on the user server) | ||
144 | /// </summary> | ||
145 | public UserAgentData currentAgent; | ||
146 | } | ||
147 | |||
148 | /// <summary> | ||
149 | /// Information about a users session | ||
150 | /// </summary> | ||
151 | public class UserAgentData | ||
152 | { | ||
153 | /// <summary> | ||
154 | /// The UUID of the users avatar (not the agent!) | ||
155 | /// </summary> | ||
156 | public LLUUID UUID; | ||
157 | |||
158 | /// <summary> | ||
159 | /// The IP address of the user | ||
160 | /// </summary> | ||
161 | public string agentIP = String.Empty; | ||
162 | |||
163 | /// <summary> | ||
164 | /// The port of the user | ||
165 | /// </summary> | ||
166 | public uint agentPort; | ||
167 | |||
168 | /// <summary> | ||
169 | /// Is the user online? | ||
170 | /// </summary> | ||
171 | public bool agentOnline; | ||
172 | |||
173 | /// <summary> | ||
174 | /// The session ID for the user (also the agent ID) | ||
175 | /// </summary> | ||
176 | public LLUUID sessionID; | ||
177 | |||
178 | /// <summary> | ||
179 | /// The "secure" session ID for the user | ||
180 | /// </summary> | ||
181 | /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks> | ||
182 | public LLUUID secureSessionID; | ||
183 | |||
184 | /// <summary> | ||
185 | /// The region the user logged into initially | ||
186 | /// </summary> | ||
187 | public LLUUID regionID; | ||
188 | |||
189 | /// <summary> | ||
190 | /// A unix timestamp from when the user logged in | ||
191 | /// </summary> | ||
192 | public int loginTime; | ||
193 | |||
194 | /// <summary> | ||
195 | /// When this agent expired and logged out, 0 if still online | ||
196 | /// </summary> | ||
197 | public int logoutTime; | ||
198 | |||
199 | /// <summary> | ||
200 | /// Current region the user is logged into | ||
201 | /// </summary> | ||
202 | public LLUUID currentRegion; | ||
203 | |||
204 | /// <summary> | ||
205 | /// Region handle of the current region the user is in | ||
206 | /// </summary> | ||
207 | public ulong currentHandle; | ||
208 | |||
209 | /// <summary> | ||
210 | /// The position of the user within the region | ||
211 | /// </summary> | ||
212 | public LLVector3 currentPos; | ||
213 | } | ||
214 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs deleted file mode 100644 index c731561..0000000 --- a/OpenSim/Framework/General/Util.cs +++ /dev/null | |||
@@ -1,371 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 | |||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Data; | ||
32 | using System.IO; | ||
33 | using System.Net; | ||
34 | using System.Net.Sockets; | ||
35 | using System.Security.Cryptography; | ||
36 | using System.Text; | ||
37 | using libsecondlife; | ||
38 | using Nini.Config; | ||
39 | |||
40 | namespace OpenSim.Framework | ||
41 | { | ||
42 | public class Util | ||
43 | { | ||
44 | private static Random randomClass = new Random(); | ||
45 | private static uint nextXferID = 5000; | ||
46 | private static object XferLock = new object(); | ||
47 | private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>(); | ||
48 | |||
49 | |||
50 | public static ulong UIntsToLong(uint X, uint Y) | ||
51 | { | ||
52 | return Helpers.UIntsToLong(X, Y); | ||
53 | } | ||
54 | |||
55 | public static Random RandomClass | ||
56 | { | ||
57 | get { return randomClass; } | ||
58 | } | ||
59 | |||
60 | public static uint GetNextXferID() | ||
61 | { | ||
62 | uint id = 0; | ||
63 | lock (XferLock) | ||
64 | { | ||
65 | id = nextXferID; | ||
66 | nextXferID++; | ||
67 | } | ||
68 | return id; | ||
69 | } | ||
70 | |||
71 | public Util() | ||
72 | { | ||
73 | } | ||
74 | |||
75 | public static string GetFileName(string file) | ||
76 | { | ||
77 | // Return just the filename on UNIX platforms | ||
78 | // TODO: this should be customisable with a prefix, but that's something to do later. | ||
79 | if (Environment.OSVersion.Platform == PlatformID.Unix) | ||
80 | { | ||
81 | return file; | ||
82 | } | ||
83 | |||
84 | // Return %APPDATA%/OpenSim/file for 2K/XP/NT/2K3/VISTA | ||
85 | // TODO: Switch this to System.Enviroment.SpecialFolders.ApplicationData | ||
86 | if (Environment.OSVersion.Platform == PlatformID.Win32NT) | ||
87 | { | ||
88 | if (!Directory.Exists("%APPDATA%\\OpenSim\\")) | ||
89 | { | ||
90 | Directory.CreateDirectory("%APPDATA%\\OpenSim"); | ||
91 | } | ||
92 | |||
93 | return "%APPDATA%\\OpenSim\\" + file; | ||
94 | } | ||
95 | |||
96 | // Catch all - covers older windows versions | ||
97 | // (but those probably wont work anyway) | ||
98 | return file; | ||
99 | } | ||
100 | |||
101 | public static bool IsEnvironmentSupported(ref string reason) | ||
102 | { | ||
103 | // Must have .NET 2.0 (Generics / libsl) | ||
104 | if (Environment.Version.Major < 2) | ||
105 | { | ||
106 | reason = ".NET 1.0/1.1 lacks components that is used by OpenSim"; | ||
107 | return false; | ||
108 | } | ||
109 | |||
110 | // Windows 95/98/ME are unsupported | ||
111 | if (Environment.OSVersion.Platform == PlatformID.Win32Windows && | ||
112 | Environment.OSVersion.Platform != PlatformID.Win32NT) | ||
113 | { | ||
114 | reason = "Windows 95/98/ME will not run OpenSim"; | ||
115 | return false; | ||
116 | } | ||
117 | |||
118 | // Windows 2000 / Pre-SP2 XP | ||
119 | if (Environment.OSVersion.Version.Major == 5 && ( | ||
120 | Environment.OSVersion.Version.Minor == 0)) | ||
121 | { | ||
122 | reason = "Please update to Windows XP Service Pack 2 or Server2003"; | ||
123 | return false; | ||
124 | } | ||
125 | |||
126 | return true; | ||
127 | } | ||
128 | |||
129 | public static int UnixTimeSinceEpoch() | ||
130 | { | ||
131 | TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); | ||
132 | int timestamp = (int) t.TotalSeconds; | ||
133 | return timestamp; | ||
134 | } | ||
135 | |||
136 | public static string Md5Hash(string pass) | ||
137 | { | ||
138 | MD5 md5 = MD5CryptoServiceProvider.Create(); | ||
139 | byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass)); | ||
140 | StringBuilder sb = new StringBuilder(); | ||
141 | for (int i = 0; i < dataMd5.Length; i++) | ||
142 | sb.AppendFormat("{0:x2}", dataMd5[i]); | ||
143 | return sb.ToString(); | ||
144 | } | ||
145 | |||
146 | public static string GetRandomCapsPath() | ||
147 | { | ||
148 | LLUUID caps = LLUUID.Random(); | ||
149 | string capsPath = caps.ToStringHyphenated(); | ||
150 | capsPath = capsPath.Remove(capsPath.Length - 4, 4); | ||
151 | return capsPath; | ||
152 | } | ||
153 | |||
154 | public static int fast_distance2d(int x, int y) | ||
155 | { | ||
156 | x = Math.Abs(x); | ||
157 | y = Math.Abs(y); | ||
158 | |||
159 | int min = Math.Min(x, y); | ||
160 | |||
161 | return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); | ||
162 | } | ||
163 | |||
164 | public static string FieldToString(byte[] bytes) | ||
165 | { | ||
166 | return FieldToString(bytes, String.Empty); | ||
167 | } | ||
168 | |||
169 | /// <summary> | ||
170 | /// Convert a variable length field (byte array) to a string, with a | ||
171 | /// field name prepended to each line of the output | ||
172 | /// </summary> | ||
173 | /// <remarks>If the byte array has unprintable characters in it, a | ||
174 | /// hex dump will be put in the string instead</remarks> | ||
175 | /// <param name="bytes">The byte array to convert to a string</param> | ||
176 | /// <param name="fieldName">A field name to prepend to each line of output</param> | ||
177 | /// <returns>An ASCII string or a string containing a hex dump, minus | ||
178 | /// the null terminator</returns> | ||
179 | public static string FieldToString(byte[] bytes, string fieldName) | ||
180 | { | ||
181 | // Check for a common case | ||
182 | if (bytes.Length == 0) return String.Empty; | ||
183 | |||
184 | StringBuilder output = new StringBuilder(); | ||
185 | bool printable = true; | ||
186 | |||
187 | for (int i = 0; i < bytes.Length; ++i) | ||
188 | { | ||
189 | // Check if there are any unprintable characters in the array | ||
190 | if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09 | ||
191 | && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00) | ||
192 | { | ||
193 | printable = false; | ||
194 | break; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | if (printable) | ||
199 | { | ||
200 | if (fieldName.Length > 0) | ||
201 | { | ||
202 | output.Append(fieldName); | ||
203 | output.Append(": "); | ||
204 | } | ||
205 | |||
206 | if (bytes[bytes.Length - 1] == 0x00) | ||
207 | output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1)); | ||
208 | else | ||
209 | output.Append(UTF8Encoding.UTF8.GetString(bytes)); | ||
210 | } | ||
211 | else | ||
212 | { | ||
213 | for (int i = 0; i < bytes.Length; i += 16) | ||
214 | { | ||
215 | if (i != 0) | ||
216 | output.Append(Environment.NewLine); | ||
217 | if (fieldName.Length > 0) | ||
218 | { | ||
219 | output.Append(fieldName); | ||
220 | output.Append(": "); | ||
221 | } | ||
222 | |||
223 | for (int j = 0; j < 16; j++) | ||
224 | { | ||
225 | if ((i + j) < bytes.Length) | ||
226 | output.Append(String.Format("{0:X2} ", bytes[i + j])); | ||
227 | else | ||
228 | output.Append(" "); | ||
229 | } | ||
230 | |||
231 | for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) | ||
232 | { | ||
233 | if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) | ||
234 | output.Append((char) bytes[i + j]); | ||
235 | else | ||
236 | output.Append("."); | ||
237 | } | ||
238 | } | ||
239 | } | ||
240 | |||
241 | return output.ToString(); | ||
242 | } | ||
243 | |||
244 | /// <summary> | ||
245 | /// Returns a IP address from a specified DNS, favouring IPv4 addresses. | ||
246 | /// </summary> | ||
247 | /// <param name="dnsAddress">DNS Hostname</param> | ||
248 | /// <returns>An IP address, or null</returns> | ||
249 | public static IPAddress GetHostFromDNS(string dnsAddress) | ||
250 | { | ||
251 | // Is it already a valid IP? No need to look it up. | ||
252 | IPAddress ipa; | ||
253 | if (IPAddress.TryParse(dnsAddress, out ipa)) | ||
254 | return ipa; | ||
255 | |||
256 | // Not an IP, lookup required | ||
257 | IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList; | ||
258 | |||
259 | foreach (IPAddress host in hosts) | ||
260 | { | ||
261 | if (host.AddressFamily == AddressFamily.InterNetwork) | ||
262 | { | ||
263 | return host; | ||
264 | } | ||
265 | } | ||
266 | |||
267 | if (hosts.Length > 0) | ||
268 | return hosts[0]; | ||
269 | |||
270 | return null; | ||
271 | } | ||
272 | |||
273 | public static IPAddress GetLocalHost() | ||
274 | { | ||
275 | string dnsAddress = "localhost"; | ||
276 | |||
277 | IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList; | ||
278 | |||
279 | foreach (IPAddress host in hosts) | ||
280 | { | ||
281 | if (!IPAddress.IsLoopback(host) && host.AddressFamily == AddressFamily.InterNetwork) | ||
282 | { | ||
283 | return host; | ||
284 | } | ||
285 | } | ||
286 | |||
287 | if (hosts.Length > 0) | ||
288 | return hosts[0]; | ||
289 | |||
290 | return null; | ||
291 | } | ||
292 | |||
293 | // | ||
294 | // directory locations | ||
295 | // | ||
296 | |||
297 | public static string homeDir() | ||
298 | { | ||
299 | string temp; | ||
300 | // string personal=(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); | ||
301 | // temp = Path.Combine(personal,".OpenSim"); | ||
302 | temp = "."; | ||
303 | return temp; | ||
304 | } | ||
305 | |||
306 | public static string configDir() | ||
307 | { | ||
308 | string temp; | ||
309 | temp = "."; | ||
310 | return temp; | ||
311 | } | ||
312 | |||
313 | public static string dataDir() | ||
314 | { | ||
315 | string temp; | ||
316 | temp = "."; | ||
317 | return temp; | ||
318 | } | ||
319 | |||
320 | public static string logDir() | ||
321 | { | ||
322 | string temp; | ||
323 | temp = "."; | ||
324 | return temp; | ||
325 | } | ||
326 | |||
327 | public static string GetCapsURL(LLUUID userID) | ||
328 | { | ||
329 | if (capsURLS.ContainsKey(userID)) | ||
330 | { | ||
331 | return capsURLS[userID]; | ||
332 | } | ||
333 | return ""; | ||
334 | } | ||
335 | |||
336 | public static void SetCapsURL(LLUUID userID, string url) | ||
337 | { | ||
338 | if (capsURLS.ContainsKey(userID)) | ||
339 | { | ||
340 | capsURLS[userID] = url; | ||
341 | } | ||
342 | else | ||
343 | { | ||
344 | capsURLS.Add(userID, url); | ||
345 | } | ||
346 | } | ||
347 | |||
348 | // Nini (config) related Methods | ||
349 | public static IConfigSource ConvertDataRowToXMLConfig(DataRow row, string fileName) | ||
350 | { | ||
351 | if (!File.Exists(fileName)) | ||
352 | { | ||
353 | //create new file | ||
354 | } | ||
355 | XmlConfigSource config = new XmlConfigSource(fileName); | ||
356 | AddDataRowToConfig(config, row); | ||
357 | config.Save(); | ||
358 | |||
359 | return config; | ||
360 | } | ||
361 | |||
362 | public static void AddDataRowToConfig(IConfigSource config, DataRow row) | ||
363 | { | ||
364 | config.Configs.Add((string) row[0]); | ||
365 | for (int i = 0; i < row.Table.Columns.Count; i++) | ||
366 | { | ||
367 | config.Configs[(string) row[0]].Set(row.Table.Columns[i].ColumnName, row[i]); | ||
368 | } | ||
369 | } | ||
370 | } | ||
371 | } \ No newline at end of file | ||