diff options
Diffstat (limited to 'OpenSim/Framework/General')
36 files changed, 3376 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/AgentInventory.cs b/OpenSim/Framework/General/AgentInventory.cs new file mode 100644 index 0000000..e45a0cd --- /dev/null +++ b/OpenSim/Framework/General/AgentInventory.cs | |||
@@ -0,0 +1,265 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Collections.Generic; | ||
29 | using libsecondlife; | ||
30 | using libsecondlife.Packets; | ||
31 | using OpenSim.Framework.Types; | ||
32 | using OpenSim.Framework.Utilities; | ||
33 | |||
34 | namespace OpenSim.Framework.Inventory | ||
35 | { | ||
36 | public class AgentInventory | ||
37 | { | ||
38 | //Holds the local copy of Inventory info for a agent | ||
39 | public Dictionary<LLUUID, InventoryFolder> InventoryFolders; | ||
40 | public Dictionary<LLUUID, InventoryItem> InventoryItems; | ||
41 | public InventoryFolder InventoryRoot; | ||
42 | public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server | ||
43 | public LLUUID AgentID; | ||
44 | public AvatarWearable[] Wearables; | ||
45 | |||
46 | public AgentInventory() | ||
47 | { | ||
48 | InventoryFolders = new Dictionary<LLUUID, InventoryFolder>(); | ||
49 | InventoryItems = new Dictionary<LLUUID, InventoryItem>(); | ||
50 | this.Initialise(); | ||
51 | } | ||
52 | |||
53 | public virtual void Initialise() | ||
54 | { | ||
55 | Wearables = new AvatarWearable[13]; //should be 12 of these | ||
56 | for (int i = 0; i < 13; i++) | ||
57 | { | ||
58 | Wearables[i] = new AvatarWearable(); | ||
59 | } | ||
60 | |||
61 | } | ||
62 | |||
63 | public bool CreateNewFolder(LLUUID folderID, ushort type) | ||
64 | { | ||
65 | InventoryFolder Folder = new InventoryFolder(); | ||
66 | Folder.FolderID = folderID; | ||
67 | Folder.OwnerID = this.AgentID; | ||
68 | Folder.DefaultType = type; | ||
69 | this.InventoryFolders.Add(Folder.FolderID, Folder); | ||
70 | return (true); | ||
71 | } | ||
72 | |||
73 | public void CreateRootFolder(LLUUID newAgentID, bool createTextures) | ||
74 | { | ||
75 | this.AgentID = newAgentID; | ||
76 | InventoryRoot = new InventoryFolder(); | ||
77 | InventoryRoot.FolderID = LLUUID.Random(); | ||
78 | InventoryRoot.ParentID = new LLUUID(); | ||
79 | InventoryRoot.Version = 1; | ||
80 | InventoryRoot.DefaultType = 8; | ||
81 | InventoryRoot.OwnerID = this.AgentID; | ||
82 | InventoryRoot.FolderName = "My Inventory"; | ||
83 | InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot); | ||
84 | InventoryRoot.OwnerID = this.AgentID; | ||
85 | if (createTextures) | ||
86 | { | ||
87 | this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName) | ||
92 | { | ||
93 | InventoryFolder Folder = new InventoryFolder(); | ||
94 | Folder.FolderID = folderID; | ||
95 | Folder.OwnerID = this.AgentID; | ||
96 | Folder.DefaultType = type; | ||
97 | Folder.FolderName = folderName; | ||
98 | this.InventoryFolders.Add(Folder.FolderID, Folder); | ||
99 | |||
100 | return (true); | ||
101 | } | ||
102 | |||
103 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent) | ||
104 | { | ||
105 | if (!this.InventoryFolders.ContainsKey(folderID)) | ||
106 | { | ||
107 | System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory"); | ||
108 | InventoryFolder Folder = new InventoryFolder(); | ||
109 | Folder.FolderID = folderID; | ||
110 | Folder.OwnerID = this.AgentID; | ||
111 | Folder.DefaultType = type; | ||
112 | Folder.FolderName = folderName; | ||
113 | Folder.ParentID = parent; | ||
114 | this.InventoryFolders.Add(Folder.FolderID, Folder); | ||
115 | } | ||
116 | |||
117 | return (true); | ||
118 | } | ||
119 | |||
120 | public bool HasFolder(LLUUID folderID) | ||
121 | { | ||
122 | if (this.InventoryFolders.ContainsKey(folderID)) | ||
123 | { | ||
124 | return true; | ||
125 | } | ||
126 | return false; | ||
127 | } | ||
128 | |||
129 | public LLUUID GetFolderID(string folderName) | ||
130 | { | ||
131 | foreach (InventoryFolder inv in this.InventoryFolders.Values) | ||
132 | { | ||
133 | if (inv.FolderName == folderName) | ||
134 | { | ||
135 | return inv.FolderID; | ||
136 | } | ||
137 | } | ||
138 | |||
139 | return LLUUID.Zero; | ||
140 | } | ||
141 | |||
142 | public bool UpdateItemAsset(LLUUID itemID, AssetBase asset) | ||
143 | { | ||
144 | if(this.InventoryItems.ContainsKey(itemID)) | ||
145 | { | ||
146 | InventoryItem Item = this.InventoryItems[itemID]; | ||
147 | Item.AssetID = asset.FullID; | ||
148 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated()); | ||
149 | //TODO need to update the rest of the info | ||
150 | } | ||
151 | return true; | ||
152 | } | ||
153 | |||
154 | public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) | ||
155 | { | ||
156 | System.Console.WriteLine("updating inventory item details"); | ||
157 | if (this.InventoryItems.ContainsKey(itemID)) | ||
158 | { | ||
159 | System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name)); | ||
160 | InventoryItem Item = this.InventoryItems[itemID]; | ||
161 | Item.Name = Util.FieldToString(packet.Name); | ||
162 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated()); | ||
163 | //TODO need to update the rest of the info | ||
164 | } | ||
165 | return true; | ||
166 | } | ||
167 | |||
168 | public LLUUID AddToInventory(LLUUID folderID, AssetBase asset) | ||
169 | { | ||
170 | if (this.InventoryFolders.ContainsKey(folderID)) | ||
171 | { | ||
172 | LLUUID NewItemID = LLUUID.Random(); | ||
173 | |||
174 | InventoryItem Item = new InventoryItem(); | ||
175 | Item.FolderID = folderID; | ||
176 | Item.OwnerID = AgentID; | ||
177 | Item.AssetID = asset.FullID; | ||
178 | Item.ItemID = NewItemID; | ||
179 | Item.Type = asset.Type; | ||
180 | Item.Name = asset.Name; | ||
181 | Item.Description = asset.Description; | ||
182 | Item.InvType = asset.InvType; | ||
183 | this.InventoryItems.Add(Item.ItemID, Item); | ||
184 | InventoryFolder Folder = InventoryFolders[Item.FolderID]; | ||
185 | Folder.Items.Add(Item); | ||
186 | return (Item.ItemID); | ||
187 | } | ||
188 | else | ||
189 | { | ||
190 | return (null); | ||
191 | } | ||
192 | } | ||
193 | |||
194 | public bool DeleteFromInventory(LLUUID itemID) | ||
195 | { | ||
196 | bool res = false; | ||
197 | if (this.InventoryItems.ContainsKey(itemID)) | ||
198 | { | ||
199 | InventoryItem item = this.InventoryItems[itemID]; | ||
200 | this.InventoryItems.Remove(itemID); | ||
201 | foreach (InventoryFolder fold in InventoryFolders.Values) | ||
202 | { | ||
203 | if (fold.Items.Contains(item)) | ||
204 | { | ||
205 | fold.Items.Remove(item); | ||
206 | break; | ||
207 | } | ||
208 | } | ||
209 | res = true; | ||
210 | |||
211 | } | ||
212 | return res; | ||
213 | } | ||
214 | } | ||
215 | |||
216 | public class InventoryFolder | ||
217 | { | ||
218 | public List<InventoryItem> Items; | ||
219 | //public List<InventoryFolder> Subfolders; | ||
220 | public LLUUID FolderID; | ||
221 | public LLUUID OwnerID; | ||
222 | public LLUUID ParentID = LLUUID.Zero; | ||
223 | public string FolderName; | ||
224 | public ushort DefaultType; | ||
225 | public ushort Version; | ||
226 | |||
227 | public InventoryFolder() | ||
228 | { | ||
229 | Items = new List<InventoryItem>(); | ||
230 | //Subfolders = new List<InventoryFolder>(); | ||
231 | } | ||
232 | |||
233 | } | ||
234 | |||
235 | public class InventoryItem | ||
236 | { | ||
237 | public LLUUID FolderID; | ||
238 | public LLUUID OwnerID; | ||
239 | public LLUUID ItemID; | ||
240 | public LLUUID AssetID; | ||
241 | public LLUUID CreatorID; | ||
242 | public sbyte InvType; | ||
243 | public sbyte Type; | ||
244 | public string Name =""; | ||
245 | public string Description; | ||
246 | |||
247 | public InventoryItem() | ||
248 | { | ||
249 | this.CreatorID = LLUUID.Zero; | ||
250 | } | ||
251 | |||
252 | public string ExportString() | ||
253 | { | ||
254 | string typ = "notecard"; | ||
255 | string result = ""; | ||
256 | result += "\tinv_object\t0\n\t{\n"; | ||
257 | result += "\t\tobj_id\t%s\n"; | ||
258 | result += "\t\tparent_id\t"+ ItemID.ToString() +"\n"; | ||
259 | result += "\t\ttype\t"+ typ +"\n"; | ||
260 | result += "\t\tname\t" + Name+"|\n"; | ||
261 | result += "\t}\n"; | ||
262 | return result; | ||
263 | } | ||
264 | } | ||
265 | } | ||
diff --git a/OpenSim/Framework/General/AuthenticateSessionBase.cs b/OpenSim/Framework/General/AuthenticateSessionBase.cs new file mode 100644 index 0000000..71616e3 --- /dev/null +++ b/OpenSim/Framework/General/AuthenticateSessionBase.cs | |||
@@ -0,0 +1,130 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Collections.Generic; | ||
29 | using libsecondlife; | ||
30 | using OpenSim.Framework.Interfaces; | ||
31 | using OpenSim.Framework.Types; | ||
32 | |||
33 | namespace OpenSim.Framework | ||
34 | { | ||
35 | public class AuthenticateSessionsBase | ||
36 | { | ||
37 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); | ||
38 | |||
39 | public AuthenticateSessionsBase() | ||
40 | { | ||
41 | |||
42 | } | ||
43 | |||
44 | public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) | ||
45 | { | ||
46 | AgentCircuitData validcircuit = null; | ||
47 | if (this.AgentCircuits.ContainsKey(circuitcode)) | ||
48 | { | ||
49 | validcircuit = this.AgentCircuits[circuitcode]; | ||
50 | } | ||
51 | AuthenticateResponse user = new AuthenticateResponse(); | ||
52 | if (validcircuit == null) | ||
53 | { | ||
54 | //don't have this circuit code in our list | ||
55 | user.Authorised = false; | ||
56 | return (user); | ||
57 | } | ||
58 | |||
59 | if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) | ||
60 | { | ||
61 | user.Authorised = true; | ||
62 | user.LoginInfo = new Login(); | ||
63 | user.LoginInfo.Agent = agentID; | ||
64 | user.LoginInfo.Session = sessionID; | ||
65 | user.LoginInfo.SecureSession = validcircuit.SecureSessionID; | ||
66 | user.LoginInfo.First = validcircuit.firstname; | ||
67 | user.LoginInfo.Last = validcircuit.lastname; | ||
68 | user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; | ||
69 | user.LoginInfo.BaseFolder = validcircuit.BaseFolder; | ||
70 | } | ||
71 | else | ||
72 | { | ||
73 | // Invalid | ||
74 | user.Authorised = false; | ||
75 | } | ||
76 | |||
77 | return (user); | ||
78 | } | ||
79 | |||
80 | public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) | ||
81 | { | ||
82 | if (this.AgentCircuits.ContainsKey(circuitCode)) | ||
83 | { | ||
84 | this.AgentCircuits[circuitCode] = agentData; | ||
85 | } | ||
86 | else | ||
87 | { | ||
88 | this.AgentCircuits.Add(circuitCode, agentData); | ||
89 | } | ||
90 | } | ||
91 | |||
92 | public LLVector3 GetPosition(uint circuitCode) | ||
93 | { | ||
94 | LLVector3 vec = new LLVector3(); | ||
95 | if (this.AgentCircuits.ContainsKey(circuitCode)) | ||
96 | { | ||
97 | vec = this.AgentCircuits[circuitCode].startpos; | ||
98 | } | ||
99 | return vec; | ||
100 | } | ||
101 | |||
102 | public void UpdateAgentData(AgentCircuitData agentData) | ||
103 | { | ||
104 | if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode)) | ||
105 | { | ||
106 | this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname; | ||
107 | this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname; | ||
108 | this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; | ||
109 | // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); | ||
110 | } | ||
111 | } | ||
112 | |||
113 | public void UpdateAgentChildStatus(uint circuitcode, bool childstatus) | ||
114 | { | ||
115 | if (this.AgentCircuits.ContainsKey(circuitcode)) | ||
116 | { | ||
117 | this.AgentCircuits[circuitcode].child = childstatus; | ||
118 | } | ||
119 | } | ||
120 | |||
121 | public bool GetAgentChildStatus(uint circuitcode) | ||
122 | { | ||
123 | if (this.AgentCircuits.ContainsKey(circuitcode)) | ||
124 | { | ||
125 | return this.AgentCircuits[circuitcode].child; | ||
126 | } | ||
127 | return false; | ||
128 | } | ||
129 | } | ||
130 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/BlockingQueue.cs b/OpenSim/Framework/General/BlockingQueue.cs new file mode 100644 index 0000000..0cc8124 --- /dev/null +++ b/OpenSim/Framework/General/BlockingQueue.cs | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Collections.Generic; | ||
29 | using System.Threading; | ||
30 | |||
31 | namespace OpenSim.Framework.Utilities | ||
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 | } | ||
diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs new file mode 100644 index 0000000..b560ca8 --- /dev/null +++ b/OpenSim/Framework/General/ClientManager.cs | |||
@@ -0,0 +1,36 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Framework.Interfaces; | ||
5 | |||
6 | namespace OpenSim.Framework | ||
7 | { | ||
8 | public delegate void ForEachClientDelegate( IClientAPI client ); | ||
9 | public class ClientManager | ||
10 | { | ||
11 | private Dictionary<uint, IClientAPI> m_clients; | ||
12 | |||
13 | public void ForEachClient(ForEachClientDelegate whatToDo) | ||
14 | { | ||
15 | foreach (IClientAPI client in m_clients.Values) | ||
16 | { | ||
17 | whatToDo(client); | ||
18 | } | ||
19 | } | ||
20 | |||
21 | public ClientManager() | ||
22 | { | ||
23 | m_clients = new Dictionary<uint, IClientAPI>(); | ||
24 | } | ||
25 | |||
26 | public void Remove(uint id) | ||
27 | { | ||
28 | m_clients.Remove(id); | ||
29 | } | ||
30 | |||
31 | public void Add(uint id, IClientAPI client ) | ||
32 | { | ||
33 | m_clients.Add( id, client ); | ||
34 | } | ||
35 | } | ||
36 | } | ||
diff --git a/OpenSim/Framework/General/IRegionCommsListener.cs b/OpenSim/Framework/General/IRegionCommsListener.cs new file mode 100644 index 0000000..32444f9 --- /dev/null +++ b/OpenSim/Framework/General/IRegionCommsListener.cs | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Collections.Generic; | ||
29 | using libsecondlife; | ||
30 | using OpenSim.Framework.Interfaces; | ||
31 | using OpenSim.Framework.Types; | ||
32 | |||
33 | namespace OpenSim.Framework | ||
34 | { | ||
35 | public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); | ||
36 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); | ||
37 | public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position); | ||
38 | |||
39 | public interface IRegionCommsListener | ||
40 | { | ||
41 | event ExpectUserDelegate OnExpectUser; | ||
42 | event GenericCall2 OnExpectChildAgent; | ||
43 | event AgentCrossing OnAvatarCrossingIntoRegion; | ||
44 | event UpdateNeighbours OnNeighboursUpdate; | ||
45 | } | ||
46 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs new file mode 100644 index 0000000..508485b --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using OpenSim.Framework.Types; | ||
29 | |||
30 | namespace OpenSim.Framework.Interfaces | ||
31 | { | ||
32 | public class AuthenticateResponse | ||
33 | { | ||
34 | public bool Authorised; | ||
35 | public Login LoginInfo; | ||
36 | |||
37 | public AuthenticateResponse() | ||
38 | { | ||
39 | |||
40 | } | ||
41 | |||
42 | } | ||
43 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs new file mode 100644 index 0000000..2c379dd --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | namespace OpenSim.Framework.Interfaces | ||
29 | { | ||
30 | public interface IGenericConfig | ||
31 | { | ||
32 | void LoadData(); | ||
33 | string GetAttribute(string attributeName); | ||
34 | bool SetAttribute(string attributeName, string attributeValue); | ||
35 | void Commit(); | ||
36 | void Close(); | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs new file mode 100644 index 0000000..81dc293 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | //using OpenSim.world; | ||
30 | |||
31 | namespace OpenSim.Framework.Interfaces | ||
32 | { | ||
33 | /// <summary> | ||
34 | /// </summary> | ||
35 | |||
36 | |||
37 | public abstract class GridConfig | ||
38 | { | ||
39 | public string GridOwner; | ||
40 | public string DefaultStartupMsg; | ||
41 | public string DefaultAssetServer; | ||
42 | public string AssetSendKey; | ||
43 | public string AssetRecvKey; | ||
44 | public string DefaultUserServer; | ||
45 | public string UserSendKey; | ||
46 | public string UserRecvKey; | ||
47 | public string SimSendKey; | ||
48 | public string SimRecvKey; | ||
49 | |||
50 | |||
51 | public abstract void InitConfig(); | ||
52 | |||
53 | } | ||
54 | |||
55 | public interface IGridConfig | ||
56 | { | ||
57 | GridConfig GetConfigObject(); | ||
58 | } | ||
59 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs new file mode 100644 index 0000000..ae6cedb --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | //using OpenSim.world; | ||
30 | |||
31 | namespace OpenSim.Framework.Interfaces | ||
32 | { | ||
33 | /// <summary> | ||
34 | /// </summary> | ||
35 | |||
36 | |||
37 | public abstract class UserConfig | ||
38 | { | ||
39 | public string DefaultStartupMsg; | ||
40 | public string GridServerURL; | ||
41 | public string GridSendKey; | ||
42 | public string GridRecvKey; | ||
43 | |||
44 | |||
45 | public abstract void InitConfig(); | ||
46 | |||
47 | } | ||
48 | |||
49 | public interface IUserConfig | ||
50 | { | ||
51 | UserConfig GetConfigObject(); | ||
52 | } | ||
53 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/IAssetServer.cs b/OpenSim/Framework/General/Interfaces/IAssetServer.cs new file mode 100644 index 0000000..ab60dd7 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IAssetServer.cs | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | using OpenSim.Framework.Types; | ||
30 | |||
31 | namespace OpenSim.Framework.Interfaces | ||
32 | { | ||
33 | /// <summary> | ||
34 | /// Description of IAssetServer. | ||
35 | /// </summary> | ||
36 | |||
37 | public interface IAssetServer | ||
38 | { | ||
39 | void SetReceiver(IAssetReceiver receiver); | ||
40 | void RequestAsset(LLUUID assetID, bool isTexture); | ||
41 | void UpdateAsset(AssetBase asset); | ||
42 | void UploadNewAsset(AssetBase asset); | ||
43 | void SetServerInfo(string ServerUrl, string ServerKey); | ||
44 | void Close(); | ||
45 | } | ||
46 | |||
47 | // could change to delegate? | ||
48 | public interface IAssetReceiver | ||
49 | { | ||
50 | void AssetReceived(AssetBase asset, bool IsTexture); | ||
51 | void AssetNotFound(AssetBase asset); | ||
52 | } | ||
53 | |||
54 | public interface IAssetPlugin | ||
55 | { | ||
56 | IAssetServer GetAssetServer(); | ||
57 | } | ||
58 | |||
59 | public struct ARequest | ||
60 | { | ||
61 | public LLUUID AssetID; | ||
62 | public bool IsTexture; | ||
63 | } | ||
64 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs new file mode 100644 index 0000000..1b0c682 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -0,0 +1,180 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Collections.Generic; | ||
29 | using System.Net; | ||
30 | using libsecondlife; | ||
31 | using libsecondlife.Packets; | ||
32 | using OpenSim.Framework.Types; | ||
33 | |||
34 | namespace OpenSim.Framework.Interfaces | ||
35 | { | ||
36 | public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | ||
37 | public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list | ||
38 | public delegate void RezObject(AssetBase primAsset, LLVector3 pos); | ||
39 | public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west); | ||
40 | public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); | ||
41 | public delegate void StartAnim(LLUUID animID, int seq); | ||
42 | public delegate void LinkObjects(uint parent, List<uint> children); | ||
43 | public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); | ||
44 | public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); | ||
45 | |||
46 | public delegate void GenericCall(IClientAPI remoteClient); | ||
47 | public delegate void GenericCall2(); | ||
48 | public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary. | ||
49 | public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); | ||
50 | public delegate void GenericCall5(IClientAPI remoteClient, bool status); | ||
51 | public delegate void GenericCall6(LLUUID uid); | ||
52 | public delegate void GenericCall7(uint localID, string message); | ||
53 | |||
54 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); | ||
55 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); | ||
56 | public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); | ||
57 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); | ||
58 | public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); | ||
59 | public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); | ||
60 | public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); | ||
61 | public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); | ||
62 | public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags); | ||
63 | public delegate void StatusChange(bool status); | ||
64 | public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); | ||
65 | public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); | ||
66 | public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient); | ||
67 | |||
68 | public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); | ||
69 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); | ||
70 | public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); | ||
71 | public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); // NOTETOSELFremove the packet part | ||
72 | |||
73 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); | ||
74 | |||
75 | public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); | ||
76 | |||
77 | public interface IClientAPI | ||
78 | { | ||
79 | event ImprovedInstantMessage OnInstantMessage; | ||
80 | event ChatFromViewer OnChatFromViewer; | ||
81 | event RezObject OnRezObject; | ||
82 | event ModifyTerrain OnModifyTerrain; | ||
83 | event SetAppearance OnSetAppearance; | ||
84 | event StartAnim OnStartAnim; | ||
85 | event LinkObjects OnLinkObjects; | ||
86 | event RequestMapBlocks OnRequestMapBlocks; | ||
87 | event TeleportLocationRequest OnTeleportLocationRequest; | ||
88 | |||
89 | event GenericCall4 OnDeRezObject; | ||
90 | event GenericCall OnRegionHandShakeReply; | ||
91 | event GenericCall OnRequestWearables; | ||
92 | event GenericCall2 OnCompleteMovementToRegion; | ||
93 | event UpdateAgent OnAgentUpdate; | ||
94 | event GenericCall OnRequestAvatarsData; | ||
95 | event GenericCall4 OnAddPrim; | ||
96 | event ObjectDuplicate OnObjectDuplicate; | ||
97 | event UpdateVector OnGrapObject; | ||
98 | event ObjectSelect OnDeGrapObject; | ||
99 | event MoveObject OnGrapUpdate; | ||
100 | |||
101 | event UpdateShape OnUpdatePrimShape; | ||
102 | event ObjectSelect OnObjectSelect; | ||
103 | event GenericCall7 OnObjectDescription; | ||
104 | event GenericCall7 OnObjectName; | ||
105 | event UpdatePrimFlags OnUpdatePrimFlags; | ||
106 | event UpdatePrimTexture OnUpdatePrimTexture; | ||
107 | event UpdateVector OnUpdatePrimGroupPosition; | ||
108 | event UpdateVector OnUpdatePrimSinglePosition; | ||
109 | event UpdatePrimRotation OnUpdatePrimGroupRotation; | ||
110 | event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | ||
111 | event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; | ||
112 | event UpdateVector OnUpdatePrimScale; | ||
113 | event StatusChange OnChildAgentStatus; | ||
114 | event GenericCall2 OnStopMovement; | ||
115 | event NewAvatar OnNewAvatar; | ||
116 | event GenericCall6 OnRemoveAvatar; | ||
117 | |||
118 | event UUIDNameRequest OnNameFromUUIDRequest; | ||
119 | |||
120 | event ParcelPropertiesRequest OnParcelPropertiesRequest; | ||
121 | event ParcelDivideRequest OnParcelDivideRequest; | ||
122 | event ParcelJoinRequest OnParcelJoinRequest; | ||
123 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | ||
124 | |||
125 | event EstateOwnerMessageRequest OnEstateOwnerMessage; | ||
126 | |||
127 | LLVector3 StartPos | ||
128 | { | ||
129 | get; | ||
130 | set; | ||
131 | } | ||
132 | |||
133 | LLUUID AgentId | ||
134 | { | ||
135 | get; | ||
136 | } | ||
137 | |||
138 | string FirstName | ||
139 | { | ||
140 | get; | ||
141 | } | ||
142 | |||
143 | string LastName | ||
144 | { | ||
145 | get; | ||
146 | } | ||
147 | |||
148 | void OutPacket(Packet newPack); | ||
149 | void SendWearables(AvatarWearable[] wearables); | ||
150 | void SendStartPingCheck(byte seq); | ||
151 | void SendKillObject(ulong regionHandle, uint avatarLocalID); | ||
152 | void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); | ||
153 | void SendRegionHandshake(RegionInfo regionInfo); | ||
154 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | ||
155 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | ||
156 | void SendInstantMessage(string message, LLUUID target); | ||
157 | void SendLayerData(float[] map); | ||
158 | void SendLayerData(int px, int py, float[] map); | ||
159 | void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); | ||
160 | void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint ); | ||
161 | AgentCircuitData RequestClientInfo(); | ||
162 | void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint ); | ||
163 | void SendMapBlock(List<MapBlockData> mapBlocks); | ||
164 | void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); | ||
165 | void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags); | ||
166 | void SendTeleportCancel(); | ||
167 | void SendTeleportLocationStart(); | ||
168 | void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); | ||
169 | |||
170 | void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry); | ||
171 | void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); | ||
172 | |||
173 | void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); | ||
174 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags); | ||
175 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags); | ||
176 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); | ||
177 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); | ||
178 | void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); | ||
179 | } | ||
180 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs new file mode 100644 index 0000000..dbdb25d --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | using libsecondlife; | ||
30 | using OpenSim.Framework.Types; | ||
31 | |||
32 | namespace OpenSim.Framework.Interfaces | ||
33 | { | ||
34 | /// <summary> | ||
35 | /// ILocalStorage. Really hacked together right now needs cleaning up | ||
36 | /// </summary> | ||
37 | public interface ILocalStorage | ||
38 | { | ||
39 | void Initialise(string datastore); | ||
40 | |||
41 | void StorePrim(PrimData prim); | ||
42 | void RemovePrim(LLUUID primID); | ||
43 | void LoadPrimitives(ILocalStorageReceiver receiver); | ||
44 | |||
45 | float[] LoadWorld(); | ||
46 | void SaveMap(float[] heightmap); | ||
47 | |||
48 | void SaveParcels(ParcelData[] parcels); | ||
49 | void SaveParcel(ParcelData parcel); | ||
50 | void RemoveParcel(ParcelData parcel); | ||
51 | void RemoveAllParcels(); | ||
52 | void LoadParcels(ILocalStorageParcelReceiver recv); | ||
53 | |||
54 | void ShutDown(); | ||
55 | } | ||
56 | |||
57 | public interface ILocalStorageReceiver | ||
58 | { | ||
59 | void PrimFromStorage(PrimData prim); | ||
60 | } | ||
61 | |||
62 | public interface ILocalStorageParcelReceiver | ||
63 | { | ||
64 | void ParcelFromStorage(ParcelData data); | ||
65 | void NoParcelDataFromStorage(); | ||
66 | } | ||
67 | } | ||
68 | |||
diff --git a/OpenSim/Framework/General/Interfaces/IUserServer.cs b/OpenSim/Framework/General/Interfaces/IUserServer.cs new file mode 100644 index 0000000..b3700d2 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IUserServer.cs | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | using OpenSim.Framework.Inventory; | ||
30 | |||
31 | namespace OpenSim.Framework.Interfaces | ||
32 | { | ||
33 | public interface IUserServer | ||
34 | { | ||
35 | AgentInventory RequestAgentsInventory(LLUUID agentID); | ||
36 | void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); | ||
37 | bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory); | ||
38 | } | ||
39 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/IWorld.cs b/OpenSim/Framework/General/Interfaces/IWorld.cs new file mode 100644 index 0000000..204c01b --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IWorld.cs | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | using OpenSim.Framework.Types; | ||
30 | |||
31 | namespace OpenSim.Framework.Interfaces | ||
32 | { | ||
33 | public interface IWorld | ||
34 | { | ||
35 | void AddNewClient(IClientAPI client, bool child); | ||
36 | void RemoveClient(LLUUID agentID); | ||
37 | |||
38 | RegionInfo RegionInfo { get; } | ||
39 | object SyncRoot { get; } | ||
40 | uint NextLocalId { get; } | ||
41 | } | ||
42 | } | ||
diff --git a/OpenSim/Framework/General/LoginService.cs b/OpenSim/Framework/General/LoginService.cs new file mode 100644 index 0000000..02efcec --- /dev/null +++ b/OpenSim/Framework/General/LoginService.cs | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | namespace OpenSim.Framework.Grid | ||
29 | { | ||
30 | public abstract class LoginService | ||
31 | { | ||
32 | |||
33 | } | ||
34 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/Properties/AssemblyInfo.cs b/OpenSim/Framework/General/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..004040b --- /dev/null +++ b/OpenSim/Framework/General/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,31 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.InteropServices; | ||
3 | // General Information about an assembly is controlled through the following | ||
4 | // set of attributes. Change these attribute values to modify the information | ||
5 | // associated with an assembly. | ||
6 | [assembly: AssemblyTitle("OpenSim.FrameWork")] | ||
7 | [assembly: AssemblyDescription("")] | ||
8 | [assembly: AssemblyConfiguration("")] | ||
9 | [assembly: AssemblyCompany("")] | ||
10 | [assembly: AssemblyProduct("OpenSim.FrameWork")] | ||
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | ||
12 | [assembly: AssemblyTrademark("")] | ||
13 | [assembly: AssemblyCulture("")] | ||
14 | |||
15 | // Setting ComVisible to false makes the types in this assembly not visible | ||
16 | // to COM components. If you need to access a type in this assembly from | ||
17 | // COM, set the ComVisible attribute to true on that type. | ||
18 | [assembly: ComVisible(false)] | ||
19 | |||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
21 | [assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")] | ||
22 | |||
23 | // Version information for an assembly consists of the following four values: | ||
24 | // | ||
25 | // Major Version | ||
26 | // Minor Version | ||
27 | // Build Number | ||
28 | // Revision | ||
29 | // | ||
30 | [assembly: AssemblyVersion("1.0.0.0")] | ||
31 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Framework/General/RegionCommsListener.cs b/OpenSim/Framework/General/RegionCommsListener.cs new file mode 100644 index 0000000..2b0bc62 --- /dev/null +++ b/OpenSim/Framework/General/RegionCommsListener.cs | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | using OpenSim.Framework.Interfaces; | ||
30 | using OpenSim.Framework.Types; | ||
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 | |||
41 | /// <summary> | ||
42 | /// | ||
43 | /// </summary> | ||
44 | /// <param name="agent"></param> | ||
45 | /// <returns></returns> | ||
46 | public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) | ||
47 | { | ||
48 | if(OnExpectUser != null) | ||
49 | { | ||
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 | { | ||
60 | if (OnAvatarCrossingIntoRegion != null) | ||
61 | { | ||
62 | OnAvatarCrossingIntoRegion(regionHandle, agentID, position); | ||
63 | return true; | ||
64 | } | ||
65 | return false; | ||
66 | } | ||
67 | } | ||
68 | } | ||
diff --git a/OpenSim/Framework/General/Remoting.cs b/OpenSim/Framework/General/Remoting.cs new file mode 100644 index 0000000..df32db2 --- /dev/null +++ b/OpenSim/Framework/General/Remoting.cs | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | 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 | 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 | } | ||
135 | } | ||
diff --git a/OpenSim/Framework/General/Types/AgentCiruitData.cs b/OpenSim/Framework/General/Types/AgentCiruitData.cs new file mode 100644 index 0000000..ed9ee3c --- /dev/null +++ b/OpenSim/Framework/General/Types/AgentCiruitData.cs | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | using System; | ||
30 | |||
31 | namespace OpenSim.Framework.Types | ||
32 | { | ||
33 | [Serializable] | ||
34 | public class AgentCircuitData | ||
35 | { | ||
36 | public AgentCircuitData() { } | ||
37 | public LLUUID AgentID; | ||
38 | public LLUUID SessionID; | ||
39 | public LLUUID SecureSessionID; | ||
40 | public LLVector3 startpos; | ||
41 | public string firstname; | ||
42 | public string lastname; | ||
43 | public uint circuitcode; | ||
44 | public bool child; | ||
45 | public LLUUID InventoryFolder; | ||
46 | public LLUUID BaseFolder; | ||
47 | public string CapsPath = ""; | ||
48 | } | ||
49 | } | ||
diff --git a/OpenSim/Framework/General/Types/AgentWearable.cs b/OpenSim/Framework/General/Types/AgentWearable.cs new file mode 100644 index 0000000..6152b7d --- /dev/null +++ b/OpenSim/Framework/General/Types/AgentWearable.cs | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework.Types | ||
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 | |||
42 | public static AvatarWearable[] DefaultWearables | ||
43 | { | ||
44 | get | ||
45 | { | ||
46 | AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these | ||
47 | for (int i = 0; i < 13; i++) | ||
48 | { | ||
49 | defaultWearables[i] = new AvatarWearable(); | ||
50 | } | ||
51 | defaultWearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | ||
52 | defaultWearables[0].ItemID = LLUUID.Random(); | ||
53 | return defaultWearables; | ||
54 | } | ||
55 | } | ||
56 | } | ||
57 | } | ||
diff --git a/OpenSim/Framework/General/Types/AssetBase.cs b/OpenSim/Framework/General/Types/AssetBase.cs new file mode 100644 index 0000000..c203f51 --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetBase.cs | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework.Types | ||
31 | { | ||
32 | public class AssetBase | ||
33 | { | ||
34 | public byte[] Data; | ||
35 | public LLUUID FullID; | ||
36 | public sbyte Type; | ||
37 | public sbyte InvType; | ||
38 | public string Name; | ||
39 | public string Description; | ||
40 | |||
41 | public AssetBase() | ||
42 | { | ||
43 | |||
44 | } | ||
45 | } | ||
46 | } | ||
diff --git a/OpenSim/Framework/General/Types/AssetLandmark.cs b/OpenSim/Framework/General/Types/AssetLandmark.cs new file mode 100644 index 0000000..8aa872e --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetLandmark.cs | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Text; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework.Types | ||
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 | this.Data = a.Data; | ||
42 | this.FullID = a.FullID; | ||
43 | this.Type = a.Type; | ||
44 | this.InvType = a.InvType; | ||
45 | this.Name = a.Name; | ||
46 | this.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 | } | ||
diff --git a/OpenSim/Framework/General/Types/AssetStorage.cs b/OpenSim/Framework/General/Types/AssetStorage.cs new file mode 100644 index 0000000..3681336 --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetStorage.cs | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework.Types | ||
31 | { | ||
32 | public class AssetStorage | ||
33 | { | ||
34 | |||
35 | public AssetStorage() { | ||
36 | } | ||
37 | |||
38 | public AssetStorage(LLUUID assetUUID) { | ||
39 | UUID=assetUUID; | ||
40 | } | ||
41 | |||
42 | public byte[] Data; | ||
43 | public sbyte Type; | ||
44 | public string Name; | ||
45 | public LLUUID UUID; | ||
46 | } | ||
47 | } | ||
diff --git a/OpenSim/Framework/General/Types/EstateSettings.cs b/OpenSim/Framework/General/Types/EstateSettings.cs new file mode 100644 index 0000000..436b109 --- /dev/null +++ b/OpenSim/Framework/General/Types/EstateSettings.cs | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework.Types | ||
32 | { | ||
33 | public class EstateSettings | ||
34 | { | ||
35 | //Settings to this island | ||
36 | public float billableFactor = (float)0.0; | ||
37 | public uint estateID = 0; | ||
38 | public uint parentEstateID = 0; | ||
39 | |||
40 | public byte maxAgents = 40; | ||
41 | public float objectBonusFactor = (float)1.0; | ||
42 | |||
43 | public int redirectGridX = 0; //?? | ||
44 | public int redirectGridY = 0; //?? | ||
45 | public Simulator.RegionFlags regionFlags = Simulator.RegionFlags.None; //Booleam values of various region settings | ||
46 | public Simulator.SimAccess simAccess = Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default. | ||
47 | public float sunHour = 0; | ||
48 | |||
49 | public float terrainRaiseLimit = 0; | ||
50 | public float terrainLowerLimit = 0; | ||
51 | |||
52 | public bool useFixedSun = false; | ||
53 | public int pricePerMeter = 1; | ||
54 | |||
55 | public ushort regionWaterHeight = 20; | ||
56 | public bool regionAllowTerraform = true; | ||
57 | |||
58 | // Region Information | ||
59 | // Low resolution 'base' textures. No longer used. | ||
60 | public LLUUID terrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default | ||
61 | public LLUUID terrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default | ||
62 | public LLUUID terrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default | ||
63 | public LLUUID terrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default | ||
64 | |||
65 | // Higher resolution terrain textures | ||
66 | public LLUUID terrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
67 | public LLUUID terrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
68 | public LLUUID terrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
69 | public LLUUID terrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
70 | |||
71 | // First quad - each point is bilinearly interpolated at each meter of terrain | ||
72 | public float terrainStartHeight0 = 10.0f; | ||
73 | public float terrainStartHeight1 = 10.0f; | ||
74 | public float terrainStartHeight2 = 10.0f; | ||
75 | public float terrainStartHeight3 = 10.0f; | ||
76 | |||
77 | // Second quad - also bilinearly interpolated. | ||
78 | // Terrain texturing is done that: | ||
79 | // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y] | ||
80 | public float terrainHeightRange0 = 60.0f; //00 | ||
81 | public float terrainHeightRange1 = 60.0f; //01 | ||
82 | public float terrainHeightRange2 = 60.0f; //10 | ||
83 | public float terrainHeightRange3 = 60.0f; //11 | ||
84 | |||
85 | // Terrain Default (Must be in F32 Format!) | ||
86 | public string terrainFile = "default.r32"; | ||
87 | public double terrainMultiplier = 60.0; | ||
88 | public float waterHeight = (float)20.0; | ||
89 | |||
90 | public LLUUID terrainImageID = LLUUID.Zero; // the assetID that is the current Map image for this region | ||
91 | |||
92 | } | ||
93 | } | ||
diff --git a/OpenSim/Framework/General/Types/Login.cs b/OpenSim/Framework/General/Types/Login.cs new file mode 100644 index 0000000..d54c019 --- /dev/null +++ b/OpenSim/Framework/General/Types/Login.cs | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework.Types | ||
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 | |||
44 | public Login() | ||
45 | { | ||
46 | |||
47 | } | ||
48 | } | ||
49 | } | ||
diff --git a/OpenSim/Framework/General/Types/MapBlockData.cs b/OpenSim/Framework/General/Types/MapBlockData.cs new file mode 100644 index 0000000..fbb3b73 --- /dev/null +++ b/OpenSim/Framework/General/Types/MapBlockData.cs | |||
@@ -0,0 +1,23 @@ | |||
1 | using System; | ||
2 | using libsecondlife; | ||
3 | |||
4 | namespace OpenSim.Framework.Types | ||
5 | { | ||
6 | public class MapBlockData | ||
7 | { | ||
8 | public uint Flags; | ||
9 | public ushort X; | ||
10 | public ushort Y; | ||
11 | public byte Agents; | ||
12 | public byte Access; | ||
13 | public byte WaterHeight; | ||
14 | public LLUUID MapImageId; | ||
15 | public String Name; | ||
16 | public uint RegionFlags; | ||
17 | |||
18 | public MapBlockData() | ||
19 | { | ||
20 | |||
21 | } | ||
22 | } | ||
23 | } | ||
diff --git a/OpenSim/Framework/General/Types/NeighbourInfo.cs b/OpenSim/Framework/General/Types/NeighbourInfo.cs new file mode 100644 index 0000000..bb67981 --- /dev/null +++ b/OpenSim/Framework/General/Types/NeighbourInfo.cs | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | namespace OpenSim.Framework.Types | ||
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 | } | ||
diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs new file mode 100644 index 0000000..89ebf94 --- /dev/null +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs | |||
@@ -0,0 +1,219 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using OpenSim.Framework.Console; | ||
30 | using OpenSim.Framework.Interfaces; | ||
31 | |||
32 | namespace OpenSim.Framework.Types | ||
33 | { | ||
34 | public class NetworkServersInfo | ||
35 | { | ||
36 | public string AssetURL = "http://127.0.0.1:8003/"; | ||
37 | public string AssetSendKey = ""; | ||
38 | |||
39 | public string GridURL = ""; | ||
40 | public string GridSendKey = ""; | ||
41 | public string GridRecvKey = ""; | ||
42 | public string UserURL = ""; | ||
43 | public string UserSendKey = ""; | ||
44 | public string UserRecvKey = ""; | ||
45 | public bool isSandbox; | ||
46 | |||
47 | public uint DefaultHomeLocX = 0; | ||
48 | public uint DefaultHomeLocY = 0; | ||
49 | |||
50 | public int HttpListenerPort = 9000; | ||
51 | public int RemotingListenerPort = 8895; | ||
52 | |||
53 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | ||
54 | { | ||
55 | this.isSandbox = sandboxMode; | ||
56 | |||
57 | try | ||
58 | { | ||
59 | string attri = ""; | ||
60 | |||
61 | attri = ""; | ||
62 | attri = configData.GetAttribute("HttpListenerPort"); | ||
63 | if (attri == "") | ||
64 | { | ||
65 | string location = MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); | ||
66 | configData.SetAttribute("HttpListenerPort", location); | ||
67 | this.HttpListenerPort = Convert.ToInt32(location); | ||
68 | } | ||
69 | else | ||
70 | { | ||
71 | this.HttpListenerPort = Convert.ToInt32(attri); | ||
72 | } | ||
73 | |||
74 | attri = ""; | ||
75 | attri = configData.GetAttribute("RemotingListenerPort"); | ||
76 | if (attri == "") | ||
77 | { | ||
78 | string location = MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); | ||
79 | configData.SetAttribute("RemotingListenerPort", location); | ||
80 | this.RemotingListenerPort = Convert.ToInt32(location); | ||
81 | } | ||
82 | else | ||
83 | { | ||
84 | this.RemotingListenerPort = Convert.ToInt32(attri); | ||
85 | } | ||
86 | |||
87 | if (sandboxMode) | ||
88 | { | ||
89 | // default home location X | ||
90 | attri = ""; | ||
91 | attri = configData.GetAttribute("DefaultLocationX"); | ||
92 | if (attri == "") | ||
93 | { | ||
94 | string location = MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); | ||
95 | configData.SetAttribute("DefaultLocationX", location); | ||
96 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); | ||
97 | } | ||
98 | else | ||
99 | { | ||
100 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri); | ||
101 | } | ||
102 | |||
103 | // default home location Y | ||
104 | attri = ""; | ||
105 | attri = configData.GetAttribute("DefaultLocationY"); | ||
106 | if (attri == "") | ||
107 | { | ||
108 | string location = MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); | ||
109 | configData.SetAttribute("DefaultLocationY", location); | ||
110 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); | ||
111 | } | ||
112 | else | ||
113 | { | ||
114 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri); | ||
115 | } | ||
116 | } | ||
117 | if (!isSandbox) | ||
118 | { | ||
119 | //Grid Server | ||
120 | attri = ""; | ||
121 | attri = configData.GetAttribute("GridServerURL"); | ||
122 | if (attri == "") | ||
123 | { | ||
124 | this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); | ||
125 | configData.SetAttribute("GridServerURL", this.GridURL); | ||
126 | } | ||
127 | else | ||
128 | { | ||
129 | this.GridURL = attri; | ||
130 | } | ||
131 | |||
132 | //Grid Send Key | ||
133 | attri = ""; | ||
134 | attri = configData.GetAttribute("GridSendKey"); | ||
135 | if (attri == "") | ||
136 | { | ||
137 | this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); | ||
138 | configData.SetAttribute("GridSendKey", this.GridSendKey); | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | this.GridSendKey = attri; | ||
143 | } | ||
144 | |||
145 | //Grid Receive Key | ||
146 | attri = ""; | ||
147 | attri = configData.GetAttribute("GridRecvKey"); | ||
148 | if (attri == "") | ||
149 | { | ||
150 | this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); | ||
151 | configData.SetAttribute("GridRecvKey", this.GridRecvKey); | ||
152 | } | ||
153 | else | ||
154 | { | ||
155 | this.GridRecvKey = attri; | ||
156 | } | ||
157 | |||
158 | //Grid Server | ||
159 | attri = ""; | ||
160 | attri = configData.GetAttribute("UserServerURL"); | ||
161 | if (attri == "") | ||
162 | { | ||
163 | this.UserURL= MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); | ||
164 | configData.SetAttribute("UserServerURL", this.UserURL); | ||
165 | } | ||
166 | else | ||
167 | { | ||
168 | this.UserURL = attri; | ||
169 | } | ||
170 | |||
171 | //Grid Send Key | ||
172 | attri = ""; | ||
173 | attri = configData.GetAttribute("UserSendKey"); | ||
174 | if (attri == "") | ||
175 | { | ||
176 | this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server", "null"); | ||
177 | configData.SetAttribute("UserSendKey", this.UserSendKey); | ||
178 | } | ||
179 | else | ||
180 | { | ||
181 | this.UserSendKey = attri; | ||
182 | } | ||
183 | |||
184 | //Grid Receive Key | ||
185 | attri = ""; | ||
186 | attri = configData.GetAttribute("UserRecvKey"); | ||
187 | if (attri == "") | ||
188 | { | ||
189 | this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); | ||
190 | configData.SetAttribute("GridRecvKey", this.UserRecvKey); | ||
191 | } | ||
192 | else | ||
193 | { | ||
194 | this.UserRecvKey = attri; | ||
195 | } | ||
196 | |||
197 | attri = ""; | ||
198 | attri = configData.GetAttribute("AssetServerURL"); | ||
199 | if (attri == "") | ||
200 | { | ||
201 | this.AssetURL = MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); | ||
202 | configData.SetAttribute("AssetServerURL", this.GridURL); | ||
203 | } | ||
204 | else | ||
205 | { | ||
206 | this.AssetURL = attri; | ||
207 | } | ||
208 | |||
209 | } | ||
210 | configData.Commit(); | ||
211 | } | ||
212 | catch (Exception e) | ||
213 | { | ||
214 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | ||
215 | MainLog.Instance.Warn(e.ToString()); | ||
216 | } | ||
217 | } | ||
218 | } | ||
219 | } | ||
diff --git a/OpenSim/Framework/General/Types/ParcelData.cs b/OpenSim/Framework/General/Types/ParcelData.cs new file mode 100644 index 0000000..761d55e --- /dev/null +++ b/OpenSim/Framework/General/Types/ParcelData.cs | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using libsecondlife; | ||
29 | |||
30 | namespace OpenSim.Framework.Types | ||
31 | { | ||
32 | |||
33 | public class ParcelData | ||
34 | { | ||
35 | public byte[] parcelBitmapByteArray = new byte[512]; | ||
36 | public string parcelName = ""; | ||
37 | public string parcelDesc = ""; | ||
38 | public LLUUID ownerID = new LLUUID(); | ||
39 | public bool isGroupOwned = false; | ||
40 | public LLVector3 AABBMin = new LLVector3(); | ||
41 | public LLVector3 AABBMax = new LLVector3(); | ||
42 | public int area = 0; | ||
43 | public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned | ||
44 | public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID | ||
45 | public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category | ||
46 | public int claimDate = 0; //Unemplemented | ||
47 | public int claimPrice = 0; //Unemplemented | ||
48 | public LLUUID groupID = new LLUUID(); //Unemplemented | ||
49 | public int groupPrims = 0; //Unemplemented | ||
50 | public int salePrice = 0; //Unemeplemented. Parcels price. | ||
51 | public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.None; | ||
52 | public Parcel.ParcelFlags parcelFlags = Parcel.ParcelFlags.None; | ||
53 | public byte landingType = 0; | ||
54 | public byte mediaAutoScale = 0; | ||
55 | public LLUUID mediaID = LLUUID.Zero; | ||
56 | public int localID = 0; | ||
57 | public LLUUID globalID = new LLUUID(); | ||
58 | |||
59 | public string mediaURL = ""; | ||
60 | public string musicURL = ""; | ||
61 | public float passHours = 0; | ||
62 | public int passPrice = 0; | ||
63 | public LLUUID snapshotID = LLUUID.Zero; | ||
64 | public LLVector3 userLocation = new LLVector3(); | ||
65 | public LLVector3 userLookAt = new LLVector3(); | ||
66 | |||
67 | public ParcelData() | ||
68 | { | ||
69 | globalID = LLUUID.Random(); | ||
70 | } | ||
71 | |||
72 | public ParcelData Copy() | ||
73 | { | ||
74 | ParcelData parcelData = new ParcelData(); | ||
75 | |||
76 | parcelData.AABBMax = this.AABBMax; | ||
77 | parcelData.AABBMin = this.AABBMin; | ||
78 | parcelData.area = this.area; | ||
79 | parcelData.auctionID = this.auctionID; | ||
80 | parcelData.authBuyerID = this.authBuyerID; | ||
81 | parcelData.category = this.category; | ||
82 | parcelData.claimDate = this.claimDate; | ||
83 | parcelData.claimPrice = this.claimPrice; | ||
84 | parcelData.globalID = this.globalID; | ||
85 | parcelData.groupID = this.groupID; | ||
86 | parcelData.groupPrims = this.groupPrims; | ||
87 | parcelData.isGroupOwned = this.isGroupOwned; | ||
88 | parcelData.localID = this.localID; | ||
89 | parcelData.landingType = this.landingType; | ||
90 | parcelData.mediaAutoScale = this.mediaAutoScale; | ||
91 | parcelData.mediaID = this.mediaID; | ||
92 | parcelData.mediaURL = this.mediaURL; | ||
93 | parcelData.musicURL = this.musicURL; | ||
94 | parcelData.ownerID = this.ownerID; | ||
95 | parcelData.parcelBitmapByteArray = (byte[])this.parcelBitmapByteArray.Clone(); | ||
96 | parcelData.parcelDesc = this.parcelDesc; | ||
97 | parcelData.parcelFlags = this.parcelFlags; | ||
98 | parcelData.parcelName = this.parcelName; | ||
99 | parcelData.parcelStatus = this.parcelStatus; | ||
100 | parcelData.passHours = this.passHours; | ||
101 | parcelData.passPrice = this.passPrice; | ||
102 | parcelData.salePrice = this.salePrice; | ||
103 | parcelData.snapshotID = this.snapshotID; | ||
104 | parcelData.userLocation = this.userLocation; | ||
105 | parcelData.userLookAt = this.userLookAt; | ||
106 | |||
107 | return parcelData; | ||
108 | |||
109 | } | ||
110 | } | ||
111 | |||
112 | } | ||
diff --git a/OpenSim/Framework/General/Types/PrimData.cs b/OpenSim/Framework/General/Types/PrimData.cs new file mode 100644 index 0000000..ff81bcd --- /dev/null +++ b/OpenSim/Framework/General/Types/PrimData.cs | |||
@@ -0,0 +1,228 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework.Types | ||
32 | { | ||
33 | public class PrimData | ||
34 | { | ||
35 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | ||
36 | |||
37 | public LLUUID OwnerID; | ||
38 | public byte PCode; | ||
39 | public ushort PathBegin; | ||
40 | public ushort PathEnd; | ||
41 | public byte PathScaleX; | ||
42 | public byte PathScaleY; | ||
43 | public byte PathShearX; | ||
44 | public byte PathShearY; | ||
45 | public sbyte PathSkew; | ||
46 | public ushort ProfileBegin; | ||
47 | public ushort ProfileEnd; | ||
48 | public LLVector3 Scale; | ||
49 | public byte PathCurve; | ||
50 | public byte ProfileCurve; | ||
51 | public uint ParentID = 0; | ||
52 | public ushort ProfileHollow; | ||
53 | public sbyte PathRadiusOffset; | ||
54 | public byte PathRevolutions; | ||
55 | public sbyte PathTaperX; | ||
56 | public sbyte PathTaperY; | ||
57 | public sbyte PathTwist; | ||
58 | public sbyte PathTwistBegin; | ||
59 | public byte[] TextureEntry; // a LL textureEntry in byte[] format | ||
60 | |||
61 | public Int32 CreationDate; | ||
62 | public uint OwnerMask = FULL_MASK_PERMISSIONS; | ||
63 | public uint NextOwnerMask = FULL_MASK_PERMISSIONS; | ||
64 | public uint GroupMask = FULL_MASK_PERMISSIONS; | ||
65 | public uint EveryoneMask = FULL_MASK_PERMISSIONS; | ||
66 | public uint BaseMask = FULL_MASK_PERMISSIONS; | ||
67 | |||
68 | //following only used during prim storage | ||
69 | public LLVector3 Position; | ||
70 | public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0); | ||
71 | public uint LocalID; | ||
72 | public LLUUID FullID; | ||
73 | |||
74 | public PrimData() | ||
75 | { | ||
76 | |||
77 | } | ||
78 | |||
79 | public PrimData(byte[] data) | ||
80 | { | ||
81 | int i = 0; | ||
82 | |||
83 | this.OwnerID = new LLUUID(data, i); i += 16; | ||
84 | this.PCode = data[i++]; | ||
85 | this.PathBegin = (ushort)(data[i++] + (data[i++] << 8)); | ||
86 | this.PathEnd = (ushort)(data[i++] + (data[i++] << 8)); | ||
87 | this.PathScaleX = data[i++]; | ||
88 | this.PathScaleY = data[i++]; | ||
89 | this.PathShearX = data[i++]; | ||
90 | this.PathShearY = data[i++]; | ||
91 | this.PathSkew = (sbyte)data[i++]; | ||
92 | this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8)); | ||
93 | this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8)); | ||
94 | this.Scale = new LLVector3(data, i); i += 12; | ||
95 | this.PathCurve = data[i++]; | ||
96 | this.ProfileCurve = data[i++]; | ||
97 | this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
98 | this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8)); | ||
99 | this.PathRadiusOffset = (sbyte)data[i++]; | ||
100 | this.PathRevolutions = data[i++]; | ||
101 | this.PathTaperX = (sbyte)data[i++]; | ||
102 | this.PathTaperY = (sbyte)data[i++]; | ||
103 | this.PathTwist = (sbyte)data[i++]; | ||
104 | this.PathTwistBegin = (sbyte)data[i++]; | ||
105 | ushort length = (ushort)(data[i++] + (data[i++] << 8)); | ||
106 | this.TextureEntry = new byte[length]; | ||
107 | Array.Copy(data, i, TextureEntry, 0, length); i += length; | ||
108 | this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
109 | this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
110 | this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
111 | this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
112 | this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
113 | this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
114 | this.Position = new LLVector3(data, i); i += 12; | ||
115 | this.Rotation = new LLQuaternion(data, i, true); i += 12; | ||
116 | this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
117 | this.FullID = new LLUUID(data, i); i += 16; | ||
118 | |||
119 | } | ||
120 | |||
121 | public byte[] ToBytes() | ||
122 | { | ||
123 | int i = 0; | ||
124 | byte[] bytes = new byte[126 + TextureEntry.Length]; | ||
125 | Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16; | ||
126 | bytes[i++] = this.PCode; | ||
127 | bytes[i++] = (byte)(this.PathBegin % 256); | ||
128 | bytes[i++] = (byte)((this.PathBegin >> 8) % 256); | ||
129 | bytes[i++] = (byte)(this.PathEnd % 256); | ||
130 | bytes[i++] = (byte)((this.PathEnd >> 8) % 256); | ||
131 | bytes[i++] = this.PathScaleX; | ||
132 | bytes[i++] = this.PathScaleY; | ||
133 | bytes[i++] = this.PathShearX; | ||
134 | bytes[i++] = this.PathShearY; | ||
135 | bytes[i++] = (byte)this.PathSkew; | ||
136 | bytes[i++] = (byte)(this.ProfileBegin % 256); | ||
137 | bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256); | ||
138 | bytes[i++] = (byte)(this.ProfileEnd % 256); | ||
139 | bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256); | ||
140 | Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12; | ||
141 | bytes[i++] = this.PathCurve; | ||
142 | bytes[i++] = this.ProfileCurve; | ||
143 | bytes[i++] = (byte)(ParentID % 256); | ||
144 | bytes[i++] = (byte)((ParentID >> 8) % 256); | ||
145 | bytes[i++] = (byte)((ParentID >> 16) % 256); | ||
146 | bytes[i++] = (byte)((ParentID >> 24) % 256); | ||
147 | bytes[i++] = (byte)(this.ProfileHollow % 256); | ||
148 | bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256); | ||
149 | bytes[i++] = ((byte)this.PathRadiusOffset); | ||
150 | bytes[i++] = this.PathRevolutions; | ||
151 | bytes[i++] = ((byte)this.PathTaperX); | ||
152 | bytes[i++] = ((byte)this.PathTaperY); | ||
153 | bytes[i++] = ((byte)this.PathTwist); | ||
154 | bytes[i++] = ((byte)this.PathTwistBegin); | ||
155 | bytes[i++] = (byte)(TextureEntry.Length % 256); | ||
156 | bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256); | ||
157 | Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length; | ||
158 | bytes[i++] = (byte)(this.CreationDate % 256); | ||
159 | bytes[i++] = (byte)((this.CreationDate >> 8) % 256); | ||
160 | bytes[i++] = (byte)((this.CreationDate >> 16) % 256); | ||
161 | bytes[i++] = (byte)((this.CreationDate >> 24) % 256); | ||
162 | bytes[i++] = (byte)(this.OwnerMask % 256); | ||
163 | bytes[i++] = (byte)((this.OwnerMask >> 8) % 256); | ||
164 | bytes[i++] = (byte)((this.OwnerMask >> 16) % 256); | ||
165 | bytes[i++] = (byte)((this.OwnerMask >> 24) % 256); | ||
166 | bytes[i++] = (byte)(this.NextOwnerMask % 256); | ||
167 | bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256); | ||
168 | bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256); | ||
169 | bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256); | ||
170 | bytes[i++] = (byte)(this.GroupMask % 256); | ||
171 | bytes[i++] = (byte)((this.GroupMask >> 8) % 256); | ||
172 | bytes[i++] = (byte)((this.GroupMask >> 16) % 256); | ||
173 | bytes[i++] = (byte)((this.GroupMask >> 24) % 256); | ||
174 | bytes[i++] = (byte)(this.EveryoneMask % 256); | ||
175 | bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256); | ||
176 | bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256); | ||
177 | bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256); | ||
178 | bytes[i++] = (byte)(this.BaseMask % 256); | ||
179 | bytes[i++] = (byte)((this.BaseMask >> 8) % 256); | ||
180 | bytes[i++] = (byte)((this.BaseMask >> 16) % 256); | ||
181 | bytes[i++] = (byte)((this.BaseMask >> 24) % 256); | ||
182 | Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; | ||
183 | if (this.Rotation == new LLQuaternion(0, 0, 0, 0)) | ||
184 | { | ||
185 | this.Rotation = new LLQuaternion(0, 1, 0, 0); | ||
186 | } | ||
187 | Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12; | ||
188 | bytes[i++] = (byte)(this.LocalID % 256); | ||
189 | bytes[i++] = (byte)((this.LocalID >> 8) % 256); | ||
190 | bytes[i++] = (byte)((this.LocalID >> 16) % 256); | ||
191 | bytes[i++] = (byte)((this.LocalID >> 24) % 256); | ||
192 | Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16; | ||
193 | |||
194 | return bytes; | ||
195 | } | ||
196 | |||
197 | public static PrimData DefaultCube() | ||
198 | { | ||
199 | PrimData primData = new PrimData(); | ||
200 | primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
201 | primData.FullID = LLUUID.Random(); | ||
202 | primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | ||
203 | primData.Rotation = new LLQuaternion(0, 0, 0, 1); | ||
204 | primData.PCode = 9; | ||
205 | primData.ParentID = 0; | ||
206 | primData.PathBegin = 0; | ||
207 | primData.PathEnd = 0; | ||
208 | primData.PathScaleX = 0; | ||
209 | primData.PathScaleY = 0; | ||
210 | primData.PathShearX = 0; | ||
211 | primData.PathShearY = 0; | ||
212 | primData.PathSkew = 0; | ||
213 | primData.ProfileBegin = 0; | ||
214 | primData.ProfileEnd = 0; | ||
215 | primData.PathCurve = 16; | ||
216 | primData.ProfileCurve = 1; | ||
217 | primData.ProfileHollow = 0; | ||
218 | primData.PathRadiusOffset = 0; | ||
219 | primData.PathRevolutions = 0; | ||
220 | primData.PathTaperX = 0; | ||
221 | primData.PathTaperY = 0; | ||
222 | primData.PathTwist = 0; | ||
223 | primData.PathTwistBegin = 0; | ||
224 | |||
225 | return primData; | ||
226 | } | ||
227 | } | ||
228 | } | ||
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs new file mode 100644 index 0000000..a6671d1 --- /dev/null +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs | |||
@@ -0,0 +1,102 @@ | |||
1 | using libsecondlife; | ||
2 | |||
3 | namespace OpenSim.Framework.Types | ||
4 | { | ||
5 | public enum ShapeType | ||
6 | { | ||
7 | Box, | ||
8 | Sphere, | ||
9 | Ring, | ||
10 | Tube, | ||
11 | Torus, | ||
12 | Prism, | ||
13 | Scuplted, | ||
14 | Cylinder, | ||
15 | Foliage, | ||
16 | Unknown | ||
17 | } | ||
18 | |||
19 | public class PrimitiveBaseShape | ||
20 | { | ||
21 | private ShapeType type = ShapeType.Unknown; | ||
22 | |||
23 | public byte PCode; | ||
24 | public ushort PathBegin; | ||
25 | public ushort PathEnd; | ||
26 | public byte PathScaleX; | ||
27 | public byte PathScaleY; | ||
28 | public byte PathShearX; | ||
29 | public byte PathShearY; | ||
30 | public sbyte PathSkew; | ||
31 | public ushort ProfileBegin; | ||
32 | public ushort ProfileEnd; | ||
33 | public LLVector3 Scale; | ||
34 | public byte PathCurve; | ||
35 | public byte ProfileCurve; | ||
36 | public ushort ProfileHollow; | ||
37 | public sbyte PathRadiusOffset; | ||
38 | public byte PathRevolutions; | ||
39 | public sbyte PathTaperX; | ||
40 | public sbyte PathTaperY; | ||
41 | public sbyte PathTwist; | ||
42 | public sbyte PathTwistBegin; | ||
43 | public byte[] TextureEntry; // a LL textureEntry in byte[] format | ||
44 | |||
45 | public ShapeType PrimType | ||
46 | { | ||
47 | get | ||
48 | { | ||
49 | return this.type; | ||
50 | } | ||
51 | } | ||
52 | |||
53 | public LLVector3 PrimScale | ||
54 | { | ||
55 | get | ||
56 | { | ||
57 | return this.Scale; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | public PrimitiveBaseShape() | ||
62 | { | ||
63 | |||
64 | } | ||
65 | |||
66 | //void returns need to change of course | ||
67 | public void GetMesh() | ||
68 | { | ||
69 | |||
70 | } | ||
71 | |||
72 | public static PrimitiveBaseShape DefaultBox() | ||
73 | { | ||
74 | PrimitiveBaseShape primShape = new PrimitiveBaseShape(); | ||
75 | |||
76 | primShape.type = ShapeType.Box; | ||
77 | primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | ||
78 | primShape.PCode = 9; | ||
79 | primShape.PathBegin = 0; | ||
80 | primShape.PathEnd = 0; | ||
81 | primShape.PathScaleX = 0; | ||
82 | primShape.PathScaleY = 0; | ||
83 | primShape.PathShearX = 0; | ||
84 | primShape.PathShearY = 0; | ||
85 | primShape.PathSkew = 0; | ||
86 | primShape.ProfileBegin = 0; | ||
87 | primShape.ProfileEnd = 0; | ||
88 | primShape.PathCurve = 16; | ||
89 | primShape.ProfileCurve = 1; | ||
90 | primShape.ProfileHollow = 0; | ||
91 | primShape.PathRadiusOffset = 0; | ||
92 | primShape.PathRevolutions = 0; | ||
93 | primShape.PathTaperX = 0; | ||
94 | primShape.PathTaperY = 0; | ||
95 | primShape.PathTwist = 0; | ||
96 | primShape.PathTwistBegin = 0; | ||
97 | |||
98 | return primShape; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | } | ||
diff --git a/OpenSim/Framework/General/Types/RegionHandle.cs b/OpenSim/Framework/General/Types/RegionHandle.cs new file mode 100644 index 0000000..4a055ad --- /dev/null +++ b/OpenSim/Framework/General/Types/RegionHandle.cs | |||
@@ -0,0 +1,121 @@ | |||
1 | using System; | ||
2 | using System.Net; | ||
3 | |||
4 | namespace OpenSim.Framework.Types | ||
5 | { | ||
6 | /// <summary> | ||
7 | /// A class for manipulating RegionHandle coordinates | ||
8 | /// </summary> | ||
9 | class RegionHandle | ||
10 | { | ||
11 | private UInt64 handle; | ||
12 | |||
13 | /// <summary> | ||
14 | /// Initialises a new grid-aware RegionHandle | ||
15 | /// </summary> | ||
16 | /// <param name="ip">IP Address of the Grid Server for this region</param> | ||
17 | /// <param name="x">Grid X Coordinate</param> | ||
18 | /// <param name="y">Grid Y Coordinate</param> | ||
19 | public RegionHandle(string ip, short x, short y) | ||
20 | { | ||
21 | IPAddress addr = IPAddress.Parse(ip); | ||
22 | |||
23 | if (addr.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork) | ||
24 | throw new Exception("Bad RegionHandle Parameter - must be an IPv4 address"); | ||
25 | |||
26 | uint baseHandle = BitConverter.ToUInt32(addr.GetAddressBytes(), 0); | ||
27 | |||
28 | // Split the IP address in half | ||
29 | short a = (short)((baseHandle << 16) & 0xFFFF); | ||
30 | short b = (short)((baseHandle << 0) & 0xFFFF); | ||
31 | |||
32 | // Raise the bounds a little | ||
33 | uint nx = (uint)x; | ||
34 | uint ny = (uint)y; | ||
35 | |||
36 | // Multiply grid coords to get region coords | ||
37 | nx *= 256; | ||
38 | ny *= 256; | ||
39 | |||
40 | // Stuff the IP address in too | ||
41 | nx = (uint)a << 16; | ||
42 | ny = (uint)b << 16; | ||
43 | |||
44 | handle = ((UInt64)nx << 32) | (uint)ny; | ||
45 | } | ||
46 | |||
47 | /// <summary> | ||
48 | /// Initialises a new RegionHandle that is not inter-grid aware | ||
49 | /// </summary> | ||
50 | /// <param name="x">Grid X Coordinate</param> | ||
51 | /// <param name="y">Grid Y Coordinate</param> | ||
52 | public RegionHandle(uint x, uint y) | ||
53 | { | ||
54 | handle = ((x * 256) << 32) | (y * 256); | ||
55 | } | ||
56 | |||
57 | /// <summary> | ||
58 | /// Initialises a new RegionHandle from an existing value | ||
59 | /// </summary> | ||
60 | /// <param name="Region">A U64 RegionHandle</param> | ||
61 | public RegionHandle(UInt64 Region) | ||
62 | { | ||
63 | handle = Region; | ||
64 | } | ||
65 | |||
66 | /// <summary> | ||
67 | /// Returns the Grid Masked RegionHandle - For use in Teleport packets and other packets where sending the grid IP address may be handy. | ||
68 | /// </summary> | ||
69 | /// <remarks>Do not use for SimulatorEnable packets. The client will choke.</remarks> | ||
70 | /// <returns>Region Handle including IP Address encoding</returns> | ||
71 | public UInt64 getTeleportHandle() | ||
72 | { | ||
73 | return handle; | ||
74 | } | ||
75 | |||
76 | /// <summary> | ||
77 | /// Returns a RegionHandle which may be used for SimulatorEnable packets. Removes the IP address encoding and returns the lower bounds. | ||
78 | /// </summary> | ||
79 | /// <returns>A U64 RegionHandle for use in SimulatorEnable packets.</returns> | ||
80 | public UInt64 getNeighbourHandle() | ||
81 | { | ||
82 | UInt64 mask = 0x0000FFFF0000FFFF; | ||
83 | |||
84 | return handle | mask; | ||
85 | } | ||
86 | |||
87 | /// <summary> | ||
88 | /// Returns the IP Address of the GridServer from a Grid-Encoded RegionHandle | ||
89 | /// </summary> | ||
90 | /// <returns>Grid Server IP Address</returns> | ||
91 | public IPAddress getGridIP() | ||
92 | { | ||
93 | uint a = (uint)((handle >> 16) & 0xFFFF); | ||
94 | uint b = (uint)((handle >> 48) & 0xFFFF); | ||
95 | |||
96 | return new IPAddress((long)(a << 16) | (long)b); | ||
97 | } | ||
98 | |||
99 | /// <summary> | ||
100 | /// Returns the X Coordinate from a Grid-Encoded RegionHandle | ||
101 | /// </summary> | ||
102 | /// <returns>X Coordinate</returns> | ||
103 | public uint getGridX() | ||
104 | { | ||
105 | uint x = (uint)((handle >> 32) & 0xFFFF); | ||
106 | |||
107 | return x; | ||
108 | } | ||
109 | |||
110 | /// <summary> | ||
111 | /// Returns the Y Coordinate from a Grid-Encoded RegionHandle | ||
112 | /// </summary> | ||
113 | /// <returns>Y Coordinate</returns> | ||
114 | public uint getGridY() | ||
115 | { | ||
116 | uint y = (uint)((handle >> 0) & 0xFFFF); | ||
117 | |||
118 | return y; | ||
119 | } | ||
120 | } | ||
121 | } | ||
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs new file mode 100644 index 0000000..cfc0925 --- /dev/null +++ b/OpenSim/Framework/General/Types/RegionInfo.cs | |||
@@ -0,0 +1,342 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Globalization; | ||
30 | using System.Net; | ||
31 | using System.Net.Sockets; | ||
32 | using libsecondlife; | ||
33 | using OpenSim.Framework.Console; | ||
34 | using OpenSim.Framework.Interfaces; | ||
35 | using OpenSim.Framework.Utilities; | ||
36 | |||
37 | namespace OpenSim.Framework.Types | ||
38 | { | ||
39 | public class RegionInfo | ||
40 | { | ||
41 | public LLUUID SimUUID = new LLUUID(); | ||
42 | public string RegionName = ""; | ||
43 | |||
44 | private IPEndPoint m_internalEndPoint; | ||
45 | public IPEndPoint InternalEndPoint | ||
46 | { | ||
47 | get | ||
48 | { | ||
49 | return m_internalEndPoint; | ||
50 | } | ||
51 | } | ||
52 | |||
53 | public IPEndPoint ExternalEndPoint | ||
54 | { | ||
55 | get | ||
56 | { | ||
57 | // Old one defaults to IPv6 | ||
58 | //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); | ||
59 | |||
60 | // New method favors IPv4 | ||
61 | IPAddress ia = null; | ||
62 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) | ||
63 | { | ||
64 | if (ia == null) | ||
65 | ia = Adr; | ||
66 | |||
67 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | ||
68 | { | ||
69 | ia = Adr; | ||
70 | break; | ||
71 | } | ||
72 | |||
73 | } | ||
74 | |||
75 | return new IPEndPoint(ia, m_internalEndPoint.Port); | ||
76 | } | ||
77 | } | ||
78 | |||
79 | private string m_externalHostName; | ||
80 | public string ExternalHostName | ||
81 | { | ||
82 | get | ||
83 | { | ||
84 | return m_externalHostName; | ||
85 | } | ||
86 | } | ||
87 | |||
88 | private uint? m_regionLocX; | ||
89 | public uint RegionLocX | ||
90 | { | ||
91 | get | ||
92 | { | ||
93 | return m_regionLocX.Value; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | private uint? m_regionLocY; | ||
98 | public uint RegionLocY | ||
99 | { | ||
100 | get | ||
101 | { | ||
102 | return m_regionLocY.Value; | ||
103 | } | ||
104 | } | ||
105 | |||
106 | private ulong? m_regionHandle; | ||
107 | public ulong RegionHandle | ||
108 | { | ||
109 | get | ||
110 | { | ||
111 | if (!m_regionHandle.HasValue) | ||
112 | { | ||
113 | m_regionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); | ||
114 | } | ||
115 | |||
116 | return m_regionHandle.Value; | ||
117 | } | ||
118 | } | ||
119 | |||
120 | // Only used for remote regions , ie ones not in the current instance | ||
121 | private uint m_remotingPort; | ||
122 | public uint RemotingPort | ||
123 | { | ||
124 | get | ||
125 | { | ||
126 | return m_remotingPort; | ||
127 | } | ||
128 | set | ||
129 | { | ||
130 | m_remotingPort = value; | ||
131 | } | ||
132 | } | ||
133 | public string RemotingAddress; | ||
134 | |||
135 | public string DataStore = ""; | ||
136 | public bool isSandbox = false; | ||
137 | |||
138 | public LLUUID MasterAvatarAssignedUUID = new LLUUID(); | ||
139 | public string MasterAvatarFirstName = ""; | ||
140 | public string MasterAvatarLastName = ""; | ||
141 | public string MasterAvatarSandboxPassword = ""; | ||
142 | |||
143 | public EstateSettings estateSettings; | ||
144 | |||
145 | public RegionInfo() | ||
146 | { | ||
147 | estateSettings = new EstateSettings(); | ||
148 | } | ||
149 | |||
150 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) | ||
151 | : this() | ||
152 | { | ||
153 | m_regionLocX = regionLocX; | ||
154 | m_regionLocY = regionLocY; | ||
155 | |||
156 | m_internalEndPoint = internalEndPoint; | ||
157 | m_externalHostName = externalUri; | ||
158 | } | ||
159 | |||
160 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | ||
161 | { | ||
162 | this.isSandbox = sandboxMode; | ||
163 | try | ||
164 | { | ||
165 | string attri = ""; | ||
166 | |||
167 | // Sim UUID | ||
168 | string simId = configData.GetAttribute("SimUUID"); | ||
169 | if (String.IsNullOrEmpty( simId )) | ||
170 | { | ||
171 | this.SimUUID = LLUUID.Random(); | ||
172 | } | ||
173 | else | ||
174 | { | ||
175 | this.SimUUID = new LLUUID(simId); | ||
176 | } | ||
177 | configData.SetAttribute("SimUUID", this.SimUUID.ToString()); | ||
178 | |||
179 | this.RegionName = GetString(configData, "SimName", "OpenSim test", "Region Name"); | ||
180 | |||
181 | //m_regionLocX = (uint) GetInt(configData, "SimLocationX", 1000, "Grid Location X"); | ||
182 | |||
183 | attri = ""; | ||
184 | attri = configData.GetAttribute("SimLocationX"); | ||
185 | if (attri == "") | ||
186 | { | ||
187 | string location = MainLog.Instance.CmdPrompt("Grid Location X", "1000"); | ||
188 | configData.SetAttribute("SimLocationX", location); | ||
189 | m_regionLocX = (uint)Convert.ToUInt32(location); | ||
190 | } | ||
191 | else | ||
192 | { | ||
193 | m_regionLocX = (uint)Convert.ToUInt32(attri); | ||
194 | } | ||
195 | // Sim/Grid location Y | ||
196 | attri = ""; | ||
197 | attri = configData.GetAttribute("SimLocationY"); | ||
198 | if (attri == "") | ||
199 | { | ||
200 | string location = MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); | ||
201 | configData.SetAttribute("SimLocationY", location); | ||
202 | m_regionLocY = (uint)Convert.ToUInt32(location); | ||
203 | } | ||
204 | else | ||
205 | { | ||
206 | m_regionLocY = (uint)Convert.ToUInt32(attri); | ||
207 | } | ||
208 | |||
209 | m_regionHandle = null; | ||
210 | |||
211 | this.DataStore = GetString(configData, "Datastore", "localworld.yap", "Filename for local storage"); | ||
212 | |||
213 | IPAddress internalAddress = GetIPAddress(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections"); | ||
214 | int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); | ||
215 | m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); | ||
216 | |||
217 | m_externalHostName = GetString(configData, "ExternalHostName", "127.0.0.1", "External Host Name"); | ||
218 | |||
219 | estateSettings.terrainFile = | ||
220 | GetString(configData, "TerrainFile", "default.r32", "GENERAL SETTING: Default Terrain File"); | ||
221 | |||
222 | attri = ""; | ||
223 | attri = configData.GetAttribute("TerrainMultiplier"); | ||
224 | if (attri == "") | ||
225 | { | ||
226 | string re = MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); | ||
227 | this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture); | ||
228 | configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString()); | ||
229 | } | ||
230 | else | ||
231 | { | ||
232 | this.estateSettings.terrainMultiplier = Convert.ToDouble(attri); | ||
233 | } | ||
234 | |||
235 | attri = ""; | ||
236 | attri = configData.GetAttribute("MasterAvatarFirstName"); | ||
237 | if (attri == "") | ||
238 | { | ||
239 | this.MasterAvatarFirstName = MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test"); | ||
240 | |||
241 | configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName); | ||
242 | } | ||
243 | else | ||
244 | { | ||
245 | this.MasterAvatarFirstName = attri; | ||
246 | } | ||
247 | |||
248 | attri = ""; | ||
249 | attri = configData.GetAttribute("MasterAvatarLastName"); | ||
250 | if (attri == "") | ||
251 | { | ||
252 | this.MasterAvatarLastName = MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User"); | ||
253 | |||
254 | configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName); | ||
255 | } | ||
256 | else | ||
257 | { | ||
258 | this.MasterAvatarLastName = attri; | ||
259 | } | ||
260 | |||
261 | if (isSandbox) //Sandbox Mode Specific Settings | ||
262 | { | ||
263 | attri = ""; | ||
264 | attri = configData.GetAttribute("MasterAvatarSandboxPassword"); | ||
265 | if (attri == "") | ||
266 | { | ||
267 | this.MasterAvatarSandboxPassword = MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test"); | ||
268 | |||
269 | //Should I store this? | ||
270 | configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword); | ||
271 | } | ||
272 | else | ||
273 | { | ||
274 | this.MasterAvatarSandboxPassword = attri; | ||
275 | } | ||
276 | } | ||
277 | |||
278 | configData.Commit(); | ||
279 | } | ||
280 | catch (Exception e) | ||
281 | { | ||
282 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | ||
283 | MainLog.Instance.Warn(e.ToString()); | ||
284 | } | ||
285 | |||
286 | MainLog.Instance.Verbose("Sim settings loaded:"); | ||
287 | MainLog.Instance.Verbose("UUID: " + this.SimUUID.ToStringHyphenated()); | ||
288 | MainLog.Instance.Verbose("Name: " + this.RegionName); | ||
289 | MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); | ||
290 | MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); | ||
291 | MainLog.Instance.Verbose("Listening on IP end point: " + m_internalEndPoint.ToString() ); | ||
292 | MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); | ||
293 | |||
294 | } | ||
295 | |||
296 | private uint GetInt(IGenericConfig configData, string p, int p_3, string p_4) | ||
297 | { | ||
298 | throw new Exception("The method or operation is not implemented."); | ||
299 | } | ||
300 | |||
301 | private string GetString(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | ||
302 | { | ||
303 | string s = configData.GetAttribute(attrName); | ||
304 | |||
305 | if (String.IsNullOrEmpty( s )) | ||
306 | { | ||
307 | s = MainLog.Instance.CmdPrompt(prompt, defaultvalue); | ||
308 | configData.SetAttribute(attrName, s ); | ||
309 | } | ||
310 | return s; | ||
311 | } | ||
312 | |||
313 | private IPAddress GetIPAddress(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | ||
314 | { | ||
315 | string addressStr = configData.GetAttribute(attrName); | ||
316 | |||
317 | IPAddress address; | ||
318 | |||
319 | if (!IPAddress.TryParse(addressStr, out address)) | ||
320 | { | ||
321 | address = MainLog.Instance.CmdPromptIPAddress(prompt, defaultvalue); | ||
322 | configData.SetAttribute(attrName, address.ToString()); | ||
323 | } | ||
324 | return address; | ||
325 | } | ||
326 | |||
327 | private int GetIPPort(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | ||
328 | { | ||
329 | string portStr = configData.GetAttribute(attrName); | ||
330 | |||
331 | int port; | ||
332 | |||
333 | if (!int.TryParse(portStr, out port)) | ||
334 | { | ||
335 | port = MainLog.Instance.CmdPromptIPPort(prompt, defaultvalue); | ||
336 | configData.SetAttribute(attrName, port.ToString()); | ||
337 | } | ||
338 | |||
339 | return port; | ||
340 | } | ||
341 | } | ||
342 | } | ||
diff --git a/OpenSim/Framework/General/Types/UUID.cs b/OpenSim/Framework/General/Types/UUID.cs new file mode 100644 index 0000000..9cde18e --- /dev/null +++ b/OpenSim/Framework/General/Types/UUID.cs | |||
@@ -0,0 +1,127 @@ | |||
1 | using System; | ||
2 | using libsecondlife; | ||
3 | |||
4 | namespace OpenSim.Framework.Types | ||
5 | { | ||
6 | class UUID | ||
7 | { | ||
8 | public LLUUID llUUID; | ||
9 | |||
10 | public UUID(string uuid) | ||
11 | { | ||
12 | llUUID = new LLUUID(uuid); | ||
13 | } | ||
14 | |||
15 | public UUID(byte[] uuid) | ||
16 | { | ||
17 | llUUID = new LLUUID(uuid, 0); | ||
18 | } | ||
19 | |||
20 | public UUID(byte[] uuid, int offset) | ||
21 | { | ||
22 | llUUID = new LLUUID(uuid, offset); | ||
23 | } | ||
24 | |||
25 | public UUID() | ||
26 | { | ||
27 | llUUID = LLUUID.Zero; | ||
28 | } | ||
29 | |||
30 | public UUID(ulong uuid) | ||
31 | { | ||
32 | llUUID = new LLUUID(uuid); | ||
33 | } | ||
34 | |||
35 | public UUID(UInt32 first, UInt32 second, UInt32 third, UInt32 fourth) | ||
36 | { | ||
37 | byte[] uuid = new byte[16]; | ||
38 | |||
39 | byte[] n = BitConverter.GetBytes(first); | ||
40 | n.CopyTo(uuid, 0); | ||
41 | n = BitConverter.GetBytes(second); | ||
42 | n.CopyTo(uuid, 4); | ||
43 | n = BitConverter.GetBytes(third); | ||
44 | n.CopyTo(uuid, 8); | ||
45 | n = BitConverter.GetBytes(fourth); | ||
46 | n.CopyTo(uuid, 12); | ||
47 | |||
48 | llUUID = new LLUUID(uuid,0); | ||
49 | } | ||
50 | |||
51 | public override string ToString() | ||
52 | { | ||
53 | return llUUID.ToString(); | ||
54 | } | ||
55 | |||
56 | public string ToStringHyphenated() | ||
57 | { | ||
58 | return llUUID.ToStringHyphenated(); | ||
59 | } | ||
60 | |||
61 | public byte[] GetBytes() | ||
62 | { | ||
63 | return llUUID.GetBytes(); | ||
64 | } | ||
65 | |||
66 | public UInt32[] GetInts() | ||
67 | { | ||
68 | UInt32[] ints = new UInt32[4]; | ||
69 | ints[0] = BitConverter.ToUInt32(llUUID.Data, 0); | ||
70 | ints[1] = BitConverter.ToUInt32(llUUID.Data, 4); | ||
71 | ints[2] = BitConverter.ToUInt32(llUUID.Data, 8); | ||
72 | ints[3] = BitConverter.ToUInt32(llUUID.Data, 12); | ||
73 | |||
74 | return ints; | ||
75 | } | ||
76 | |||
77 | public LLUUID GetLLUUID() | ||
78 | { | ||
79 | return llUUID; | ||
80 | } | ||
81 | |||
82 | public uint CRC() | ||
83 | { | ||
84 | return llUUID.CRC(); | ||
85 | } | ||
86 | |||
87 | public override int GetHashCode() | ||
88 | { | ||
89 | return llUUID.GetHashCode(); | ||
90 | } | ||
91 | |||
92 | public void Combine(UUID other) | ||
93 | { | ||
94 | llUUID.Combine(other.GetLLUUID()); | ||
95 | } | ||
96 | |||
97 | public void Combine(LLUUID other) | ||
98 | { | ||
99 | llUUID.Combine(other); | ||
100 | } | ||
101 | |||
102 | public override bool Equals(Object other) | ||
103 | { | ||
104 | return llUUID.Equals(other); | ||
105 | } | ||
106 | |||
107 | public static bool operator ==(UUID a, UUID b) | ||
108 | { | ||
109 | return a.llUUID.Equals(b.GetLLUUID()); | ||
110 | } | ||
111 | |||
112 | public static bool operator !=(UUID a, UUID b) | ||
113 | { | ||
114 | return !a.llUUID.Equals(b.GetLLUUID()); | ||
115 | } | ||
116 | |||
117 | public static bool operator ==(UUID a, LLUUID b) | ||
118 | { | ||
119 | return a.Equals(b); | ||
120 | } | ||
121 | |||
122 | public static bool operator !=(UUID a, LLUUID b) | ||
123 | { | ||
124 | return !a.Equals(b); | ||
125 | } | ||
126 | } | ||
127 | } | ||
diff --git a/OpenSim/Framework/General/UserProfile.cs b/OpenSim/Framework/General/UserProfile.cs new file mode 100644 index 0000000..243208a --- /dev/null +++ b/OpenSim/Framework/General/UserProfile.cs | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Collections.Generic; | ||
29 | using System.Security.Cryptography; | ||
30 | using libsecondlife; | ||
31 | using OpenSim.Framework.Inventory; | ||
32 | |||
33 | namespace OpenSim.Framework.User | ||
34 | { | ||
35 | public class UserProfile | ||
36 | { | ||
37 | |||
38 | public string firstname; | ||
39 | public string lastname; | ||
40 | public ulong homeregionhandle; | ||
41 | public LLVector3 homepos; | ||
42 | public LLVector3 homelookat; | ||
43 | |||
44 | public bool IsGridGod = false; | ||
45 | public bool IsLocal = true; // will be used in future for visitors from foreign grids | ||
46 | public string AssetURL; | ||
47 | public string MD5passwd; | ||
48 | |||
49 | public LLUUID CurrentSessionID; | ||
50 | public LLUUID CurrentSecureSessionID; | ||
51 | public LLUUID UUID; | ||
52 | public Dictionary<LLUUID, uint> Circuits = new Dictionary<LLUUID, uint>(); // tracks circuit codes | ||
53 | |||
54 | public AgentInventory Inventory; | ||
55 | |||
56 | public UserProfile() | ||
57 | { | ||
58 | Circuits = new Dictionary<LLUUID, uint>(); | ||
59 | Inventory = new AgentInventory(); | ||
60 | homeregionhandle = Helpers.UIntsToLong((1000 * 256), (1000 * 256)); | ||
61 | homepos = new LLVector3(); | ||
62 | homelookat = new LLVector3(); | ||
63 | } | ||
64 | |||
65 | public void InitSessionData() | ||
66 | { | ||
67 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); | ||
68 | |||
69 | byte[] randDataS = new byte[16]; | ||
70 | byte[] randDataSS = new byte[16]; | ||
71 | |||
72 | rand.GetBytes(randDataS); | ||
73 | rand.GetBytes(randDataSS); | ||
74 | |||
75 | CurrentSecureSessionID = new LLUUID(randDataSS,0); | ||
76 | CurrentSessionID = new LLUUID(randDataS,0); | ||
77 | |||
78 | } | ||
79 | |||
80 | public void AddSimCircuit(uint circuitCode, LLUUID regionUUID) | ||
81 | { | ||
82 | if (this.Circuits.ContainsKey(regionUUID) == false) | ||
83 | this.Circuits.Add(regionUUID, circuitCode); | ||
84 | } | ||
85 | |||
86 | } | ||
87 | } | ||
diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs new file mode 100644 index 0000000..13e3af2 --- /dev/null +++ b/OpenSim/Framework/General/Util.cs | |||
@@ -0,0 +1,184 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Security.Cryptography; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Utilities | ||
34 | { | ||
35 | public class Util | ||
36 | { | ||
37 | private static Random randomClass = new Random(); | ||
38 | private static uint nextXferID = 5000; | ||
39 | private static object XferLock = new object(); | ||
40 | |||
41 | public static ulong UIntsToLong(uint X, uint Y) | ||
42 | { | ||
43 | return Helpers.UIntsToLong(X, Y); | ||
44 | } | ||
45 | |||
46 | public static Random RandomClass | ||
47 | { | ||
48 | get | ||
49 | { | ||
50 | return randomClass; | ||
51 | } | ||
52 | } | ||
53 | |||
54 | public static uint GetNextXferID() | ||
55 | { | ||
56 | uint id = 0; | ||
57 | lock(XferLock) | ||
58 | { | ||
59 | id = nextXferID; | ||
60 | nextXferID++; | ||
61 | } | ||
62 | return id; | ||
63 | } | ||
64 | |||
65 | public static int UnixTimeSinceEpoch() | ||
66 | { | ||
67 | TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); | ||
68 | int timestamp = (int)t.TotalSeconds; | ||
69 | return timestamp; | ||
70 | } | ||
71 | |||
72 | public static string Md5Hash(string pass) | ||
73 | { | ||
74 | MD5 md5 = MD5CryptoServiceProvider.Create(); | ||
75 | byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass)); | ||
76 | StringBuilder sb = new StringBuilder(); | ||
77 | for (int i = 0; i < dataMd5.Length; i++) | ||
78 | sb.AppendFormat("{0:x2}", dataMd5[i]); | ||
79 | return sb.ToString(); | ||
80 | } | ||
81 | |||
82 | public static string GetRandomCapsPath() | ||
83 | { | ||
84 | LLUUID caps = LLUUID.Random(); | ||
85 | string capsPath = caps.ToStringHyphenated(); | ||
86 | capsPath = capsPath.Remove(capsPath.Length - 4, 4); | ||
87 | return capsPath; | ||
88 | } | ||
89 | |||
90 | //public static int fast_distance2d(int x, int y) | ||
91 | //{ | ||
92 | // x = System.Math.Abs(x); | ||
93 | // y = System.Math.Abs(y); | ||
94 | |||
95 | // int min = System.Math.Min(x, y); | ||
96 | |||
97 | // return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); | ||
98 | //} | ||
99 | |||
100 | public static string FieldToString(byte[] bytes) | ||
101 | { | ||
102 | return FieldToString(bytes, String.Empty); | ||
103 | } | ||
104 | |||
105 | /// <summary> | ||
106 | /// Convert a variable length field (byte array) to a string, with a | ||
107 | /// field name prepended to each line of the output | ||
108 | /// </summary> | ||
109 | /// <remarks>If the byte array has unprintable characters in it, a | ||
110 | /// hex dump will be put in the string instead</remarks> | ||
111 | /// <param name="bytes">The byte array to convert to a string</param> | ||
112 | /// <param name="fieldName">A field name to prepend to each line of output</param> | ||
113 | /// <returns>An ASCII string or a string containing a hex dump, minus | ||
114 | /// the null terminator</returns> | ||
115 | public static string FieldToString(byte[] bytes, string fieldName) | ||
116 | { | ||
117 | // Check for a common case | ||
118 | if (bytes.Length == 0) return String.Empty; | ||
119 | |||
120 | StringBuilder output = new StringBuilder(); | ||
121 | bool printable = true; | ||
122 | |||
123 | for (int i = 0; i < bytes.Length; ++i) | ||
124 | { | ||
125 | // Check if there are any unprintable characters in the array | ||
126 | if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09 | ||
127 | && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00) | ||
128 | { | ||
129 | printable = false; | ||
130 | break; | ||
131 | } | ||
132 | } | ||
133 | |||
134 | if (printable) | ||
135 | { | ||
136 | if (fieldName.Length > 0) | ||
137 | { | ||
138 | output.Append(fieldName); | ||
139 | output.Append(": "); | ||
140 | } | ||
141 | |||
142 | if (bytes[bytes.Length - 1] == 0x00) | ||
143 | output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1)); | ||
144 | else | ||
145 | output.Append(UTF8Encoding.UTF8.GetString(bytes)); | ||
146 | } | ||
147 | else | ||
148 | { | ||
149 | for (int i = 0; i < bytes.Length; i += 16) | ||
150 | { | ||
151 | if (i != 0) | ||
152 | output.Append(Environment.NewLine); | ||
153 | if (fieldName.Length > 0) | ||
154 | { | ||
155 | output.Append(fieldName); | ||
156 | output.Append(": "); | ||
157 | } | ||
158 | |||
159 | for (int j = 0; j < 16; j++) | ||
160 | { | ||
161 | if ((i + j) < bytes.Length) | ||
162 | output.Append(String.Format("{0:X2} ", bytes[i + j])); | ||
163 | else | ||
164 | output.Append(" "); | ||
165 | } | ||
166 | |||
167 | for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) | ||
168 | { | ||
169 | if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) | ||
170 | output.Append((char)bytes[i + j]); | ||
171 | else | ||
172 | output.Append("."); | ||
173 | } | ||
174 | } | ||
175 | } | ||
176 | |||
177 | return output.ToString(); | ||
178 | } | ||
179 | public Util() | ||
180 | { | ||
181 | |||
182 | } | ||
183 | } | ||
184 | } | ||