diff options
Diffstat (limited to 'OpenSim/Framework/General')
40 files changed, 3863 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/AgentInventory.cs b/OpenSim/Framework/General/AgentInventory.cs new file mode 100644 index 0000000..fbf4d23 --- /dev/null +++ b/OpenSim/Framework/General/AgentInventory.cs | |||
@@ -0,0 +1,267 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | using libsecondlife.Packets; | ||
33 | using OpenSim.Framework.Types; | ||
34 | using OpenSim.Framework.Utilities; | ||
35 | |||
36 | namespace OpenSim.Framework.Inventory | ||
37 | { | ||
38 | public class AgentInventory | ||
39 | { | ||
40 | //Holds the local copy of Inventory info for a agent | ||
41 | public Dictionary<LLUUID, InventoryFolder> InventoryFolders; | ||
42 | public Dictionary<LLUUID, InventoryItem> InventoryItems; | ||
43 | public InventoryFolder InventoryRoot; | ||
44 | public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server | ||
45 | public LLUUID AgentID; | ||
46 | public AvatarWearable[] Wearables; | ||
47 | |||
48 | public AgentInventory() | ||
49 | { | ||
50 | InventoryFolders = new Dictionary<LLUUID, InventoryFolder>(); | ||
51 | InventoryItems = new Dictionary<LLUUID, InventoryItem>(); | ||
52 | this.Initialise(); | ||
53 | } | ||
54 | |||
55 | public virtual void Initialise() | ||
56 | { | ||
57 | Wearables = new AvatarWearable[13]; //should be 12 of these | ||
58 | for (int i = 0; i < 13; i++) | ||
59 | { | ||
60 | Wearables[i] = new AvatarWearable(); | ||
61 | } | ||
62 | |||
63 | } | ||
64 | |||
65 | public bool CreateNewFolder(LLUUID folderID, ushort type) | ||
66 | { | ||
67 | InventoryFolder Folder = new InventoryFolder(); | ||
68 | Folder.FolderID = folderID; | ||
69 | Folder.OwnerID = this.AgentID; | ||
70 | Folder.DefaultType = type; | ||
71 | this.InventoryFolders.Add(Folder.FolderID, Folder); | ||
72 | return (true); | ||
73 | } | ||
74 | |||
75 | public void CreateRootFolder(LLUUID newAgentID, bool createTextures) | ||
76 | { | ||
77 | this.AgentID = newAgentID; | ||
78 | InventoryRoot = new InventoryFolder(); | ||
79 | InventoryRoot.FolderID = LLUUID.Random(); | ||
80 | InventoryRoot.ParentID = new LLUUID(); | ||
81 | InventoryRoot.Version = 1; | ||
82 | InventoryRoot.DefaultType = 8; | ||
83 | InventoryRoot.OwnerID = this.AgentID; | ||
84 | InventoryRoot.FolderName = "My Inventory"; | ||
85 | InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot); | ||
86 | InventoryRoot.OwnerID = this.AgentID; | ||
87 | if (createTextures) | ||
88 | { | ||
89 | this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID); | ||
90 | } | ||
91 | } | ||
92 | |||
93 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName) | ||
94 | { | ||
95 | InventoryFolder Folder = new InventoryFolder(); | ||
96 | Folder.FolderID = folderID; | ||
97 | Folder.OwnerID = this.AgentID; | ||
98 | Folder.DefaultType = type; | ||
99 | Folder.FolderName = folderName; | ||
100 | this.InventoryFolders.Add(Folder.FolderID, Folder); | ||
101 | |||
102 | return (true); | ||
103 | } | ||
104 | |||
105 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent) | ||
106 | { | ||
107 | if (!this.InventoryFolders.ContainsKey(folderID)) | ||
108 | { | ||
109 | System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory"); | ||
110 | InventoryFolder Folder = new InventoryFolder(); | ||
111 | Folder.FolderID = folderID; | ||
112 | Folder.OwnerID = this.AgentID; | ||
113 | Folder.DefaultType = type; | ||
114 | Folder.FolderName = folderName; | ||
115 | Folder.ParentID = parent; | ||
116 | this.InventoryFolders.Add(Folder.FolderID, Folder); | ||
117 | } | ||
118 | |||
119 | return (true); | ||
120 | } | ||
121 | |||
122 | public bool HasFolder(LLUUID folderID) | ||
123 | { | ||
124 | if (this.InventoryFolders.ContainsKey(folderID)) | ||
125 | { | ||
126 | return true; | ||
127 | } | ||
128 | return false; | ||
129 | } | ||
130 | |||
131 | public LLUUID GetFolderID(string folderName) | ||
132 | { | ||
133 | foreach (InventoryFolder inv in this.InventoryFolders.Values) | ||
134 | { | ||
135 | if (inv.FolderName == folderName) | ||
136 | { | ||
137 | return inv.FolderID; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | return LLUUID.Zero; | ||
142 | } | ||
143 | |||
144 | public bool UpdateItemAsset(LLUUID itemID, AssetBase asset) | ||
145 | { | ||
146 | if(this.InventoryItems.ContainsKey(itemID)) | ||
147 | { | ||
148 | InventoryItem Item = this.InventoryItems[itemID]; | ||
149 | Item.AssetID = asset.FullID; | ||
150 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated()); | ||
151 | //TODO need to update the rest of the info | ||
152 | } | ||
153 | return true; | ||
154 | } | ||
155 | |||
156 | public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) | ||
157 | { | ||
158 | System.Console.WriteLine("updating inventory item details"); | ||
159 | if (this.InventoryItems.ContainsKey(itemID)) | ||
160 | { | ||
161 | System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name)); | ||
162 | InventoryItem Item = this.InventoryItems[itemID]; | ||
163 | Item.Name = Util.FieldToString(packet.Name); | ||
164 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated()); | ||
165 | //TODO need to update the rest of the info | ||
166 | } | ||
167 | return true; | ||
168 | } | ||
169 | |||
170 | public LLUUID AddToInventory(LLUUID folderID, AssetBase asset) | ||
171 | { | ||
172 | if (this.InventoryFolders.ContainsKey(folderID)) | ||
173 | { | ||
174 | LLUUID NewItemID = LLUUID.Random(); | ||
175 | |||
176 | InventoryItem Item = new InventoryItem(); | ||
177 | Item.FolderID = folderID; | ||
178 | Item.OwnerID = AgentID; | ||
179 | Item.AssetID = asset.FullID; | ||
180 | Item.ItemID = NewItemID; | ||
181 | Item.Type = asset.Type; | ||
182 | Item.Name = asset.Name; | ||
183 | Item.Description = asset.Description; | ||
184 | Item.InvType = asset.InvType; | ||
185 | this.InventoryItems.Add(Item.ItemID, Item); | ||
186 | InventoryFolder Folder = InventoryFolders[Item.FolderID]; | ||
187 | Folder.Items.Add(Item); | ||
188 | return (Item.ItemID); | ||
189 | } | ||
190 | else | ||
191 | { | ||
192 | return (null); | ||
193 | } | ||
194 | } | ||
195 | |||
196 | public bool DeleteFromInventory(LLUUID itemID) | ||
197 | { | ||
198 | bool res = false; | ||
199 | if (this.InventoryItems.ContainsKey(itemID)) | ||
200 | { | ||
201 | InventoryItem item = this.InventoryItems[itemID]; | ||
202 | this.InventoryItems.Remove(itemID); | ||
203 | foreach (InventoryFolder fold in InventoryFolders.Values) | ||
204 | { | ||
205 | if (fold.Items.Contains(item)) | ||
206 | { | ||
207 | fold.Items.Remove(item); | ||
208 | break; | ||
209 | } | ||
210 | } | ||
211 | res = true; | ||
212 | |||
213 | } | ||
214 | return res; | ||
215 | } | ||
216 | } | ||
217 | |||
218 | public class InventoryFolder | ||
219 | { | ||
220 | public List<InventoryItem> Items; | ||
221 | //public List<InventoryFolder> Subfolders; | ||
222 | public LLUUID FolderID; | ||
223 | public LLUUID OwnerID; | ||
224 | public LLUUID ParentID = LLUUID.Zero; | ||
225 | public string FolderName; | ||
226 | public ushort DefaultType; | ||
227 | public ushort Version; | ||
228 | |||
229 | public InventoryFolder() | ||
230 | { | ||
231 | Items = new List<InventoryItem>(); | ||
232 | //Subfolders = new List<InventoryFolder>(); | ||
233 | } | ||
234 | |||
235 | } | ||
236 | |||
237 | public class InventoryItem | ||
238 | { | ||
239 | public LLUUID FolderID; | ||
240 | public LLUUID OwnerID; | ||
241 | public LLUUID ItemID; | ||
242 | public LLUUID AssetID; | ||
243 | public LLUUID CreatorID; | ||
244 | public sbyte InvType; | ||
245 | public sbyte Type; | ||
246 | public string Name =""; | ||
247 | public string Description; | ||
248 | |||
249 | public InventoryItem() | ||
250 | { | ||
251 | this.CreatorID = LLUUID.Zero; | ||
252 | } | ||
253 | |||
254 | public string ExportString() | ||
255 | { | ||
256 | string typ = "notecard"; | ||
257 | string result = ""; | ||
258 | result += "\tinv_object\t0\n\t{\n"; | ||
259 | result += "\t\tobj_id\t%s\n"; | ||
260 | result += "\t\tparent_id\t"+ ItemID.ToString() +"\n"; | ||
261 | result += "\t\ttype\t"+ typ +"\n"; | ||
262 | result += "\t\tname\t" + Name+"|\n"; | ||
263 | result += "\t}\n"; | ||
264 | return result; | ||
265 | } | ||
266 | } | ||
267 | } | ||
diff --git a/OpenSim/Framework/General/AuthenticateSessionBase.cs b/OpenSim/Framework/General/AuthenticateSessionBase.cs new file mode 100644 index 0000000..73dd3e2 --- /dev/null +++ b/OpenSim/Framework/General/AuthenticateSessionBase.cs | |||
@@ -0,0 +1,132 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | using OpenSim.Framework.Interfaces; | ||
33 | using OpenSim.Framework.Types; | ||
34 | |||
35 | namespace OpenSim.Framework | ||
36 | { | ||
37 | public class AuthenticateSessionsBase | ||
38 | { | ||
39 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); | ||
40 | |||
41 | public AuthenticateSessionsBase() | ||
42 | { | ||
43 | |||
44 | } | ||
45 | |||
46 | public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) | ||
47 | { | ||
48 | AgentCircuitData validcircuit = null; | ||
49 | if (this.AgentCircuits.ContainsKey(circuitcode)) | ||
50 | { | ||
51 | validcircuit = this.AgentCircuits[circuitcode]; | ||
52 | } | ||
53 | AuthenticateResponse user = new AuthenticateResponse(); | ||
54 | if (validcircuit == null) | ||
55 | { | ||
56 | //don't have this circuit code in our list | ||
57 | user.Authorised = false; | ||
58 | return (user); | ||
59 | } | ||
60 | |||
61 | if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) | ||
62 | { | ||
63 | user.Authorised = true; | ||
64 | user.LoginInfo = new Login(); | ||
65 | user.LoginInfo.Agent = agentID; | ||
66 | user.LoginInfo.Session = sessionID; | ||
67 | user.LoginInfo.SecureSession = validcircuit.SecureSessionID; | ||
68 | user.LoginInfo.First = validcircuit.firstname; | ||
69 | user.LoginInfo.Last = validcircuit.lastname; | ||
70 | user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; | ||
71 | user.LoginInfo.BaseFolder = validcircuit.BaseFolder; | ||
72 | } | ||
73 | else | ||
74 | { | ||
75 | // Invalid | ||
76 | user.Authorised = false; | ||
77 | } | ||
78 | |||
79 | return (user); | ||
80 | } | ||
81 | |||
82 | public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) | ||
83 | { | ||
84 | if (this.AgentCircuits.ContainsKey(circuitCode)) | ||
85 | { | ||
86 | this.AgentCircuits[circuitCode] = agentData; | ||
87 | } | ||
88 | else | ||
89 | { | ||
90 | this.AgentCircuits.Add(circuitCode, agentData); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | public LLVector3 GetPosition(uint circuitCode) | ||
95 | { | ||
96 | LLVector3 vec = new LLVector3(); | ||
97 | if (this.AgentCircuits.ContainsKey(circuitCode)) | ||
98 | { | ||
99 | vec = this.AgentCircuits[circuitCode].startpos; | ||
100 | } | ||
101 | return vec; | ||
102 | } | ||
103 | |||
104 | public void UpdateAgentData(AgentCircuitData agentData) | ||
105 | { | ||
106 | if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode)) | ||
107 | { | ||
108 | this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname; | ||
109 | this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname; | ||
110 | this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; | ||
111 | // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); | ||
112 | } | ||
113 | } | ||
114 | |||
115 | public void UpdateAgentChildStatus(uint circuitcode, bool childstatus) | ||
116 | { | ||
117 | if (this.AgentCircuits.ContainsKey(circuitcode)) | ||
118 | { | ||
119 | this.AgentCircuits[circuitcode].child = childstatus; | ||
120 | } | ||
121 | } | ||
122 | |||
123 | public bool GetAgentChildStatus(uint circuitcode) | ||
124 | { | ||
125 | if (this.AgentCircuits.ContainsKey(circuitcode)) | ||
126 | { | ||
127 | return this.AgentCircuits[circuitcode].child; | ||
128 | } | ||
129 | return false; | ||
130 | } | ||
131 | } | ||
132 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/BlockingQueue.cs b/OpenSim/Framework/General/BlockingQueue.cs new file mode 100644 index 0000000..667b8d8 --- /dev/null +++ b/OpenSim/Framework/General/BlockingQueue.cs | |||
@@ -0,0 +1,60 @@ | |||
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.Threading; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | |||
33 | namespace OpenSim.Framework.Utilities | ||
34 | { | ||
35 | public class BlockingQueue<T> | ||
36 | { | ||
37 | private Queue<T> _queue = new Queue<T>(); | ||
38 | private object _queueSync = new object(); | ||
39 | |||
40 | public void Enqueue(T value) | ||
41 | { | ||
42 | lock (_queueSync) | ||
43 | { | ||
44 | _queue.Enqueue(value); | ||
45 | Monitor.Pulse(_queueSync); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | public T Dequeue() | ||
50 | { | ||
51 | lock (_queueSync) | ||
52 | { | ||
53 | if (_queue.Count < 1) | ||
54 | Monitor.Wait(_queueSync); | ||
55 | |||
56 | return _queue.Dequeue(); | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | } | ||
diff --git a/OpenSim/Framework/General/IRegionCommsListener.cs b/OpenSim/Framework/General/IRegionCommsListener.cs new file mode 100644 index 0000000..0e80941 --- /dev/null +++ b/OpenSim/Framework/General/IRegionCommsListener.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 System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Framework.Interfaces; | ||
32 | using OpenSim.Framework.Types; | ||
33 | |||
34 | namespace OpenSim.Framework | ||
35 | { | ||
36 | public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); | ||
37 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); | ||
38 | public delegate void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); | ||
39 | |||
40 | public interface IRegionCommsListener | ||
41 | { | ||
42 | event ExpectUserDelegate OnExpectUser; | ||
43 | event GenericCall2 OnExpectChildAgent; | ||
44 | event AgentCrossing OnAvatarCrossingIntoRegion; | ||
45 | event UpdateNeighbours OnNeighboursUpdate; | ||
46 | } | ||
47 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs new file mode 100644 index 0000000..462e2c5 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs | |||
@@ -0,0 +1,51 @@ | |||
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.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Net; | ||
32 | using System.Net.Sockets; | ||
33 | using System.IO; | ||
34 | using libsecondlife; | ||
35 | using OpenSim; | ||
36 | using OpenSim.Framework.Types; | ||
37 | |||
38 | namespace OpenSim.Framework.Interfaces | ||
39 | { | ||
40 | public class AuthenticateResponse | ||
41 | { | ||
42 | public bool Authorised; | ||
43 | public Login LoginInfo; | ||
44 | |||
45 | public AuthenticateResponse() | ||
46 | { | ||
47 | |||
48 | } | ||
49 | |||
50 | } | ||
51 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs new file mode 100644 index 0000000..13980fe --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.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 System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Framework.Interfaces | ||
33 | { | ||
34 | public interface IGenericConfig | ||
35 | { | ||
36 | void LoadData(); | ||
37 | string GetAttribute(string attributeName); | ||
38 | bool SetAttribute(string attributeName, string attributeValue); | ||
39 | void Commit(); | ||
40 | void Close(); | ||
41 | } | ||
42 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs new file mode 100644 index 0000000..0fafe1a --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs | |||
@@ -0,0 +1,63 @@ | |||
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 System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.IO; | ||
32 | using libsecondlife; | ||
33 | //using OpenSim.world; | ||
34 | |||
35 | namespace OpenSim.Framework.Interfaces | ||
36 | { | ||
37 | /// <summary> | ||
38 | /// </summary> | ||
39 | |||
40 | |||
41 | public abstract class GridConfig | ||
42 | { | ||
43 | public string GridOwner; | ||
44 | public string DefaultStartupMsg; | ||
45 | public string DefaultAssetServer; | ||
46 | public string AssetSendKey; | ||
47 | public string AssetRecvKey; | ||
48 | public string DefaultUserServer; | ||
49 | public string UserSendKey; | ||
50 | public string UserRecvKey; | ||
51 | public string SimSendKey; | ||
52 | public string SimRecvKey; | ||
53 | |||
54 | |||
55 | public abstract void InitConfig(); | ||
56 | |||
57 | } | ||
58 | |||
59 | public interface IGridConfig | ||
60 | { | ||
61 | GridConfig GetConfigObject(); | ||
62 | } | ||
63 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs new file mode 100644 index 0000000..2f4b340 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.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 | |||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.IO; | ||
32 | using libsecondlife; | ||
33 | //using OpenSim.world; | ||
34 | |||
35 | namespace OpenSim.Framework.Interfaces | ||
36 | { | ||
37 | /// <summary> | ||
38 | /// </summary> | ||
39 | |||
40 | |||
41 | public abstract class UserConfig | ||
42 | { | ||
43 | public string DefaultStartupMsg; | ||
44 | public string GridServerURL; | ||
45 | public string GridSendKey; | ||
46 | public string GridRecvKey; | ||
47 | |||
48 | |||
49 | public abstract void InitConfig(); | ||
50 | |||
51 | } | ||
52 | |||
53 | public interface IUserConfig | ||
54 | { | ||
55 | UserConfig GetConfigObject(); | ||
56 | } | ||
57 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/IAssetServer.cs b/OpenSim/Framework/General/Interfaces/IAssetServer.cs new file mode 100644 index 0000000..826392d --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IAssetServer.cs | |||
@@ -0,0 +1,69 @@ | |||
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.Net; | ||
30 | using System.Net.Sockets; | ||
31 | using System.IO; | ||
32 | using System.Threading; | ||
33 | using libsecondlife; | ||
34 | using OpenSim.Framework.Types; | ||
35 | |||
36 | namespace OpenSim.Framework.Interfaces | ||
37 | { | ||
38 | /// <summary> | ||
39 | /// Description of IAssetServer. | ||
40 | /// </summary> | ||
41 | |||
42 | public interface IAssetServer | ||
43 | { | ||
44 | void SetReceiver(IAssetReceiver receiver); | ||
45 | void RequestAsset(LLUUID assetID, bool isTexture); | ||
46 | void UpdateAsset(AssetBase asset); | ||
47 | void UploadNewAsset(AssetBase asset); | ||
48 | void SetServerInfo(string ServerUrl, string ServerKey); | ||
49 | void Close(); | ||
50 | } | ||
51 | |||
52 | // could change to delegate? | ||
53 | public interface IAssetReceiver | ||
54 | { | ||
55 | void AssetReceived(AssetBase asset, bool IsTexture); | ||
56 | void AssetNotFound(AssetBase asset); | ||
57 | } | ||
58 | |||
59 | public interface IAssetPlugin | ||
60 | { | ||
61 | IAssetServer GetAssetServer(); | ||
62 | } | ||
63 | |||
64 | public struct ARequest | ||
65 | { | ||
66 | public LLUUID AssetID; | ||
67 | public bool IsTexture; | ||
68 | } | ||
69 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs new file mode 100644 index 0000000..009648c --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -0,0 +1,160 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Framework.Inventory; | ||
32 | using libsecondlife; | ||
33 | using libsecondlife.Packets; | ||
34 | using OpenSim.Framework.Types; | ||
35 | |||
36 | namespace OpenSim.Framework.Interfaces | ||
37 | { | ||
38 | public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | ||
39 | public delegate void RezObject(AssetBase primAsset, LLVector3 pos); | ||
40 | public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west); | ||
41 | public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); | ||
42 | public delegate void StartAnim(LLUUID animID, int seq); | ||
43 | public delegate void LinkObjects(uint parent, List<uint> children); | ||
44 | public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); | ||
45 | public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); | ||
46 | |||
47 | public delegate void GenericCall(IClientAPI remoteClient); | ||
48 | public delegate void GenericCall2(); | ||
49 | public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary. | ||
50 | public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); | ||
51 | public delegate void GenericCall5(IClientAPI remoteClient, bool status); | ||
52 | public delegate void GenericCall6(LLUUID uid); | ||
53 | |||
54 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); | ||
55 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); | ||
56 | public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); | ||
57 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); | ||
58 | public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); | ||
59 | public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); | ||
60 | public delegate void StatusChange(bool status); | ||
61 | public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); | ||
62 | public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); | ||
63 | public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient); | ||
64 | |||
65 | public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); | ||
66 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); | ||
67 | public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); | ||
68 | public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); // NOTETOSELFremove the packet part | ||
69 | |||
70 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); | ||
71 | |||
72 | public interface IClientAPI | ||
73 | { | ||
74 | event ChatFromViewer OnChatFromViewer; | ||
75 | event RezObject OnRezObject; | ||
76 | event ModifyTerrain OnModifyTerrain; | ||
77 | event SetAppearance OnSetAppearance; | ||
78 | event StartAnim OnStartAnim; | ||
79 | event LinkObjects OnLinkObjects; | ||
80 | event RequestMapBlocks OnRequestMapBlocks; | ||
81 | event TeleportLocationRequest OnTeleportLocationRequest; | ||
82 | |||
83 | event GenericCall4 OnDeRezObject; | ||
84 | event GenericCall OnRegionHandShakeReply; | ||
85 | event GenericCall OnRequestWearables; | ||
86 | event GenericCall2 OnCompleteMovementToRegion; | ||
87 | event UpdateAgent OnAgentUpdate; | ||
88 | event GenericCall OnRequestAvatarsData; | ||
89 | event GenericCall4 OnAddPrim; | ||
90 | event UpdateVector OnGrapObject; | ||
91 | event ObjectSelect OnDeGrapObject; | ||
92 | event MoveObject OnGrapUpdate; | ||
93 | |||
94 | event UpdateShape OnUpdatePrimShape; | ||
95 | event ObjectSelect OnObjectSelect; | ||
96 | event UpdatePrimFlags OnUpdatePrimFlags; | ||
97 | event UpdatePrimTexture OnUpdatePrimTexture; | ||
98 | event UpdateVector OnUpdatePrimPosition; | ||
99 | event UpdatePrimRotation OnUpdatePrimRotation; | ||
100 | event UpdateVector OnUpdatePrimScale; | ||
101 | event StatusChange OnChildAgentStatus; | ||
102 | event GenericCall2 OnStopMovement; | ||
103 | event NewAvatar OnNewAvatar; | ||
104 | event GenericCall6 OnRemoveAvatar; | ||
105 | |||
106 | event ParcelPropertiesRequest OnParcelPropertiesRequest; | ||
107 | event ParcelDivideRequest OnParcelDivideRequest; | ||
108 | event ParcelJoinRequest OnParcelJoinRequest; | ||
109 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | ||
110 | |||
111 | event EstateOwnerMessageRequest OnEstateOwnerMessage; | ||
112 | |||
113 | LLVector3 StartPos | ||
114 | { | ||
115 | get; | ||
116 | set; | ||
117 | } | ||
118 | |||
119 | LLUUID AgentId | ||
120 | { | ||
121 | get; | ||
122 | } | ||
123 | |||
124 | string FirstName | ||
125 | { | ||
126 | get; | ||
127 | } | ||
128 | |||
129 | string LastName | ||
130 | { | ||
131 | get; | ||
132 | } | ||
133 | |||
134 | void OutPacket(Packet newPack); | ||
135 | void SendWearables(AvatarWearable[] wearables); | ||
136 | void SendRegionHandshake(RegionInfo regionInfo); | ||
137 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | ||
138 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | ||
139 | void SendLayerData(float[] map); | ||
140 | void SendLayerData(int px, int py, float[] map); | ||
141 | void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); | ||
142 | void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); | ||
143 | AgentCircuitData RequestClientInfo(); | ||
144 | void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort); | ||
145 | void SendMapBlock(List<MapBlockData> mapBlocks); | ||
146 | void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); | ||
147 | void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags); | ||
148 | void SendTeleportCancel(); | ||
149 | void SendTeleportLocationStart(); | ||
150 | void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); | ||
151 | |||
152 | void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry); | ||
153 | void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); | ||
154 | |||
155 | void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); | ||
156 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags); | ||
157 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags); | ||
158 | void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); | ||
159 | } | ||
160 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs new file mode 100644 index 0000000..4987d10 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs | |||
@@ -0,0 +1,69 @@ | |||
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 System; | ||
30 | using libsecondlife; | ||
31 | using OpenSim.Framework.Types; | ||
32 | |||
33 | namespace OpenSim.Framework.Interfaces | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// ILocalStorage. Really hacked together right now needs cleaning up | ||
37 | /// </summary> | ||
38 | public interface ILocalStorage | ||
39 | { | ||
40 | void Initialise(string datastore); | ||
41 | |||
42 | void StorePrim(PrimData prim); | ||
43 | void RemovePrim(LLUUID primID); | ||
44 | void LoadPrimitives(ILocalStorageReceiver receiver); | ||
45 | |||
46 | float[] LoadWorld(); | ||
47 | void SaveMap(float[] heightmap); | ||
48 | |||
49 | void SaveParcels(ParcelData[] parcels); | ||
50 | void SaveParcel(ParcelData parcel); | ||
51 | void RemoveParcel(ParcelData parcel); | ||
52 | void RemoveAllParcels(); | ||
53 | void LoadParcels(ILocalStorageParcelReceiver recv); | ||
54 | |||
55 | void ShutDown(); | ||
56 | } | ||
57 | |||
58 | public interface ILocalStorageReceiver | ||
59 | { | ||
60 | void PrimFromStorage(PrimData prim); | ||
61 | } | ||
62 | |||
63 | public interface ILocalStorageParcelReceiver | ||
64 | { | ||
65 | void ParcelFromStorage(ParcelData data); | ||
66 | void NoParcelDataFromStorage(); | ||
67 | } | ||
68 | } | ||
69 | |||
diff --git a/OpenSim/Framework/General/Interfaces/IUserServer.cs b/OpenSim/Framework/General/Interfaces/IUserServer.cs new file mode 100644 index 0000000..c6e2223 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IUserServer.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 System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Framework.Inventory; | ||
32 | using libsecondlife; | ||
33 | |||
34 | namespace OpenSim.Framework.Interfaces | ||
35 | { | ||
36 | public interface IUserServer | ||
37 | { | ||
38 | AgentInventory RequestAgentsInventory(LLUUID agentID); | ||
39 | void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); | ||
40 | bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory); | ||
41 | } | ||
42 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/IWorld.cs b/OpenSim/Framework/General/Interfaces/IWorld.cs new file mode 100644 index 0000000..4857417 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/IWorld.cs | |||
@@ -0,0 +1,45 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | using OpenSim.Framework.Types; | ||
33 | |||
34 | namespace OpenSim.Framework.Interfaces | ||
35 | { | ||
36 | public interface IWorld | ||
37 | { | ||
38 | void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child); | ||
39 | void RemoveClient(LLUUID agentID); | ||
40 | |||
41 | RegionInfo RegionInfo { get; } | ||
42 | object SyncRoot { get; } | ||
43 | uint NextLocalId { get; } | ||
44 | } | ||
45 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs b/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.cs new file mode 100644 index 0000000..0c1627b --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Scripting/IScriptAPI.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 System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Framework.Types; | ||
32 | |||
33 | using libsecondlife; | ||
34 | namespace OpenSim.Framework.Interfaces | ||
35 | { | ||
36 | public interface IScriptAPI | ||
37 | { | ||
38 | LLVector3 GetEntityPosition(uint localID); | ||
39 | void SetEntityPosition(uint localID, float x, float y, float z); | ||
40 | uint GetRandomAvatarID(); | ||
41 | } | ||
42 | } | ||
diff --git a/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs b/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs new file mode 100644 index 0000000..ca50be0 --- /dev/null +++ b/OpenSim/Framework/General/Interfaces/Scripting/IScriptEngine.cs | |||
@@ -0,0 +1,41 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Framework.Interfaces | ||
33 | { | ||
34 | public interface IScriptEngine | ||
35 | { | ||
36 | bool Init(IScriptAPI api); | ||
37 | string GetName(); | ||
38 | void LoadScript(string script, string scriptName, uint entityID); | ||
39 | void OnFrame(); | ||
40 | } | ||
41 | } | ||
diff --git a/OpenSim/Framework/General/LLSDHelpers.cs b/OpenSim/Framework/General/LLSDHelpers.cs new file mode 100644 index 0000000..051520c --- /dev/null +++ b/OpenSim/Framework/General/LLSDHelpers.cs | |||
@@ -0,0 +1,246 @@ | |||
1 | using System; | ||
2 | using System.Collections; | ||
3 | using System.Collections.Generic; | ||
4 | using System.Text; | ||
5 | using System.IO; | ||
6 | using System.Xml; | ||
7 | using libsecondlife; | ||
8 | |||
9 | namespace OpenSim.Framework | ||
10 | { | ||
11 | public class LLSDHelpers | ||
12 | { | ||
13 | public static string SerialiseLLSDReply(object obj) | ||
14 | { | ||
15 | StringWriter sw = new StringWriter(); | ||
16 | XmlTextWriter writer = new XmlTextWriter(sw); | ||
17 | writer.Formatting = Formatting.None; | ||
18 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); | ||
19 | LLSDHelpers.SerializeLLSDType(writer, obj); | ||
20 | writer.WriteEndElement(); | ||
21 | writer.Close(); | ||
22 | return sw.ToString(); | ||
23 | } | ||
24 | |||
25 | public static void SerializeLLSDType(XmlTextWriter writer, object obj) | ||
26 | { | ||
27 | Type myType = obj.GetType(); | ||
28 | LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); | ||
29 | if (llsdattributes.Length > 0) | ||
30 | { | ||
31 | switch (llsdattributes[0].ObjectType) | ||
32 | { | ||
33 | case "MAP": | ||
34 | writer.WriteStartElement(String.Empty, "map", String.Empty); | ||
35 | System.Reflection.FieldInfo[] fields = myType.GetFields(); | ||
36 | for (int i = 0; i < fields.Length; i++) | ||
37 | { | ||
38 | object fieldValue = fields[i].GetValue(obj); | ||
39 | LLSDType[] fieldAttributes = (LLSDType[])fieldValue.GetType().GetCustomAttributes(typeof(LLSDType), false); | ||
40 | if (fieldAttributes.Length > 0) | ||
41 | { | ||
42 | writer.WriteStartElement(String.Empty, "key", String.Empty); | ||
43 | writer.WriteString(fields[i].Name); | ||
44 | writer.WriteEndElement(); | ||
45 | SerializeLLSDType(writer, fieldValue); | ||
46 | } | ||
47 | else | ||
48 | { | ||
49 | //Console.WriteLine("LLSD field name" + fields[i].Name + " , " + fields[i].GetValue(obj).GetType()); | ||
50 | writer.WriteStartElement(String.Empty, "key", String.Empty); | ||
51 | writer.WriteString(fields[i].Name); | ||
52 | writer.WriteEndElement(); | ||
53 | LLSD.LLSDWriteOne(writer, fieldValue); | ||
54 | } | ||
55 | } | ||
56 | writer.WriteEndElement(); | ||
57 | break; | ||
58 | case "ARRAY": | ||
59 | // LLSDArray arrayObject = obj as LLSDArray; | ||
60 | // ArrayList a = arrayObject.Array; | ||
61 | ArrayList a = (ArrayList)obj.GetType().GetField("Array").GetValue(obj); | ||
62 | writer.WriteStartElement(String.Empty, "array", String.Empty); | ||
63 | foreach (object item in a) | ||
64 | { | ||
65 | SerializeLLSDType(writer, item); | ||
66 | } | ||
67 | writer.WriteEndElement(); | ||
68 | break; | ||
69 | } | ||
70 | } | ||
71 | else | ||
72 | { | ||
73 | LLSD.LLSDWriteOne(writer, obj); | ||
74 | } | ||
75 | } | ||
76 | |||
77 | public static object DeserialiseLLSDMap(Hashtable llsd, object obj) | ||
78 | { | ||
79 | Type myType = obj.GetType(); | ||
80 | LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); | ||
81 | if (llsdattributes.Length > 0) | ||
82 | { | ||
83 | switch (llsdattributes[0].ObjectType) | ||
84 | { | ||
85 | case "MAP": | ||
86 | IDictionaryEnumerator enumerator = llsd.GetEnumerator(); | ||
87 | while (enumerator.MoveNext()) | ||
88 | { | ||
89 | System.Reflection.FieldInfo field = myType.GetField((string)enumerator.Key); | ||
90 | if (field != null) | ||
91 | { | ||
92 | if (enumerator.Value is Hashtable) | ||
93 | { | ||
94 | object fieldValue = field.GetValue(obj); | ||
95 | DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); | ||
96 | } | ||
97 | else if (enumerator.Value is ArrayList) | ||
98 | { | ||
99 | object fieldValue = field.GetValue(obj); | ||
100 | fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); | ||
101 | //TODO | ||
102 | // the LLSD map/array types in the array need to be deserialised | ||
103 | // but first we need to know the right class to deserialise them into. | ||
104 | } | ||
105 | else | ||
106 | { | ||
107 | field.SetValue(obj, enumerator.Value); | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | break; | ||
112 | } | ||
113 | } | ||
114 | return obj; | ||
115 | } | ||
116 | } | ||
117 | |||
118 | [LLSDType("MAP")] | ||
119 | public class LLSDMapLayerResponse | ||
120 | { | ||
121 | public LLSDMapRequest AgentData = new LLSDMapRequest(); | ||
122 | public LLSDArray LayerData = new LLSDArray(); | ||
123 | |||
124 | public LLSDMapLayerResponse() | ||
125 | { | ||
126 | |||
127 | } | ||
128 | } | ||
129 | |||
130 | [LLSDType("MAP")] | ||
131 | public class LLSDCapsDetails | ||
132 | { | ||
133 | public string MapLayer = ""; | ||
134 | public string NewFileAgentInventory = ""; | ||
135 | //public string EventQueueGet = ""; | ||
136 | |||
137 | public LLSDCapsDetails() | ||
138 | { | ||
139 | |||
140 | } | ||
141 | } | ||
142 | |||
143 | [LLSDType("MAP")] | ||
144 | public class LLSDMapLayer | ||
145 | { | ||
146 | public int Left = 0; | ||
147 | public int Right = 0; | ||
148 | public int Top = 0; | ||
149 | public int Bottom = 0; | ||
150 | public LLUUID ImageID = LLUUID.Zero; | ||
151 | |||
152 | public LLSDMapLayer() | ||
153 | { | ||
154 | |||
155 | } | ||
156 | } | ||
157 | |||
158 | [LLSDType("ARRAY")] | ||
159 | public class LLSDArray | ||
160 | { | ||
161 | public ArrayList Array = new ArrayList(); | ||
162 | |||
163 | public LLSDArray() | ||
164 | { | ||
165 | |||
166 | } | ||
167 | } | ||
168 | |||
169 | [LLSDType("MAP")] | ||
170 | public class LLSDMapRequest | ||
171 | { | ||
172 | public int Flags = 0; | ||
173 | |||
174 | public LLSDMapRequest() | ||
175 | { | ||
176 | |||
177 | } | ||
178 | } | ||
179 | |||
180 | [LLSDType("MAP")] | ||
181 | public class LLSDUploadReply | ||
182 | { | ||
183 | public string new_asset = ""; | ||
184 | public LLUUID new_inventory_item = LLUUID.Zero; | ||
185 | public string state = ""; | ||
186 | |||
187 | public LLSDUploadReply() | ||
188 | { | ||
189 | |||
190 | } | ||
191 | } | ||
192 | |||
193 | [LLSDType("MAP")] | ||
194 | public class LLSDCapEvent | ||
195 | { | ||
196 | public int id = 0; | ||
197 | public LLSDArray events = new LLSDArray(); | ||
198 | |||
199 | public LLSDCapEvent() | ||
200 | { | ||
201 | |||
202 | } | ||
203 | } | ||
204 | |||
205 | [LLSDType("MAP")] | ||
206 | public class LLSDEmpty | ||
207 | { | ||
208 | public LLSDEmpty() | ||
209 | { | ||
210 | |||
211 | } | ||
212 | } | ||
213 | |||
214 | [LLSDType("MAP")] | ||
215 | public class LLSDTest | ||
216 | { | ||
217 | public int Test1 = 20; | ||
218 | public int Test2 = 10; | ||
219 | |||
220 | public LLSDTest() | ||
221 | { | ||
222 | |||
223 | } | ||
224 | } | ||
225 | |||
226 | |||
227 | [AttributeUsage(AttributeTargets.Class)] | ||
228 | public class LLSDType : Attribute | ||
229 | { | ||
230 | private string myType; | ||
231 | |||
232 | public LLSDType(string type) | ||
233 | { | ||
234 | myType = type; | ||
235 | |||
236 | } | ||
237 | |||
238 | public string ObjectType | ||
239 | { | ||
240 | get | ||
241 | { | ||
242 | return myType; | ||
243 | } | ||
244 | } | ||
245 | } | ||
246 | } | ||
diff --git a/OpenSim/Framework/General/Logger.cs b/OpenSim/Framework/General/Logger.cs new file mode 100644 index 0000000..e7eaa03 --- /dev/null +++ b/OpenSim/Framework/General/Logger.cs | |||
@@ -0,0 +1,85 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework | ||
6 | { | ||
7 | public class Logger | ||
8 | { | ||
9 | public static Logger Instance = new Logger( false ); | ||
10 | |||
11 | public delegate void LoggerMethodDelegate(); | ||
12 | private delegate bool LoggerDelegate( LoggerMethodDelegate whatToDo ); | ||
13 | |||
14 | |||
15 | private LoggerDelegate m_delegate; | ||
16 | |||
17 | public Logger( bool log ) | ||
18 | { | ||
19 | if( log ) | ||
20 | { | ||
21 | m_delegate = CatchAndLog; | ||
22 | } | ||
23 | else | ||
24 | { | ||
25 | m_delegate = DontCatch; | ||
26 | } | ||
27 | } | ||
28 | |||
29 | public bool Wrap( LoggerMethodDelegate whatToDo ) | ||
30 | { | ||
31 | return m_delegate( whatToDo ); | ||
32 | } | ||
33 | |||
34 | |||
35 | private bool CatchAndLog(LoggerMethodDelegate whatToDo) | ||
36 | { | ||
37 | try | ||
38 | { | ||
39 | whatToDo(); | ||
40 | return true; | ||
41 | } | ||
42 | catch(Exception e) | ||
43 | { | ||
44 | System.Console.WriteLine( "Exception logged!!! Woah!!!!" ); | ||
45 | return false; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | private bool DontCatch(LoggerMethodDelegate whatToDo) | ||
50 | { | ||
51 | whatToDo(); | ||
52 | return true; | ||
53 | } | ||
54 | |||
55 | public class LoggerExample | ||
56 | { | ||
57 | public void TryWrap() | ||
58 | { | ||
59 | // This will log and ignore | ||
60 | Logger log = new Logger(true); | ||
61 | |||
62 | log.Wrap(delegate() | ||
63 | { | ||
64 | Int16.Parse("waa!"); | ||
65 | }); | ||
66 | |||
67 | // This will throw; | ||
68 | try | ||
69 | { | ||
70 | |||
71 | log = new Logger(false); | ||
72 | |||
73 | log.Wrap(delegate() | ||
74 | { | ||
75 | Int16.Parse("waa!"); | ||
76 | }); | ||
77 | } | ||
78 | catch | ||
79 | { | ||
80 | System.Console.WriteLine("Example barfed!"); | ||
81 | } | ||
82 | } | ||
83 | } | ||
84 | } | ||
85 | } | ||
diff --git a/OpenSim/Framework/General/LoginService.cs b/OpenSim/Framework/General/LoginService.cs new file mode 100644 index 0000000..f14754f --- /dev/null +++ b/OpenSim/Framework/General/LoginService.cs | |||
@@ -0,0 +1,41 @@ | |||
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.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | using Nwc.XmlRpc; | ||
33 | using libsecondlife; | ||
34 | |||
35 | namespace OpenSim.Framework.Grid | ||
36 | { | ||
37 | public abstract class LoginService | ||
38 | { | ||
39 | |||
40 | } | ||
41 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj new file mode 100644 index 0000000..e164d5a --- /dev/null +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj | |||
@@ -0,0 +1,213 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <ProjectType>Local</ProjectType> | ||
4 | <ProductVersion>8.0.50727</ProductVersion> | ||
5 | <SchemaVersion>2.0</SchemaVersion> | ||
6 | <ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid> | ||
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
9 | <ApplicationIcon></ApplicationIcon> | ||
10 | <AssemblyKeyContainerName> | ||
11 | </AssemblyKeyContainerName> | ||
12 | <AssemblyName>OpenSim.Framework</AssemblyName> | ||
13 | <DefaultClientScript>JScript</DefaultClientScript> | ||
14 | <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> | ||
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | ||
16 | <DelaySign>false</DelaySign> | ||
17 | <OutputType>Library</OutputType> | ||
18 | <AppDesignerFolder></AppDesignerFolder> | ||
19 | <RootNamespace>OpenSim.Framework</RootNamespace> | ||
20 | <StartupObject></StartupObject> | ||
21 | <FileUpgradeFlags> | ||
22 | </FileUpgradeFlags> | ||
23 | </PropertyGroup> | ||
24 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
25 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
26 | <BaseAddress>285212672</BaseAddress> | ||
27 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
28 | <ConfigurationOverrideFile> | ||
29 | </ConfigurationOverrideFile> | ||
30 | <DefineConstants>TRACE;DEBUG</DefineConstants> | ||
31 | <DocumentationFile></DocumentationFile> | ||
32 | <DebugSymbols>True</DebugSymbols> | ||
33 | <FileAlignment>4096</FileAlignment> | ||
34 | <Optimize>False</Optimize> | ||
35 | <OutputPath>..\..\..\bin\</OutputPath> | ||
36 | <RegisterForComInterop>False</RegisterForComInterop> | ||
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
39 | <WarningLevel>4</WarningLevel> | ||
40 | <NoWarn></NoWarn> | ||
41 | </PropertyGroup> | ||
42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
43 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
44 | <BaseAddress>285212672</BaseAddress> | ||
45 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
46 | <ConfigurationOverrideFile> | ||
47 | </ConfigurationOverrideFile> | ||
48 | <DefineConstants>TRACE</DefineConstants> | ||
49 | <DocumentationFile></DocumentationFile> | ||
50 | <DebugSymbols>False</DebugSymbols> | ||
51 | <FileAlignment>4096</FileAlignment> | ||
52 | <Optimize>True</Optimize> | ||
53 | <OutputPath>..\..\..\bin\</OutputPath> | ||
54 | <RegisterForComInterop>False</RegisterForComInterop> | ||
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
57 | <WarningLevel>4</WarningLevel> | ||
58 | <NoWarn></NoWarn> | ||
59 | </PropertyGroup> | ||
60 | <ItemGroup> | ||
61 | <Reference Include="Db4objects.Db4o.dll" > | ||
62 | <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath> | ||
63 | <Private>False</Private> | ||
64 | </Reference> | ||
65 | <Reference Include="libsecondlife.dll" > | ||
66 | <HintPath>..\..\..\bin\libsecondlife.dll</HintPath> | ||
67 | <Private>False</Private> | ||
68 | </Reference> | ||
69 | <Reference Include="System" > | ||
70 | <HintPath>System.dll</HintPath> | ||
71 | <Private>False</Private> | ||
72 | </Reference> | ||
73 | <Reference Include="System.Xml" > | ||
74 | <HintPath>System.Xml.dll</HintPath> | ||
75 | <Private>False</Private> | ||
76 | </Reference> | ||
77 | <Reference Include="XMLRPC.dll" > | ||
78 | <HintPath>..\..\..\bin\XMLRPC.dll</HintPath> | ||
79 | <Private>False</Private> | ||
80 | </Reference> | ||
81 | </ItemGroup> | ||
82 | <ItemGroup> | ||
83 | <ProjectReference Include="..\Console\OpenSim.Framework.Console.csproj"> | ||
84 | <Name>OpenSim.Framework.Console</Name> | ||
85 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> | ||
86 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
87 | <Private>False</Private> | ||
88 | </ProjectReference> | ||
89 | </ItemGroup> | ||
90 | <ItemGroup> | ||
91 | <Compile Include="AgentInventory.cs"> | ||
92 | <SubType>Code</SubType> | ||
93 | </Compile> | ||
94 | <Compile Include="AuthenticateSessionBase.cs"> | ||
95 | <SubType>Code</SubType> | ||
96 | </Compile> | ||
97 | <Compile Include="BlockingQueue.cs"> | ||
98 | <SubType>Code</SubType> | ||
99 | </Compile> | ||
100 | <Compile Include="IRegionCommsListener.cs"> | ||
101 | <SubType>Code</SubType> | ||
102 | </Compile> | ||
103 | <Compile Include="LLSDHelpers.cs"> | ||
104 | <SubType>Code</SubType> | ||
105 | </Compile> | ||
106 | <Compile Include="Logger.cs"> | ||
107 | <SubType>Code</SubType> | ||
108 | </Compile> | ||
109 | <Compile Include="LoginService.cs"> | ||
110 | <SubType>Code</SubType> | ||
111 | </Compile> | ||
112 | <Compile Include="RegionCommsListener.cs"> | ||
113 | <SubType>Code</SubType> | ||
114 | </Compile> | ||
115 | <Compile Include="Remoting.cs"> | ||
116 | <SubType>Code</SubType> | ||
117 | </Compile> | ||
118 | <Compile Include="SimProfile.cs"> | ||
119 | <SubType>Code</SubType> | ||
120 | </Compile> | ||
121 | <Compile Include="UserProfile.cs"> | ||
122 | <SubType>Code</SubType> | ||
123 | </Compile> | ||
124 | <Compile Include="Util.cs"> | ||
125 | <SubType>Code</SubType> | ||
126 | </Compile> | ||
127 | <Compile Include="Interfaces\AuthenticateResponse.cs"> | ||
128 | <SubType>Code</SubType> | ||
129 | </Compile> | ||
130 | <Compile Include="Interfaces\IAssetServer.cs"> | ||
131 | <SubType>Code</SubType> | ||
132 | </Compile> | ||
133 | <Compile Include="Interfaces\IClientAPI.cs"> | ||
134 | <SubType>Code</SubType> | ||
135 | </Compile> | ||
136 | <Compile Include="Interfaces\ILocalStorage.cs"> | ||
137 | <SubType>Code</SubType> | ||
138 | </Compile> | ||
139 | <Compile Include="Interfaces\IUserServer.cs"> | ||
140 | <SubType>Code</SubType> | ||
141 | </Compile> | ||
142 | <Compile Include="Interfaces\IWorld.cs"> | ||
143 | <SubType>Code</SubType> | ||
144 | </Compile> | ||
145 | <Compile Include="Interfaces\Config\IGenericConfig.cs"> | ||
146 | <SubType>Code</SubType> | ||
147 | </Compile> | ||
148 | <Compile Include="Interfaces\Config\IGridConfig.cs"> | ||
149 | <SubType>Code</SubType> | ||
150 | </Compile> | ||
151 | <Compile Include="Interfaces\Config\IUserConfig.cs"> | ||
152 | <SubType>Code</SubType> | ||
153 | </Compile> | ||
154 | <Compile Include="Interfaces\Scripting\IScriptAPI.cs"> | ||
155 | <SubType>Code</SubType> | ||
156 | </Compile> | ||
157 | <Compile Include="Interfaces\Scripting\IScriptEngine.cs"> | ||
158 | <SubType>Code</SubType> | ||
159 | </Compile> | ||
160 | <Compile Include="Properties\AssemblyInfo.cs"> | ||
161 | <SubType>Code</SubType> | ||
162 | </Compile> | ||
163 | <Compile Include="Types\AgentCiruitData.cs"> | ||
164 | <SubType>Code</SubType> | ||
165 | </Compile> | ||
166 | <Compile Include="Types\AgentWearable.cs"> | ||
167 | <SubType>Code</SubType> | ||
168 | </Compile> | ||
169 | <Compile Include="Types\AssetBase.cs"> | ||
170 | <SubType>Code</SubType> | ||
171 | </Compile> | ||
172 | <Compile Include="Types\AssetLandmark.cs"> | ||
173 | <SubType>Code</SubType> | ||
174 | </Compile> | ||
175 | <Compile Include="Types\AssetStorage.cs"> | ||
176 | <SubType>Code</SubType> | ||
177 | </Compile> | ||
178 | <Compile Include="Types\EstateSettings.cs"> | ||
179 | <SubType>Code</SubType> | ||
180 | </Compile> | ||
181 | <Compile Include="Types\Login.cs"> | ||
182 | <SubType>Code</SubType> | ||
183 | </Compile> | ||
184 | <Compile Include="Types\MapBlockData.cs"> | ||
185 | <SubType>Code</SubType> | ||
186 | </Compile> | ||
187 | <Compile Include="Types\NeighbourInfo.cs"> | ||
188 | <SubType>Code</SubType> | ||
189 | </Compile> | ||
190 | <Compile Include="Types\NetworkServersInfo.cs"> | ||
191 | <SubType>Code</SubType> | ||
192 | </Compile> | ||
193 | <Compile Include="Types\ParcelData.cs"> | ||
194 | <SubType>Code</SubType> | ||
195 | </Compile> | ||
196 | <Compile Include="Types\PrimData.cs"> | ||
197 | <SubType>Code</SubType> | ||
198 | </Compile> | ||
199 | <Compile Include="Types\RegionHandle.cs"> | ||
200 | <SubType>Code</SubType> | ||
201 | </Compile> | ||
202 | <Compile Include="Types\RegionInfo.cs"> | ||
203 | <SubType>Code</SubType> | ||
204 | </Compile> | ||
205 | </ItemGroup> | ||
206 | <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> | ||
207 | <PropertyGroup> | ||
208 | <PreBuildEvent> | ||
209 | </PreBuildEvent> | ||
210 | <PostBuildEvent> | ||
211 | </PostBuildEvent> | ||
212 | </PropertyGroup> | ||
213 | </Project> | ||
diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj.user b/OpenSim/Framework/General/OpenSim.Framework.csproj.user new file mode 100644 index 0000000..6841907 --- /dev/null +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj.user | |||
@@ -0,0 +1,12 @@ | |||
1 | <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
4 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
5 | <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\</ReferencePath> | ||
6 | <LastOpenVersion>8.0.50727</LastOpenVersion> | ||
7 | <ProjectView>ProjectFiles</ProjectView> | ||
8 | <ProjectTrust>0</ProjectTrust> | ||
9 | </PropertyGroup> | ||
10 | <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " /> | ||
11 | <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " /> | ||
12 | </Project> | ||
diff --git a/OpenSim/Framework/General/Properties/AssemblyInfo.cs b/OpenSim/Framework/General/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..86f5cdb --- /dev/null +++ b/OpenSim/Framework/General/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.FrameWork")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("")] | ||
12 | [assembly: AssemblyProduct("OpenSim.FrameWork")] | ||
13 | [assembly: AssemblyCopyright("Copyright © 2007")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("1.0.0.0")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Framework/General/RegionCommsListener.cs b/OpenSim/Framework/General/RegionCommsListener.cs new file mode 100644 index 0000000..bba928f --- /dev/null +++ b/OpenSim/Framework/General/RegionCommsListener.cs | |||
@@ -0,0 +1,69 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Framework.Interfaces; | ||
32 | using OpenSim.Framework.Types; | ||
33 | |||
34 | namespace OpenSim.Framework | ||
35 | { | ||
36 | public class RegionCommsListener :IRegionCommsListener | ||
37 | { | ||
38 | public event ExpectUserDelegate OnExpectUser; | ||
39 | public event GenericCall2 OnExpectChildAgent; | ||
40 | public event AgentCrossing OnAvatarCrossingIntoRegion; | ||
41 | public event UpdateNeighbours OnNeighboursUpdate; | ||
42 | |||
43 | /// <summary> | ||
44 | /// | ||
45 | /// </summary> | ||
46 | /// <param name="agent"></param> | ||
47 | /// <returns></returns> | ||
48 | public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) | ||
49 | { | ||
50 | if(OnExpectUser != null) | ||
51 | { | ||
52 | OnExpectUser(regionHandle, agent); | ||
53 | return true; | ||
54 | } | ||
55 | |||
56 | return false; | ||
57 | } | ||
58 | |||
59 | public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) | ||
60 | { | ||
61 | if (OnAvatarCrossingIntoRegion != null) | ||
62 | { | ||
63 | OnAvatarCrossingIntoRegion(regionHandle, agentID, position); | ||
64 | return true; | ||
65 | } | ||
66 | return false; | ||
67 | } | ||
68 | } | ||
69 | } | ||
diff --git a/OpenSim/Framework/General/Remoting.cs b/OpenSim/Framework/General/Remoting.cs new file mode 100644 index 0000000..e6fdf70 --- /dev/null +++ b/OpenSim/Framework/General/Remoting.cs | |||
@@ -0,0 +1,136 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using System.Security.Cryptography; | ||
32 | |||
33 | namespace OpenSim.Framework | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// NEEDS AUDIT. | ||
37 | /// </summary> | ||
38 | /// <remarks> | ||
39 | /// Suggested implementation | ||
40 | /// <para>Store two digests for each foreign host. A local copy of the local hash using the local challenge (when issued), and a local copy of the remote hash using the remote challenge.</para> | ||
41 | /// <para>When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message.</para> | ||
42 | /// <para>When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[].</para> | ||
43 | /// <para>Both hosts should be performing these operations for this to be effective.</para> | ||
44 | /// </remarks> | ||
45 | class RemoteDigest | ||
46 | { | ||
47 | private byte[] currentHash; | ||
48 | private byte[] secret; | ||
49 | |||
50 | private SHA512Managed SHA512; | ||
51 | |||
52 | /// <summary> | ||
53 | /// Initialises a new RemoteDigest authentication mechanism | ||
54 | /// </summary> | ||
55 | /// <remarks>Needs an audit by a cryptographic professional - was not "roll your own"'d by choice but rather a serious lack of decent authentication mechanisms in .NET remoting</remarks> | ||
56 | /// <param name="sharedSecret">The shared secret between systems (for inter-sim, this is provided in encrypted form during connection, for grid this is input manually in setup)</param> | ||
57 | /// <param name="salt">Binary salt - some common value - to be decided what</param> | ||
58 | /// <param name="challenge">The challenge key provided by the third party</param> | ||
59 | public RemoteDigest(string sharedSecret, byte[] salt, string challenge) | ||
60 | { | ||
61 | SHA512 = new SHA512Managed(); | ||
62 | Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret,salt); | ||
63 | secret = RFC2898.GetBytes(512); | ||
64 | ASCIIEncoding ASCII = new ASCIIEncoding(); | ||
65 | |||
66 | currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge))); | ||
67 | } | ||
68 | |||
69 | /// <summary> | ||
70 | /// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented. | ||
71 | /// </summary> | ||
72 | /// <param name="data">The incoming data</param> | ||
73 | /// <param name="digest">The remote digest</param> | ||
74 | /// <returns></returns> | ||
75 | public bool Authenticate(byte[] data, byte[] digest) | ||
76 | { | ||
77 | byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); | ||
78 | if (digest == newHash) | ||
79 | { | ||
80 | currentHash = newHash; | ||
81 | return true; | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | throw new Exception("Hash comparison failed. Key resync required."); | ||
86 | } | ||
87 | } | ||
88 | |||
89 | /// <summary> | ||
90 | /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message. | ||
91 | /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the | ||
92 | /// hashes will get out of sync and throw an exception when validation is attempted. | ||
93 | /// </summary> | ||
94 | /// <param name="data">The outgoing data</param> | ||
95 | /// <returns>The local digest</returns> | ||
96 | public byte[] Sign(byte[] data) | ||
97 | { | ||
98 | currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); | ||
99 | return currentHash; | ||
100 | } | ||
101 | |||
102 | /// <summary> | ||
103 | /// Generates a new challenge string to be issued to a foreign host. Challenges are 1024-bit (effective strength of less than 512-bits) messages generated using the Crytographic Random Number Generator. | ||
104 | /// </summary> | ||
105 | /// <returns>A 128-character hexadecimal string containing the challenge.</returns> | ||
106 | public static string GenerateChallenge() | ||
107 | { | ||
108 | RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider(); | ||
109 | byte[] bytes = new byte[64]; | ||
110 | RNG.GetBytes(bytes); | ||
111 | |||
112 | StringBuilder sb = new StringBuilder(bytes.Length * 2); | ||
113 | foreach (byte b in bytes) | ||
114 | { | ||
115 | sb.AppendFormat("{0:x2}", b); | ||
116 | } | ||
117 | return sb.ToString(); | ||
118 | } | ||
119 | |||
120 | /// <summary> | ||
121 | /// Helper function, merges two byte arrays | ||
122 | /// </summary> | ||
123 | /// <remarks>Sourced from MSDN Forum</remarks> | ||
124 | /// <param name="a">A</param> | ||
125 | /// <param name="b">B</param> | ||
126 | /// <returns>C</returns> | ||
127 | private byte[] AppendArrays(byte[] a, byte[] b) | ||
128 | { | ||
129 | byte[] c = new byte[a.Length + b.Length]; | ||
130 | Buffer.BlockCopy(a, 0, c, 0, a.Length); | ||
131 | Buffer.BlockCopy(b, 0, c, a.Length, b.Length); | ||
132 | return c; | ||
133 | } | ||
134 | |||
135 | } | ||
136 | } | ||
diff --git a/OpenSim/Framework/General/SimProfile.cs b/OpenSim/Framework/General/SimProfile.cs new file mode 100644 index 0000000..cfa5e50 --- /dev/null +++ b/OpenSim/Framework/General/SimProfile.cs | |||
@@ -0,0 +1,122 @@ | |||
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.Collections.Generic; | ||
30 | using System.Collections; | ||
31 | using System.Xml; | ||
32 | using System.Text; | ||
33 | using libsecondlife; | ||
34 | using Nwc.XmlRpc; | ||
35 | |||
36 | namespace OpenSim.Framework.Sims | ||
37 | { | ||
38 | public class SimProfile | ||
39 | { | ||
40 | public LLUUID UUID; | ||
41 | public ulong regionhandle; | ||
42 | public string regionname; | ||
43 | public string sim_ip; | ||
44 | public uint sim_port; | ||
45 | public string caps_url; | ||
46 | public uint RegionLocX; | ||
47 | public uint RegionLocY; | ||
48 | public string sendkey; | ||
49 | public string recvkey; | ||
50 | public bool online; | ||
51 | |||
52 | public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey) | ||
53 | { | ||
54 | try | ||
55 | { | ||
56 | Hashtable GridReqParams = new Hashtable(); | ||
57 | GridReqParams["region_handle"] = region_handle.ToString(); | ||
58 | GridReqParams["authkey"] = SendKey; | ||
59 | ArrayList SendParams = new ArrayList(); | ||
60 | SendParams.Add(GridReqParams); | ||
61 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); | ||
62 | |||
63 | XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); | ||
64 | |||
65 | Hashtable RespData = (Hashtable)GridResp.Value; | ||
66 | this.UUID = new LLUUID((string)RespData["UUID"]); | ||
67 | this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256)); | ||
68 | this.regionname = (string)RespData["regionname"]; | ||
69 | this.sim_ip = (string)RespData["sim_ip"]; | ||
70 | this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); | ||
71 | this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/"; | ||
72 | this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]); | ||
73 | this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]); | ||
74 | this.sendkey = SendKey; | ||
75 | this.recvkey = RecvKey; | ||
76 | } | ||
77 | catch (Exception e) | ||
78 | { | ||
79 | System.Console.WriteLine(e.ToString()); | ||
80 | } | ||
81 | return this; | ||
82 | } | ||
83 | |||
84 | public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey) | ||
85 | { | ||
86 | try | ||
87 | { | ||
88 | Hashtable GridReqParams = new Hashtable(); | ||
89 | GridReqParams["UUID"] = UUID.ToString(); | ||
90 | GridReqParams["authkey"] = SendKey; | ||
91 | ArrayList SendParams = new ArrayList(); | ||
92 | SendParams.Add(GridReqParams); | ||
93 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); | ||
94 | |||
95 | XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); | ||
96 | |||
97 | Hashtable RespData = (Hashtable)GridResp.Value; | ||
98 | this.UUID = new LLUUID((string)RespData["UUID"]); | ||
99 | this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256)); | ||
100 | this.regionname = (string)RespData["regionname"]; | ||
101 | this.sim_ip = (string)RespData["sim_ip"]; | ||
102 | this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); | ||
103 | this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/"; | ||
104 | this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]); | ||
105 | this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]); | ||
106 | this.sendkey = SendKey; | ||
107 | this.recvkey = RecvKey; | ||
108 | } | ||
109 | catch (Exception e) | ||
110 | { | ||
111 | System.Console.WriteLine(e.ToString()); | ||
112 | } | ||
113 | return this; | ||
114 | } | ||
115 | |||
116 | |||
117 | public SimProfile() | ||
118 | { | ||
119 | } | ||
120 | } | ||
121 | |||
122 | } | ||
diff --git a/OpenSim/Framework/General/Types/AgentCiruitData.cs b/OpenSim/Framework/General/Types/AgentCiruitData.cs new file mode 100644 index 0000000..a650343 --- /dev/null +++ b/OpenSim/Framework/General/Types/AgentCiruitData.cs | |||
@@ -0,0 +1,50 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | public class AgentCircuitData | ||
36 | { | ||
37 | public AgentCircuitData() { } | ||
38 | public LLUUID AgentID; | ||
39 | public LLUUID SessionID; | ||
40 | public LLUUID SecureSessionID; | ||
41 | public LLVector3 startpos; | ||
42 | public string firstname; | ||
43 | public string lastname; | ||
44 | public uint circuitcode; | ||
45 | public bool child; | ||
46 | public LLUUID InventoryFolder; | ||
47 | public LLUUID BaseFolder; | ||
48 | public string CapsPath = ""; | ||
49 | } | ||
50 | } | ||
diff --git a/OpenSim/Framework/General/Types/AgentWearable.cs b/OpenSim/Framework/General/Types/AgentWearable.cs new file mode 100644 index 0000000..4c93da7 --- /dev/null +++ b/OpenSim/Framework/General/Types/AgentWearable.cs | |||
@@ -0,0 +1,60 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | public class AvatarWearable | ||
36 | { | ||
37 | public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
38 | public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
39 | |||
40 | public AvatarWearable() | ||
41 | { | ||
42 | |||
43 | } | ||
44 | |||
45 | public static AvatarWearable[] DefaultWearables | ||
46 | { | ||
47 | get | ||
48 | { | ||
49 | AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these | ||
50 | for (int i = 0; i < 13; i++) | ||
51 | { | ||
52 | defaultWearables[i] = new AvatarWearable(); | ||
53 | } | ||
54 | defaultWearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | ||
55 | defaultWearables[0].ItemID = LLUUID.Random(); | ||
56 | return defaultWearables; | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | } | ||
diff --git a/OpenSim/Framework/General/Types/AssetBase.cs b/OpenSim/Framework/General/Types/AssetBase.cs new file mode 100644 index 0000000..86586a6 --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetBase.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 System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | public class AssetBase | ||
36 | { | ||
37 | public byte[] Data; | ||
38 | public LLUUID FullID; | ||
39 | public sbyte Type; | ||
40 | public sbyte InvType; | ||
41 | public string Name; | ||
42 | public string Description; | ||
43 | |||
44 | public AssetBase() | ||
45 | { | ||
46 | |||
47 | } | ||
48 | } | ||
49 | } | ||
diff --git a/OpenSim/Framework/General/Types/AssetLandmark.cs b/OpenSim/Framework/General/Types/AssetLandmark.cs new file mode 100644 index 0000000..8a10b70 --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetLandmark.cs | |||
@@ -0,0 +1,61 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | public class AssetLandmark : AssetBase | ||
36 | { | ||
37 | public int Version; | ||
38 | public LLVector3 Position; | ||
39 | public LLUUID RegionID; | ||
40 | |||
41 | public AssetLandmark(AssetBase a) | ||
42 | { | ||
43 | this.Data = a.Data; | ||
44 | this.FullID = a.FullID; | ||
45 | this.Type = a.Type; | ||
46 | this.InvType = a.InvType; | ||
47 | this.Name = a.Name; | ||
48 | this.Description = a.Description; | ||
49 | InternData(); | ||
50 | } | ||
51 | |||
52 | private void InternData() | ||
53 | { | ||
54 | string temp = System.Text.Encoding.UTF8.GetString(Data).Trim(); | ||
55 | string[] parts = temp.Split('\n'); | ||
56 | int.TryParse(parts[0].Substring(17, 1), out Version); | ||
57 | LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID); | ||
58 | LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position); | ||
59 | } | ||
60 | } | ||
61 | } | ||
diff --git a/OpenSim/Framework/General/Types/AssetStorage.cs b/OpenSim/Framework/General/Types/AssetStorage.cs new file mode 100644 index 0000000..8cac23a --- /dev/null +++ b/OpenSim/Framework/General/Types/AssetStorage.cs | |||
@@ -0,0 +1,50 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | public class AssetStorage | ||
36 | { | ||
37 | |||
38 | public AssetStorage() { | ||
39 | } | ||
40 | |||
41 | public AssetStorage(LLUUID assetUUID) { | ||
42 | UUID=assetUUID; | ||
43 | } | ||
44 | |||
45 | public byte[] Data; | ||
46 | public sbyte Type; | ||
47 | public string Name; | ||
48 | public LLUUID UUID; | ||
49 | } | ||
50 | } | ||
diff --git a/OpenSim/Framework/General/Types/EstateSettings.cs b/OpenSim/Framework/General/Types/EstateSettings.cs new file mode 100644 index 0000000..778c893 --- /dev/null +++ b/OpenSim/Framework/General/Types/EstateSettings.cs | |||
@@ -0,0 +1,97 @@ | |||
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 System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | |||
33 | using libsecondlife; | ||
34 | |||
35 | namespace OpenSim.Framework.Types | ||
36 | { | ||
37 | public class EstateSettings | ||
38 | { | ||
39 | //Settings to this island | ||
40 | public float billableFactor = (float)0.0; | ||
41 | public uint estateID = 0; | ||
42 | public uint parentEstateID = 0; | ||
43 | |||
44 | public byte maxAgents = 40; | ||
45 | public float objectBonusFactor = (float)1.0; | ||
46 | |||
47 | public int redirectGridX = 0; //?? | ||
48 | public int redirectGridY = 0; //?? | ||
49 | public libsecondlife.Simulator.RegionFlags regionFlags = libsecondlife.Simulator.RegionFlags.None; //Booleam values of various region settings | ||
50 | public libsecondlife.Simulator.SimAccess simAccess = libsecondlife.Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default. | ||
51 | public float sunHour = 0; | ||
52 | |||
53 | public float terrainRaiseLimit = 0; | ||
54 | public float terrainLowerLimit = 0; | ||
55 | |||
56 | public bool useFixedSun = false; | ||
57 | public int pricePerMeter = 1; | ||
58 | |||
59 | public ushort regionWaterHeight = 20; | ||
60 | public bool regionAllowTerraform = true; | ||
61 | |||
62 | // Region Information | ||
63 | // Low resolution 'base' textures. No longer used. | ||
64 | public LLUUID terrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default | ||
65 | public LLUUID terrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default | ||
66 | public LLUUID terrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default | ||
67 | public LLUUID terrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default | ||
68 | |||
69 | // Higher resolution terrain textures | ||
70 | public LLUUID terrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
71 | public LLUUID terrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
72 | public LLUUID terrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
73 | public LLUUID terrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
74 | |||
75 | // First quad - each point is bilinearly interpolated at each meter of terrain | ||
76 | public float terrainStartHeight0 = 10.0f; | ||
77 | public float terrainStartHeight1 = 10.0f; | ||
78 | public float terrainStartHeight2 = 10.0f; | ||
79 | public float terrainStartHeight3 = 10.0f; | ||
80 | |||
81 | // Second quad - also bilinearly interpolated. | ||
82 | // Terrain texturing is done that: | ||
83 | // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y] | ||
84 | public float terrainHeightRange0 = 60.0f; //00 | ||
85 | public float terrainHeightRange1 = 60.0f; //01 | ||
86 | public float terrainHeightRange2 = 60.0f; //10 | ||
87 | public float terrainHeightRange3 = 60.0f; //11 | ||
88 | |||
89 | // Terrain Default (Must be in F32 Format!) | ||
90 | public string terrainFile = "default.r32"; | ||
91 | public double terrainMultiplier = 60.0; | ||
92 | public float waterHeight = (float)20.0; | ||
93 | |||
94 | public LLUUID terrainImageID = LLUUID.Zero; // the assetID that is the current Map image for this region | ||
95 | |||
96 | } | ||
97 | } | ||
diff --git a/OpenSim/Framework/General/Types/Login.cs b/OpenSim/Framework/General/Types/Login.cs new file mode 100644 index 0000000..3180a16 --- /dev/null +++ b/OpenSim/Framework/General/Types/Login.cs | |||
@@ -0,0 +1,52 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | public class Login | ||
36 | { | ||
37 | public string First = "Test"; | ||
38 | public string Last = "User"; | ||
39 | public LLUUID Agent; | ||
40 | public LLUUID Session; | ||
41 | public LLUUID SecureSession = LLUUID.Zero; | ||
42 | public LLUUID InventoryFolder; | ||
43 | public LLUUID BaseFolder; | ||
44 | public uint CircuitCode; | ||
45 | public string CapsPath =""; | ||
46 | |||
47 | public Login() | ||
48 | { | ||
49 | |||
50 | } | ||
51 | } | ||
52 | } | ||
diff --git a/OpenSim/Framework/General/Types/MapBlockData.cs b/OpenSim/Framework/General/Types/MapBlockData.cs new file mode 100644 index 0000000..2e6f56e --- /dev/null +++ b/OpenSim/Framework/General/Types/MapBlockData.cs | |||
@@ -0,0 +1,25 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | |||
6 | namespace OpenSim.Framework.Types | ||
7 | { | ||
8 | public class MapBlockData | ||
9 | { | ||
10 | public uint Flags; | ||
11 | public ushort X; | ||
12 | public ushort Y; | ||
13 | public byte Agents; | ||
14 | public byte Access; | ||
15 | public byte WaterHeight; | ||
16 | public LLUUID MapImageId; | ||
17 | public String Name; | ||
18 | public uint RegionFlags; | ||
19 | |||
20 | public MapBlockData() | ||
21 | { | ||
22 | |||
23 | } | ||
24 | } | ||
25 | } | ||
diff --git a/OpenSim/Framework/General/Types/NeighbourInfo.cs b/OpenSim/Framework/General/Types/NeighbourInfo.cs new file mode 100644 index 0000000..310fd1c --- /dev/null +++ b/OpenSim/Framework/General/Types/NeighbourInfo.cs | |||
@@ -0,0 +1,50 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Framework.Interfaces; | ||
32 | using OpenSim.Framework.Utilities; | ||
33 | using OpenSim.Framework.Console; | ||
34 | using libsecondlife; | ||
35 | |||
36 | namespace OpenSim.Framework.Types | ||
37 | { | ||
38 | public class NeighbourInfo | ||
39 | { | ||
40 | public NeighbourInfo() | ||
41 | { | ||
42 | } | ||
43 | |||
44 | public ulong regionhandle; | ||
45 | public uint RegionLocX; | ||
46 | public uint RegionLocY; | ||
47 | public string sim_ip; | ||
48 | public uint sim_port; | ||
49 | } | ||
50 | } | ||
diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs new file mode 100644 index 0000000..73d7811 --- /dev/null +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs | |||
@@ -0,0 +1,181 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Framework.Interfaces; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | public class NetworkServersInfo | ||
36 | { | ||
37 | public string AssetURL = "http://127.0.0.1:8003/"; | ||
38 | public string AssetSendKey = ""; | ||
39 | |||
40 | public string GridURL = ""; | ||
41 | public string GridSendKey = ""; | ||
42 | public string GridRecvKey = ""; | ||
43 | public string UserURL = ""; | ||
44 | public string UserSendKey = ""; | ||
45 | public string UserRecvKey = ""; | ||
46 | public bool isSandbox; | ||
47 | |||
48 | public uint DefaultHomeLocX = 0; | ||
49 | public uint DefaultHomeLocY = 0; | ||
50 | |||
51 | public int HttpListenerPort = 9000; | ||
52 | public int RemotingListenerPort = 8895; | ||
53 | |||
54 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | ||
55 | { | ||
56 | this.isSandbox = sandboxMode; | ||
57 | |||
58 | try | ||
59 | { | ||
60 | string attri = ""; | ||
61 | |||
62 | attri = ""; | ||
63 | attri = configData.GetAttribute("HttpListenerPort"); | ||
64 | if (attri == "") | ||
65 | { | ||
66 | string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); | ||
67 | configData.SetAttribute("HttpListenerPort", location); | ||
68 | this.HttpListenerPort = Convert.ToInt32(location); | ||
69 | } | ||
70 | else | ||
71 | { | ||
72 | this.HttpListenerPort = Convert.ToInt32(attri); | ||
73 | } | ||
74 | |||
75 | attri = ""; | ||
76 | attri = configData.GetAttribute("RemotingListenerPort"); | ||
77 | if (attri == "") | ||
78 | { | ||
79 | string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); | ||
80 | configData.SetAttribute("RemotingListenerPort", location); | ||
81 | this.RemotingListenerPort = Convert.ToInt32(location); | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | this.RemotingListenerPort = Convert.ToInt32(attri); | ||
86 | } | ||
87 | |||
88 | if (sandboxMode) | ||
89 | { | ||
90 | // default home location X | ||
91 | attri = ""; | ||
92 | attri = configData.GetAttribute("DefaultLocationX"); | ||
93 | if (attri == "") | ||
94 | { | ||
95 | string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); | ||
96 | configData.SetAttribute("DefaultLocationX", location); | ||
97 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); | ||
98 | } | ||
99 | else | ||
100 | { | ||
101 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri); | ||
102 | } | ||
103 | |||
104 | // default home location Y | ||
105 | attri = ""; | ||
106 | attri = configData.GetAttribute("DefaultLocationY"); | ||
107 | if (attri == "") | ||
108 | { | ||
109 | string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); | ||
110 | configData.SetAttribute("DefaultLocationY", location); | ||
111 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); | ||
112 | } | ||
113 | else | ||
114 | { | ||
115 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri); | ||
116 | } | ||
117 | } | ||
118 | if (!isSandbox) | ||
119 | { | ||
120 | //Grid Server | ||
121 | attri = ""; | ||
122 | attri = configData.GetAttribute("GridServerURL"); | ||
123 | if (attri == "") | ||
124 | { | ||
125 | this.GridURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); | ||
126 | configData.SetAttribute("GridServerURL", this.GridURL); | ||
127 | } | ||
128 | else | ||
129 | { | ||
130 | this.GridURL = attri; | ||
131 | } | ||
132 | |||
133 | //Grid Send Key | ||
134 | attri = ""; | ||
135 | attri = configData.GetAttribute("GridSendKey"); | ||
136 | if (attri == "") | ||
137 | { | ||
138 | this.GridSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); | ||
139 | configData.SetAttribute("GridSendKey", this.GridSendKey); | ||
140 | } | ||
141 | else | ||
142 | { | ||
143 | this.GridSendKey = attri; | ||
144 | } | ||
145 | |||
146 | //Grid Receive Key | ||
147 | attri = ""; | ||
148 | attri = configData.GetAttribute("GridRecvKey"); | ||
149 | if (attri == "") | ||
150 | { | ||
151 | this.GridRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); | ||
152 | configData.SetAttribute("GridRecvKey", this.GridRecvKey); | ||
153 | } | ||
154 | else | ||
155 | { | ||
156 | this.GridRecvKey = attri; | ||
157 | } | ||
158 | |||
159 | attri = ""; | ||
160 | attri = configData.GetAttribute("AssetServerURL"); | ||
161 | if (attri == "") | ||
162 | { | ||
163 | this.AssetURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); | ||
164 | configData.SetAttribute("AssetServerURL", this.GridURL); | ||
165 | } | ||
166 | else | ||
167 | { | ||
168 | this.AssetURL = attri; | ||
169 | } | ||
170 | |||
171 | } | ||
172 | configData.Commit(); | ||
173 | } | ||
174 | catch (Exception e) | ||
175 | { | ||
176 | OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | ||
177 | OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); | ||
178 | } | ||
179 | } | ||
180 | } | ||
181 | } | ||
diff --git a/OpenSim/Framework/General/Types/ParcelData.cs b/OpenSim/Framework/General/Types/ParcelData.cs new file mode 100644 index 0000000..40f128a --- /dev/null +++ b/OpenSim/Framework/General/Types/ParcelData.cs | |||
@@ -0,0 +1,115 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | |||
36 | public class ParcelData | ||
37 | { | ||
38 | public byte[] parcelBitmapByteArray = new byte[512]; | ||
39 | public string parcelName = ""; | ||
40 | public string parcelDesc = ""; | ||
41 | public LLUUID ownerID = new LLUUID(); | ||
42 | public bool isGroupOwned = false; | ||
43 | public LLVector3 AABBMin = new LLVector3(); | ||
44 | public LLVector3 AABBMax = new LLVector3(); | ||
45 | public int area = 0; | ||
46 | public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned | ||
47 | public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID | ||
48 | public libsecondlife.Parcel.ParcelCategory category = new libsecondlife.Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category | ||
49 | public int claimDate = 0; //Unemplemented | ||
50 | public int claimPrice = 0; //Unemplemented | ||
51 | public LLUUID groupID = new LLUUID(); //Unemplemented | ||
52 | public int groupPrims = 0; //Unemplemented | ||
53 | public int salePrice = 0; //Unemeplemented. Parcels price. | ||
54 | public libsecondlife.Parcel.ParcelStatus parcelStatus = libsecondlife.Parcel.ParcelStatus.None; | ||
55 | public libsecondlife.Parcel.ParcelFlags parcelFlags = libsecondlife.Parcel.ParcelFlags.None; | ||
56 | public byte landingType = 0; | ||
57 | public byte mediaAutoScale = 0; | ||
58 | public LLUUID mediaID = LLUUID.Zero; | ||
59 | public int localID = 0; | ||
60 | public LLUUID globalID = new LLUUID(); | ||
61 | |||
62 | public string mediaURL = ""; | ||
63 | public string musicURL = ""; | ||
64 | public float passHours = 0; | ||
65 | public int passPrice = 0; | ||
66 | public LLUUID snapshotID = LLUUID.Zero; | ||
67 | public LLVector3 userLocation = new LLVector3(); | ||
68 | public LLVector3 userLookAt = new LLVector3(); | ||
69 | |||
70 | public ParcelData() | ||
71 | { | ||
72 | globalID = LLUUID.Random(); | ||
73 | } | ||
74 | |||
75 | public ParcelData Copy() | ||
76 | { | ||
77 | ParcelData parcelData = new ParcelData(); | ||
78 | |||
79 | parcelData.AABBMax = this.AABBMax; | ||
80 | parcelData.AABBMin = this.AABBMin; | ||
81 | parcelData.area = this.area; | ||
82 | parcelData.auctionID = this.auctionID; | ||
83 | parcelData.authBuyerID = this.authBuyerID; | ||
84 | parcelData.category = this.category; | ||
85 | parcelData.claimDate = this.claimDate; | ||
86 | parcelData.claimPrice = this.claimPrice; | ||
87 | parcelData.globalID = this.globalID; | ||
88 | parcelData.groupID = this.groupID; | ||
89 | parcelData.groupPrims = this.groupPrims; | ||
90 | parcelData.isGroupOwned = this.isGroupOwned; | ||
91 | parcelData.localID = this.localID; | ||
92 | parcelData.landingType = this.landingType; | ||
93 | parcelData.mediaAutoScale = this.mediaAutoScale; | ||
94 | parcelData.mediaID = this.mediaID; | ||
95 | parcelData.mediaURL = this.mediaURL; | ||
96 | parcelData.musicURL = this.musicURL; | ||
97 | parcelData.ownerID = this.ownerID; | ||
98 | parcelData.parcelBitmapByteArray = (byte[])this.parcelBitmapByteArray.Clone(); | ||
99 | parcelData.parcelDesc = this.parcelDesc; | ||
100 | parcelData.parcelFlags = this.parcelFlags; | ||
101 | parcelData.parcelName = this.parcelName; | ||
102 | parcelData.parcelStatus = this.parcelStatus; | ||
103 | parcelData.passHours = this.passHours; | ||
104 | parcelData.passPrice = this.passPrice; | ||
105 | parcelData.salePrice = this.salePrice; | ||
106 | parcelData.snapshotID = this.snapshotID; | ||
107 | parcelData.userLocation = this.userLocation; | ||
108 | parcelData.userLookAt = this.userLookAt; | ||
109 | |||
110 | return parcelData; | ||
111 | |||
112 | } | ||
113 | } | ||
114 | |||
115 | } | ||
diff --git a/OpenSim/Framework/General/Types/PrimData.cs b/OpenSim/Framework/General/Types/PrimData.cs new file mode 100644 index 0000000..f84ae3e --- /dev/null +++ b/OpenSim/Framework/General/Types/PrimData.cs | |||
@@ -0,0 +1,230 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace OpenSim.Framework.Types | ||
34 | { | ||
35 | public class PrimData | ||
36 | { | ||
37 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | ||
38 | |||
39 | public LLUUID OwnerID; | ||
40 | public byte PCode; | ||
41 | public ushort PathBegin; | ||
42 | public ushort PathEnd; | ||
43 | public byte PathScaleX; | ||
44 | public byte PathScaleY; | ||
45 | public byte PathShearX; | ||
46 | public byte PathShearY; | ||
47 | public sbyte PathSkew; | ||
48 | public ushort ProfileBegin; | ||
49 | public ushort ProfileEnd; | ||
50 | public LLVector3 Scale; | ||
51 | public byte PathCurve; | ||
52 | public byte ProfileCurve; | ||
53 | public uint ParentID = 0; | ||
54 | public ushort ProfileHollow; | ||
55 | public sbyte PathRadiusOffset; | ||
56 | public byte PathRevolutions; | ||
57 | public sbyte PathTaperX; | ||
58 | public sbyte PathTaperY; | ||
59 | public sbyte PathTwist; | ||
60 | public sbyte PathTwistBegin; | ||
61 | public byte[] TextureEntry; // a LL textureEntry in byte[] format | ||
62 | |||
63 | public Int32 CreationDate; | ||
64 | public uint OwnerMask = FULL_MASK_PERMISSIONS; | ||
65 | public uint NextOwnerMask = FULL_MASK_PERMISSIONS; | ||
66 | public uint GroupMask = FULL_MASK_PERMISSIONS; | ||
67 | public uint EveryoneMask = FULL_MASK_PERMISSIONS; | ||
68 | public uint BaseMask = FULL_MASK_PERMISSIONS; | ||
69 | |||
70 | //following only used during prim storage | ||
71 | public LLVector3 Position; | ||
72 | public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0); | ||
73 | public uint LocalID; | ||
74 | public LLUUID FullID; | ||
75 | |||
76 | public PrimData() | ||
77 | { | ||
78 | |||
79 | } | ||
80 | |||
81 | public PrimData(byte[] data) | ||
82 | { | ||
83 | int i = 0; | ||
84 | |||
85 | this.OwnerID = new LLUUID(data, i); i += 16; | ||
86 | this.PCode = data[i++]; | ||
87 | this.PathBegin = (ushort)(data[i++] + (data[i++] << 8)); | ||
88 | this.PathEnd = (ushort)(data[i++] + (data[i++] << 8)); | ||
89 | this.PathScaleX = data[i++]; | ||
90 | this.PathScaleY = data[i++]; | ||
91 | this.PathShearX = data[i++]; | ||
92 | this.PathShearY = data[i++]; | ||
93 | this.PathSkew = (sbyte)data[i++]; | ||
94 | this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8)); | ||
95 | this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8)); | ||
96 | this.Scale = new LLVector3(data, i); i += 12; | ||
97 | this.PathCurve = data[i++]; | ||
98 | this.ProfileCurve = data[i++]; | ||
99 | this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
100 | this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8)); | ||
101 | this.PathRadiusOffset = (sbyte)data[i++]; | ||
102 | this.PathRevolutions = data[i++]; | ||
103 | this.PathTaperX = (sbyte)data[i++]; | ||
104 | this.PathTaperY = (sbyte)data[i++]; | ||
105 | this.PathTwist = (sbyte)data[i++]; | ||
106 | this.PathTwistBegin = (sbyte)data[i++]; | ||
107 | ushort length = (ushort)(data[i++] + (data[i++] << 8)); | ||
108 | this.TextureEntry = new byte[length]; | ||
109 | Array.Copy(data, i, TextureEntry, 0, length); i += length; | ||
110 | this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
111 | this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
112 | this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
113 | this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
114 | this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
115 | this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
116 | this.Position = new LLVector3(data, i); i += 12; | ||
117 | this.Rotation = new LLQuaternion(data, i, true); i += 12; | ||
118 | this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
119 | this.FullID = new LLUUID(data, i); i += 16; | ||
120 | |||
121 | } | ||
122 | |||
123 | public byte[] ToBytes() | ||
124 | { | ||
125 | int i = 0; | ||
126 | byte[] bytes = new byte[126 + TextureEntry.Length]; | ||
127 | Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16; | ||
128 | bytes[i++] = this.PCode; | ||
129 | bytes[i++] = (byte)(this.PathBegin % 256); | ||
130 | bytes[i++] = (byte)((this.PathBegin >> 8) % 256); | ||
131 | bytes[i++] = (byte)(this.PathEnd % 256); | ||
132 | bytes[i++] = (byte)((this.PathEnd >> 8) % 256); | ||
133 | bytes[i++] = this.PathScaleX; | ||
134 | bytes[i++] = this.PathScaleY; | ||
135 | bytes[i++] = this.PathShearX; | ||
136 | bytes[i++] = this.PathShearY; | ||
137 | bytes[i++] = (byte)this.PathSkew; | ||
138 | bytes[i++] = (byte)(this.ProfileBegin % 256); | ||
139 | bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256); | ||
140 | bytes[i++] = (byte)(this.ProfileEnd % 256); | ||
141 | bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256); | ||
142 | Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12; | ||
143 | bytes[i++] = this.PathCurve; | ||
144 | bytes[i++] = this.ProfileCurve; | ||
145 | bytes[i++] = (byte)(ParentID % 256); | ||
146 | bytes[i++] = (byte)((ParentID >> 8) % 256); | ||
147 | bytes[i++] = (byte)((ParentID >> 16) % 256); | ||
148 | bytes[i++] = (byte)((ParentID >> 24) % 256); | ||
149 | bytes[i++] = (byte)(this.ProfileHollow % 256); | ||
150 | bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256); | ||
151 | bytes[i++] = ((byte)this.PathRadiusOffset); | ||
152 | bytes[i++] = this.PathRevolutions; | ||
153 | bytes[i++] = ((byte)this.PathTaperX); | ||
154 | bytes[i++] = ((byte)this.PathTaperY); | ||
155 | bytes[i++] = ((byte)this.PathTwist); | ||
156 | bytes[i++] = ((byte)this.PathTwistBegin); | ||
157 | bytes[i++] = (byte)(TextureEntry.Length % 256); | ||
158 | bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256); | ||
159 | Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length; | ||
160 | bytes[i++] = (byte)(this.CreationDate % 256); | ||
161 | bytes[i++] = (byte)((this.CreationDate >> 8) % 256); | ||
162 | bytes[i++] = (byte)((this.CreationDate >> 16) % 256); | ||
163 | bytes[i++] = (byte)((this.CreationDate >> 24) % 256); | ||
164 | bytes[i++] = (byte)(this.OwnerMask % 256); | ||
165 | bytes[i++] = (byte)((this.OwnerMask >> 8) % 256); | ||
166 | bytes[i++] = (byte)((this.OwnerMask >> 16) % 256); | ||
167 | bytes[i++] = (byte)((this.OwnerMask >> 24) % 256); | ||
168 | bytes[i++] = (byte)(this.NextOwnerMask % 256); | ||
169 | bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256); | ||
170 | bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256); | ||
171 | bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256); | ||
172 | bytes[i++] = (byte)(this.GroupMask % 256); | ||
173 | bytes[i++] = (byte)((this.GroupMask >> 8) % 256); | ||
174 | bytes[i++] = (byte)((this.GroupMask >> 16) % 256); | ||
175 | bytes[i++] = (byte)((this.GroupMask >> 24) % 256); | ||
176 | bytes[i++] = (byte)(this.EveryoneMask % 256); | ||
177 | bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256); | ||
178 | bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256); | ||
179 | bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256); | ||
180 | bytes[i++] = (byte)(this.BaseMask % 256); | ||
181 | bytes[i++] = (byte)((this.BaseMask >> 8) % 256); | ||
182 | bytes[i++] = (byte)((this.BaseMask >> 16) % 256); | ||
183 | bytes[i++] = (byte)((this.BaseMask >> 24) % 256); | ||
184 | Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; | ||
185 | if (this.Rotation == new LLQuaternion(0, 0, 0, 0)) | ||
186 | { | ||
187 | this.Rotation = new LLQuaternion(0, 1, 0, 0); | ||
188 | } | ||
189 | Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12; | ||
190 | bytes[i++] = (byte)(this.LocalID % 256); | ||
191 | bytes[i++] = (byte)((this.LocalID >> 8) % 256); | ||
192 | bytes[i++] = (byte)((this.LocalID >> 16) % 256); | ||
193 | bytes[i++] = (byte)((this.LocalID >> 24) % 256); | ||
194 | Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16; | ||
195 | |||
196 | return bytes; | ||
197 | } | ||
198 | |||
199 | public static PrimData DefaultCube() | ||
200 | { | ||
201 | PrimData primData = new PrimData(); | ||
202 | primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
203 | primData.FullID = LLUUID.Random(); | ||
204 | primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | ||
205 | primData.Rotation = new LLQuaternion(0, 0, 0, 1); | ||
206 | primData.PCode = 9; | ||
207 | primData.ParentID = 0; | ||
208 | primData.PathBegin = 0; | ||
209 | primData.PathEnd = 0; | ||
210 | primData.PathScaleX = 0; | ||
211 | primData.PathScaleY = 0; | ||
212 | primData.PathShearX = 0; | ||
213 | primData.PathShearY = 0; | ||
214 | primData.PathSkew = 0; | ||
215 | primData.ProfileBegin = 0; | ||
216 | primData.ProfileEnd = 0; | ||
217 | primData.PathCurve = 16; | ||
218 | primData.ProfileCurve = 1; | ||
219 | primData.ProfileHollow = 0; | ||
220 | primData.PathRadiusOffset = 0; | ||
221 | primData.PathRevolutions = 0; | ||
222 | primData.PathTaperX = 0; | ||
223 | primData.PathTaperY = 0; | ||
224 | primData.PathTwist = 0; | ||
225 | primData.PathTwistBegin = 0; | ||
226 | |||
227 | return primData; | ||
228 | } | ||
229 | } | ||
230 | } | ||
diff --git a/OpenSim/Framework/General/Types/RegionHandle.cs b/OpenSim/Framework/General/Types/RegionHandle.cs new file mode 100644 index 0000000..1271d04 --- /dev/null +++ b/OpenSim/Framework/General/Types/RegionHandle.cs | |||
@@ -0,0 +1,120 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Net; | ||
5 | |||
6 | namespace OpenSim.Framework.Types | ||
7 | { | ||
8 | /// <summary> | ||
9 | /// A class for manipulating RegionHandle coordinates | ||
10 | /// </summary> | ||
11 | class RegionHandle | ||
12 | { | ||
13 | private UInt64 handle; | ||
14 | |||
15 | /// <summary> | ||
16 | /// Initialises a new grid-aware RegionHandle | ||
17 | /// </summary> | ||
18 | /// <param name="ip">IP Address of the Grid Server for this region</param> | ||
19 | /// <param name="x">Grid X Coordinate</param> | ||
20 | /// <param name="y">Grid Y Coordinate</param> | ||
21 | public RegionHandle(string ip, short x, short y) | ||
22 | { | ||
23 | IPAddress addr = IPAddress.Parse(ip); | ||
24 | |||
25 | long baseHandle = addr.Address; | ||
26 | |||
27 | // Split the IP address in half | ||
28 | short a = (short)((baseHandle << 16) & 0xFFFF); | ||
29 | short b = (short)((baseHandle << 0) & 0xFFFF); | ||
30 | |||
31 | // Raise the bounds a little | ||
32 | uint nx = (uint)x; | ||
33 | uint ny = (uint)y; | ||
34 | |||
35 | // Multiply grid coords to get region coords | ||
36 | nx *= 256; | ||
37 | ny *= 256; | ||
38 | |||
39 | // Stuff the IP address in too | ||
40 | nx = (uint)a << 16; | ||
41 | ny = (uint)b << 16; | ||
42 | |||
43 | handle = ((UInt64)nx << 32) | (uint)ny; | ||
44 | } | ||
45 | |||
46 | /// <summary> | ||
47 | /// Initialises a new RegionHandle that is not inter-grid aware | ||
48 | /// </summary> | ||
49 | /// <param name="x">Grid X Coordinate</param> | ||
50 | /// <param name="y">Grid Y Coordinate</param> | ||
51 | public RegionHandle(uint x, uint y) | ||
52 | { | ||
53 | handle = ((x * 256) << 32) | (y * 256); | ||
54 | } | ||
55 | |||
56 | /// <summary> | ||
57 | /// Initialises a new RegionHandle from an existing value | ||
58 | /// </summary> | ||
59 | /// <param name="Region">A U64 RegionHandle</param> | ||
60 | public RegionHandle(UInt64 Region) | ||
61 | { | ||
62 | handle = Region; | ||
63 | } | ||
64 | |||
65 | /// <summary> | ||
66 | /// Returns the Grid Masked RegionHandle - For use in Teleport packets and other packets where sending the grid IP address may be handy. | ||
67 | /// </summary> | ||
68 | /// <remarks>Do not use for SimulatorEnable packets. The client will choke.</remarks> | ||
69 | /// <returns>Region Handle including IP Address encoding</returns> | ||
70 | public UInt64 getTeleportHandle() | ||
71 | { | ||
72 | return handle; | ||
73 | } | ||
74 | |||
75 | /// <summary> | ||
76 | /// Returns a RegionHandle which may be used for SimulatorEnable packets. Removes the IP address encoding and returns the lower bounds. | ||
77 | /// </summary> | ||
78 | /// <returns>A U64 RegionHandle for use in SimulatorEnable packets.</returns> | ||
79 | public UInt64 getNeighbourHandle() | ||
80 | { | ||
81 | UInt64 mask = 0x0000FFFF0000FFFF; | ||
82 | |||
83 | return handle | mask; | ||
84 | } | ||
85 | |||
86 | /// <summary> | ||
87 | /// Returns the IP Address of the GridServer from a Grid-Encoded RegionHandle | ||
88 | /// </summary> | ||
89 | /// <returns>Grid Server IP Address</returns> | ||
90 | public IPAddress getGridIP() | ||
91 | { | ||
92 | uint a = (uint)((handle >> 16) & 0xFFFF); | ||
93 | uint b = (uint)((handle >> 48) & 0xFFFF); | ||
94 | |||
95 | return new IPAddress((long)(a << 16) | (long)b); | ||
96 | } | ||
97 | |||
98 | /// <summary> | ||
99 | /// Returns the X Coordinate from a Grid-Encoded RegionHandle | ||
100 | /// </summary> | ||
101 | /// <returns>X Coordinate</returns> | ||
102 | public uint getGridX() | ||
103 | { | ||
104 | uint x = (uint)((handle >> 32) & 0xFFFF); | ||
105 | |||
106 | return x; | ||
107 | } | ||
108 | |||
109 | /// <summary> | ||
110 | /// Returns the Y Coordinate from a Grid-Encoded RegionHandle | ||
111 | /// </summary> | ||
112 | /// <returns>Y Coordinate</returns> | ||
113 | public uint getGridY() | ||
114 | { | ||
115 | uint y = (uint)((handle >> 0) & 0xFFFF); | ||
116 | |||
117 | return y; | ||
118 | } | ||
119 | } | ||
120 | } | ||
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs new file mode 100644 index 0000000..48e6922 --- /dev/null +++ b/OpenSim/Framework/General/Types/RegionInfo.cs | |||
@@ -0,0 +1,304 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using System.Globalization; | ||
32 | using OpenSim.Framework.Interfaces; | ||
33 | using OpenSim.Framework.Utilities; | ||
34 | using OpenSim.Framework.Console; | ||
35 | using libsecondlife; | ||
36 | |||
37 | namespace OpenSim.Framework.Types | ||
38 | { | ||
39 | public class RegionInfo | ||
40 | { | ||
41 | public LLUUID SimUUID = new LLUUID(); | ||
42 | public string RegionName = ""; | ||
43 | public uint RegionLocX = 0; | ||
44 | public uint RegionLocY = 0; | ||
45 | public ulong RegionHandle = 0; | ||
46 | |||
47 | public string DataStore = ""; | ||
48 | public bool isSandbox = false; | ||
49 | |||
50 | public LLUUID MasterAvatarAssignedUUID = new LLUUID(); | ||
51 | public string MasterAvatarFirstName = ""; | ||
52 | public string MasterAvatarLastName = ""; | ||
53 | public string MasterAvatarSandboxPassword = ""; | ||
54 | |||
55 | /// <summary> | ||
56 | /// Port used for listening (TCP and UDP) | ||
57 | /// </summary> | ||
58 | /// <remarks>Seperate TCP and UDP</remarks> | ||
59 | public int CommsIPListenPort = 0; | ||
60 | /// <summary> | ||
61 | /// Address used for internal listening (default: 0.0.0.0?) | ||
62 | /// </summary> | ||
63 | public string CommsIPListenAddr = ""; | ||
64 | /// <summary> | ||
65 | /// Address used for external addressing (DNS or IP) | ||
66 | /// </summary> | ||
67 | public string CommsExternalAddress = ""; | ||
68 | |||
69 | |||
70 | public EstateSettings estateSettings; | ||
71 | |||
72 | public RegionInfo() | ||
73 | { | ||
74 | estateSettings = new EstateSettings(); | ||
75 | } | ||
76 | |||
77 | |||
78 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | ||
79 | { | ||
80 | this.isSandbox = sandboxMode; | ||
81 | try | ||
82 | { | ||
83 | // Sim UUID | ||
84 | string attri = ""; | ||
85 | attri = configData.GetAttribute("SimUUID"); | ||
86 | if (attri == "") | ||
87 | { | ||
88 | this.SimUUID = LLUUID.Random(); | ||
89 | configData.SetAttribute("SimUUID", this.SimUUID.ToString()); | ||
90 | } | ||
91 | else | ||
92 | { | ||
93 | this.SimUUID = new LLUUID(attri); | ||
94 | } | ||
95 | |||
96 | // Sim name | ||
97 | attri = ""; | ||
98 | attri = configData.GetAttribute("SimName"); | ||
99 | if (attri == "") | ||
100 | { | ||
101 | this.RegionName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Name", "OpenSim test"); | ||
102 | configData.SetAttribute("SimName", this.RegionName); | ||
103 | } | ||
104 | else | ||
105 | { | ||
106 | this.RegionName = attri; | ||
107 | } | ||
108 | // Sim/Grid location X | ||
109 | attri = ""; | ||
110 | attri = configData.GetAttribute("SimLocationX"); | ||
111 | if (attri == "") | ||
112 | { | ||
113 | string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location X", "997"); | ||
114 | configData.SetAttribute("SimLocationX", location); | ||
115 | this.RegionLocX = (uint)Convert.ToUInt32(location); | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | this.RegionLocX = (uint)Convert.ToUInt32(attri); | ||
120 | } | ||
121 | // Sim/Grid location Y | ||
122 | attri = ""; | ||
123 | attri = configData.GetAttribute("SimLocationY"); | ||
124 | if (attri == "") | ||
125 | { | ||
126 | string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location Y", "996"); | ||
127 | configData.SetAttribute("SimLocationY", location); | ||
128 | this.RegionLocY = (uint)Convert.ToUInt32(location); | ||
129 | } | ||
130 | else | ||
131 | { | ||
132 | this.RegionLocY = (uint)Convert.ToUInt32(attri); | ||
133 | } | ||
134 | |||
135 | // Local storage datastore | ||
136 | attri = ""; | ||
137 | attri = configData.GetAttribute("Datastore"); | ||
138 | if (attri == "") | ||
139 | { | ||
140 | string datastore = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Filename for local storage", "localworld.yap"); | ||
141 | configData.SetAttribute("Datastore", datastore); | ||
142 | this.DataStore = datastore; | ||
143 | } | ||
144 | else | ||
145 | { | ||
146 | this.DataStore = attri; | ||
147 | } | ||
148 | |||
149 | //Sim Listen Port | ||
150 | attri = ""; | ||
151 | attri = configData.GetAttribute("SimListenPort"); | ||
152 | if (attri == "") | ||
153 | { | ||
154 | string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000"); | ||
155 | configData.SetAttribute("SimListenPort", port); | ||
156 | this.CommsIPListenPort = Convert.ToInt32(port); | ||
157 | } | ||
158 | else | ||
159 | { | ||
160 | this.CommsIPListenPort = Convert.ToInt32(attri); | ||
161 | } | ||
162 | |||
163 | //Sim Listen Address | ||
164 | attri = ""; | ||
165 | attri = configData.GetAttribute("SimListenAddress"); | ||
166 | if (attri == "") | ||
167 | { | ||
168 | this.CommsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); | ||
169 | configData.SetAttribute("SimListenAddress", this.CommsIPListenAddr); | ||
170 | } | ||
171 | else | ||
172 | { | ||
173 | // Probably belongs elsewhere, but oh well. | ||
174 | if (attri.Trim().StartsWith("SYSTEMIP")) | ||
175 | { | ||
176 | string localhostname = System.Net.Dns.GetHostName(); | ||
177 | System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); | ||
178 | try | ||
179 | { | ||
180 | this.CommsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found | ||
181 | |||
182 | foreach (System.Net.IPAddress ip in ips) | ||
183 | { | ||
184 | if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) | ||
185 | { | ||
186 | this.CommsIPListenAddr = ip.ToString(); | ||
187 | break; | ||
188 | } | ||
189 | } | ||
190 | } | ||
191 | catch (Exception e) | ||
192 | { | ||
193 | e.ToString(); | ||
194 | this.CommsIPListenAddr = "0.0.0.0"; // Use the default if we fail | ||
195 | } | ||
196 | } | ||
197 | else | ||
198 | { | ||
199 | this.CommsIPListenAddr = attri; | ||
200 | } | ||
201 | } | ||
202 | |||
203 | // Sim External Address | ||
204 | attri = ""; | ||
205 | attri = configData.GetAttribute("SimExternalAddress"); | ||
206 | if (attri == "") | ||
207 | { | ||
208 | this.CommsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); | ||
209 | configData.SetAttribute("SimExternalAddress", this.CommsExternalAddress); | ||
210 | } | ||
211 | else | ||
212 | { | ||
213 | this.CommsExternalAddress = attri; | ||
214 | } | ||
215 | |||
216 | attri = ""; | ||
217 | attri = configData.GetAttribute("TerrainFile"); | ||
218 | if (attri == "") | ||
219 | { | ||
220 | this.estateSettings.terrainFile = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32"); | ||
221 | configData.SetAttribute("TerrainFile", this.estateSettings.terrainFile); | ||
222 | } | ||
223 | else | ||
224 | { | ||
225 | this.estateSettings.terrainFile = attri; | ||
226 | } | ||
227 | |||
228 | attri = ""; | ||
229 | attri = configData.GetAttribute("TerrainMultiplier"); | ||
230 | if (attri == "") | ||
231 | { | ||
232 | string re = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); | ||
233 | this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture); | ||
234 | configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString()); | ||
235 | } | ||
236 | else | ||
237 | { | ||
238 | this.estateSettings.terrainMultiplier = Convert.ToDouble(attri); | ||
239 | } | ||
240 | |||
241 | attri = ""; | ||
242 | attri = configData.GetAttribute("MasterAvatarFirstName"); | ||
243 | if (attri == "") | ||
244 | { | ||
245 | this.MasterAvatarFirstName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test"); | ||
246 | |||
247 | configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName); | ||
248 | } | ||
249 | else | ||
250 | { | ||
251 | this.MasterAvatarFirstName = attri; | ||
252 | } | ||
253 | |||
254 | attri = ""; | ||
255 | attri = configData.GetAttribute("MasterAvatarLastName"); | ||
256 | if (attri == "") | ||
257 | { | ||
258 | this.MasterAvatarLastName = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User"); | ||
259 | |||
260 | configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName); | ||
261 | } | ||
262 | else | ||
263 | { | ||
264 | this.MasterAvatarLastName = attri; | ||
265 | } | ||
266 | |||
267 | if (isSandbox) //Sandbox Mode Specific Settings | ||
268 | { | ||
269 | attri = ""; | ||
270 | attri = configData.GetAttribute("MasterAvatarSandboxPassword"); | ||
271 | if (attri == "") | ||
272 | { | ||
273 | this.MasterAvatarSandboxPassword = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test"); | ||
274 | |||
275 | //Should I store this? | ||
276 | configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword); | ||
277 | } | ||
278 | else | ||
279 | { | ||
280 | this.MasterAvatarSandboxPassword = attri; | ||
281 | } | ||
282 | } | ||
283 | |||
284 | this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); | ||
285 | |||
286 | configData.Commit(); | ||
287 | } | ||
288 | catch (Exception e) | ||
289 | { | ||
290 | OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | ||
291 | OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); | ||
292 | } | ||
293 | |||
294 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Sim settings loaded:"); | ||
295 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "UUID: " + this.SimUUID.ToStringHyphenated()); | ||
296 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "Name: " + this.RegionName); | ||
297 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); | ||
298 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Handle: " + this.RegionHandle.ToString()); | ||
299 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort); | ||
300 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "Sandbox Mode? " + isSandbox.ToString()); | ||
301 | |||
302 | } | ||
303 | } | ||
304 | } | ||
diff --git a/OpenSim/Framework/General/UserProfile.cs b/OpenSim/Framework/General/UserProfile.cs new file mode 100644 index 0000000..04ff20b --- /dev/null +++ b/OpenSim/Framework/General/UserProfile.cs | |||
@@ -0,0 +1,89 @@ | |||
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.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | using OpenSim.Framework.Inventory; | ||
33 | using System.Security.Cryptography; | ||
34 | |||
35 | namespace OpenSim.Framework.User | ||
36 | { | ||
37 | public class UserProfile | ||
38 | { | ||
39 | |||
40 | public string firstname; | ||
41 | public string lastname; | ||
42 | public ulong homeregionhandle; | ||
43 | public LLVector3 homepos; | ||
44 | public LLVector3 homelookat; | ||
45 | |||
46 | public bool IsGridGod = false; | ||
47 | public bool IsLocal = true; // will be used in future for visitors from foreign grids | ||
48 | public string AssetURL; | ||
49 | public string MD5passwd; | ||
50 | |||
51 | public LLUUID CurrentSessionID; | ||
52 | public LLUUID CurrentSecureSessionID; | ||
53 | public LLUUID UUID; | ||
54 | public Dictionary<LLUUID, uint> Circuits = new Dictionary<LLUUID, uint>(); // tracks circuit codes | ||
55 | |||
56 | public AgentInventory Inventory; | ||
57 | |||
58 | public UserProfile() | ||
59 | { | ||
60 | Circuits = new Dictionary<LLUUID, uint>(); | ||
61 | Inventory = new AgentInventory(); | ||
62 | homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256)); | ||
63 | homepos = new LLVector3(); | ||
64 | homelookat = new LLVector3(); | ||
65 | } | ||
66 | |||
67 | public void InitSessionData() | ||
68 | { | ||
69 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); | ||
70 | |||
71 | byte[] randDataS = new byte[16]; | ||
72 | byte[] randDataSS = new byte[16]; | ||
73 | |||
74 | rand.GetBytes(randDataS); | ||
75 | rand.GetBytes(randDataSS); | ||
76 | |||
77 | CurrentSecureSessionID = new LLUUID(randDataSS,0); | ||
78 | CurrentSessionID = new LLUUID(randDataS,0); | ||
79 | |||
80 | } | ||
81 | |||
82 | public void AddSimCircuit(uint circuitCode, LLUUID regionUUID) | ||
83 | { | ||
84 | if (this.Circuits.ContainsKey(regionUUID) == false) | ||
85 | this.Circuits.Add(regionUUID, circuitCode); | ||
86 | } | ||
87 | |||
88 | } | ||
89 | } | ||
diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs new file mode 100644 index 0000000..8c34c9b --- /dev/null +++ b/OpenSim/Framework/General/Util.cs | |||
@@ -0,0 +1,186 @@ | |||
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.Collections.Generic; | ||
31 | using System.Text; | ||
32 | using libsecondlife; | ||
33 | using libsecondlife.Packets; | ||
34 | |||
35 | namespace OpenSim.Framework.Utilities | ||
36 | { | ||
37 | public class Util | ||
38 | { | ||
39 | private static Random randomClass = new Random(); | ||
40 | private static uint nextXferID = 5000; | ||
41 | private static object XferLock = new object(); | ||
42 | |||
43 | public static ulong UIntsToLong(uint X, uint Y) | ||
44 | { | ||
45 | return Helpers.UIntsToLong(X, Y); | ||
46 | } | ||
47 | |||
48 | public static Random RandomClass | ||
49 | { | ||
50 | get | ||
51 | { | ||
52 | return randomClass; | ||
53 | } | ||
54 | } | ||
55 | |||
56 | public static uint GetNextXferID() | ||
57 | { | ||
58 | uint id = 0; | ||
59 | lock(XferLock) | ||
60 | { | ||
61 | id = nextXferID; | ||
62 | nextXferID++; | ||
63 | } | ||
64 | return id; | ||
65 | } | ||
66 | |||
67 | public static int UnixTimeSinceEpoch() | ||
68 | { | ||
69 | TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); | ||
70 | int timestamp = (int)t.TotalSeconds; | ||
71 | return timestamp; | ||
72 | } | ||
73 | |||
74 | public static string Md5Hash(string pass) | ||
75 | { | ||
76 | MD5 md5 = MD5CryptoServiceProvider.Create(); | ||
77 | byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass)); | ||
78 | StringBuilder sb = new StringBuilder(); | ||
79 | for (int i = 0; i < dataMd5.Length; i++) | ||
80 | sb.AppendFormat("{0:x2}", dataMd5[i]); | ||
81 | return sb.ToString(); | ||
82 | } | ||
83 | |||
84 | public static string GetRandomCapsPath() | ||
85 | { | ||
86 | LLUUID caps = LLUUID.Random(); | ||
87 | string capsPath = caps.ToStringHyphenated(); | ||
88 | capsPath = capsPath.Remove(capsPath.Length - 4, 4); | ||
89 | return capsPath; | ||
90 | } | ||
91 | |||
92 | //public static int fast_distance2d(int x, int y) | ||
93 | //{ | ||
94 | // x = System.Math.Abs(x); | ||
95 | // y = System.Math.Abs(y); | ||
96 | |||
97 | // int min = System.Math.Min(x, y); | ||
98 | |||
99 | // return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); | ||
100 | //} | ||
101 | |||
102 | public static string FieldToString(byte[] bytes) | ||
103 | { | ||
104 | return FieldToString(bytes, String.Empty); | ||
105 | } | ||
106 | |||
107 | /// <summary> | ||
108 | /// Convert a variable length field (byte array) to a string, with a | ||
109 | /// field name prepended to each line of the output | ||
110 | /// </summary> | ||
111 | /// <remarks>If the byte array has unprintable characters in it, a | ||
112 | /// hex dump will be put in the string instead</remarks> | ||
113 | /// <param name="bytes">The byte array to convert to a string</param> | ||
114 | /// <param name="fieldName">A field name to prepend to each line of output</param> | ||
115 | /// <returns>An ASCII string or a string containing a hex dump, minus | ||
116 | /// the null terminator</returns> | ||
117 | public static string FieldToString(byte[] bytes, string fieldName) | ||
118 | { | ||
119 | // Check for a common case | ||
120 | if (bytes.Length == 0) return String.Empty; | ||
121 | |||
122 | StringBuilder output = new StringBuilder(); | ||
123 | bool printable = true; | ||
124 | |||
125 | for (int i = 0; i < bytes.Length; ++i) | ||
126 | { | ||
127 | // Check if there are any unprintable characters in the array | ||
128 | if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09 | ||
129 | && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00) | ||
130 | { | ||
131 | printable = false; | ||
132 | break; | ||
133 | } | ||
134 | } | ||
135 | |||
136 | if (printable) | ||
137 | { | ||
138 | if (fieldName.Length > 0) | ||
139 | { | ||
140 | output.Append(fieldName); | ||
141 | output.Append(": "); | ||
142 | } | ||
143 | |||
144 | if (bytes[bytes.Length - 1] == 0x00) | ||
145 | output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1)); | ||
146 | else | ||
147 | output.Append(UTF8Encoding.UTF8.GetString(bytes)); | ||
148 | } | ||
149 | else | ||
150 | { | ||
151 | for (int i = 0; i < bytes.Length; i += 16) | ||
152 | { | ||
153 | if (i != 0) | ||
154 | output.Append(Environment.NewLine); | ||
155 | if (fieldName.Length > 0) | ||
156 | { | ||
157 | output.Append(fieldName); | ||
158 | output.Append(": "); | ||
159 | } | ||
160 | |||
161 | for (int j = 0; j < 16; j++) | ||
162 | { | ||
163 | if ((i + j) < bytes.Length) | ||
164 | output.Append(String.Format("{0:X2} ", bytes[i + j])); | ||
165 | else | ||
166 | output.Append(" "); | ||
167 | } | ||
168 | |||
169 | for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) | ||
170 | { | ||
171 | if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) | ||
172 | output.Append((char)bytes[i + j]); | ||
173 | else | ||
174 | output.Append("."); | ||
175 | } | ||
176 | } | ||
177 | } | ||
178 | |||
179 | return output.ToString(); | ||
180 | } | ||
181 | public Util() | ||
182 | { | ||
183 | |||
184 | } | ||
185 | } | ||
186 | } | ||