diff options
Diffstat (limited to 'OpenSim/Framework/General/Types')
-rw-r--r-- | OpenSim/Framework/General/Types/PrimData.cs | 228 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/RegionInfo.cs | 2 |
2 files changed, 1 insertions, 229 deletions
diff --git a/OpenSim/Framework/General/Types/PrimData.cs b/OpenSim/Framework/General/Types/PrimData.cs deleted file mode 100644 index 9b24c0f..0000000 --- a/OpenSim/Framework/General/Types/PrimData.cs +++ /dev/null | |||
@@ -1,228 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework.Types | ||
32 | { | ||
33 | public class PrimData | ||
34 | { | ||
35 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | ||
36 | |||
37 | public LLUUID OwnerID; | ||
38 | public byte PCode; | ||
39 | public ushort PathBegin; | ||
40 | public ushort PathEnd; | ||
41 | public byte PathScaleX; | ||
42 | public byte PathScaleY; | ||
43 | public byte PathShearX; | ||
44 | public byte PathShearY; | ||
45 | public sbyte PathSkew; | ||
46 | public ushort ProfileBegin; | ||
47 | public ushort ProfileEnd; | ||
48 | public LLVector3 Scale; | ||
49 | public byte PathCurve; | ||
50 | public byte ProfileCurve; | ||
51 | public uint ParentID = 0; | ||
52 | public ushort ProfileHollow; | ||
53 | public sbyte PathRadiusOffset; | ||
54 | public byte PathRevolutions; | ||
55 | public sbyte PathTaperX; | ||
56 | public sbyte PathTaperY; | ||
57 | public sbyte PathTwist; | ||
58 | public sbyte PathTwistBegin; | ||
59 | public byte[] TextureEntry; // a LL textureEntry in byte[] format | ||
60 | |||
61 | public Int32 CreationDate; | ||
62 | public uint OwnerMask = FULL_MASK_PERMISSIONS; | ||
63 | public uint NextOwnerMask = FULL_MASK_PERMISSIONS; | ||
64 | public uint GroupMask = FULL_MASK_PERMISSIONS; | ||
65 | public uint EveryoneMask = FULL_MASK_PERMISSIONS; | ||
66 | public uint BaseMask = FULL_MASK_PERMISSIONS; | ||
67 | |||
68 | //following only used during prim storage | ||
69 | public LLVector3 Position; | ||
70 | public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0); | ||
71 | public uint LocalID; | ||
72 | public LLUUID FullID; | ||
73 | |||
74 | public PrimData() | ||
75 | { | ||
76 | |||
77 | } | ||
78 | |||
79 | public PrimData(byte[] data) | ||
80 | { | ||
81 | int i = 0; | ||
82 | |||
83 | this.OwnerID = new LLUUID(data, i); i += 16; | ||
84 | this.PCode = data[i++]; | ||
85 | this.PathBegin = (ushort)(data[i++] + (data[i++] << 8)); | ||
86 | this.PathEnd = (ushort)(data[i++] + (data[i++] << 8)); | ||
87 | this.PathScaleX = data[i++]; | ||
88 | this.PathScaleY = data[i++]; | ||
89 | this.PathShearX = data[i++]; | ||
90 | this.PathShearY = data[i++]; | ||
91 | this.PathSkew = (sbyte)data[i++]; | ||
92 | this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8)); | ||
93 | this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8)); | ||
94 | this.Scale = new LLVector3(data, i); i += 12; | ||
95 | this.PathCurve = data[i++]; | ||
96 | this.ProfileCurve = data[i++]; | ||
97 | this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
98 | this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8)); | ||
99 | this.PathRadiusOffset = (sbyte)data[i++]; | ||
100 | this.PathRevolutions = data[i++]; | ||
101 | this.PathTaperX = (sbyte)data[i++]; | ||
102 | this.PathTaperY = (sbyte)data[i++]; | ||
103 | this.PathTwist = (sbyte)data[i++]; | ||
104 | this.PathTwistBegin = (sbyte)data[i++]; | ||
105 | ushort length = (ushort)(data[i++] + (data[i++] << 8)); | ||
106 | this.TextureEntry = new byte[length]; | ||
107 | Array.Copy(data, i, TextureEntry, 0, length); i += length; | ||
108 | this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
109 | this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
110 | this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
111 | this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
112 | this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
113 | this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
114 | this.Position = new LLVector3(data, i); i += 12; | ||
115 | this.Rotation = new LLQuaternion(data, i, true); i += 12; | ||
116 | this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | ||
117 | this.FullID = new LLUUID(data, i); i += 16; | ||
118 | |||
119 | } | ||
120 | |||
121 | public byte[] ToBytes() | ||
122 | { | ||
123 | int i = 0; | ||
124 | byte[] bytes = new byte[126 + TextureEntry.Length]; | ||
125 | Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16; | ||
126 | bytes[i++] = this.PCode; | ||
127 | bytes[i++] = (byte)(this.PathBegin % 256); | ||
128 | bytes[i++] = (byte)((this.PathBegin >> 8) % 256); | ||
129 | bytes[i++] = (byte)(this.PathEnd % 256); | ||
130 | bytes[i++] = (byte)((this.PathEnd >> 8) % 256); | ||
131 | bytes[i++] = this.PathScaleX; | ||
132 | bytes[i++] = this.PathScaleY; | ||
133 | bytes[i++] = this.PathShearX; | ||
134 | bytes[i++] = this.PathShearY; | ||
135 | bytes[i++] = (byte)this.PathSkew; | ||
136 | bytes[i++] = (byte)(this.ProfileBegin % 256); | ||
137 | bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256); | ||
138 | bytes[i++] = (byte)(this.ProfileEnd % 256); | ||
139 | bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256); | ||
140 | Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12; | ||
141 | bytes[i++] = this.PathCurve; | ||
142 | bytes[i++] = this.ProfileCurve; | ||
143 | bytes[i++] = (byte)(ParentID % 256); | ||
144 | bytes[i++] = (byte)((ParentID >> 8) % 256); | ||
145 | bytes[i++] = (byte)((ParentID >> 16) % 256); | ||
146 | bytes[i++] = (byte)((ParentID >> 24) % 256); | ||
147 | bytes[i++] = (byte)(this.ProfileHollow % 256); | ||
148 | bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256); | ||
149 | bytes[i++] = ((byte)this.PathRadiusOffset); | ||
150 | bytes[i++] = this.PathRevolutions; | ||
151 | bytes[i++] = ((byte)this.PathTaperX); | ||
152 | bytes[i++] = ((byte)this.PathTaperY); | ||
153 | bytes[i++] = ((byte)this.PathTwist); | ||
154 | bytes[i++] = ((byte)this.PathTwistBegin); | ||
155 | bytes[i++] = (byte)(TextureEntry.Length % 256); | ||
156 | bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256); | ||
157 | Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length; | ||
158 | bytes[i++] = (byte)(this.CreationDate % 256); | ||
159 | bytes[i++] = (byte)((this.CreationDate >> 8) % 256); | ||
160 | bytes[i++] = (byte)((this.CreationDate >> 16) % 256); | ||
161 | bytes[i++] = (byte)((this.CreationDate >> 24) % 256); | ||
162 | bytes[i++] = (byte)(this.OwnerMask % 256); | ||
163 | bytes[i++] = (byte)((this.OwnerMask >> 8) % 256); | ||
164 | bytes[i++] = (byte)((this.OwnerMask >> 16) % 256); | ||
165 | bytes[i++] = (byte)((this.OwnerMask >> 24) % 256); | ||
166 | bytes[i++] = (byte)(this.NextOwnerMask % 256); | ||
167 | bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256); | ||
168 | bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256); | ||
169 | bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256); | ||
170 | bytes[i++] = (byte)(this.GroupMask % 256); | ||
171 | bytes[i++] = (byte)((this.GroupMask >> 8) % 256); | ||
172 | bytes[i++] = (byte)((this.GroupMask >> 16) % 256); | ||
173 | bytes[i++] = (byte)((this.GroupMask >> 24) % 256); | ||
174 | bytes[i++] = (byte)(this.EveryoneMask % 256); | ||
175 | bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256); | ||
176 | bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256); | ||
177 | bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256); | ||
178 | bytes[i++] = (byte)(this.BaseMask % 256); | ||
179 | bytes[i++] = (byte)((this.BaseMask >> 8) % 256); | ||
180 | bytes[i++] = (byte)((this.BaseMask >> 16) % 256); | ||
181 | bytes[i++] = (byte)((this.BaseMask >> 24) % 256); | ||
182 | Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; | ||
183 | if (this.Rotation == new LLQuaternion(0, 0, 0, 0)) | ||
184 | { | ||
185 | this.Rotation = new LLQuaternion(0, 1, 0, 0); | ||
186 | } | ||
187 | Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12; | ||
188 | bytes[i++] = (byte)(this.LocalID % 256); | ||
189 | bytes[i++] = (byte)((this.LocalID >> 8) % 256); | ||
190 | bytes[i++] = (byte)((this.LocalID >> 16) % 256); | ||
191 | bytes[i++] = (byte)((this.LocalID >> 24) % 256); | ||
192 | Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16; | ||
193 | |||
194 | return bytes; | ||
195 | } | ||
196 | |||
197 | //public static PrimData DefaultCube() | ||
198 | //{ | ||
199 | // PrimData primData = new PrimData(); | ||
200 | // primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
201 | // primData.FullID = LLUUID.Random(); | ||
202 | // primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | ||
203 | // primData.Rotation = new LLQuaternion(0, 0, 0, 1); | ||
204 | // primData.PCode = 9; | ||
205 | // primData.ParentID = 0; | ||
206 | // primData.PathBegin = 0; | ||
207 | // primData.PathEnd = 0; | ||
208 | // primData.PathScaleX = 0; | ||
209 | // primData.PathScaleY = 0; | ||
210 | // primData.PathShearX = 0; | ||
211 | // primData.PathShearY = 0; | ||
212 | // primData.PathSkew = 0; | ||
213 | // primData.ProfileBegin = 0; | ||
214 | // primData.ProfileEnd = 0; | ||
215 | // primData.PathCurve = 16; | ||
216 | // primData.ProfileCurve = 1; | ||
217 | // primData.ProfileHollow = 0; | ||
218 | // primData.PathRadiusOffset = 0; | ||
219 | // primData.PathRevolutions = 0; | ||
220 | // primData.PathTaperX = 0; | ||
221 | // primData.PathTaperY = 0; | ||
222 | // primData.PathTwist = 0; | ||
223 | // primData.PathTwistBegin = 0; | ||
224 | |||
225 | // return primData; | ||
226 | //} | ||
227 | } | ||
228 | } | ||
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index c567aa6..b7dff17 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs | |||
@@ -216,7 +216,7 @@ namespace OpenSim.Framework.Types | |||
216 | configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Simulator Name", "OpenSim Test", false); | 216 | configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Simulator Name", "OpenSim Test", false); |
217 | configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false); | 217 | configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false); |
218 | configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); | 218 | configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); |
219 | configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "localworld.yap", false); | 219 | configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); |
220 | configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); | 220 | configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); |
221 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", "9000", false); | 221 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", "9000", false); |
222 | configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); | 222 | configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); |