diff options
Diffstat (limited to 'OpenSim/Framework/General/Types')
-rw-r--r-- | OpenSim/Framework/General/Types/AgentCiruitData.cs | 50 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/AgentWearable.cs | 60 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/AssetBase.cs | 49 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/AssetLandmark.cs | 61 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/AssetStorage.cs | 50 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/EstateSettings.cs | 97 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/Login.cs | 52 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/MapBlockData.cs | 25 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/NeighbourInfo.cs | 50 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/NetworkServersInfo.cs | 181 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/ParcelData.cs | 115 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/PrimData.cs | 230 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/RegionHandle.cs | 120 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/RegionInfo.cs | 304 |
14 files changed, 1444 insertions, 0 deletions
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 | } | ||