corrade-vassal – Diff between revs 1 and 16
?pathlinks?
Rev 1 | Rev 16 | |||
---|---|---|---|---|
1 | /* |
1 | /* |
|
2 | * Copyright (c) 2006-2014, openmetaverse.org |
2 | * Copyright (c) 2006-2014, openmetaverse.org |
|
3 | * All rights reserved. |
3 | * All rights reserved. |
|
4 | * |
4 | * |
|
5 | * - Redistribution and use in source and binary forms, with or without |
5 | * - Redistribution and use in source and binary forms, with or without |
|
6 | * modification, are permitted provided that the following conditions are met: |
6 | * modification, are permitted provided that the following conditions are met: |
|
7 | * |
7 | * |
|
8 | * - Redistributions of source code must retain the above copyright notice, this |
8 | * - Redistributions of source code must retain the above copyright notice, this |
|
9 | * list of conditions and the following disclaimer. |
9 | * list of conditions and the following disclaimer. |
|
10 | * - Neither the name of the openmetaverse.org nor the names |
10 | * - Neither the name of the openmetaverse.org nor the names |
|
11 | * of its contributors may be used to endorse or promote products derived from |
11 | * of its contributors may be used to endorse or promote products derived from |
|
12 | * this software without specific prior written permission. |
12 | * this software without specific prior written permission. |
|
13 | * |
13 | * |
|
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
|
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
24 | * POSSIBILITY OF SUCH DAMAGE. |
24 | * POSSIBILITY OF SUCH DAMAGE. |
|
25 | */ |
25 | */ |
|
26 | |
26 | |
|
27 | using System; |
27 | using System; |
|
28 | using System.Threading; |
28 | using System.Threading; |
|
29 | using System.Reflection; |
29 | using System.Reflection; |
|
30 | using System.Collections.Generic; |
30 | using System.Collections.Generic; |
|
31 | using OpenMetaverse.Http; |
31 | using OpenMetaverse.Http; |
|
32 | using OpenMetaverse.Packets; |
32 | using OpenMetaverse.Packets; |
|
33 | using OpenMetaverse.Interfaces; |
33 | using OpenMetaverse.Interfaces; |
|
34 | using OpenMetaverse.StructuredData; |
34 | using OpenMetaverse.StructuredData; |
|
35 | using OpenMetaverse.Messages.Linden; |
35 | using OpenMetaverse.Messages.Linden; |
|
36 | |
36 | |
|
37 | namespace OpenMetaverse |
37 | namespace OpenMetaverse |
|
38 | { |
38 | { |
|
39 | #region Enums |
39 | #region Enums |
|
40 | |
40 | |
|
41 | /// <summary> |
41 | /// <summary> |
|
42 | /// Type of return to use when returning objects from a parcel |
42 | /// Type of return to use when returning objects from a parcel |
|
43 | /// </summary> |
43 | /// </summary> |
|
44 | public enum ObjectReturnType : uint |
44 | public enum ObjectReturnType : uint |
|
45 | { |
45 | { |
|
46 | /// <summary></summary> |
46 | /// <summary></summary> |
|
47 | None = 0, |
47 | None = 0, |
|
48 | /// <summary>Return objects owned by parcel owner</summary> |
48 | /// <summary>Return objects owned by parcel owner</summary> |
|
49 | Owner = 1 << 1, |
49 | Owner = 1 << 1, |
|
50 | /// <summary>Return objects set to group</summary> |
50 | /// <summary>Return objects set to group</summary> |
|
51 | Group = 1 << 2, |
51 | Group = 1 << 2, |
|
52 | /// <summary>Return objects not owned by parcel owner or set to group</summary> |
52 | /// <summary>Return objects not owned by parcel owner or set to group</summary> |
|
53 | Other = 1 << 3, |
53 | Other = 1 << 3, |
|
54 | /// <summary>Return a specific list of objects on parcel</summary> |
54 | /// <summary>Return a specific list of objects on parcel</summary> |
|
55 | List = 1 << 4, |
55 | List = 1 << 4, |
|
56 | /// <summary>Return objects that are marked for-sale</summary> |
56 | /// <summary>Return objects that are marked for-sale</summary> |
|
57 | Sell = 1 << 5 |
57 | Sell = 1 << 5 |
|
58 | } |
58 | } |
|
59 | |
59 | |
|
60 | /// <summary> |
60 | /// <summary> |
|
61 | /// Blacklist/Whitelist flags used in parcels Access List |
61 | /// Blacklist/Whitelist flags used in parcels Access List |
|
62 | /// </summary> |
62 | /// </summary> |
|
63 | public enum ParcelAccessFlags : uint |
63 | public enum ParcelAccessFlags : uint |
|
64 | { |
64 | { |
|
65 | /// <summary>Agent is denied access</summary> |
65 | /// <summary>Agent is denied access</summary> |
|
66 | NoAccess = 0, |
66 | NoAccess = 0, |
|
67 | /// <summary>Agent is granted access</summary> |
67 | /// <summary>Agent is granted access</summary> |
|
68 | Access = 1 |
68 | Access = 1 |
|
69 | } |
69 | } |
|
70 | |
70 | |
|
71 | /// <summary> |
71 | /// <summary> |
|
72 | /// The result of a request for parcel properties |
72 | /// The result of a request for parcel properties |
|
73 | /// </summary> |
73 | /// </summary> |
|
74 | public enum ParcelResult : int |
74 | public enum ParcelResult : int |
|
75 | { |
75 | { |
|
76 | /// <summary>No matches were found for the request</summary> |
76 | /// <summary>No matches were found for the request</summary> |
|
77 | NoData = -1, |
77 | NoData = -1, |
|
78 | /// <summary>Request matched a single parcel</summary> |
78 | /// <summary>Request matched a single parcel</summary> |
|
79 | Single = 0, |
79 | Single = 0, |
|
80 | /// <summary>Request matched multiple parcels</summary> |
80 | /// <summary>Request matched multiple parcels</summary> |
|
81 | Multiple = 1 |
81 | Multiple = 1 |
|
82 | } |
82 | } |
|
83 | |
83 | |
|
84 | /// <summary> |
84 | /// <summary> |
|
85 | /// Flags used in the ParcelAccessListRequest packet to specify whether |
85 | /// Flags used in the ParcelAccessListRequest packet to specify whether |
|
86 | /// we want the access list (whitelist), ban list (blacklist), or both |
86 | /// we want the access list (whitelist), ban list (blacklist), or both |
|
87 | /// </summary> |
87 | /// </summary> |
|
88 | [Flags] |
88 | [Flags] |
|
89 | public enum AccessList : uint |
89 | public enum AccessList : uint |
|
90 | { |
90 | { |
|
91 | /// <summary>Request the access list</summary> |
91 | /// <summary>Request the access list</summary> |
|
92 | Access = 1 << 0, |
92 | Access = 1 << 0, |
|
93 | /// <summary>Request the ban list</summary> |
93 | /// <summary>Request the ban list</summary> |
|
94 | Ban = 1 << 1, |
94 | Ban = 1 << 1, |
|
95 | /// <summary>Request both White and Black lists</summary> |
95 | /// <summary>Request both White and Black lists</summary> |
|
96 | Both = Access | Ban |
96 | Both = Access | Ban |
|
97 | } |
97 | } |
|
98 | |
98 | |
|
99 | /// <summary> |
99 | /// <summary> |
|
100 | /// Sequence ID in ParcelPropertiesReply packets (sent when avatar |
100 | /// Sequence ID in ParcelPropertiesReply packets (sent when avatar |
|
101 | /// tries to cross a parcel border) |
101 | /// tries to cross a parcel border) |
|
102 | /// </summary> |
102 | /// </summary> |
|
103 | public enum ParcelPropertiesStatus : int |
103 | public enum ParcelPropertiesStatus : int |
|
104 | { |
104 | { |
|
105 | /// <summary>Parcel is currently selected</summary> |
105 | /// <summary>Parcel is currently selected</summary> |
|
106 | ParcelSelected = -10000, |
106 | ParcelSelected = -10000, |
|
107 | /// <summary>Parcel restricted to a group the avatar is not a |
107 | /// <summary>Parcel restricted to a group the avatar is not a |
|
108 | /// member of</summary> |
108 | /// member of</summary> |
|
109 | CollisionNotInGroup = -20000, |
109 | CollisionNotInGroup = -20000, |
|
110 | /// <summary>Avatar is banned from the parcel</summary> |
110 | /// <summary>Avatar is banned from the parcel</summary> |
|
111 | CollisionBanned = -30000, |
111 | CollisionBanned = -30000, |
|
112 | /// <summary>Parcel is restricted to an access list that the |
112 | /// <summary>Parcel is restricted to an access list that the |
|
113 | /// avatar is not on</summary> |
113 | /// avatar is not on</summary> |
|
114 | CollisionNotOnAccessList = -40000, |
114 | CollisionNotOnAccessList = -40000, |
|
115 | /// <summary>Response to hovering over a parcel</summary> |
115 | /// <summary>Response to hovering over a parcel</summary> |
|
116 | HoveredOverParcel = -50000 |
116 | HoveredOverParcel = -50000 |
|
117 | } |
117 | } |
|
118 | |
118 | |
|
119 | /// <summary> |
119 | /// <summary> |
|
120 | /// The tool to use when modifying terrain levels |
120 | /// The tool to use when modifying terrain levels |
|
121 | /// </summary> |
121 | /// </summary> |
|
122 | public enum TerraformAction : byte |
122 | public enum TerraformAction : byte |
|
123 | { |
123 | { |
|
124 | /// <summary>Level the terrain</summary> |
124 | /// <summary>Level the terrain</summary> |
|
125 | Level = 0, |
125 | Level = 0, |
|
126 | /// <summary>Raise the terrain</summary> |
126 | /// <summary>Raise the terrain</summary> |
|
127 | Raise = 1, |
127 | Raise = 1, |
|
128 | /// <summary>Lower the terrain</summary> |
128 | /// <summary>Lower the terrain</summary> |
|
129 | Lower = 2, |
129 | Lower = 2, |
|
130 | /// <summary>Smooth the terrain</summary> |
130 | /// <summary>Smooth the terrain</summary> |
|
131 | Smooth = 3, |
131 | Smooth = 3, |
|
132 | /// <summary>Add random noise to the terrain</summary> |
132 | /// <summary>Add random noise to the terrain</summary> |
|
133 | Noise = 4, |
133 | Noise = 4, |
|
134 | /// <summary>Revert terrain to simulator default</summary> |
134 | /// <summary>Revert terrain to simulator default</summary> |
|
135 | Revert = 5 |
135 | Revert = 5 |
|
136 | } |
136 | } |
|
137 | |
137 | |
|
138 | /// <summary> |
138 | /// <summary> |
|
139 | /// The tool size to use when changing terrain levels |
139 | /// The tool size to use when changing terrain levels |
|
140 | /// </summary> |
140 | /// </summary> |
|
141 | public enum TerraformBrushSize : byte |
141 | public enum TerraformBrushSize : byte |
|
142 | { |
142 | { |
|
143 | /// <summary>Small</summary> |
143 | /// <summary>Small</summary> |
|
144 | Small = 1, |
144 | Small = 1, |
|
145 | /// <summary>Medium</summary> |
145 | /// <summary>Medium</summary> |
|
146 | Medium = 2, |
146 | Medium = 2, |
|
147 | /// <summary>Large</summary> |
147 | /// <summary>Large</summary> |
|
148 | Large = 4 |
148 | Large = 4 |
|
149 | } |
149 | } |
|
150 | |
150 | |
|
151 | /// <summary> |
151 | /// <summary> |
|
152 | /// Reasons agent is denied access to a parcel on the simulator |
152 | /// Reasons agent is denied access to a parcel on the simulator |
|
153 | /// </summary> |
153 | /// </summary> |
|
154 | public enum AccessDeniedReason : byte |
154 | public enum AccessDeniedReason : byte |
|
155 | { |
155 | { |
|
156 | /// <summary>Agent is not denied, access is granted</summary> |
156 | /// <summary>Agent is not denied, access is granted</summary> |
|
157 | NotDenied = 0, |
157 | NotDenied = 0, |
|
158 | /// <summary>Agent is not a member of the group set for the parcel, or which owns the parcel</summary> |
158 | /// <summary>Agent is not a member of the group set for the parcel, or which owns the parcel</summary> |
|
159 | NotInGroup = 1, |
159 | NotInGroup = 1, |
|
160 | /// <summary>Agent is not on the parcels specific allow list</summary> |
160 | /// <summary>Agent is not on the parcels specific allow list</summary> |
|
161 | NotOnAllowList = 2, |
161 | NotOnAllowList = 2, |
|
162 | /// <summary>Agent is on the parcels ban list</summary> |
162 | /// <summary>Agent is on the parcels ban list</summary> |
|
163 | BannedFromParcel = 3, |
163 | BannedFromParcel = 3, |
|
164 | /// <summary>Unknown</summary> |
164 | /// <summary>Unknown</summary> |
|
165 | NoAccess = 4, |
165 | NoAccess = 4, |
|
166 | /// <summary>Agent is not age verified and parcel settings deny access to non age verified avatars</summary> |
166 | /// <summary>Agent is not age verified and parcel settings deny access to non age verified avatars</summary> |
|
167 | NotAgeVerified = 5 |
167 | NotAgeVerified = 5 |
|
168 | } |
168 | } |
|
169 | |
169 | |
|
170 | /// <summary> |
170 | /// <summary> |
|
171 | /// Parcel overlay type. This is used primarily for highlighting and |
171 | /// Parcel overlay type. This is used primarily for highlighting and |
|
172 | /// coloring which is why it is a single integer instead of a set of |
172 | /// coloring which is why it is a single integer instead of a set of |
|
173 | /// flags |
173 | /// flags |
|
174 | /// </summary> |
174 | /// </summary> |
|
175 | /// <remarks>These values seem to be poorly thought out. The first three |
175 | /// <remarks>These values seem to be poorly thought out. The first three |
|
176 | /// bits represent a single value, not flags. For example Auction (0x05) is |
176 | /// bits represent a single value, not flags. For example Auction (0x05) is |
|
177 | /// not a combination of OwnedByOther (0x01) and ForSale(0x04). However, |
177 | /// not a combination of OwnedByOther (0x01) and ForSale(0x04). However, |
|
178 | /// the BorderWest and BorderSouth values are bit flags that get attached |
178 | /// the BorderWest and BorderSouth values are bit flags that get attached |
|
179 | /// to the value stored in the first three bits. Bits four, five, and six |
179 | /// to the value stored in the first three bits. Bits four, five, and six |
|
180 | /// are unused</remarks> |
180 | /// are unused</remarks> |
|
181 | [Flags] |
181 | [Flags] |
|
182 | public enum ParcelOverlayType : byte |
182 | public enum ParcelOverlayType : byte |
|
183 | { |
183 | { |
|
184 | /// <summary>Public land</summary> |
184 | /// <summary>Public land</summary> |
|
185 | Public = 0, |
185 | Public = 0, |
|
186 | /// <summary>Land is owned by another avatar</summary> |
186 | /// <summary>Land is owned by another avatar</summary> |
|
187 | OwnedByOther = 1, |
187 | OwnedByOther = 1, |
|
188 | /// <summary>Land is owned by a group</summary> |
188 | /// <summary>Land is owned by a group</summary> |
|
189 | OwnedByGroup = 2, |
189 | OwnedByGroup = 2, |
|
190 | /// <summary>Land is owned by the current avatar</summary> |
190 | /// <summary>Land is owned by the current avatar</summary> |
|
191 | OwnedBySelf = 3, |
191 | OwnedBySelf = 3, |
|
192 | /// <summary>Land is for sale</summary> |
192 | /// <summary>Land is for sale</summary> |
|
193 | ForSale = 4, |
193 | ForSale = 4, |
|
194 | /// <summary>Land is being auctioned</summary> |
194 | /// <summary>Land is being auctioned</summary> |
|
195 | Auction = 5, |
195 | Auction = 5, |
|
196 | /// <summary>Land is private</summary> |
196 | /// <summary>Land is private</summary> |
|
197 | Private = 32, |
197 | Private = 32, |
|
198 | /// <summary>To the west of this area is a parcel border</summary> |
198 | /// <summary>To the west of this area is a parcel border</summary> |
|
199 | BorderWest = 64, |
199 | BorderWest = 64, |
|
200 | /// <summary>To the south of this area is a parcel border</summary> |
200 | /// <summary>To the south of this area is a parcel border</summary> |
|
201 | BorderSouth = 128 |
201 | BorderSouth = 128 |
|
202 | } |
202 | } |
|
203 | |
203 | |
|
204 | /// <summary> |
204 | /// <summary> |
|
205 | /// Various parcel properties |
205 | /// Various parcel properties |
|
206 | /// </summary> |
206 | /// </summary> |
|
207 | [Flags] |
207 | [Flags] |
|
208 | public enum ParcelFlags : uint |
208 | public enum ParcelFlags : uint |
|
209 | { |
209 | { |
|
210 | /// <summary>No flags set</summary> |
210 | /// <summary>No flags set</summary> |
|
211 | None = 0, |
211 | None = 0, |
|
212 | /// <summary>Allow avatars to fly (a client-side only restriction)</summary> |
212 | /// <summary>Allow avatars to fly (a client-side only restriction)</summary> |
|
213 | AllowFly = 1 << 0, |
213 | AllowFly = 1 << 0, |
|
214 | /// <summary>Allow foreign scripts to run</summary> |
214 | /// <summary>Allow foreign scripts to run</summary> |
|
215 | AllowOtherScripts = 1 << 1, |
215 | AllowOtherScripts = 1 << 1, |
|
216 | /// <summary>This parcel is for sale</summary> |
216 | /// <summary>This parcel is for sale</summary> |
|
217 | ForSale = 1 << 2, |
217 | ForSale = 1 << 2, |
|
218 | /// <summary>Allow avatars to create a landmark on this parcel</summary> |
218 | /// <summary>Allow avatars to create a landmark on this parcel</summary> |
|
219 | AllowLandmark = 1 << 3, |
219 | AllowLandmark = 1 << 3, |
|
220 | /// <summary>Allows all avatars to edit the terrain on this parcel</summary> |
220 | /// <summary>Allows all avatars to edit the terrain on this parcel</summary> |
|
221 | AllowTerraform = 1 << 4, |
221 | AllowTerraform = 1 << 4, |
|
222 | /// <summary>Avatars have health and can take damage on this parcel. |
222 | /// <summary>Avatars have health and can take damage on this parcel. |
|
223 | /// If set, avatars can be killed and sent home here</summary> |
223 | /// If set, avatars can be killed and sent home here</summary> |
|
224 | AllowDamage = 1 << 5, |
224 | AllowDamage = 1 << 5, |
|
225 | /// <summary>Foreign avatars can create objects here</summary> |
225 | /// <summary>Foreign avatars can create objects here</summary> |
|
226 | CreateObjects = 1 << 6, |
226 | CreateObjects = 1 << 6, |
|
227 | /// <summary>All objects on this parcel can be purchased</summary> |
227 | /// <summary>All objects on this parcel can be purchased</summary> |
|
228 | ForSaleObjects = 1 << 7, |
228 | ForSaleObjects = 1 << 7, |
|
229 | /// <summary>Access is restricted to a group</summary> |
229 | /// <summary>Access is restricted to a group</summary> |
|
230 | UseAccessGroup = 1 << 8, |
230 | UseAccessGroup = 1 << 8, |
|
231 | /// <summary>Access is restricted to a whitelist</summary> |
231 | /// <summary>Access is restricted to a whitelist</summary> |
|
232 | UseAccessList = 1 << 9, |
232 | UseAccessList = 1 << 9, |
|
233 | /// <summary>Ban blacklist is enabled</summary> |
233 | /// <summary>Ban blacklist is enabled</summary> |
|
234 | UseBanList = 1 << 10, |
234 | UseBanList = 1 << 10, |
|
235 | /// <summary>Unknown</summary> |
235 | /// <summary>Unknown</summary> |
|
236 | UsePassList = 1 << 11, |
236 | UsePassList = 1 << 11, |
|
237 | /// <summary>List this parcel in the search directory</summary> |
237 | /// <summary>List this parcel in the search directory</summary> |
|
238 | ShowDirectory = 1 << 12, |
238 | ShowDirectory = 1 << 12, |
|
239 | /// <summary>Allow personally owned parcels to be deeded to group</summary> |
239 | /// <summary>Allow personally owned parcels to be deeded to group</summary> |
|
240 | AllowDeedToGroup = 1 << 13, |
240 | AllowDeedToGroup = 1 << 13, |
|
241 | /// <summary>If Deeded, owner contributes required tier to group parcel is deeded to</summary> |
241 | /// <summary>If Deeded, owner contributes required tier to group parcel is deeded to</summary> |
|
242 | ContributeWithDeed = 1 << 14, |
242 | ContributeWithDeed = 1 << 14, |
|
243 | /// <summary>Restrict sounds originating on this parcel to the |
243 | /// <summary>Restrict sounds originating on this parcel to the |
|
244 | /// parcel boundaries</summary> |
244 | /// parcel boundaries</summary> |
|
245 | SoundLocal = 1 << 15, |
245 | SoundLocal = 1 << 15, |
|
246 | /// <summary>Objects on this parcel are sold when the land is |
246 | /// <summary>Objects on this parcel are sold when the land is |
|
247 | /// purchsaed</summary> |
247 | /// purchsaed</summary> |
|
248 | SellParcelObjects = 1 << 16, |
248 | SellParcelObjects = 1 << 16, |
|
249 | /// <summary>Allow this parcel to be published on the web</summary> |
249 | /// <summary>Allow this parcel to be published on the web</summary> |
|
250 | AllowPublish = 1 << 17, |
250 | AllowPublish = 1 << 17, |
|
251 | /// <summary>The information for this parcel is mature content</summary> |
251 | /// <summary>The information for this parcel is mature content</summary> |
|
252 | MaturePublish = 1 << 18, |
252 | MaturePublish = 1 << 18, |
|
253 | /// <summary>The media URL is an HTML page</summary> |
253 | /// <summary>The media URL is an HTML page</summary> |
|
254 | UrlWebPage = 1 << 19, |
254 | UrlWebPage = 1 << 19, |
|
255 | /// <summary>The media URL is a raw HTML string</summary> |
255 | /// <summary>The media URL is a raw HTML string</summary> |
|
256 | UrlRawHtml = 1 << 20, |
256 | UrlRawHtml = 1 << 20, |
|
257 | /// <summary>Restrict foreign object pushes</summary> |
257 | /// <summary>Restrict foreign object pushes</summary> |
|
258 | RestrictPushObject = 1 << 21, |
258 | RestrictPushObject = 1 << 21, |
|
259 | /// <summary>Ban all non identified/transacted avatars</summary> |
259 | /// <summary>Ban all non identified/transacted avatars</summary> |
|
260 | DenyAnonymous = 1 << 22, |
260 | DenyAnonymous = 1 << 22, |
|
261 | // <summary>Ban all identified avatars [OBSOLETE]</summary> |
261 | // <summary>Ban all identified avatars [OBSOLETE]</summary> |
|
262 | //[Obsolete] |
262 | //[Obsolete] |
|
263 | // This was obsoleted in 1.19.0 but appears to be recycled and is used on linden homes parcels |
263 | // This was obsoleted in 1.19.0 but appears to be recycled and is used on linden homes parcels |
|
264 | LindenHome = 1 << 23, |
264 | LindenHome = 1 << 23, |
|
265 | // <summary>Ban all transacted avatars [OBSOLETE]</summary> |
265 | // <summary>Ban all transacted avatars [OBSOLETE]</summary> |
|
266 | //[Obsolete] |
266 | //[Obsolete] |
|
267 | //DenyTransacted = 1 << 24, |
267 | //DenyTransacted = 1 << 24, |
|
268 | /// <summary>Allow group-owned scripts to run</summary> |
268 | /// <summary>Allow group-owned scripts to run</summary> |
|
269 | AllowGroupScripts = 1 << 25, |
269 | AllowGroupScripts = 1 << 25, |
|
270 | /// <summary>Allow object creation by group members or group |
270 | /// <summary>Allow object creation by group members or group |
|
271 | /// objects</summary> |
271 | /// objects</summary> |
|
272 | CreateGroupObjects = 1 << 26, |
272 | CreateGroupObjects = 1 << 26, |
|
273 | /// <summary>Allow all objects to enter this parcel</summary> |
273 | /// <summary>Allow all objects to enter this parcel</summary> |
|
274 | AllowAPrimitiveEntry = 1 << 27, |
274 | AllowAPrimitiveEntry = 1 << 27, |
|
275 | /// <summary>Only allow group and owner objects to enter this parcel</summary> |
275 | /// <summary>Only allow group and owner objects to enter this parcel</summary> |
|
276 | AllowGroupObjectEntry = 1 << 28, |
276 | AllowGroupObjectEntry = 1 << 28, |
|
277 | /// <summary>Voice Enabled on this parcel</summary> |
277 | /// <summary>Voice Enabled on this parcel</summary> |
|
278 | AllowVoiceChat = 1 << 29, |
278 | AllowVoiceChat = 1 << 29, |
|
279 | /// <summary>Use Estate Voice channel for Voice on this parcel</summary> |
279 | /// <summary>Use Estate Voice channel for Voice on this parcel</summary> |
|
280 | UseEstateVoiceChan = 1 << 30, |
280 | UseEstateVoiceChan = 1 << 30, |
|
281 | /// <summary>Deny Age Unverified Users</summary> |
281 | /// <summary>Deny Age Unverified Users</summary> |
|
282 | DenyAgeUnverified = 1U << 31 |
282 | DenyAgeUnverified = 1U << 31 |
|
283 | } |
283 | } |
|
284 | |
284 | |
|
285 | /// <summary> |
285 | /// <summary> |
|
286 | /// Parcel ownership status |
286 | /// Parcel ownership status |
|
287 | /// </summary> |
287 | /// </summary> |
|
288 | public enum ParcelStatus : sbyte |
288 | public enum ParcelStatus : sbyte |
|
289 | { |
289 | { |
|
290 | /// <summary>Placeholder</summary> |
290 | /// <summary>Placeholder</summary> |
|
291 | None = -1, |
291 | None = -1, |
|
292 | /// <summary>Parcel is leased (owned) by an avatar or group</summary> |
292 | /// <summary>Parcel is leased (owned) by an avatar or group</summary> |
|
293 | Leased = 0, |
293 | Leased = 0, |
|
294 | /// <summary>Parcel is in process of being leased (purchased) by an avatar or group</summary> |
294 | /// <summary>Parcel is in process of being leased (purchased) by an avatar or group</summary> |
|
295 | LeasePending = 1, |
295 | LeasePending = 1, |
|
296 | /// <summary>Parcel has been abandoned back to Governor Linden</summary> |
296 | /// <summary>Parcel has been abandoned back to Governor Linden</summary> |
|
297 | Abandoned = 2 |
297 | Abandoned = 2 |
|
298 | } |
298 | } |
|
299 | |
299 | |
|
300 | /// <summary> |
300 | /// <summary> |
|
301 | /// Category parcel is listed in under search |
301 | /// Category parcel is listed in under search |
|
302 | /// </summary> |
302 | /// </summary> |
|
303 | public enum ParcelCategory : sbyte |
303 | public enum ParcelCategory : sbyte |
|
304 | { |
304 | { |
|
305 | /// <summary>No assigned category</summary> |
305 | /// <summary>No assigned category</summary> |
|
306 | None = 0, |
306 | None = 0, |
|
307 | /// <summary>Linden Infohub or public area</summary> |
307 | /// <summary>Linden Infohub or public area</summary> |
|
308 | Linden, |
308 | Linden, |
|
309 | /// <summary>Adult themed area</summary> |
309 | /// <summary>Adult themed area</summary> |
|
310 | Adult, |
310 | Adult, |
|
311 | /// <summary>Arts and Culture</summary> |
311 | /// <summary>Arts and Culture</summary> |
|
312 | Arts, |
312 | Arts, |
|
313 | /// <summary>Business</summary> |
313 | /// <summary>Business</summary> |
|
314 | Business, |
314 | Business, |
|
315 | /// <summary>Educational</summary> |
315 | /// <summary>Educational</summary> |
|
316 | Educational, |
316 | Educational, |
|
317 | /// <summary>Gaming</summary> |
317 | /// <summary>Gaming</summary> |
|
318 | Gaming, |
318 | Gaming, |
|
319 | /// <summary>Hangout or Club</summary> |
319 | /// <summary>Hangout or Club</summary> |
|
320 | Hangout, |
320 | Hangout, |
|
321 | /// <summary>Newcomer friendly</summary> |
321 | /// <summary>Newcomer friendly</summary> |
|
322 | Newcomer, |
322 | Newcomer, |
|
323 | /// <summary>Parks and Nature</summary> |
323 | /// <summary>Parks and Nature</summary> |
|
324 | Park, |
324 | Park, |
|
325 | /// <summary>Residential</summary> |
325 | /// <summary>Residential</summary> |
|
326 | Residential, |
326 | Residential, |
|
327 | /// <summary>Shopping</summary> |
327 | /// <summary>Shopping</summary> |
|
328 | Shopping, |
328 | Shopping, |
|
329 | /// <summary>Not Used?</summary> |
329 | /// <summary>Not Used?</summary> |
|
330 | Stage, |
330 | Stage, |
|
331 | /// <summary>Other</summary> |
331 | /// <summary>Other</summary> |
|
332 | Other, |
332 | Other, |
|
333 | /// <summary>Not an actual category, only used for queries</summary> |
333 | /// <summary>Not an actual category, only used for queries</summary> |
|
334 | Any = -1 |
334 | Any = -1 |
|
335 | } |
335 | } |
|
336 | |
336 | |
|
337 | /// <summary> |
337 | /// <summary> |
|
338 | /// Type of teleport landing for a parcel |
338 | /// Type of teleport landing for a parcel |
|
339 | /// </summary> |
339 | /// </summary> |
|
340 | public enum LandingType : byte |
340 | public enum LandingType : byte |
|
341 | { |
341 | { |
|
342 | /// <summary>Unset, simulator default</summary> |
342 | /// <summary>Unset, simulator default</summary> |
|
343 | None = 0, |
343 | None = 0, |
|
344 | /// <summary>Specific landing point set for this parcel</summary> |
344 | /// <summary>Specific landing point set for this parcel</summary> |
|
345 | LandingPoint = 1, |
345 | LandingPoint = 1, |
|
346 | /// <summary>No landing point set, direct teleports enabled for |
346 | /// <summary>No landing point set, direct teleports enabled for |
|
347 | /// this parcel</summary> |
347 | /// this parcel</summary> |
|
348 | Direct = 2 |
348 | Direct = 2 |
|
349 | } |
349 | } |
|
350 | |
350 | |
|
351 | /// <summary> |
351 | /// <summary> |
|
352 | /// Parcel Media Command used in ParcelMediaCommandMessage |
352 | /// Parcel Media Command used in ParcelMediaCommandMessage |
|
353 | /// </summary> |
353 | /// </summary> |
|
354 | public enum ParcelMediaCommand : uint |
354 | public enum ParcelMediaCommand : uint |
|
355 | { |
355 | { |
|
356 | /// <summary>Stop the media stream and go back to the first frame</summary> |
356 | /// <summary>Stop the media stream and go back to the first frame</summary> |
|
357 | Stop = 0, |
357 | Stop = 0, |
|
358 | /// <summary>Pause the media stream (stop playing but stay on current frame)</summary> |
358 | /// <summary>Pause the media stream (stop playing but stay on current frame)</summary> |
|
359 | Pause, |
359 | Pause, |
|
360 | /// <summary>Start the current media stream playing and stop when the end is reached</summary> |
360 | /// <summary>Start the current media stream playing and stop when the end is reached</summary> |
|
361 | Play, |
361 | Play, |
|
362 | /// <summary>Start the current media stream playing, |
362 | /// <summary>Start the current media stream playing, |
|
363 | /// loop to the beginning when the end is reached and continue to play</summary> |
363 | /// loop to the beginning when the end is reached and continue to play</summary> |
|
364 | Loop, |
364 | Loop, |
|
365 | /// <summary>Specifies the texture to replace with video</summary> |
365 | /// <summary>Specifies the texture to replace with video</summary> |
|
366 | /// <remarks>If passing the key of a texture, it must be explicitly typecast as a key, |
366 | /// <remarks>If passing the key of a texture, it must be explicitly typecast as a key, |
|
367 | /// not just passed within double quotes.</remarks> |
367 | /// not just passed within double quotes.</remarks> |
|
368 | Texture, |
368 | Texture, |
|
369 | /// <summary>Specifies the movie URL (254 characters max)</summary> |
369 | /// <summary>Specifies the movie URL (254 characters max)</summary> |
|
370 | URL, |
370 | URL, |
|
371 | /// <summary>Specifies the time index at which to begin playing</summary> |
371 | /// <summary>Specifies the time index at which to begin playing</summary> |
|
372 | Time, |
372 | Time, |
|
373 | /// <summary>Specifies a single agent to apply the media command to</summary> |
373 | /// <summary>Specifies a single agent to apply the media command to</summary> |
|
374 | Agent, |
374 | Agent, |
|
375 | /// <summary>Unloads the stream. While the stop command sets the texture to the first frame of the movie, |
375 | /// <summary>Unloads the stream. While the stop command sets the texture to the first frame of the movie, |
|
376 | /// unload resets it to the real texture that the movie was replacing.</summary> |
376 | /// unload resets it to the real texture that the movie was replacing.</summary> |
|
377 | Unload, |
377 | Unload, |
|
378 | /// <summary>Turn on/off the auto align feature, similar to the auto align checkbox in the parcel media properties |
378 | /// <summary>Turn on/off the auto align feature, similar to the auto align checkbox in the parcel media properties |
|
379 | /// (NOT to be confused with the "align" function in the textures view of the editor!) Takes TRUE or FALSE as parameter.</summary> |
379 | /// (NOT to be confused with the "align" function in the textures view of the editor!) Takes TRUE or FALSE as parameter.</summary> |
|
380 | AutoAlign, |
380 | AutoAlign, |
|
381 | /// <summary>Allows a Web page or image to be placed on a prim (1.19.1 RC0 and later only). |
381 | /// <summary>Allows a Web page or image to be placed on a prim (1.19.1 RC0 and later only). |
|
382 | /// Use "text/html" for HTML.</summary> |
382 | /// Use "text/html" for HTML.</summary> |
|
383 | Type, |
383 | Type, |
|
384 | /// <summary>Resizes a Web page to fit on x, y pixels (1.19.1 RC0 and later only).</summary> |
384 | /// <summary>Resizes a Web page to fit on x, y pixels (1.19.1 RC0 and later only).</summary> |
|
385 | /// <remarks>This might still not be working</remarks> |
385 | /// <remarks>This might still not be working</remarks> |
|
386 | Size, |
386 | Size, |
|
387 | /// <summary>Sets a description for the media being displayed (1.19.1 RC0 and later only).</summary> |
387 | /// <summary>Sets a description for the media being displayed (1.19.1 RC0 and later only).</summary> |
|
388 | Desc |
388 | Desc |
|
389 | } |
389 | } |
|
390 | |
390 | |
|
391 | #endregion Enums |
391 | #endregion Enums |
|
392 | |
392 | |
|
393 | #region Structs |
393 | #region Structs |
|
394 | |
394 | |
|
395 | /// <summary> |
395 | /// <summary> |
|
396 | /// Some information about a parcel of land returned from a DirectoryManager search |
396 | /// Some information about a parcel of land returned from a DirectoryManager search |
|
397 | /// </summary> |
397 | /// </summary> |
|
398 | public struct ParcelInfo |
398 | public struct ParcelInfo |
|
399 | { |
399 | { |
|
400 | /// <summary>Global Key of record</summary> |
400 | /// <summary>Global Key of record</summary> |
|
401 | public UUID ID; |
401 | public UUID ID; |
|
402 | /// <summary>Parcel Owners <seealso cref="UUID"/></summary> |
402 | /// <summary>Parcel Owners <seealso cref="UUID"/></summary> |
|
403 | public UUID OwnerID; |
403 | public UUID OwnerID; |
|
404 | /// <summary>Name field of parcel, limited to 128 characters</summary> |
404 | /// <summary>Name field of parcel, limited to 128 characters</summary> |
|
405 | public string Name; |
405 | public string Name; |
|
406 | /// <summary>Description field of parcel, limited to 256 characters</summary> |
406 | /// <summary>Description field of parcel, limited to 256 characters</summary> |
|
407 | public string Description; |
407 | public string Description; |
|
408 | /// <summary>Total Square meters of parcel</summary> |
408 | /// <summary>Total Square meters of parcel</summary> |
|
409 | public int ActualArea; |
409 | public int ActualArea; |
|
410 | /// <summary>Total area billable as Tier, for group owned land this will be 10% less than ActualArea</summary> |
410 | /// <summary>Total area billable as Tier, for group owned land this will be 10% less than ActualArea</summary> |
|
411 | public int BillableArea; |
411 | public int BillableArea; |
|
412 | /// <summary>True of parcel is in Mature simulator</summary> |
412 | /// <summary>True of parcel is in Mature simulator</summary> |
|
413 | public bool Mature; |
413 | public bool Mature; |
|
414 | /// <summary>Grid global X position of parcel</summary> |
414 | /// <summary>Grid global X position of parcel</summary> |
|
415 | public float GlobalX; |
415 | public float GlobalX; |
|
416 | /// <summary>Grid global Y position of parcel</summary> |
416 | /// <summary>Grid global Y position of parcel</summary> |
|
417 | public float GlobalY; |
417 | public float GlobalY; |
|
418 | /// <summary>Grid global Z position of parcel (not used)</summary> |
418 | /// <summary>Grid global Z position of parcel (not used)</summary> |
|
419 | public float GlobalZ; |
419 | public float GlobalZ; |
|
420 | /// <summary>Name of simulator parcel is located in</summary> |
420 | /// <summary>Name of simulator parcel is located in</summary> |
|
421 | public string SimName; |
421 | public string SimName; |
|
422 | /// <summary>Texture <seealso cref="T:OpenMetaverse.UUID"/> of parcels display picture</summary> |
422 | /// <summary>Texture <seealso cref="T:OpenMetaverse.UUID"/> of parcels display picture</summary> |
|
423 | public UUID SnapshotID; |
423 | public UUID SnapshotID; |
|
424 | /// <summary>Float representing calculated traffic based on time spent on parcel by avatars</summary> |
424 | /// <summary>Float representing calculated traffic based on time spent on parcel by avatars</summary> |
|
425 | public float Dwell; |
425 | public float Dwell; |
|
426 | /// <summary>Sale price of parcel (not used)</summary> |
426 | /// <summary>Sale price of parcel (not used)</summary> |
|
427 | public int SalePrice; |
427 | public int SalePrice; |
|
428 | /// <summary>Auction ID of parcel</summary> |
428 | /// <summary>Auction ID of parcel</summary> |
|
429 | public int AuctionID; |
429 | public int AuctionID; |
|
430 | } |
430 | } |
|
431 | |
431 | |
|
432 | /// <summary> |
432 | /// <summary> |
|
433 | /// Parcel Media Information |
433 | /// Parcel Media Information |
|
434 | /// </summary> |
434 | /// </summary> |
|
435 | public struct ParcelMedia |
435 | public struct ParcelMedia |
|
436 | { |
436 | { |
|
437 | /// <summary>A byte, if 0x1 viewer should auto scale media to fit object</summary> |
437 | /// <summary>A byte, if 0x1 viewer should auto scale media to fit object</summary> |
|
438 | public bool MediaAutoScale; |
438 | public bool MediaAutoScale; |
|
439 | /// <summary>A boolean, if true the viewer should loop the media</summary> |
439 | /// <summary>A boolean, if true the viewer should loop the media</summary> |
|
440 | public bool MediaLoop; |
440 | public bool MediaLoop; |
|
441 | /// <summary>The Asset UUID of the Texture which when applied to a |
441 | /// <summary>The Asset UUID of the Texture which when applied to a |
|
442 | /// primitive will display the media</summary> |
442 | /// primitive will display the media</summary> |
|
443 | public UUID MediaID; |
443 | public UUID MediaID; |
|
444 | /// <summary>A URL which points to any Quicktime supported media type</summary> |
444 | /// <summary>A URL which points to any Quicktime supported media type</summary> |
|
445 | public string MediaURL; |
445 | public string MediaURL; |
|
446 | /// <summary>A description of the media</summary> |
446 | /// <summary>A description of the media</summary> |
|
447 | public string MediaDesc; |
447 | public string MediaDesc; |
|
448 | /// <summary>An Integer which represents the height of the media</summary> |
448 | /// <summary>An Integer which represents the height of the media</summary> |
|
449 | public int MediaHeight; |
449 | public int MediaHeight; |
|
450 | /// <summary>An integer which represents the width of the media</summary> |
450 | /// <summary>An integer which represents the width of the media</summary> |
|
451 | public int MediaWidth; |
451 | public int MediaWidth; |
|
452 | /// <summary>A string which contains the mime type of the media</summary> |
452 | /// <summary>A string which contains the mime type of the media</summary> |
|
453 | public string MediaType; |
453 | public string MediaType; |
|
454 | } |
454 | } |
|
455 | |
455 | |
|
456 | #endregion Structs |
456 | #endregion Structs |
|
457 | |
457 | |
|
458 | #region Parcel Class |
458 | #region Parcel Class |
|
459 | |
459 | |
|
460 | /// <summary> |
460 | /// <summary> |
|
461 | /// Parcel of land, a portion of virtual real estate in a simulator |
461 | /// Parcel of land, a portion of virtual real estate in a simulator |
|
462 | /// </summary> |
462 | /// </summary> |
|
463 | public class Parcel |
463 | public class Parcel |
|
464 | { |
464 | { |
|
465 | /// <summary>The total number of contiguous 4x4 meter blocks your agent owns within this parcel</summary> |
465 | /// <summary>The total number of contiguous 4x4 meter blocks your agent owns within this parcel</summary> |
|
466 | public int SelfCount; |
466 | public int SelfCount; |
|
467 | /// <summary>The total number of contiguous 4x4 meter blocks contained in this parcel owned by a group or agent other than your own</summary> |
467 | /// <summary>The total number of contiguous 4x4 meter blocks contained in this parcel owned by a group or agent other than your own</summary> |
|
468 | public int OtherCount; |
468 | public int OtherCount; |
|
469 | /// <summary>Deprecated, Value appears to always be 0</summary> |
469 | /// <summary>Deprecated, Value appears to always be 0</summary> |
|
470 | public int PublicCount; |
470 | public int PublicCount; |
|
471 | /// <summary>Simulator-local ID of this parcel</summary> |
471 | /// <summary>Simulator-local ID of this parcel</summary> |
|
472 | public int LocalID; |
472 | public int LocalID; |
|
473 | /// <summary>UUID of the owner of this parcel</summary> |
473 | /// <summary>UUID of the owner of this parcel</summary> |
|
474 | public UUID OwnerID; |
474 | public UUID OwnerID; |
|
475 | /// <summary>Whether the land is deeded to a group or not</summary> |
475 | /// <summary>Whether the land is deeded to a group or not</summary> |
|
476 | public bool IsGroupOwned; |
476 | public bool IsGroupOwned; |
|
477 | /// <summary></summary> |
477 | /// <summary></summary> |
|
478 | public uint AuctionID; |
478 | public uint AuctionID; |
|
479 | /// <summary>Date land was claimed</summary> |
479 | /// <summary>Date land was claimed</summary> |
|
480 | public DateTime ClaimDate; |
480 | public DateTime ClaimDate; |
|
481 | /// <summary>Appears to always be zero</summary> |
481 | /// <summary>Appears to always be zero</summary> |
|
482 | public int ClaimPrice; |
482 | public int ClaimPrice; |
|
483 | /// <summary>This field is no longer used</summary> |
483 | /// <summary>This field is no longer used</summary> |
|
484 | public int RentPrice; |
484 | public int RentPrice; |
|
485 | /// <summary>Minimum corner of the axis-aligned bounding box for this |
485 | /// <summary>Minimum corner of the axis-aligned bounding box for this |
|
486 | /// parcel</summary> |
486 | /// parcel</summary> |
|
487 | public Vector3 AABBMin; |
487 | public Vector3 AABBMin; |
|
488 | /// <summary>Maximum corner of the axis-aligned bounding box for this |
488 | /// <summary>Maximum corner of the axis-aligned bounding box for this |
|
489 | /// parcel</summary> |
489 | /// parcel</summary> |
|
490 | public Vector3 AABBMax; |
490 | public Vector3 AABBMax; |
|
491 | /// <summary>Bitmap describing land layout in 4x4m squares across the |
491 | /// <summary>Bitmap describing land layout in 4x4m squares across the |
|
492 | /// entire region</summary> |
492 | /// entire region</summary> |
|
493 | public byte[] Bitmap; |
493 | public byte[] Bitmap; |
|
494 | /// <summary>Total parcel land area</summary> |
494 | /// <summary>Total parcel land area</summary> |
|
495 | public int Area; |
495 | public int Area; |
|
496 | /// <summary></summary> |
496 | /// <summary></summary> |
|
497 | public ParcelStatus Status; |
497 | public ParcelStatus Status; |
|
498 | /// <summary>Maximum primitives across the entire simulator owned by the same agent or group that owns this parcel that can be used</summary> |
498 | /// <summary>Maximum primitives across the entire simulator owned by the same agent or group that owns this parcel that can be used</summary> |
|
499 | public int SimWideMaxPrims; |
499 | public int SimWideMaxPrims; |
|
500 | /// <summary>Total primitives across the entire simulator calculated by combining the allowed prim counts for each parcel |
500 | /// <summary>Total primitives across the entire simulator calculated by combining the allowed prim counts for each parcel |
|
501 | /// owned by the agent or group that owns this parcel</summary> |
501 | /// owned by the agent or group that owns this parcel</summary> |
|
502 | public int SimWideTotalPrims; |
502 | public int SimWideTotalPrims; |
|
503 | /// <summary>Maximum number of primitives this parcel supports</summary> |
503 | /// <summary>Maximum number of primitives this parcel supports</summary> |
|
504 | public int MaxPrims; |
504 | public int MaxPrims; |
|
505 | /// <summary>Total number of primitives on this parcel</summary> |
505 | /// <summary>Total number of primitives on this parcel</summary> |
|
506 | public int TotalPrims; |
506 | public int TotalPrims; |
|
507 | /// <summary>For group-owned parcels this indicates the total number of prims deeded to the group, |
507 | /// <summary>For group-owned parcels this indicates the total number of prims deeded to the group, |
|
508 | /// for parcels owned by an individual this inicates the number of prims owned by the individual</summary> |
508 | /// for parcels owned by an individual this inicates the number of prims owned by the individual</summary> |
|
509 | public int OwnerPrims; |
509 | public int OwnerPrims; |
|
510 | /// <summary>Total number of primitives owned by the parcel group on |
510 | /// <summary>Total number of primitives owned by the parcel group on |
|
511 | /// this parcel, or for parcels owned by an individual with a group set the |
511 | /// this parcel, or for parcels owned by an individual with a group set the |
|
512 | /// total number of prims set to that group.</summary> |
512 | /// total number of prims set to that group.</summary> |
|
513 | public int GroupPrims; |
513 | public int GroupPrims; |
|
514 | /// <summary>Total number of prims owned by other avatars that are not set to group, or not the parcel owner</summary> |
514 | /// <summary>Total number of prims owned by other avatars that are not set to group, or not the parcel owner</summary> |
|
515 | public int OtherPrims; |
515 | public int OtherPrims; |
|
516 | /// <summary>A bonus multiplier which allows parcel prim counts to go over times this amount, this does not affect |
516 | /// <summary>A bonus multiplier which allows parcel prim counts to go over times this amount, this does not affect |
|
517 | /// the max prims per simulator. e.g: 117 prim parcel limit x 1.5 bonus = 175 allowed</summary> |
517 | /// the max prims per simulator. e.g: 117 prim parcel limit x 1.5 bonus = 175 allowed</summary> |
|
518 | public float ParcelPrimBonus; |
518 | public float ParcelPrimBonus; |
|
519 | /// <summary>Autoreturn value in minutes for others' objects</summary> |
519 | /// <summary>Autoreturn value in minutes for others' objects</summary> |
|
520 | public int OtherCleanTime; |
520 | public int OtherCleanTime; |
|
521 | /// <summary></summary> |
521 | /// <summary></summary> |
|
522 | public ParcelFlags Flags; |
522 | public ParcelFlags Flags; |
|
523 | /// <summary>Sale price of the parcel, only useful if ForSale is set</summary> |
523 | /// <summary>Sale price of the parcel, only useful if ForSale is set</summary> |
|
524 | /// <remarks>The SalePrice will remain the same after an ownership |
524 | /// <remarks>The SalePrice will remain the same after an ownership |
|
525 | /// transfer (sale), so it can be used to see the purchase price after |
525 | /// transfer (sale), so it can be used to see the purchase price after |
|
526 | /// a sale if the new owner has not changed it</remarks> |
526 | /// a sale if the new owner has not changed it</remarks> |
|
527 | public int SalePrice; |
527 | public int SalePrice; |
|
528 | /// <summary>Parcel Name</summary> |
528 | /// <summary>Parcel Name</summary> |
|
529 | public string Name; |
529 | public string Name; |
|
530 | /// <summary>Parcel Description</summary> |
530 | /// <summary>Parcel Description</summary> |
|
531 | public string Desc; |
531 | public string Desc; |
|
532 | /// <summary>URL For Music Stream</summary> |
532 | /// <summary>URL For Music Stream</summary> |
|
533 | public string MusicURL; |
533 | public string MusicURL; |
|
534 | /// <summary></summary> |
534 | /// <summary></summary> |
|
535 | public UUID GroupID; |
535 | public UUID GroupID; |
|
536 | /// <summary>Price for a temporary pass</summary> |
536 | /// <summary>Price for a temporary pass</summary> |
|
537 | public int PassPrice; |
537 | public int PassPrice; |
|
538 | /// <summary>How long is pass valid for</summary> |
538 | /// <summary>How long is pass valid for</summary> |
|
539 | public float PassHours; |
539 | public float PassHours; |
|
540 | /// <summary></summary> |
540 | /// <summary></summary> |
|
541 | public ParcelCategory Category; |
541 | public ParcelCategory Category; |
|
542 | /// <summary>Key of authorized buyer</summary> |
542 | /// <summary>Key of authorized buyer</summary> |
|
543 | public UUID AuthBuyerID; |
543 | public UUID AuthBuyerID; |
|
544 | /// <summary>Key of parcel snapshot</summary> |
544 | /// <summary>Key of parcel snapshot</summary> |
|
545 | public UUID SnapshotID; |
545 | public UUID SnapshotID; |
|
546 | /// <summary>The landing point location</summary> |
546 | /// <summary>The landing point location</summary> |
|
547 | public Vector3 UserLocation; |
547 | public Vector3 UserLocation; |
|
548 | /// <summary>The landing point LookAt</summary> |
548 | /// <summary>The landing point LookAt</summary> |
|
549 | public Vector3 UserLookAt; |
549 | public Vector3 UserLookAt; |
|
550 | /// <summary>The type of landing enforced from the <see cref="LandingType"/> enum</summary> |
550 | /// <summary>The type of landing enforced from the <see cref="LandingType"/> enum</summary> |
|
551 | public LandingType Landing; |
551 | public LandingType Landing; |
|
552 | /// <summary></summary> |
552 | /// <summary></summary> |
|
553 | public float Dwell; |
553 | public float Dwell; |
|
554 | /// <summary></summary> |
554 | /// <summary></summary> |
|
555 | public bool RegionDenyAnonymous; |
555 | public bool RegionDenyAnonymous; |
|
556 | /// <summary></summary> |
556 | /// <summary></summary> |
|
557 | public bool RegionPushOverride; |
557 | public bool RegionPushOverride; |
|
558 | /// <summary>Access list of who is whitelisted on this |
558 | /// <summary>Access list of who is whitelisted on this |
|
559 | /// parcel</summary> |
559 | /// parcel</summary> |
|
560 | public List<ParcelManager.ParcelAccessEntry> AccessWhiteList; |
560 | public List<ParcelManager.ParcelAccessEntry> AccessWhiteList; |
|
561 | /// <summary>Access list of who is blacklisted on this |
561 | /// <summary>Access list of who is blacklisted on this |
|
562 | /// parcel</summary> |
562 | /// parcel</summary> |
|
563 | public List<ParcelManager.ParcelAccessEntry> AccessBlackList; |
563 | public List<ParcelManager.ParcelAccessEntry> AccessBlackList; |
|
564 | /// <summary>TRUE of region denies access to age unverified users</summary> |
564 | /// <summary>TRUE of region denies access to age unverified users</summary> |
|
565 | public bool RegionDenyAgeUnverified; |
565 | public bool RegionDenyAgeUnverified; |
|
566 | /// <summary>true to obscure (hide) media url</summary> |
566 | /// <summary>true to obscure (hide) media url</summary> |
|
567 | public bool ObscureMedia; |
567 | public bool ObscureMedia; |
|
568 | /// <summary>true to obscure (hide) music url</summary> |
568 | /// <summary>true to obscure (hide) music url</summary> |
|
569 | public bool ObscureMusic; |
569 | public bool ObscureMusic; |
|
570 | /// <summary>A struct containing media details</summary> |
570 | /// <summary>A struct containing media details</summary> |
|
571 | public ParcelMedia Media; |
571 | public ParcelMedia Media; |
|
- | 572 | /// <summary> true if avatars in this parcel should be invisible to people outside</summary> |
||
- | 573 | public bool SeeAVs; |
||
- | 574 | /// <summary> true if avatars outside can hear any sounds avatars inside play</summary> |
||
- | 575 | public bool AnyAVSounds; |
||
- | 576 | /// <summary> true if group members outside can hear any sounds avatars inside play</summary> |
||
- | 577 | public bool GroupAVSounds; |
||
572 | |
578 | |
|
573 | /// <summary> |
579 | /// <summary> |
|
574 | /// Displays a parcel object in string format |
580 | /// Displays a parcel object in string format |
|
575 | /// </summary> |
581 | /// </summary> |
|
576 | /// <returns>string containing key=value pairs of a parcel object</returns> |
582 | /// <returns>string containing key=value pairs of a parcel object</returns> |
|
577 | public override string ToString() |
583 | public override string ToString() |
|
578 | { |
584 | { |
|
579 | string result = ""; |
585 | string result = ""; |
|
580 | Type parcelType = this.GetType(); |
586 | Type parcelType = this.GetType(); |
|
581 | FieldInfo[] fields = parcelType.GetFields(); |
587 | FieldInfo[] fields = parcelType.GetFields(); |
|
582 | foreach (FieldInfo field in fields) |
588 | foreach (FieldInfo field in fields) |
|
583 | { |
589 | { |
|
584 | result += (field.Name + " = " + field.GetValue(this) + " "); |
590 | result += (field.Name + " = " + field.GetValue(this) + " "); |
|
585 | } |
591 | } |
|
586 | return result; |
592 | return result; |
|
587 | } |
593 | } |
|
588 | /// <summary> |
594 | /// <summary> |
|
589 | /// Defalt constructor |
595 | /// Defalt constructor |
|
590 | /// </summary> |
596 | /// </summary> |
|
591 | /// <param name="localID">Local ID of this parcel</param> |
597 | /// <param name="localID">Local ID of this parcel</param> |
|
592 | public Parcel(int localID) |
598 | public Parcel(int localID) |
|
593 | { |
599 | { |
|
594 | LocalID = localID; |
600 | LocalID = localID; |
|
595 | ClaimDate = Utils.Epoch; |
601 | ClaimDate = Utils.Epoch; |
|
596 | Bitmap = Utils.EmptyBytes; |
602 | Bitmap = Utils.EmptyBytes; |
|
597 | Name = String.Empty; |
603 | Name = String.Empty; |
|
598 | Desc = String.Empty; |
604 | Desc = String.Empty; |
|
599 | MusicURL = String.Empty; |
605 | MusicURL = String.Empty; |
|
600 | AccessWhiteList = new List<ParcelManager.ParcelAccessEntry>(0); |
606 | AccessWhiteList = new List<ParcelManager.ParcelAccessEntry>(0); |
|
601 | AccessBlackList = new List<ParcelManager.ParcelAccessEntry>(0); |
607 | AccessBlackList = new List<ParcelManager.ParcelAccessEntry>(0); |
|
602 | Media = new ParcelMedia(); |
608 | Media = new ParcelMedia(); |
|
603 | } |
609 | } |
|
604 | |
610 | |
|
605 | /// <summary> |
611 | /// <summary> |
|
606 | /// Update the simulator with any local changes to this Parcel object |
612 | /// Update the simulator with any local changes to this Parcel object |
|
607 | /// </summary> |
613 | /// </summary> |
|
608 | /// <param name="simulator">Simulator to send updates to</param> |
614 | /// <param name="simulator">Simulator to send updates to</param> |
|
609 | /// <param name="wantReply">Whether we want the simulator to confirm |
615 | /// <param name="wantReply">Whether we want the simulator to confirm |
|
610 | /// the update with a reply packet or not</param> |
616 | /// the update with a reply packet or not</param> |
|
611 | public void Update(Simulator simulator, bool wantReply) |
617 | public void Update(Simulator simulator, bool wantReply) |
|
612 | { |
618 | { |
|
613 | Uri url = simulator.Caps.CapabilityURI("ParcelPropertiesUpdate"); |
619 | Uri url = simulator.Caps.CapabilityURI("ParcelPropertiesUpdate"); |
|
614 | |
620 | |
|
615 | if (url != null) |
621 | if (url != null) |
|
616 | { |
622 | { |
|
617 | ParcelPropertiesUpdateMessage req = new ParcelPropertiesUpdateMessage(); |
623 | ParcelPropertiesUpdateMessage req = new ParcelPropertiesUpdateMessage(); |
|
618 | req.AuthBuyerID = this.AuthBuyerID; |
624 | req.AuthBuyerID = this.AuthBuyerID; |
|
619 | req.Category = this.Category; |
625 | req.Category = this.Category; |
|
620 | req.Desc = this.Desc; |
626 | req.Desc = this.Desc; |
|
621 | req.GroupID = this.GroupID; |
627 | req.GroupID = this.GroupID; |
|
622 | req.Landing = this.Landing; |
628 | req.Landing = this.Landing; |
|
623 | req.LocalID = this.LocalID; |
629 | req.LocalID = this.LocalID; |
|
624 | req.MediaAutoScale = this.Media.MediaAutoScale; |
630 | req.MediaAutoScale = this.Media.MediaAutoScale; |
|
625 | req.MediaDesc = this.Media.MediaDesc; |
631 | req.MediaDesc = this.Media.MediaDesc; |
|
626 | req.MediaHeight = this.Media.MediaHeight; |
632 | req.MediaHeight = this.Media.MediaHeight; |
|
627 | req.MediaID = this.Media.MediaID; |
633 | req.MediaID = this.Media.MediaID; |
|
628 | req.MediaLoop = this.Media.MediaLoop; |
634 | req.MediaLoop = this.Media.MediaLoop; |
|
629 | req.MediaType = this.Media.MediaType; |
635 | req.MediaType = this.Media.MediaType; |
|
630 | req.MediaURL = this.Media.MediaURL; |
636 | req.MediaURL = this.Media.MediaURL; |
|
631 | req.MediaWidth = this.Media.MediaWidth; |
637 | req.MediaWidth = this.Media.MediaWidth; |
|
632 | req.MusicURL = this.MusicURL; |
638 | req.MusicURL = this.MusicURL; |
|
633 | req.Name = this.Name; |
639 | req.Name = this.Name; |
|
634 | req.ObscureMedia = this.ObscureMedia; |
640 | req.ObscureMedia = this.ObscureMedia; |
|
635 | req.ObscureMusic = this.ObscureMusic; |
641 | req.ObscureMusic = this.ObscureMusic; |
|
636 | req.ParcelFlags = this.Flags; |
642 | req.ParcelFlags = this.Flags; |
|
637 | req.PassHours = this.PassHours; |
643 | req.PassHours = this.PassHours; |
|
638 | req.PassPrice = (uint)this.PassPrice; |
644 | req.PassPrice = (uint)this.PassPrice; |
|
639 | req.SalePrice = (uint)this.SalePrice; |
645 | req.SalePrice = (uint)this.SalePrice; |
|
640 | req.SnapshotID = this.SnapshotID; |
646 | req.SnapshotID = this.SnapshotID; |
|
641 | req.UserLocation = this.UserLocation; |
647 | req.UserLocation = this.UserLocation; |
|
642 | req.UserLookAt = this.UserLookAt; |
648 | req.UserLookAt = this.UserLookAt; |
|
- | 649 | req.SeeAVs = this.SeeAVs; |
||
- | 650 | req.AnyAVSounds = this.AnyAVSounds; |
||
- | 651 | req.GroupAVSounds = this.GroupAVSounds; |
||
643 | |
652 | |
|
644 | OSDMap body = req.Serialize(); |
653 | OSDMap body = req.Serialize(); |
|
645 | |
654 | |
|
646 | CapsClient capsPost = new CapsClient(url); |
655 | CapsClient capsPost = new CapsClient(url); |
|
647 | capsPost.BeginGetResponse(body, OSDFormat.Xml, simulator.Client.Settings.CAPS_TIMEOUT); |
656 | capsPost.BeginGetResponse(body, OSDFormat.Xml, simulator.Client.Settings.CAPS_TIMEOUT); |
|
648 | } |
657 | } |
|
649 | else |
658 | else |
|
650 | { |
659 | { |
|
651 | ParcelPropertiesUpdatePacket request = new ParcelPropertiesUpdatePacket(); |
660 | ParcelPropertiesUpdatePacket request = new ParcelPropertiesUpdatePacket(); |
|
652 | |
661 | |
|
653 | request.AgentData.AgentID = simulator.Client.Self.AgentID; |
662 | request.AgentData.AgentID = simulator.Client.Self.AgentID; |
|
654 | request.AgentData.SessionID = simulator.Client.Self.SessionID; |
663 | request.AgentData.SessionID = simulator.Client.Self.SessionID; |
|
655 | |
664 | |
|
656 | request.ParcelData.LocalID = this.LocalID; |
665 | request.ParcelData.LocalID = this.LocalID; |
|
657 | |
666 | |
|
658 | request.ParcelData.AuthBuyerID = this.AuthBuyerID; |
667 | request.ParcelData.AuthBuyerID = this.AuthBuyerID; |
|
659 | request.ParcelData.Category = (byte)this.Category; |
668 | request.ParcelData.Category = (byte)this.Category; |
|
660 | request.ParcelData.Desc = Utils.StringToBytes(this.Desc); |
669 | request.ParcelData.Desc = Utils.StringToBytes(this.Desc); |
|
661 | request.ParcelData.GroupID = this.GroupID; |
670 | request.ParcelData.GroupID = this.GroupID; |
|
662 | request.ParcelData.LandingType = (byte)this.Landing; |
671 | request.ParcelData.LandingType = (byte)this.Landing; |
|
663 | request.ParcelData.MediaAutoScale = (this.Media.MediaAutoScale) ? (byte)0x1 : (byte)0x0; |
672 | request.ParcelData.MediaAutoScale = (this.Media.MediaAutoScale) ? (byte)0x1 : (byte)0x0; |
|
664 | request.ParcelData.MediaID = this.Media.MediaID; |
673 | request.ParcelData.MediaID = this.Media.MediaID; |
|
665 | request.ParcelData.MediaURL = Utils.StringToBytes(this.Media.MediaURL.ToString()); |
674 | request.ParcelData.MediaURL = Utils.StringToBytes(this.Media.MediaURL.ToString()); |
|
666 | request.ParcelData.MusicURL = Utils.StringToBytes(this.MusicURL.ToString()); |
675 | request.ParcelData.MusicURL = Utils.StringToBytes(this.MusicURL.ToString()); |
|
667 | request.ParcelData.Name = Utils.StringToBytes(this.Name); |
676 | request.ParcelData.Name = Utils.StringToBytes(this.Name); |
|
668 | if (wantReply) request.ParcelData.Flags = 1; |
677 | if (wantReply) request.ParcelData.Flags = 1; |
|
669 | request.ParcelData.ParcelFlags = (uint)this.Flags; |
678 | request.ParcelData.ParcelFlags = (uint)this.Flags; |
|
670 | request.ParcelData.PassHours = this.PassHours; |
679 | request.ParcelData.PassHours = this.PassHours; |
|
671 | request.ParcelData.PassPrice = this.PassPrice; |
680 | request.ParcelData.PassPrice = this.PassPrice; |
|
672 | request.ParcelData.SalePrice = this.SalePrice; |
681 | request.ParcelData.SalePrice = this.SalePrice; |
|
673 | request.ParcelData.SnapshotID = this.SnapshotID; |
682 | request.ParcelData.SnapshotID = this.SnapshotID; |
|
674 | request.ParcelData.UserLocation = this.UserLocation; |
683 | request.ParcelData.UserLocation = this.UserLocation; |
|
675 | request.ParcelData.UserLookAt = this.UserLookAt; |
684 | request.ParcelData.UserLookAt = this.UserLookAt; |
|
676 | |
685 | |
|
677 | simulator.SendPacket(request); |
686 | simulator.SendPacket(request); |
|
678 | } |
687 | } |
|
679 | |
688 | |
|
680 | UpdateOtherCleanTime(simulator); |
689 | UpdateOtherCleanTime(simulator); |
|
681 | |
690 | |
|
682 | } |
691 | } |
|
683 | |
692 | |
|
684 | /// <summary> |
693 | /// <summary> |
|
685 | /// Set Autoreturn time |
694 | /// Set Autoreturn time |
|
686 | /// </summary> |
695 | /// </summary> |
|
687 | /// <param name="simulator">Simulator to send the update to</param> |
696 | /// <param name="simulator">Simulator to send the update to</param> |
|
688 | public void UpdateOtherCleanTime(Simulator simulator) |
697 | public void UpdateOtherCleanTime(Simulator simulator) |
|
689 | { |
698 | { |
|
690 | ParcelSetOtherCleanTimePacket request = new ParcelSetOtherCleanTimePacket(); |
699 | ParcelSetOtherCleanTimePacket request = new ParcelSetOtherCleanTimePacket(); |
|
691 | request.AgentData.AgentID = simulator.Client.Self.AgentID; |
700 | request.AgentData.AgentID = simulator.Client.Self.AgentID; |
|
692 | request.AgentData.SessionID = simulator.Client.Self.SessionID; |
701 | request.AgentData.SessionID = simulator.Client.Self.SessionID; |
|
693 | request.ParcelData.LocalID = this.LocalID; |
702 | request.ParcelData.LocalID = this.LocalID; |
|
694 | request.ParcelData.OtherCleanTime = this.OtherCleanTime; |
703 | request.ParcelData.OtherCleanTime = this.OtherCleanTime; |
|
695 | |
704 | |
|
696 | simulator.SendPacket(request); |
705 | simulator.SendPacket(request); |
|
697 | } |
706 | } |
|
698 | } |
707 | } |
|
699 | |
708 | |
|
700 | #endregion Parcel Class |
709 | #endregion Parcel Class |
|
701 | |
710 | |
|
702 | /// <summary> |
711 | /// <summary> |
|
703 | /// Parcel (subdivided simulator lots) subsystem |
712 | /// Parcel (subdivided simulator lots) subsystem |
|
704 | /// </summary> |
713 | /// </summary> |
|
705 | public class ParcelManager |
714 | public class ParcelManager |
|
706 | { |
715 | { |
|
707 | #region Structs |
716 | #region Structs |
|
708 | |
717 | |
|
709 | /// <summary> |
718 | /// <summary> |
|
710 | /// Parcel Accesslist |
719 | /// Parcel Accesslist |
|
711 | /// </summary> |
720 | /// </summary> |
|
712 | public struct ParcelAccessEntry |
721 | public struct ParcelAccessEntry |
|
713 | { |
722 | { |
|
714 | /// <summary>Agents <seealso cref="T:OpenMetaverse.UUID"/></summary> |
723 | /// <summary>Agents <seealso cref="T:OpenMetaverse.UUID"/></summary> |
|
715 | public UUID AgentID; |
724 | public UUID AgentID; |
|
716 | /// <summary></summary> |
725 | /// <summary></summary> |
|
717 | public DateTime Time; |
726 | public DateTime Time; |
|
718 | /// <summary>Flags for specific entry in white/black lists</summary> |
727 | /// <summary>Flags for specific entry in white/black lists</summary> |
|
719 | public AccessList Flags; |
728 | public AccessList Flags; |
|
720 | } |
729 | } |
|
721 | |
730 | |
|
722 | /// <summary> |
731 | /// <summary> |
|
723 | /// Owners of primitives on parcel |
732 | /// Owners of primitives on parcel |
|
724 | /// </summary> |
733 | /// </summary> |
|
725 | public struct ParcelPrimOwners |
734 | public struct ParcelPrimOwners |
|
726 | { |
735 | { |
|
727 | /// <summary>Prim Owners <seealso cref="T:OpenMetaverse.UUID"/></summary> |
736 | /// <summary>Prim Owners <seealso cref="T:OpenMetaverse.UUID"/></summary> |
|
728 | public UUID OwnerID; |
737 | public UUID OwnerID; |
|
729 | /// <summary>True of owner is group</summary> |
738 | /// <summary>True of owner is group</summary> |
|
730 | public bool IsGroupOwned; |
739 | public bool IsGroupOwned; |
|
731 | /// <summary>Total count of prims owned by OwnerID</summary> |
740 | /// <summary>Total count of prims owned by OwnerID</summary> |
|
732 | public int Count; |
741 | public int Count; |
|
733 | /// <summary>true of OwnerID is currently online and is not a group</summary> |
742 | /// <summary>true of OwnerID is currently online and is not a group</summary> |
|
734 | public bool OnlineStatus; |
743 | public bool OnlineStatus; |
|
735 | /// <summary>The date of the most recent prim left by OwnerID</summary> |
744 | /// <summary>The date of the most recent prim left by OwnerID</summary> |
|
736 | public DateTime NewestPrim; |
745 | public DateTime NewestPrim; |
|
737 | } |
746 | } |
|
738 | |
747 | |
|
739 | #endregion Structs |
748 | #endregion Structs |
|
740 | |
749 | |
|
741 | #region Delegates |
750 | #region Delegates |
|
742 | /// <summary> |
751 | /// <summary> |
|
743 | /// Called once parcel resource usage information has been collected |
752 | /// Called once parcel resource usage information has been collected |
|
744 | /// </summary> |
753 | /// </summary> |
|
745 | /// <param name="success">Indicates if operation was successfull</param> |
754 | /// <param name="success">Indicates if operation was successfull</param> |
|
746 | /// <param name="info">Parcel resource usage information</param> |
755 | /// <param name="info">Parcel resource usage information</param> |
|
747 | public delegate void LandResourcesCallback(bool success, LandResourcesInfo info); |
756 | public delegate void LandResourcesCallback(bool success, LandResourcesInfo info); |
|
748 | |
757 | |
|
749 | /// <summary>The event subscribers. null if no subcribers</summary> |
758 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
750 | private EventHandler<ParcelDwellReplyEventArgs> m_DwellReply; |
759 | private EventHandler<ParcelDwellReplyEventArgs> m_DwellReply; |
|
751 | |
760 | |
|
752 | /// <summary>Raises the ParcelDwellReply event</summary> |
761 | /// <summary>Raises the ParcelDwellReply event</summary> |
|
753 | /// <param name="e">A ParcelDwellReplyEventArgs object containing the |
762 | /// <param name="e">A ParcelDwellReplyEventArgs object containing the |
|
754 | /// data returned from the simulator</param> |
763 | /// data returned from the simulator</param> |
|
755 | protected virtual void OnParcelDwellReply(ParcelDwellReplyEventArgs e) |
764 | protected virtual void OnParcelDwellReply(ParcelDwellReplyEventArgs e) |
|
756 | { |
765 | { |
|
757 | EventHandler<ParcelDwellReplyEventArgs> handler = m_DwellReply; |
766 | EventHandler<ParcelDwellReplyEventArgs> handler = m_DwellReply; |
|
758 | if (handler != null) |
767 | if (handler != null) |
|
759 | handler(this, e); |
768 | handler(this, e); |
|
760 | } |
769 | } |
|
761 | |
770 | |
|
762 | /// <summary>Thread sync lock object</summary> |
771 | /// <summary>Thread sync lock object</summary> |
|
763 | private readonly object m_DwellReplyLock = new object(); |
772 | private readonly object m_DwellReplyLock = new object(); |
|
764 | |
773 | |
|
765 | /// <summary>Raised when the simulator responds to a <see cref="RequestDwell"/> request</summary> |
774 | /// <summary>Raised when the simulator responds to a <see cref="RequestDwell"/> request</summary> |
|
766 | public event EventHandler<ParcelDwellReplyEventArgs> ParcelDwellReply |
775 | public event EventHandler<ParcelDwellReplyEventArgs> ParcelDwellReply |
|
767 | { |
776 | { |
|
768 | add { lock (m_DwellReplyLock) { m_DwellReply += value; } } |
777 | add { lock (m_DwellReplyLock) { m_DwellReply += value; } } |
|
769 | remove { lock (m_DwellReplyLock) { m_DwellReply -= value; } } |
778 | remove { lock (m_DwellReplyLock) { m_DwellReply -= value; } } |
|
770 | } |
779 | } |
|
771 | |
780 | |
|
772 | /// <summary>The event subscribers. null if no subcribers</summary> |
781 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
773 | private EventHandler<ParcelInfoReplyEventArgs> m_ParcelInfo; |
782 | private EventHandler<ParcelInfoReplyEventArgs> m_ParcelInfo; |
|
774 | |
783 | |
|
775 | /// <summary>Raises the ParcelInfoReply event</summary> |
784 | /// <summary>Raises the ParcelInfoReply event</summary> |
|
776 | /// <param name="e">A ParcelInfoReplyEventArgs object containing the |
785 | /// <param name="e">A ParcelInfoReplyEventArgs object containing the |
|
777 | /// data returned from the simulator</param> |
786 | /// data returned from the simulator</param> |
|
778 | protected virtual void OnParcelInfoReply(ParcelInfoReplyEventArgs e) |
787 | protected virtual void OnParcelInfoReply(ParcelInfoReplyEventArgs e) |
|
779 | { |
788 | { |
|
780 | EventHandler<ParcelInfoReplyEventArgs> handler = m_ParcelInfo; |
789 | EventHandler<ParcelInfoReplyEventArgs> handler = m_ParcelInfo; |
|
781 | if (handler != null) |
790 | if (handler != null) |
|
782 | handler(this, e); |
791 | handler(this, e); |
|
783 | } |
792 | } |
|
784 | |
793 | |
|
785 | /// <summary>Thread sync lock object</summary> |
794 | /// <summary>Thread sync lock object</summary> |
|
786 | private readonly object m_ParcelInfoLock = new object(); |
795 | private readonly object m_ParcelInfoLock = new object(); |
|
787 | |
796 | |
|
788 | /// <summary>Raised when the simulator responds to a <see cref="RequestParcelInfo"/> request</summary> |
797 | /// <summary>Raised when the simulator responds to a <see cref="RequestParcelInfo"/> request</summary> |
|
789 | public event EventHandler<ParcelInfoReplyEventArgs> ParcelInfoReply |
798 | public event EventHandler<ParcelInfoReplyEventArgs> ParcelInfoReply |
|
790 | { |
799 | { |
|
791 | add { lock (m_ParcelInfoLock) { m_ParcelInfo += value; } } |
800 | add { lock (m_ParcelInfoLock) { m_ParcelInfo += value; } } |
|
792 | remove { lock (m_ParcelInfoLock) { m_ParcelInfo -= value; } } |
801 | remove { lock (m_ParcelInfoLock) { m_ParcelInfo -= value; } } |
|
793 | } |
802 | } |
|
794 | |
803 | |
|
795 | /// <summary>The event subscribers. null if no subcribers</summary> |
804 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
796 | private EventHandler<ParcelPropertiesEventArgs> m_ParcelProperties; |
805 | private EventHandler<ParcelPropertiesEventArgs> m_ParcelProperties; |
|
797 | |
806 | |
|
798 | /// <summary>Raises the ParcelProperties event</summary> |
807 | /// <summary>Raises the ParcelProperties event</summary> |
|
799 | /// <param name="e">A ParcelPropertiesEventArgs object containing the |
808 | /// <param name="e">A ParcelPropertiesEventArgs object containing the |
|
800 | /// data returned from the simulator</param> |
809 | /// data returned from the simulator</param> |
|
801 | protected virtual void OnParcelProperties(ParcelPropertiesEventArgs e) |
810 | protected virtual void OnParcelProperties(ParcelPropertiesEventArgs e) |
|
802 | { |
811 | { |
|
803 | EventHandler<ParcelPropertiesEventArgs> handler = m_ParcelProperties; |
812 | EventHandler<ParcelPropertiesEventArgs> handler = m_ParcelProperties; |
|
804 | if (handler != null) |
813 | if (handler != null) |
|
805 | handler(this, e); |
814 | handler(this, e); |
|
806 | } |
815 | } |
|
807 | |
816 | |
|
808 | /// <summary>Thread sync lock object</summary> |
817 | /// <summary>Thread sync lock object</summary> |
|
809 | private readonly object m_ParcelPropertiesLock = new object(); |
818 | private readonly object m_ParcelPropertiesLock = new object(); |
|
810 | |
819 | |
|
811 | /// <summary>Raised when the simulator responds to a <see cref="RequestParcelProperties"/> request</summary> |
820 | /// <summary>Raised when the simulator responds to a <see cref="RequestParcelProperties"/> request</summary> |
|
812 | public event EventHandler<ParcelPropertiesEventArgs> ParcelProperties |
821 | public event EventHandler<ParcelPropertiesEventArgs> ParcelProperties |
|
813 | { |
822 | { |
|
814 | add { lock (m_ParcelPropertiesLock) { m_ParcelProperties += value; } } |
823 | add { lock (m_ParcelPropertiesLock) { m_ParcelProperties += value; } } |
|
815 | remove { lock (m_ParcelPropertiesLock) { m_ParcelProperties -= value; } } |
824 | remove { lock (m_ParcelPropertiesLock) { m_ParcelProperties -= value; } } |
|
816 | } |
825 | } |
|
817 | |
826 | |
|
818 | /// <summary>The event subscribers. null if no subcribers</summary> |
827 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
819 | private EventHandler<ParcelAccessListReplyEventArgs> m_ParcelACL; |
828 | private EventHandler<ParcelAccessListReplyEventArgs> m_ParcelACL; |
|
820 | |
829 | |
|
821 | /// <summary>Raises the ParcelAccessListReply event</summary> |
830 | /// <summary>Raises the ParcelAccessListReply event</summary> |
|
822 | /// <param name="e">A ParcelAccessListReplyEventArgs object containing the |
831 | /// <param name="e">A ParcelAccessListReplyEventArgs object containing the |
|
823 | /// data returned from the simulator</param> |
832 | /// data returned from the simulator</param> |
|
824 | protected virtual void OnParcelAccessListReply(ParcelAccessListReplyEventArgs e) |
833 | protected virtual void OnParcelAccessListReply(ParcelAccessListReplyEventArgs e) |
|
825 | { |
834 | { |
|
826 | EventHandler<ParcelAccessListReplyEventArgs> handler = m_ParcelACL; |
835 | EventHandler<ParcelAccessListReplyEventArgs> handler = m_ParcelACL; |
|
827 | if (handler != null) |
836 | if (handler != null) |
|
828 | handler(this, e); |
837 | handler(this, e); |
|
829 | } |
838 | } |
|
830 | |
839 | |
|
831 | /// <summary>Thread sync lock object</summary> |
840 | /// <summary>Thread sync lock object</summary> |
|
832 | private readonly object m_ParcelACLLock = new object(); |
841 | private readonly object m_ParcelACLLock = new object(); |
|
833 | |
842 | |
|
834 | /// <summary>Raised when the simulator responds to a <see cref="RequestParcelAccessList"/> request</summary> |
843 | /// <summary>Raised when the simulator responds to a <see cref="RequestParcelAccessList"/> request</summary> |
|
835 | public event EventHandler<ParcelAccessListReplyEventArgs> ParcelAccessListReply |
844 | public event EventHandler<ParcelAccessListReplyEventArgs> ParcelAccessListReply |
|
836 | { |
845 | { |
|
837 | add { lock (m_ParcelACLLock) { m_ParcelACL += value; } } |
846 | add { lock (m_ParcelACLLock) { m_ParcelACL += value; } } |
|
838 | remove { lock (m_ParcelACLLock) { m_ParcelACL -= value; } } |
847 | remove { lock (m_ParcelACLLock) { m_ParcelACL -= value; } } |
|
839 | } |
848 | } |
|
840 | |
849 | |
|
841 | /// <summary>The event subscribers. null if no subcribers</summary> |
850 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
842 | private EventHandler<ParcelObjectOwnersReplyEventArgs> m_ParcelObjectOwnersReply; |
851 | private EventHandler<ParcelObjectOwnersReplyEventArgs> m_ParcelObjectOwnersReply; |
|
843 | |
852 | |
|
844 | /// <summary>Raises the ParcelObjectOwnersReply event</summary> |
853 | /// <summary>Raises the ParcelObjectOwnersReply event</summary> |
|
845 | /// <param name="e">A ParcelObjectOwnersReplyEventArgs object containing the |
854 | /// <param name="e">A ParcelObjectOwnersReplyEventArgs object containing the |
|
846 | /// data returned from the simulator</param> |
855 | /// data returned from the simulator</param> |
|
847 | protected virtual void OnParcelObjectOwnersReply(ParcelObjectOwnersReplyEventArgs e) |
856 | protected virtual void OnParcelObjectOwnersReply(ParcelObjectOwnersReplyEventArgs e) |
|
848 | { |
857 | { |
|
849 | EventHandler<ParcelObjectOwnersReplyEventArgs> handler = m_ParcelObjectOwnersReply; |
858 | EventHandler<ParcelObjectOwnersReplyEventArgs> handler = m_ParcelObjectOwnersReply; |
|
850 | if (handler != null) |
859 | if (handler != null) |
|
851 | handler(this, e); |
860 | handler(this, e); |
|
852 | } |
861 | } |
|
853 | |
862 | |
|
854 | /// <summary>Thread sync lock object</summary> |
863 | /// <summary>Thread sync lock object</summary> |
|
855 | private readonly object m_ParcelObjectOwnersLock = new object(); |
864 | private readonly object m_ParcelObjectOwnersLock = new object(); |
|
856 | |
865 | |
|
857 | /// <summary>Raised when the simulator responds to a <see cref="RequestObjectOwners"/> request</summary> |
866 | /// <summary>Raised when the simulator responds to a <see cref="RequestObjectOwners"/> request</summary> |
|
858 | public event EventHandler<ParcelObjectOwnersReplyEventArgs> ParcelObjectOwnersReply |
867 | public event EventHandler<ParcelObjectOwnersReplyEventArgs> ParcelObjectOwnersReply |
|
859 | { |
868 | { |
|
860 | add { lock (m_ParcelObjectOwnersLock) { m_ParcelObjectOwnersReply += value; } } |
869 | add { lock (m_ParcelObjectOwnersLock) { m_ParcelObjectOwnersReply += value; } } |
|
861 | remove { lock (m_ParcelObjectOwnersLock) { m_ParcelObjectOwnersReply -= value; } } |
870 | remove { lock (m_ParcelObjectOwnersLock) { m_ParcelObjectOwnersReply -= value; } } |
|
862 | } |
871 | } |
|
863 | |
872 | |
|
864 | /// <summary>The event subscribers. null if no subcribers</summary> |
873 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
865 | private EventHandler<SimParcelsDownloadedEventArgs> m_SimParcelsDownloaded; |
874 | private EventHandler<SimParcelsDownloadedEventArgs> m_SimParcelsDownloaded; |
|
866 | |
875 | |
|
867 | /// <summary>Raises the SimParcelsDownloaded event</summary> |
876 | /// <summary>Raises the SimParcelsDownloaded event</summary> |
|
868 | /// <param name="e">A SimParcelsDownloadedEventArgs object containing the |
877 | /// <param name="e">A SimParcelsDownloadedEventArgs object containing the |
|
869 | /// data returned from the simulator</param> |
878 | /// data returned from the simulator</param> |
|
870 | protected virtual void OnSimParcelsDownloaded(SimParcelsDownloadedEventArgs e) |
879 | protected virtual void OnSimParcelsDownloaded(SimParcelsDownloadedEventArgs e) |
|
871 | { |
880 | { |
|
872 | EventHandler<SimParcelsDownloadedEventArgs> handler = m_SimParcelsDownloaded; |
881 | EventHandler<SimParcelsDownloadedEventArgs> handler = m_SimParcelsDownloaded; |
|
873 | if (handler != null) |
882 | if (handler != null) |
|
874 | handler(this, e); |
883 | handler(this, e); |
|
875 | } |
884 | } |
|
876 | |
885 | |
|
877 | /// <summary>Thread sync lock object</summary> |
886 | /// <summary>Thread sync lock object</summary> |
|
878 | private readonly object m_SimParcelsDownloadedLock = new object(); |
887 | private readonly object m_SimParcelsDownloadedLock = new object(); |
|
879 | |
888 | |
|
880 | /// <summary>Raised when the simulator responds to a <see cref="RequestAllSimParcels"/> request</summary> |
889 | /// <summary>Raised when the simulator responds to a <see cref="RequestAllSimParcels"/> request</summary> |
|
881 | public event EventHandler<SimParcelsDownloadedEventArgs> SimParcelsDownloaded |
890 | public event EventHandler<SimParcelsDownloadedEventArgs> SimParcelsDownloaded |
|
882 | { |
891 | { |
|
883 | add { lock (m_SimParcelsDownloadedLock) { m_SimParcelsDownloaded += value; } } |
892 | add { lock (m_SimParcelsDownloadedLock) { m_SimParcelsDownloaded += value; } } |
|
884 | remove { lock (m_SimParcelsDownloadedLock) { m_SimParcelsDownloaded -= value; } } |
893 | remove { lock (m_SimParcelsDownloadedLock) { m_SimParcelsDownloaded -= value; } } |
|
885 | } |
894 | } |
|
886 | |
895 | |
|
887 | /// <summary>The event subscribers. null if no subcribers</summary> |
896 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
888 | private EventHandler<ForceSelectObjectsReplyEventArgs> m_ForceSelectObjects; |
897 | private EventHandler<ForceSelectObjectsReplyEventArgs> m_ForceSelectObjects; |
|
889 | |
898 | |
|
890 | /// <summary>Raises the ForceSelectObjectsReply event</summary> |
899 | /// <summary>Raises the ForceSelectObjectsReply event</summary> |
|
891 | /// <param name="e">A ForceSelectObjectsReplyEventArgs object containing the |
900 | /// <param name="e">A ForceSelectObjectsReplyEventArgs object containing the |
|
892 | /// data returned from the simulator</param> |
901 | /// data returned from the simulator</param> |
|
893 | protected virtual void OnForceSelectObjectsReply(ForceSelectObjectsReplyEventArgs e) |
902 | protected virtual void OnForceSelectObjectsReply(ForceSelectObjectsReplyEventArgs e) |
|
894 | { |
903 | { |
|
895 | EventHandler<ForceSelectObjectsReplyEventArgs> handler = m_ForceSelectObjects; |
904 | EventHandler<ForceSelectObjectsReplyEventArgs> handler = m_ForceSelectObjects; |
|
896 | if (handler != null) |
905 | if (handler != null) |
|
897 | handler(this, e); |
906 | handler(this, e); |
|
898 | } |
907 | } |
|
899 | |
908 | |
|
900 | /// <summary>Thread sync lock object</summary> |
909 | /// <summary>Thread sync lock object</summary> |
|
901 | private readonly object m_ForceSelectObjectsLock = new object(); |
910 | private readonly object m_ForceSelectObjectsLock = new object(); |
|
902 | |
911 | |
|
903 | /// <summary>Raised when the simulator responds to a <see cref="RequestForceSelectObjects"/> request</summary> |
912 | /// <summary>Raised when the simulator responds to a <see cref="RequestForceSelectObjects"/> request</summary> |
|
904 | public event EventHandler<ForceSelectObjectsReplyEventArgs> ForceSelectObjectsReply |
913 | public event EventHandler<ForceSelectObjectsReplyEventArgs> ForceSelectObjectsReply |
|
905 | { |
914 | { |
|
906 | add { lock (m_ForceSelectObjectsLock) { m_ForceSelectObjects += value; } } |
915 | add { lock (m_ForceSelectObjectsLock) { m_ForceSelectObjects += value; } } |
|
907 | remove { lock (m_ForceSelectObjectsLock) { m_ForceSelectObjects -= value; } } |
916 | remove { lock (m_ForceSelectObjectsLock) { m_ForceSelectObjects -= value; } } |
|
908 | } |
917 | } |
|
909 | |
918 | |
|
910 | /// <summary>The event subscribers. null if no subcribers</summary> |
919 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
911 | private EventHandler<ParcelMediaUpdateReplyEventArgs> m_ParcelMediaUpdateReply; |
920 | private EventHandler<ParcelMediaUpdateReplyEventArgs> m_ParcelMediaUpdateReply; |
|
912 | |
921 | |
|
913 | /// <summary>Raises the ParcelMediaUpdateReply event</summary> |
922 | /// <summary>Raises the ParcelMediaUpdateReply event</summary> |
|
914 | /// <param name="e">A ParcelMediaUpdateReplyEventArgs object containing the |
923 | /// <param name="e">A ParcelMediaUpdateReplyEventArgs object containing the |
|
915 | /// data returned from the simulator</param> |
924 | /// data returned from the simulator</param> |
|
916 | protected virtual void OnParcelMediaUpdateReply(ParcelMediaUpdateReplyEventArgs e) |
925 | protected virtual void OnParcelMediaUpdateReply(ParcelMediaUpdateReplyEventArgs e) |
|
917 | { |
926 | { |
|
918 | EventHandler<ParcelMediaUpdateReplyEventArgs> handler = m_ParcelMediaUpdateReply; |
927 | EventHandler<ParcelMediaUpdateReplyEventArgs> handler = m_ParcelMediaUpdateReply; |
|
919 | if (handler != null) |
928 | if (handler != null) |
|
920 | handler(this, e); |
929 | handler(this, e); |
|
921 | } |
930 | } |
|
922 | |
931 | |
|
923 | /// <summary>Thread sync lock object</summary> |
932 | /// <summary>Thread sync lock object</summary> |
|
924 | private readonly object m_ParcelMediaUpdateReplyLock = new object(); |
933 | private readonly object m_ParcelMediaUpdateReplyLock = new object(); |
|
925 | |
934 | |
|
926 | /// <summary>Raised when the simulator responds to a Parcel Update request</summary> |
935 | /// <summary>Raised when the simulator responds to a Parcel Update request</summary> |
|
927 | public event EventHandler<ParcelMediaUpdateReplyEventArgs> ParcelMediaUpdateReply |
936 | public event EventHandler<ParcelMediaUpdateReplyEventArgs> ParcelMediaUpdateReply |
|
928 | { |
937 | { |
|
929 | add { lock (m_ParcelMediaUpdateReplyLock) { m_ParcelMediaUpdateReply += value; } } |
938 | add { lock (m_ParcelMediaUpdateReplyLock) { m_ParcelMediaUpdateReply += value; } } |
|
930 | remove { lock (m_ParcelMediaUpdateReplyLock) { m_ParcelMediaUpdateReply -= value; } } |
939 | remove { lock (m_ParcelMediaUpdateReplyLock) { m_ParcelMediaUpdateReply -= value; } } |
|
931 | } |
940 | } |
|
932 | |
941 | |
|
933 | /// <summary>The event subscribers. null if no subcribers</summary> |
942 | /// <summary>The event subscribers. null if no subcribers</summary> |
|
934 | private EventHandler<ParcelMediaCommandEventArgs> m_ParcelMediaCommand; |
943 | private EventHandler<ParcelMediaCommandEventArgs> m_ParcelMediaCommand; |
|
935 | |
944 | |
|
936 | /// <summary>Raises the ParcelMediaCommand event</summary> |
945 | /// <summary>Raises the ParcelMediaCommand event</summary> |
|
937 | /// <param name="e">A ParcelMediaCommandEventArgs object containing the |
946 | /// <param name="e">A ParcelMediaCommandEventArgs object containing the |
|
938 | /// data returned from the simulator</param> |
947 | /// data returned from the simulator</param> |
|
939 | protected virtual void OnParcelMediaCommand(ParcelMediaCommandEventArgs e) |
948 | protected virtual void OnParcelMediaCommand(ParcelMediaCommandEventArgs e) |
|
940 | { |
949 | { |
|
941 | EventHandler<ParcelMediaCommandEventArgs> handler = m_ParcelMediaCommand; |
950 | EventHandler<ParcelMediaCommandEventArgs> handler = m_ParcelMediaCommand; |
|
942 | if (handler != null) |
951 | if (handler != null) |
|
943 | handler(this, e); |
952 | handler(this, e); |
|
944 | } |
953 | } |
|
945 | |
954 | |
|
946 | /// <summary>Thread sync lock object</summary> |
955 | /// <summary>Thread sync lock object</summary> |
|
947 | private readonly object m_ParcelMediaCommandLock = new object(); |
956 | private readonly object m_ParcelMediaCommandLock = new object(); |
|
948 | |
957 | |
|
949 | /// <summary>Raised when the parcel your agent is located sends a ParcelMediaCommand</summary> |
958 | /// <summary>Raised when the parcel your agent is located sends a ParcelMediaCommand</summary> |
|
950 | public event EventHandler<ParcelMediaCommandEventArgs> ParcelMediaCommand |
959 | public event EventHandler<ParcelMediaCommandEventArgs> ParcelMediaCommand |
|
951 | { |
960 | { |
|
952 | add { lock (m_ParcelMediaCommandLock) { m_ParcelMediaCommand += value; } } |
961 | add { lock (m_ParcelMediaCommandLock) { m_ParcelMediaCommand += value; } } |
|
953 | remove { lock (m_ParcelMediaCommandLock) { m_ParcelMediaCommand -= value; } } |
962 | remove { lock (m_ParcelMediaCommandLock) { m_ParcelMediaCommand -= value; } } |
|
954 | } |
963 | } |
|
955 | #endregion Delegates |
964 | #endregion Delegates |
|
956 | |
965 | |
|
957 | private GridClient Client; |
966 | private GridClient Client; |
|
958 | private AutoResetEvent WaitForSimParcel; |
967 | private AutoResetEvent WaitForSimParcel; |
|
959 | |
968 | |
|
960 | #region Public Methods |
969 | #region Public Methods |
|
961 | |
970 | |
|
962 | /// <summary> |
971 | /// <summary> |
|
963 | /// Default constructor |
972 | /// Default constructor |
|
964 | /// </summary> |
973 | /// </summary> |
|
965 | /// <param name="client">A reference to the GridClient object</param> |
974 | /// <param name="client">A reference to the GridClient object</param> |
|
966 | public ParcelManager(GridClient client) |
975 | public ParcelManager(GridClient client) |
|
967 | { |
976 | { |
|
968 | Client = client; |
977 | Client = client; |
|
969 | |
978 | |
|
970 | // Setup the callbacks |
979 | // Setup the callbacks |
|
971 | Client.Network.RegisterCallback(PacketType.ParcelInfoReply, ParcelInfoReplyHandler); |
980 | Client.Network.RegisterCallback(PacketType.ParcelInfoReply, ParcelInfoReplyHandler); |
|
972 | Client.Network.RegisterEventCallback("ParcelObjectOwnersReply", new Caps.EventQueueCallback(ParcelObjectOwnersReplyHandler)); |
981 | Client.Network.RegisterEventCallback("ParcelObjectOwnersReply", new Caps.EventQueueCallback(ParcelObjectOwnersReplyHandler)); |
|
973 | // CAPS packet handler, to allow for Media Data not contained in the message template |
982 | // CAPS packet handler, to allow for Media Data not contained in the message template |
|
974 | Client.Network.RegisterEventCallback("ParcelProperties", new Caps.EventQueueCallback(ParcelPropertiesReplyHandler)); |
983 | Client.Network.RegisterEventCallback("ParcelProperties", new Caps.EventQueueCallback(ParcelPropertiesReplyHandler)); |
|
975 | Client.Network.RegisterCallback(PacketType.ParcelDwellReply, ParcelDwellReplyHandler); |
984 | Client.Network.RegisterCallback(PacketType.ParcelDwellReply, ParcelDwellReplyHandler); |
|
976 | Client.Network.RegisterCallback(PacketType.ParcelAccessListReply, ParcelAccessListReplyHandler); |
985 | Client.Network.RegisterCallback(PacketType.ParcelAccessListReply, ParcelAccessListReplyHandler); |
|
977 | Client.Network.RegisterCallback(PacketType.ForceObjectSelect, SelectParcelObjectsReplyHandler); |
986 | Client.Network.RegisterCallback(PacketType.ForceObjectSelect, SelectParcelObjectsReplyHandler); |
|
978 | Client.Network.RegisterCallback(PacketType.ParcelMediaUpdate, ParcelMediaUpdateHandler); |
987 | Client.Network.RegisterCallback(PacketType.ParcelMediaUpdate, ParcelMediaUpdateHandler); |
|
979 | Client.Network.RegisterCallback(PacketType.ParcelOverlay, ParcelOverlayHandler); |
988 | Client.Network.RegisterCallback(PacketType.ParcelOverlay, ParcelOverlayHandler); |
|
980 | Client.Network.RegisterCallback(PacketType.ParcelMediaCommandMessage, ParcelMediaCommandMessagePacketHandler); |
989 | Client.Network.RegisterCallback(PacketType.ParcelMediaCommandMessage, ParcelMediaCommandMessagePacketHandler); |
|
981 | } |
990 | } |
|
982 | |
991 | |
|
983 | /// <summary> |
992 | /// <summary> |
|
984 | /// Request basic information for a single parcel |
993 | /// Request basic information for a single parcel |
|
985 | /// </summary> |
994 | /// </summary> |
|
986 | /// <param name="parcelID">Simulator-local ID of the parcel</param> |
995 | /// <param name="parcelID">Simulator-local ID of the parcel</param> |
|
987 | public void RequestParcelInfo(UUID parcelID) |
996 | public void RequestParcelInfo(UUID parcelID) |
|
988 | { |
997 | { |
|
989 | ParcelInfoRequestPacket request = new ParcelInfoRequestPacket(); |
998 | ParcelInfoRequestPacket request = new ParcelInfoRequestPacket(); |
|
990 | request.AgentData.AgentID = Client.Self.AgentID; |
999 | request.AgentData.AgentID = Client.Self.AgentID; |
|
991 | request.AgentData.SessionID = Client.Self.SessionID; |
1000 | request.AgentData.SessionID = Client.Self.SessionID; |
|
992 | request.Data.ParcelID = parcelID; |
1001 | request.Data.ParcelID = parcelID; |
|
993 | |
1002 | |
|
994 | Client.Network.SendPacket(request); |
1003 | Client.Network.SendPacket(request); |
|
995 | } |
1004 | } |
|
996 | |
1005 | |
|
997 | /// <summary> |
1006 | /// <summary> |
|
998 | /// Request properties of a single parcel |
1007 | /// Request properties of a single parcel |
|
999 | /// </summary> |
1008 | /// </summary> |
|
1000 | /// <param name="simulator">Simulator containing the parcel</param> |
1009 | /// <param name="simulator">Simulator containing the parcel</param> |
|
1001 | /// <param name="localID">Simulator-local ID of the parcel</param> |
1010 | /// <param name="localID">Simulator-local ID of the parcel</param> |
|
1002 | /// <param name="sequenceID">An arbitrary integer that will be returned |
1011 | /// <param name="sequenceID">An arbitrary integer that will be returned |
|
1003 | /// with the ParcelProperties reply, useful for distinguishing between |
1012 | /// with the ParcelProperties reply, useful for distinguishing between |
|
1004 | /// multiple simultaneous requests</param> |
1013 | /// multiple simultaneous requests</param> |
|
1005 | public void RequestParcelProperties(Simulator simulator, int localID, int sequenceID) |
1014 | public void RequestParcelProperties(Simulator simulator, int localID, int sequenceID) |
|
1006 | { |
1015 | { |
|
1007 | ParcelPropertiesRequestByIDPacket request = new ParcelPropertiesRequestByIDPacket(); |
1016 | ParcelPropertiesRequestByIDPacket request = new ParcelPropertiesRequestByIDPacket(); |
|
1008 | |
1017 | |
|
1009 | request.AgentData.AgentID = Client.Self.AgentID; |
1018 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1010 | request.AgentData.SessionID = Client.Self.SessionID; |
1019 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1011 | |
1020 | |
|
1012 | request.ParcelData.LocalID = localID; |
1021 | request.ParcelData.LocalID = localID; |
|
1013 | request.ParcelData.SequenceID = sequenceID; |
1022 | request.ParcelData.SequenceID = sequenceID; |
|
1014 | |
1023 | |
|
1015 | Client.Network.SendPacket(request, simulator); |
1024 | Client.Network.SendPacket(request, simulator); |
|
1016 | } |
1025 | } |
|
1017 | |
1026 | |
|
1018 | /// <summary> |
1027 | /// <summary> |
|
1019 | /// Request the access list for a single parcel |
1028 | /// Request the access list for a single parcel |
|
1020 | /// </summary> |
1029 | /// </summary> |
|
1021 | /// <param name="simulator">Simulator containing the parcel</param> |
1030 | /// <param name="simulator">Simulator containing the parcel</param> |
|
1022 | /// <param name="localID">Simulator-local ID of the parcel</param> |
1031 | /// <param name="localID">Simulator-local ID of the parcel</param> |
|
1023 | /// <param name="sequenceID">An arbitrary integer that will be returned |
1032 | /// <param name="sequenceID">An arbitrary integer that will be returned |
|
1024 | /// with the ParcelAccessList reply, useful for distinguishing between |
1033 | /// with the ParcelAccessList reply, useful for distinguishing between |
|
1025 | /// multiple simultaneous requests</param> |
1034 | /// multiple simultaneous requests</param> |
|
1026 | /// <param name="flags"></param> |
1035 | /// <param name="flags"></param> |
|
1027 | public void RequestParcelAccessList(Simulator simulator, int localID, AccessList flags, int sequenceID) |
1036 | public void RequestParcelAccessList(Simulator simulator, int localID, AccessList flags, int sequenceID) |
|
1028 | { |
1037 | { |
|
1029 | ParcelAccessListRequestPacket request = new ParcelAccessListRequestPacket(); |
1038 | ParcelAccessListRequestPacket request = new ParcelAccessListRequestPacket(); |
|
1030 | |
1039 | |
|
1031 | request.AgentData.AgentID = Client.Self.AgentID; |
1040 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1032 | request.AgentData.SessionID = Client.Self.SessionID; |
1041 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1033 | request.Data.LocalID = localID; |
1042 | request.Data.LocalID = localID; |
|
1034 | request.Data.Flags = (uint)flags; |
1043 | request.Data.Flags = (uint)flags; |
|
1035 | request.Data.SequenceID = sequenceID; |
1044 | request.Data.SequenceID = sequenceID; |
|
1036 | |
1045 | |
|
1037 | Client.Network.SendPacket(request, simulator); |
1046 | Client.Network.SendPacket(request, simulator); |
|
1038 | } |
1047 | } |
|
1039 | |
1048 | |
|
1040 | /// <summary> |
1049 | /// <summary> |
|
1041 | /// Request properties of parcels using a bounding box selection |
1050 | /// Request properties of parcels using a bounding box selection |
|
1042 | /// </summary> |
1051 | /// </summary> |
|
1043 | /// <param name="simulator">Simulator containing the parcel</param> |
1052 | /// <param name="simulator">Simulator containing the parcel</param> |
|
1044 | /// <param name="north">Northern boundary of the parcel selection</param> |
1053 | /// <param name="north">Northern boundary of the parcel selection</param> |
|
1045 | /// <param name="east">Eastern boundary of the parcel selection</param> |
1054 | /// <param name="east">Eastern boundary of the parcel selection</param> |
|
1046 | /// <param name="south">Southern boundary of the parcel selection</param> |
1055 | /// <param name="south">Southern boundary of the parcel selection</param> |
|
1047 | /// <param name="west">Western boundary of the parcel selection</param> |
1056 | /// <param name="west">Western boundary of the parcel selection</param> |
|
1048 | /// <param name="sequenceID">An arbitrary integer that will be returned |
1057 | /// <param name="sequenceID">An arbitrary integer that will be returned |
|
1049 | /// with the ParcelProperties reply, useful for distinguishing between |
1058 | /// with the ParcelProperties reply, useful for distinguishing between |
|
1050 | /// different types of parcel property requests</param> |
1059 | /// different types of parcel property requests</param> |
|
1051 | /// <param name="snapSelection">A boolean that is returned with the |
1060 | /// <param name="snapSelection">A boolean that is returned with the |
|
1052 | /// ParcelProperties reply, useful for snapping focus to a single |
1061 | /// ParcelProperties reply, useful for snapping focus to a single |
|
1053 | /// parcel</param> |
1062 | /// parcel</param> |
|
1054 | public void RequestParcelProperties(Simulator simulator, float north, float east, float south, float west, |
1063 | public void RequestParcelProperties(Simulator simulator, float north, float east, float south, float west, |
|
1055 | int sequenceID, bool snapSelection) |
1064 | int sequenceID, bool snapSelection) |
|
1056 | { |
1065 | { |
|
1057 | ParcelPropertiesRequestPacket request = new ParcelPropertiesRequestPacket(); |
1066 | ParcelPropertiesRequestPacket request = new ParcelPropertiesRequestPacket(); |
|
1058 | |
1067 | |
|
1059 | request.AgentData.AgentID = Client.Self.AgentID; |
1068 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1060 | request.AgentData.SessionID = Client.Self.SessionID; |
1069 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1061 | request.ParcelData.North = north; |
1070 | request.ParcelData.North = north; |
|
1062 | request.ParcelData.East = east; |
1071 | request.ParcelData.East = east; |
|
1063 | request.ParcelData.South = south; |
1072 | request.ParcelData.South = south; |
|
1064 | request.ParcelData.West = west; |
1073 | request.ParcelData.West = west; |
|
1065 | request.ParcelData.SequenceID = sequenceID; |
1074 | request.ParcelData.SequenceID = sequenceID; |
|
1066 | request.ParcelData.SnapSelection = snapSelection; |
1075 | request.ParcelData.SnapSelection = snapSelection; |
|
1067 | |
1076 | |
|
1068 | Client.Network.SendPacket(request, simulator); |
1077 | Client.Network.SendPacket(request, simulator); |
|
1069 | } |
1078 | } |
|
1070 | |
1079 | |
|
1071 | /// <summary> |
1080 | /// <summary> |
|
1072 | /// Request all simulator parcel properties (used for populating the <code>Simulator.Parcels</code> |
1081 | /// Request all simulator parcel properties (used for populating the <code>Simulator.Parcels</code> |
|
1073 | /// dictionary) |
1082 | /// dictionary) |
|
1074 | /// </summary> |
1083 | /// </summary> |
|
1075 | /// <param name="simulator">Simulator to request parcels from (must be connected)</param> |
1084 | /// <param name="simulator">Simulator to request parcels from (must be connected)</param> |
|
1076 | public void RequestAllSimParcels(Simulator simulator) |
1085 | public void RequestAllSimParcels(Simulator simulator) |
|
1077 | { |
1086 | { |
|
1078 | RequestAllSimParcels(simulator, false, 750); |
1087 | RequestAllSimParcels(simulator, false, 750); |
|
1079 | } |
1088 | } |
|
1080 | |
1089 | |
|
1081 | /// <summary> |
1090 | /// <summary> |
|
1082 | /// Request all simulator parcel properties (used for populating the <code>Simulator.Parcels</code> |
1091 | /// Request all simulator parcel properties (used for populating the <code>Simulator.Parcels</code> |
|
1083 | /// dictionary) |
1092 | /// dictionary) |
|
1084 | /// </summary> |
1093 | /// </summary> |
|
1085 | /// <param name="simulator">Simulator to request parcels from (must be connected)</param> |
1094 | /// <param name="simulator">Simulator to request parcels from (must be connected)</param> |
|
1086 | /// <param name="refresh">If TRUE, will force a full refresh</param> |
1095 | /// <param name="refresh">If TRUE, will force a full refresh</param> |
|
1087 | /// <param name="msDelay">Number of milliseconds to pause in between each request</param> |
1096 | /// <param name="msDelay">Number of milliseconds to pause in between each request</param> |
|
1088 | public void RequestAllSimParcels(Simulator simulator, bool refresh, int msDelay) |
1097 | public void RequestAllSimParcels(Simulator simulator, bool refresh, int msDelay) |
|
1089 | { |
1098 | { |
|
1090 | if (simulator.DownloadingParcelMap) |
1099 | if (simulator.DownloadingParcelMap) |
|
1091 | { |
1100 | { |
|
1092 | Logger.Log("Already downloading parcels in " + simulator.Name, Helpers.LogLevel.Info, Client); |
1101 | Logger.Log("Already downloading parcels in " + simulator.Name, Helpers.LogLevel.Info, Client); |
|
1093 | return; |
1102 | return; |
|
1094 | } |
1103 | } |
|
1095 | else |
1104 | else |
|
1096 | { |
1105 | { |
|
1097 | simulator.DownloadingParcelMap = true; |
1106 | simulator.DownloadingParcelMap = true; |
|
1098 | WaitForSimParcel = new AutoResetEvent(false); |
1107 | WaitForSimParcel = new AutoResetEvent(false); |
|
1099 | } |
1108 | } |
|
1100 | |
1109 | |
|
1101 | if (refresh) |
1110 | if (refresh) |
|
1102 | { |
1111 | { |
|
1103 | for (int y = 0; y < 64; y++) |
1112 | for (int y = 0; y < 64; y++) |
|
1104 | for (int x = 0; x < 64; x++) |
1113 | for (int x = 0; x < 64; x++) |
|
1105 | simulator.ParcelMap[y, x] = 0; |
1114 | simulator.ParcelMap[y, x] = 0; |
|
1106 | } |
1115 | } |
|
1107 | |
1116 | |
|
1108 | Thread th = new Thread(delegate() |
1117 | Thread th = new Thread(delegate() |
|
1109 | { |
1118 | { |
|
1110 | int count = 0, timeouts = 0, y, x; |
1119 | int count = 0, timeouts = 0, y, x; |
|
1111 | |
1120 | |
|
1112 | for (y = 0; y < 64; y++) |
1121 | for (y = 0; y < 64; y++) |
|
1113 | { |
1122 | { |
|
1114 | for (x = 0; x < 64; x++) |
1123 | for (x = 0; x < 64; x++) |
|
1115 | { |
1124 | { |
|
1116 | if (!Client.Network.Connected) |
1125 | if (!Client.Network.Connected) |
|
1117 | return; |
1126 | return; |
|
1118 | |
1127 | |
|
1119 | if (simulator.ParcelMap[y, x] == 0) |
1128 | if (simulator.ParcelMap[y, x] == 0) |
|
1120 | { |
1129 | { |
|
1121 | Client.Parcels.RequestParcelProperties(simulator, |
1130 | Client.Parcels.RequestParcelProperties(simulator, |
|
1122 | (y + 1) * 4.0f, (x + 1) * 4.0f, |
1131 | (y + 1) * 4.0f, (x + 1) * 4.0f, |
|
1123 | y * 4.0f, x * 4.0f, int.MaxValue, false); |
1132 | y * 4.0f, x * 4.0f, int.MaxValue, false); |
|
1124 | |
1133 | |
|
1125 | // Wait the given amount of time for a reply before sending the next request |
1134 | // Wait the given amount of time for a reply before sending the next request |
|
1126 | if (!WaitForSimParcel.WaitOne(msDelay, false)) |
1135 | if (!WaitForSimParcel.WaitOne(msDelay, false)) |
|
1127 | ++timeouts; |
1136 | ++timeouts; |
|
1128 | |
1137 | |
|
1129 | ++count; |
1138 | ++count; |
|
1130 | } |
1139 | } |
|
1131 | } |
1140 | } |
|
1132 | } |
1141 | } |
|
1133 | |
1142 | |
|
1134 | Logger.Log(String.Format( |
1143 | Logger.Log(String.Format( |
|
1135 | "Full simulator parcel information retrieved. Sent {0} parcel requests. Current outgoing queue: {1}, Retry Count {2}", |
1144 | "Full simulator parcel information retrieved. Sent {0} parcel requests. Current outgoing queue: {1}, Retry Count {2}", |
|
1136 | count, Client.Network.OutboxCount, timeouts), Helpers.LogLevel.Info, Client); |
1145 | count, Client.Network.OutboxCount, timeouts), Helpers.LogLevel.Info, Client); |
|
1137 | |
1146 | |
|
1138 | simulator.DownloadingParcelMap = false; |
1147 | simulator.DownloadingParcelMap = false; |
|
1139 | }); |
1148 | }); |
|
1140 | |
1149 | |
|
1141 | th.Start(); |
1150 | th.Start(); |
|
1142 | } |
1151 | } |
|
1143 | |
1152 | |
|
1144 | /// <summary> |
1153 | /// <summary> |
|
1145 | /// Request the dwell value for a parcel |
1154 | /// Request the dwell value for a parcel |
|
1146 | /// </summary> |
1155 | /// </summary> |
|
1147 | /// <param name="simulator">Simulator containing the parcel</param> |
1156 | /// <param name="simulator">Simulator containing the parcel</param> |
|
1148 | /// <param name="localID">Simulator-local ID of the parcel</param> |
1157 | /// <param name="localID">Simulator-local ID of the parcel</param> |
|
1149 | public void RequestDwell(Simulator simulator, int localID) |
1158 | public void RequestDwell(Simulator simulator, int localID) |
|
1150 | { |
1159 | { |
|
1151 | ParcelDwellRequestPacket request = new ParcelDwellRequestPacket(); |
1160 | ParcelDwellRequestPacket request = new ParcelDwellRequestPacket(); |
|
1152 | request.AgentData.AgentID = Client.Self.AgentID; |
1161 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1153 | request.AgentData.SessionID = Client.Self.SessionID; |
1162 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1154 | request.Data.LocalID = localID; |
1163 | request.Data.LocalID = localID; |
|
1155 | request.Data.ParcelID = UUID.Zero; // Not used by clients |
1164 | request.Data.ParcelID = UUID.Zero; // Not used by clients |
|
1156 | |
1165 | |
|
1157 | Client.Network.SendPacket(request, simulator); |
1166 | Client.Network.SendPacket(request, simulator); |
|
1158 | } |
1167 | } |
|
1159 | |
1168 | |
|
1160 | /// <summary> |
1169 | /// <summary> |
|
1161 | /// Send a request to Purchase a parcel of land |
1170 | /// Send a request to Purchase a parcel of land |
|
1162 | /// </summary> |
1171 | /// </summary> |
|
1163 | /// <param name="simulator">The Simulator the parcel is located in</param> |
1172 | /// <param name="simulator">The Simulator the parcel is located in</param> |
|
1164 | /// <param name="localID">The parcels region specific local ID</param> |
1173 | /// <param name="localID">The parcels region specific local ID</param> |
|
1165 | /// <param name="forGroup">true if this parcel is being purchased by a group</param> |
1174 | /// <param name="forGroup">true if this parcel is being purchased by a group</param> |
|
1166 | /// <param name="groupID">The groups <seealso cref="T:OpenMetaverse.UUID"/></param> |
1175 | /// <param name="groupID">The groups <seealso cref="T:OpenMetaverse.UUID"/></param> |
|
1167 | /// <param name="removeContribution">true to remove tier contribution if purchase is successful</param> |
1176 | /// <param name="removeContribution">true to remove tier contribution if purchase is successful</param> |
|
1168 | /// <param name="parcelArea">The parcels size</param> |
1177 | /// <param name="parcelArea">The parcels size</param> |
|
1169 | /// <param name="parcelPrice">The purchase price of the parcel</param> |
1178 | /// <param name="parcelPrice">The purchase price of the parcel</param> |
|
1170 | /// <returns></returns> |
1179 | /// <returns></returns> |
|
1171 | public void Buy(Simulator simulator, int localID, bool forGroup, UUID groupID, |
1180 | public void Buy(Simulator simulator, int localID, bool forGroup, UUID groupID, |
|
1172 | bool removeContribution, int parcelArea, int parcelPrice) |
1181 | bool removeContribution, int parcelArea, int parcelPrice) |
|
1173 | { |
1182 | { |
|
1174 | ParcelBuyPacket request = new ParcelBuyPacket(); |
1183 | ParcelBuyPacket request = new ParcelBuyPacket(); |
|
1175 | |
1184 | |
|
1176 | request.AgentData.AgentID = Client.Self.AgentID; |
1185 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1177 | request.AgentData.SessionID = Client.Self.SessionID; |
1186 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1178 | |
1187 | |
|
1179 | request.Data.Final = true; |
1188 | request.Data.Final = true; |
|
1180 | request.Data.GroupID = groupID; |
1189 | request.Data.GroupID = groupID; |
|
1181 | request.Data.LocalID = localID; |
1190 | request.Data.LocalID = localID; |
|
1182 | request.Data.IsGroupOwned = forGroup; |
1191 | request.Data.IsGroupOwned = forGroup; |
|
1183 | request.Data.RemoveContribution = removeContribution; |
1192 | request.Data.RemoveContribution = removeContribution; |
|
1184 | |
1193 | |
|
1185 | request.ParcelData.Area = parcelArea; |
1194 | request.ParcelData.Area = parcelArea; |
|
1186 | request.ParcelData.Price = parcelPrice; |
1195 | request.ParcelData.Price = parcelPrice; |
|
1187 | |
1196 | |
|
1188 | Client.Network.SendPacket(request, simulator); |
1197 | Client.Network.SendPacket(request, simulator); |
|
1189 | } |
1198 | } |
|
1190 | |
1199 | |
|
1191 | /// <summary> |
1200 | /// <summary> |
|
1192 | /// Reclaim a parcel of land |
1201 | /// Reclaim a parcel of land |
|
1193 | /// </summary> |
1202 | /// </summary> |
|
1194 | /// <param name="simulator">The simulator the parcel is in</param> |
1203 | /// <param name="simulator">The simulator the parcel is in</param> |
|
1195 | /// <param name="localID">The parcels region specific local ID</param> |
1204 | /// <param name="localID">The parcels region specific local ID</param> |
|
1196 | public void Reclaim(Simulator simulator, int localID) |
1205 | public void Reclaim(Simulator simulator, int localID) |
|
1197 | { |
1206 | { |
|
1198 | ParcelReclaimPacket request = new ParcelReclaimPacket(); |
1207 | ParcelReclaimPacket request = new ParcelReclaimPacket(); |
|
1199 | request.AgentData.AgentID = Client.Self.AgentID; |
1208 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1200 | request.AgentData.SessionID = Client.Self.SessionID; |
1209 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1201 | |
1210 | |
|
1202 | request.Data.LocalID = localID; |
1211 | request.Data.LocalID = localID; |
|
1203 | |
1212 | |
|
1204 | Client.Network.SendPacket(request, simulator); |
1213 | Client.Network.SendPacket(request, simulator); |
|
1205 | } |
1214 | } |
|
1206 | |
1215 | |
|
1207 | /// <summary> |
1216 | /// <summary> |
|
1208 | /// Deed a parcel to a group |
1217 | /// Deed a parcel to a group |
|
1209 | /// </summary> |
1218 | /// </summary> |
|
1210 | /// <param name="simulator">The simulator the parcel is in</param> |
1219 | /// <param name="simulator">The simulator the parcel is in</param> |
|
1211 | /// <param name="localID">The parcels region specific local ID</param> |
1220 | /// <param name="localID">The parcels region specific local ID</param> |
|
1212 | /// <param name="groupID">The groups <seealso cref="T:OpenMetaverse.UUID"/></param> |
1221 | /// <param name="groupID">The groups <seealso cref="T:OpenMetaverse.UUID"/></param> |
|
1213 | public void DeedToGroup(Simulator simulator, int localID, UUID groupID) |
1222 | public void DeedToGroup(Simulator simulator, int localID, UUID groupID) |
|
1214 | { |
1223 | { |
|
1215 | ParcelDeedToGroupPacket request = new ParcelDeedToGroupPacket(); |
1224 | ParcelDeedToGroupPacket request = new ParcelDeedToGroupPacket(); |
|
1216 | request.AgentData.AgentID = Client.Self.AgentID; |
1225 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1217 | request.AgentData.SessionID = Client.Self.SessionID; |
1226 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1218 | |
1227 | |
|
1219 | request.Data.LocalID = localID; |
1228 | request.Data.LocalID = localID; |
|
1220 | request.Data.GroupID = groupID; |
1229 | request.Data.GroupID = groupID; |
|
1221 | |
1230 | |
|
1222 | Client.Network.SendPacket(request, simulator); |
1231 | Client.Network.SendPacket(request, simulator); |
|
1223 | } |
1232 | } |
|
1224 | |
1233 | |
|
1225 | /// <summary> |
1234 | /// <summary> |
|
1226 | /// Request prim owners of a parcel of land. |
1235 | /// Request prim owners of a parcel of land. |
|
1227 | /// </summary> |
1236 | /// </summary> |
|
1228 | /// <param name="simulator">Simulator parcel is in</param> |
1237 | /// <param name="simulator">Simulator parcel is in</param> |
|
1229 | /// <param name="localID">The parcels region specific local ID</param> |
1238 | /// <param name="localID">The parcels region specific local ID</param> |
|
1230 | public void RequestObjectOwners(Simulator simulator, int localID) |
1239 | public void RequestObjectOwners(Simulator simulator, int localID) |
|
1231 | { |
1240 | { |
|
1232 | ParcelObjectOwnersRequestPacket request = new ParcelObjectOwnersRequestPacket(); |
1241 | ParcelObjectOwnersRequestPacket request = new ParcelObjectOwnersRequestPacket(); |
|
1233 | |
1242 | |
|
1234 | request.AgentData.AgentID = Client.Self.AgentID; |
1243 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1235 | request.AgentData.SessionID = Client.Self.SessionID; |
1244 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1236 | |
1245 | |
|
1237 | request.ParcelData.LocalID = localID; |
1246 | request.ParcelData.LocalID = localID; |
|
1238 | Client.Network.SendPacket(request, simulator); |
1247 | Client.Network.SendPacket(request, simulator); |
|
1239 | } |
1248 | } |
|
1240 | |
1249 | |
|
1241 | /// <summary> |
1250 | /// <summary> |
|
1242 | /// Return objects from a parcel |
1251 | /// Return objects from a parcel |
|
1243 | /// </summary> |
1252 | /// </summary> |
|
1244 | /// <param name="simulator">Simulator parcel is in</param> |
1253 | /// <param name="simulator">Simulator parcel is in</param> |
|
1245 | /// <param name="localID">The parcels region specific local ID</param> |
1254 | /// <param name="localID">The parcels region specific local ID</param> |
|
1246 | /// <param name="type">the type of objects to return, <seealso cref="T:OpenMetaverse.ObjectReturnType"/></param> |
1255 | /// <param name="type">the type of objects to return, <seealso cref="T:OpenMetaverse.ObjectReturnType"/></param> |
|
1247 | /// <param name="ownerIDs">A list containing object owners <seealso cref="OpenMetaverse.UUID"/>s to return</param> |
1256 | /// <param name="ownerIDs">A list containing object owners <seealso cref="OpenMetaverse.UUID"/>s to return</param> |
|
1248 | public void ReturnObjects(Simulator simulator, int localID, ObjectReturnType type, List<UUID> ownerIDs) |
1257 | public void ReturnObjects(Simulator simulator, int localID, ObjectReturnType type, List<UUID> ownerIDs) |
|
1249 | { |
1258 | { |
|
1250 | ParcelReturnObjectsPacket request = new ParcelReturnObjectsPacket(); |
1259 | ParcelReturnObjectsPacket request = new ParcelReturnObjectsPacket(); |
|
1251 | request.AgentData.AgentID = Client.Self.AgentID; |
1260 | request.AgentData.AgentID = Client.Self.AgentID; |
|
1252 | request.AgentData.SessionID = Client.Self.SessionID; |
1261 | request.AgentData.SessionID = Client.Self.SessionID; |
|
1253 | |
1262 | |
|
1254 | request.ParcelData.LocalID = localID; |
1263 | request.ParcelData.LocalID = localID; |
|
1255 | request.ParcelData.ReturnType = (uint)type; |
1264 | request.ParcelData.ReturnType = (uint)type; |
|
1256 | |
1265 | |
|
1257 | // A single null TaskID is (not) used for parcel object returns |
1266 | // A single null TaskID is (not) used for parcel object returns |
|
1258 | request.TaskIDs = new ParcelReturnObjectsPacket.TaskIDsBlock[1]; |
1267 | request.TaskIDs = new ParcelReturnObjectsPacket.TaskIDsBlock[1]; |
|
1259 | request.TaskIDs[0] = new ParcelReturnObjectsPacket.TaskIDsBlock(); |
1268 | request.TaskIDs[0] = new ParcelReturnObjectsPacket.TaskIDsBlock(); |
|
1260 | request.TaskIDs[0].TaskID = UUID.Zero; |
1269 | request.TaskIDs[0].TaskID = UUID.Zero; |
|
1261 | |
1270 | |
|
1262 | // Convert the list of owner UUIDs to packet blocks if a list is given |
1271 | // Convert the list of owner UUIDs to packet blocks if a list is given |
|
1263 | if (ownerIDs != null) |
1272 | if (ownerIDs != null) |
|
1264 | { |
1273 | { |
|
1265 | request.OwnerIDs = new ParcelReturnObjectsPacket.OwnerIDsBlock[ownerIDs.Count]; |
1274 | request.OwnerIDs = new ParcelReturnObjectsPacket.OwnerIDsBlock[ownerIDs.Count]; |
|
1266 | |
1275 | |
|
1267 | for (int i = 0; i < ownerIDs.Count; i++) |
1276 | for (int i = 0; i < ownerIDs.Count; i++) |
|
1268 | { |
1277 | { |
|
1269 | request.OwnerIDs[i] = new ParcelReturnObjectsPacket.OwnerIDsBlock(); |
1278 | request.OwnerIDs[i] = new ParcelReturnObjectsPacket.OwnerIDsBlock(); |
|
1270 | request.OwnerIDs[i].OwnerID = ownerIDs[i]; |
1279 | request.OwnerIDs[i].OwnerID = ownerIDs[i]; |
|
1271 | } |
1280 | } |
|
1272 | } |
1281 | } |
|
1273 | else |
1282 | else |
|
1274 | { |
1283 | { |
|
1275 | request.OwnerIDs = new ParcelReturnObjectsPacket.OwnerIDsBlock[0]; |
1284 | request.OwnerIDs = new ParcelReturnObjectsPacket.OwnerIDsBlock[0]; |
|
1276 | } |
1285 | } |
|
1277 | |
1286 | |
|
1278 | Client.Network.SendPacket(request, simulator); |
1287 | Client.Network.SendPacket(request, simulator); |
|
1279 | } |
1288 | } |
|
1280 | |
1289 | |
|
1281 | /// <summary> |
1290 | /// <summary> |
|
1282 | /// Subdivide (split) a parcel |
1291 | /// Subdivide (split) a parcel |
|
1283 | /// </summary> |
1292 | /// </summary> |
|
1284 | /// <param name="simulator"></param> |
1293 | /// <param name="simulator"></param> |
|
1285 | /// <param name="west"></param> |
1294 | /// <param name="west"></param> |
|
1286 | /// <param name="south"></param> |
1295 | /// <param name="south"></param> |
|
1287 | /// <param name="east"></param> |
1296 | /// <param name="east"></param> |
|
1288 | /// <param name="north"></param> |
1297 | /// <param name="north"></param> |
|
1289 | public void ParcelSubdivide(Simulator simulator, float west, float south, float east, float north) |
1298 | public void ParcelSubdivide(Simulator simulator, float west, float south, float east, float north) |
|
1290 | { |
1299 | { |
|
1291 | ParcelDividePacket divide = new ParcelDividePacket(); |
1300 | ParcelDividePacket divide = new ParcelDividePacket(); |
|
1292 | divide.AgentData.AgentID = Client.Self.AgentID; |
1301 | divide.AgentData.AgentID = Client.Self.AgentID; |
|
1293 | divide.AgentData.SessionID = Client.Self.SessionID; |
1302 | divide.AgentData.SessionID = Client.Self.SessionID; |
|
1294 | divide.ParcelData.East = east; |
1303 | divide.ParcelData.East = east; |
|
1295 | divide.ParcelData.North = north; |
1304 | divide.ParcelData.North = north; |
|
1296 | divide.ParcelData.South = south; |
1305 | divide.ParcelData.South = south; |
|
1297 | divide.ParcelData.West = west; |
1306 | divide.ParcelData.West = west; |
|
1298 | |
1307 | |
|
1299 | Client.Network.SendPacket(divide, simulator); |
1308 | Client.Network.SendPacket(divide, simulator); |
|
1300 | } |
1309 | } |
|
1301 | |
1310 | |
|
1302 | /// <summary> |
1311 | /// <summary> |
|
1303 | /// Join two parcels of land creating a single parcel |
1312 | /// Join two parcels of land creating a single parcel |
|
1304 | /// </summary> |
1313 | /// </summary> |
|
1305 | /// <param name="simulator"></param> |
1314 | /// <param name="simulator"></param> |
|
1306 | /// <param name="west"></param> |
1315 | /// <param name="west"></param> |
|
1307 | /// <param name="south"></param> |
1316 | /// <param name="south"></param> |
|
1308 | /// <param name="east"></param> |
1317 | /// <param name="east"></param> |
|
1309 | /// <param name="north"></param> |
1318 | /// <param name="north"></param> |
|
1310 | public void ParcelJoin(Simulator simulator, float west, float south, float east, float north) |
1319 | public void ParcelJoin(Simulator simulator, float west, float south, float east, float north) |
|
1311 | { |
1320 | { |
|
1312 | ParcelJoinPacket join = new ParcelJoinPacket(); |
1321 | ParcelJoinPacket join = new ParcelJoinPacket(); |
|
1313 | join.AgentData.AgentID = Client.Self.AgentID; |
1322 | join.AgentData.AgentID = Client.Self.AgentID; |
|
1314 | join.AgentData.SessionID = Client.Self.SessionID; |
1323 | join.AgentData.SessionID = Client.Self.SessionID; |
|
1315 | join.ParcelData.East = east; |
1324 | join.ParcelData.East = east; |
|
1316 | join.ParcelData.North = north; |
1325 | join.ParcelData.North = north; |
|
1317 | join.ParcelData.South = south; |
1326 | join.ParcelData.South = south; |
|
1318 | join.ParcelData.West = west; |
1327 | join.ParcelData.West = west; |
|
1319 | |
1328 | |
|
1320 | Client.Network.SendPacket(join, simulator); |
1329 | Client.Network.SendPacket(join, simulator); |
|
1321 | } |
1330 | } |
|
1322 | |
1331 | |
|
1323 | /// <summary> |
1332 | /// <summary> |
|
1324 | /// Get a parcels LocalID |
1333 | /// Get a parcels LocalID |
|
1325 | /// </summary> |
1334 | /// </summary> |
|
1326 | /// <param name="simulator">Simulator parcel is in</param> |
1335 | /// <param name="simulator">Simulator parcel is in</param> |
|
1327 | /// <param name="position">Vector3 position in simulator (Z not used)</param> |
1336 | /// <param name="position">Vector3 position in simulator (Z not used)</param> |
|
1328 | /// <returns>0 on failure, or parcel LocalID on success.</returns> |
1337 | /// <returns>0 on failure, or parcel LocalID on success.</returns> |
|
1329 | /// <remarks>A call to <code>Parcels.RequestAllSimParcels</code> is required to populate map and |
1338 | /// <remarks>A call to <code>Parcels.RequestAllSimParcels</code> is required to populate map and |
|
1330 | /// dictionary.</remarks> |
1339 | /// dictionary.</remarks> |
|
1331 | public int GetParcelLocalID(Simulator simulator, Vector3 position) |
1340 | public int GetParcelLocalID(Simulator simulator, Vector3 position) |
|
1332 | { |
1341 | { |
|
1333 | if (simulator.ParcelMap[(byte)position.Y / 4, (byte)position.X / 4] > 0) |
1342 | if (simulator.ParcelMap[(byte)position.Y / 4, (byte)position.X / 4] > 0) |
|
1334 | { |
1343 | { |
|
1335 | return simulator.ParcelMap[(byte)position.Y / 4, (byte)position.X / 4]; |
1344 | return simulator.ParcelMap[(byte)position.Y / 4, (byte)position.X / 4]; |
|
1336 | } |
1345 | } |
|
1337 | else |
1346 | else |
|
1338 | { |
1347 | { |
|
1339 | Logger.Log(String.Format("ParcelMap returned an default/invalid value for location {0}/{1} Did you use RequestAllSimParcels() to populate the dictionaries?", (byte)position.Y / 4, (byte)position.X / 4 ), Helpers.LogLevel.Warning); |
1348 | Logger.Log(String.Format("ParcelMap returned an default/invalid value for location {0}/{1} Did you use RequestAllSimParcels() to populate the dictionaries?", (byte)position.Y / 4, (byte)position.X / 4 ), Helpers.LogLevel.Warning); |
|
1340 | return 0; |
1349 | return 0; |
|
1341 | } |
1350 | } |
|
1342 | } |
1351 | } |
|
1343 | |
1352 | |
|
1344 | /// <summary> |
1353 | /// <summary> |
|
1345 | /// Terraform (raise, lower, etc) an area or whole parcel of land |
1354 | /// Terraform (raise, lower, etc) an area or whole parcel of land |
|
1346 | /// </summary> |
1355 | /// </summary> |
|
1347 | /// <param name="simulator">Simulator land area is in.</param> |
1356 | /// <param name="simulator">Simulator land area is in.</param> |
|
1348 | /// <param name="localID">LocalID of parcel, or -1 if using bounding box</param> |
1357 | /// <param name="localID">LocalID of parcel, or -1 if using bounding box</param> |
|
1349 | /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param> |
1358 | /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param> |
|
1350 | /// <param name="brushSize">Size of area to modify</param> |
1359 | /// <param name="brushSize">Size of area to modify</param> |
|
1351 | /// <returns>true on successful request sent.</returns> |
1360 | /// <returns>true on successful request sent.</returns> |
|
1352 | /// <remarks>Settings.STORE_LAND_PATCHES must be true, |
1361 | /// <remarks>Settings.STORE_LAND_PATCHES must be true, |
|
1353 | /// Parcel information must be downloaded using <code>RequestAllSimParcels()</code></remarks> |
1362 | /// Parcel information must be downloaded using <code>RequestAllSimParcels()</code></remarks> |
|
1354 | public bool Terraform(Simulator simulator, int localID, TerraformAction action, TerraformBrushSize brushSize) |
1363 | public bool Terraform(Simulator simulator, int localID, TerraformAction action, TerraformBrushSize brushSize) |
|
1355 | { |
1364 | { |
|
1356 | return Terraform(simulator, localID, 0f, 0f, 0f, 0f, action, brushSize, 1); |
1365 | return Terraform(simulator, localID, 0f, 0f, 0f, 0f, action, brushSize, 1); |
|
1357 | } |
1366 | } |
|
1358 | |
1367 | |
|
1359 | /// <summary> |
1368 | /// <summary> |
|
1360 | /// Terraform (raise, lower, etc) an area or whole parcel of land |
1369 | /// Terraform (raise, lower, etc) an area or whole parcel of land |
|
1361 | /// </summary> |
1370 | /// </summary> |
|
1362 | /// <param name="simulator">Simulator land area is in.</param> |
1371 | /// <param name="simulator">Simulator land area is in.</param> |
|
1363 | /// <param name="west">west border of area to modify</param> |
1372 | /// <param name="west">west border of area to modify</param> |
|
1364 | /// <param name="south">south border of area to modify</param> |
1373 | /// <param name="south">south border of area to modify</param> |
|
1365 | /// <param name="east">east border of area to modify</param> |
1374 | /// <param name="east">east border of area to modify</param> |
|
1366 | /// <param name="north">north border of area to modify</param> |
1375 | /// <param name="north">north border of area to modify</param> |
|
1367 | /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param> |
1376 | /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param> |
|
1368 | /// <param name="brushSize">Size of area to modify</param> |
1377 | /// <param name="brushSize">Size of area to modify</param> |
|
1369 | /// <returns>true on successful request sent.</returns> |
1378 | /// <returns>true on successful request sent.</returns> |
|
1370 | /// <remarks>Settings.STORE_LAND_PATCHES must be true, |
1379 | /// <remarks>Settings.STORE_LAND_PATCHES must be true, |
|
1371 | /// Parcel information must be downloaded using <code>RequestAllSimParcels()</code></remarks> |
1380 | /// Parcel information must be downloaded using <code>RequestAllSimParcels()</code></remarks> |
|
1372 | public bool Terraform(Simulator simulator, float west, float south, float east, float north, |
1381 | public bool Terraform(Simulator simulator, float west, float south, float east, float north, |
|
1373 | TerraformAction action, TerraformBrushSize brushSize) |
1382 | TerraformAction action, TerraformBrushSize brushSize) |
|
1374 | { |
1383 | { |
|
1375 | return Terraform(simulator, -1, west, south, east, north, action, brushSize, 1); |
1384 | return Terraform(simulator, -1, west, south, east, north, action, brushSize, 1); |
|
1376 | } |
1385 | } |
|
1377 | |
1386 | |
|
1378 | /// <summary> |
1387 | /// <summary> |
|
1379 | /// Terraform (raise, lower, etc) an area or whole parcel of land |
1388 | /// Terraform (raise, lower, etc) an area or whole parcel of land |
|
1380 | /// </summary> |
1389 | /// </summary> |
|
1381 | /// <param name="simulator">Simulator land area is in.</param> |
1390 | /// <param name="simulator">Simulator land area is in.</param> |
|
1382 | /// <param name="localID">LocalID of parcel, or -1 if using bounding box</param> |
1391 | /// <param name="localID">LocalID of parcel, or -1 if using bounding box</param> |
|
1383 | /// <param name="west">west border of area to modify</param> |
1392 | /// <param name="west">west border of area to modify</param> |
|
1384 | /// <param name="south">south border of area to modify</param> |
1393 | /// <param name="south">south border of area to modify</param> |
|
1385 | /// <param name="east">east border of area to modify</param> |
1394 | /// <param name="east">east border of area to modify</param> |
|
1386 | /// <param name="north">north border of area to modify</param> |
1395 | /// <param name="north">north border of area to modify</param> |
|
1387 | /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param> |
1396 | /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param> |
|
1388 | /// <param name="brushSize">Size of area to modify</param> |
1397 | /// <param name="brushSize">Size of area to modify</param> |
|
1389 | /// <param name="seconds">How many meters + or - to lower, 1 = 1 meter</param> |
1398 | /// <param name="seconds">How many meters + or - to lower, 1 = 1 meter</param> |
|
1390 | /// <returns>true on successful request sent.</returns> |
1399 | /// <returns>true on successful request sent.</returns> |
|
1391 | /// <remarks>Settings.STORE_LAND_PATCHES must be true, |
1400 | /// <remarks>Settings.STORE_LAND_PATCHES must be true, |
|
1392 | /// Parcel information must be downloaded using <code>RequestAllSimParcels()</code></remarks> |
1401 | /// Parcel information must be downloaded using <code>RequestAllSimParcels()</code></remarks> |
|
1393 | public bool Terraform(Simulator simulator, int localID, float west, float south, float east, float north, |
1402 | public bool Terraform(Simulator simulator, int localID, float west, float south, float east, float north, |
|
1394 | TerraformAction action, TerraformBrushSize brushSize, int seconds) |
1403 | TerraformAction action, TerraformBrushSize brushSize, int seconds) |
|
1395 | { |
1404 | { |
|
1396 | float height = 0f; |
1405 | float height = 0f; |
|
1397 | int x, y; |
1406 | int x, y; |
|
1398 | if (localID == -1) |
1407 | if (localID == -1) |
|
1399 | { |
1408 | { |
|
1400 | x = (int)east - (int)west / 2; |
1409 | x = (int)east - (int)west / 2; |
|
1401 | y = (int)north - (int)south / 2; |
1410 | y = (int)north - (int)south / 2; |
|
1402 | } |
1411 | } |
|
1403 | else |
1412 | else |
|
1404 | { |
1413 | { |
|
1405 | Parcel p; |
1414 | Parcel p; |
|
1406 | if (!simulator.Parcels.TryGetValue(localID, out p)) |
1415 | if (!simulator.Parcels.TryGetValue(localID, out p)) |
|
1407 | { |
1416 | { |
|
1408 | Logger.Log(String.Format("Can't find parcel {0} in simulator {1}", localID, simulator), |
1417 | Logger.Log(String.Format("Can't find parcel {0} in simulator {1}", localID, simulator), |
|
1409 | Helpers.LogLevel.Warning, Client); |
1418 | Helpers.LogLevel.Warning, Client); |
|
1410 | return false; |
1419 | return false; |
|
1411 | } |
1420 | } |
|
1412 | |
1421 | |
|
1413 | x = (int)p.AABBMax.X - (int)p.AABBMin.X / 2; |
1422 | x = (int)p.AABBMax.X - (int)p.AABBMin.X / 2; |
|
1414 | y = (int)p.AABBMax.Y - (int)p.AABBMin.Y / 2; |
1423 | y = (int)p.AABBMax.Y - (int)p.AABBMin.Y / 2; |
|
1415 | } |
1424 | } |
|
1416 | |
1425 | |
|
1417 | if (!simulator.TerrainHeightAtPoint(x, y, out height)) |
1426 | if (!simulator.TerrainHeightAtPoint(x, y, out height)) |
|
1418 | { |
1427 | { |
|
1419 | Logger.Log("Land Patch not stored for location", Helpers.LogLevel.Warning, Client); |
1428 | Logger.Log("Land Patch not stored for location", Helpers.LogLevel.Warning, Client); |
|
1420 | return false; |
1429 | return false; |
|
1421 | } |
1430 | } |
|
1422 | |
1431 | |
|
1423 | Terraform(simulator, localID, west, south, east, north, action, brushSize, seconds, height); |
1432 | Terraform(simulator, localID, west, south, east, north, action, brushSize, seconds, height); |
|
1424 | return true; |
1433 | return true; |
|
1425 | } |
1434 | } |
|
1426 | |
1435 | |
|
1427 | /// <summary> |
1436 | /// <summary> |
|
1428 | /// Terraform (raise, lower, etc) an area or whole parcel of land |
1437 | /// Terraform (raise, lower, etc) an area or whole parcel of land |
|
1429 | /// </summary> |
1438 | /// </summary> |
|
1430 | /// <param name="simulator">Simulator land area is in.</param> |
1439 | /// <param name="simulator">Simulator land area is in.</param> |
|
1431 | /// <param name="localID">LocalID of parcel, or -1 if using bounding box</param> |
1440 | /// <param name="localID">LocalID of parcel, or -1 if using bounding box</param> |
|
1432 | /// <param name="west">west border of area to modify</param> |
1441 | /// <param name="west">west border of area to modify</param> |
|
1433 | /// <param name="south">south border of area to modify</param> |
1442 | /// <param name="south">south border of area to modify</param> |
|
1434 | /// <param name="east">east border of area to modify</param> |
1443 | /// <param name="east">east border of area to modify</param> |
|
1435 | /// <param name="north">north border of area to modify</param> |
1444 | /// <param name="north">north border of area to modify</param> |
|
1436 | /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param> |
1445 | /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param> |
|
1437 | /// <param name="brushSize">Size of area to modify</param> |
1446 | /// <param name="brushSize">Size of area to modify</param> |
|
1438 | /// <param name="seconds">How many meters + or - to lower, 1 = 1 meter</param> |
1447 | /// <param name="seconds">How many meters + or - to lower, 1 = 1 meter</param> |
|
1439 | /// <param name="height">Height at which the terraform operation is acting at</param> |
1448 | /// <param name="height">Height at which the terraform operation is acting at</param> |
|
1440 | public void Terraform(Simulator simulator, int localID, float west, float south, float east, float north, |
1449 | public void Terraform(Simulator simulator, int localID, float west, float south, float east, float north, |
|
1441 | TerraformAction action, TerraformBrushSize brushSize, int seconds, float height) |
1450 | TerraformAction action, TerraformBrushSize brushSize, int seconds, float height) |
|
1442 | { |
1451 | { |
|
1443 | ModifyLandPacket land = new ModifyLandPacket(); |
1452 | ModifyLandPacket land = new ModifyLandPacket(); |
|
1444 | land.AgentData.AgentID = Client.Self.AgentID; |
1453 | land.AgentData.AgentID = Client.Self.AgentID; |
|
1445 | land.AgentData.SessionID = Client.Self.SessionID; |
1454 | land.AgentData.SessionID = Client.Self.SessionID; |
|
1446 | |
1455 | |
|
1447 | land.ModifyBlock.Action = (byte)action; |
1456 | land.ModifyBlock.Action = (byte)action; |
|
1448 | land.ModifyBlock.BrushSize = (byte)brushSize; |
1457 | land.ModifyBlock.BrushSize = (byte)brushSize; |
|
1449 | land.ModifyBlock.Seconds = seconds; |
1458 | land.ModifyBlock.Seconds = seconds; |
|
1450 | land.ModifyBlock.Height = height; |
1459 | land.ModifyBlock.Height = height; |
|
1451 | |
1460 | |
|
1452 | land.ParcelData = new ModifyLandPacket.ParcelDataBlock[1]; |
1461 | land.ParcelData = new ModifyLandPacket.ParcelDataBlock[1]; |
|
1453 | land.ParcelData[0] = new ModifyLandPacket.ParcelDataBlock(); |
1462 | land.ParcelData[0] = new ModifyLandPacket.ParcelDataBlock(); |
|
1454 | land.ParcelData[0].LocalID = localID; |
1463 | land.ParcelData[0].LocalID = localID; |
|
1455 | land.ParcelData[0].West = west; |
1464 | land.ParcelData[0].West = west; |
|
1456 | land.ParcelData[0].South = south; |
1465 | land.ParcelData[0].South = south; |
|
1457 | land.ParcelData[0].East = east; |
1466 | land.ParcelData[0].East = east; |
|
1458 | land.ParcelData[0].North = north; |
1467 | land.ParcelData[0].North = north; |
|
1459 | |
1468 | |
|
1460 | land.ModifyBlockExtended = new ModifyLandPacket.ModifyBlockExtendedBlock[1]; |
1469 | land.ModifyBlockExtended = new ModifyLandPacket.ModifyBlockExtendedBlock[1]; |
|
1461 | land.ModifyBlockExtended[0] = new ModifyLandPacket.ModifyBlockExtendedBlock(); |
1470 | land.ModifyBlockExtended[0] = new ModifyLandPacket.ModifyBlockExtendedBlock(); |
|
1462 | land.ModifyBlockExtended[0].BrushSize = (float)brushSize; |
1471 | land.ModifyBlockExtended[0].BrushSize = (float)brushSize; |
|
1463 | |
1472 | |
|
1464 | Client.Network.SendPacket(land, simulator); |
1473 | Client.Network.SendPacket(land, simulator); |
|
1465 | } |
1474 | } |
|
1466 | |
1475 | |
|
1467 | /// <summary> |
1476 | /// <summary> |
|
1468 | /// Sends a request to the simulator to return a list of objects owned by specific owners |
1477 | /// Sends a request to the simulator to return a list of objects owned by specific owners |
|
1469 | /// </summary> |
1478 | /// </summary> |
|
1470 | /// <param name="localID">Simulator local ID of parcel</param> |
1479 | /// <param name="localID">Simulator local ID of parcel</param> |
|
1471 | /// <param name="selectType">Owners, Others, Etc</param> |
1480 | /// <param name="selectType">Owners, Others, Etc</param> |
|
1472 | /// <param name="ownerID">List containing keys of avatars objects to select; |
1481 | /// <param name="ownerID">List containing keys of avatars objects to select; |
|
1473 | /// if List is null will return Objects of type <c>selectType</c></param> |
1482 | /// if List is null will return Objects of type <c>selectType</c></param> |
|
1474 | /// <remarks>Response data is returned in the event <seealso cref="E:ForceSelectObjectsReply"/></remarks> |
1483 | /// <remarks>Response data is returned in the event <seealso cref="E:ForceSelectObjectsReply"/></remarks> |
|
1475 | public void RequestSelectObjects(int localID, ObjectReturnType selectType, UUID ownerID) |
1484 | public void RequestSelectObjects(int localID, ObjectReturnType selectType, UUID ownerID) |
|
1476 | { |
1485 | { |
|
1477 | ParcelSelectObjectsPacket select = new ParcelSelectObjectsPacket(); |
1486 | ParcelSelectObjectsPacket select = new ParcelSelectObjectsPacket(); |
|
1478 | select.AgentData.AgentID = Client.Self.AgentID; |
1487 | select.AgentData.AgentID = Client.Self.AgentID; |
|
1479 | select.AgentData.SessionID = Client.Self.SessionID; |
1488 | select.AgentData.SessionID = Client.Self.SessionID; |
|
1480 | |
1489 | |
|
1481 | select.ParcelData.LocalID = localID; |
1490 | select.ParcelData.LocalID = localID; |
|
1482 | select.ParcelData.ReturnType = (uint)selectType; |
1491 | select.ParcelData.ReturnType = (uint)selectType; |
|
1483 | |
1492 | |
|
1484 | select.ReturnIDs = new ParcelSelectObjectsPacket.ReturnIDsBlock[1]; |
1493 | select.ReturnIDs = new ParcelSelectObjectsPacket.ReturnIDsBlock[1]; |
|
1485 | select.ReturnIDs[0] = new ParcelSelectObjectsPacket.ReturnIDsBlock(); |
1494 | select.ReturnIDs[0] = new ParcelSelectObjectsPacket.ReturnIDsBlock(); |
|
1486 | select.ReturnIDs[0].ReturnID = ownerID; |
1495 | select.ReturnIDs[0].ReturnID = ownerID; |
|
1487 | |
1496 | |
|
1488 | Client.Network.SendPacket(select); |
1497 | Client.Network.SendPacket(select); |
|
1489 | } |
1498 | } |
|
1490 | |
1499 | |
|
1491 | /// <summary> |
1500 | /// <summary> |
|
1492 | /// Eject and optionally ban a user from a parcel |
1501 | /// Eject and optionally ban a user from a parcel |
|
1493 | /// </summary> |
1502 | /// </summary> |
|
1494 | /// <param name="targetID">target key of avatar to eject</param> |
1503 | /// <param name="targetID">target key of avatar to eject</param> |
|
1495 | /// <param name="ban">true to also ban target</param> |
1504 | /// <param name="ban">true to also ban target</param> |
|
1496 | public void EjectUser(UUID targetID, bool ban) |
1505 | public void EjectUser(UUID targetID, bool ban) |
|
1497 | { |
1506 | { |
|
1498 | EjectUserPacket eject = new EjectUserPacket(); |
1507 | EjectUserPacket eject = new EjectUserPacket(); |
|
1499 | eject.AgentData.AgentID = Client.Self.AgentID; |
1508 | eject.AgentData.AgentID = Client.Self.AgentID; |
|
1500 | eject.AgentData.SessionID = Client.Self.SessionID; |
1509 | eject.AgentData.SessionID = Client.Self.SessionID; |
|
1501 | eject.Data.TargetID = targetID; |
1510 | eject.Data.TargetID = targetID; |
|
1502 | if (ban) eject.Data.Flags = 1; |
1511 | if (ban) eject.Data.Flags = 1; |
|
1503 | else eject.Data.Flags = 0; |
1512 | else eject.Data.Flags = 0; |
|
1504 | |
1513 | |
|
1505 | Client.Network.SendPacket(eject); |
1514 | Client.Network.SendPacket(eject); |
|
1506 | } |
1515 | } |
|
1507 | |
1516 | |
|
1508 | /// <summary> |
1517 | /// <summary> |
|
1509 | /// Freeze or unfreeze an avatar over your land |
1518 | /// Freeze or unfreeze an avatar over your land |
|
1510 | /// </summary> |
1519 | /// </summary> |
|
1511 | /// <param name="targetID">target key to freeze</param> |
1520 | /// <param name="targetID">target key to freeze</param> |
|
1512 | /// <param name="freeze">true to freeze, false to unfreeze</param> |
1521 | /// <param name="freeze">true to freeze, false to unfreeze</param> |
|
1513 | public void FreezeUser(UUID targetID, bool freeze) |
1522 | public void FreezeUser(UUID targetID, bool freeze) |
|
1514 | { |
1523 | { |
|
1515 | FreezeUserPacket frz = new FreezeUserPacket(); |
1524 | FreezeUserPacket frz = new FreezeUserPacket(); |
|
1516 | frz.AgentData.AgentID = Client.Self.AgentID; |
1525 | frz.AgentData.AgentID = Client.Self.AgentID; |
|
1517 | frz.AgentData.SessionID = Client.Self.SessionID; |
1526 | frz.AgentData.SessionID = Client.Self.SessionID; |
|
1518 | frz.Data.TargetID = targetID; |
1527 | frz.Data.TargetID = targetID; |
|
1519 | if (freeze) frz.Data.Flags = 0; |
1528 | if (freeze) frz.Data.Flags = 0; |
|
1520 | else frz.Data.Flags = 1; |
1529 | else frz.Data.Flags = 1; |
|
1521 | |
1530 | |
|
1522 | Client.Network.SendPacket(frz); |
1531 | Client.Network.SendPacket(frz); |
|
1523 | } |
1532 | } |
|
1524 | |
1533 | |
|
1525 | /// <summary> |
1534 | /// <summary> |
|
1526 | /// Abandon a parcel of land |
1535 | /// Abandon a parcel of land |
|
1527 | /// </summary> |
1536 | /// </summary> |
|
1528 | /// <param name="simulator">Simulator parcel is in</param> |
1537 | /// <param name="simulator">Simulator parcel is in</param> |
|
1529 | /// <param name="localID">Simulator local ID of parcel</param> |
1538 | /// <param name="localID">Simulator local ID of parcel</param> |
|
1530 | public void ReleaseParcel(Simulator simulator, int localID) |
1539 | public void ReleaseParcel(Simulator simulator, int localID) |
|
1531 | { |
1540 | { |
|
1532 | ParcelReleasePacket abandon = new ParcelReleasePacket(); |
1541 | ParcelReleasePacket abandon = new ParcelReleasePacket(); |
|
1533 | abandon.AgentData.AgentID = Client.Self.AgentID; |
1542 | abandon.AgentData.AgentID = Client.Self.AgentID; |
|
1534 | abandon.AgentData.SessionID = Client.Self.SessionID; |
1543 | abandon.AgentData.SessionID = Client.Self.SessionID; |
|
1535 | abandon.Data.LocalID = localID; |
1544 | abandon.Data.LocalID = localID; |
|
1536 | |
1545 | |
|
1537 | Client.Network.SendPacket(abandon, simulator); |
1546 | Client.Network.SendPacket(abandon, simulator); |
|
1538 | } |
1547 | } |
|
1539 | |
1548 | |
|
1540 | /// <summary> |
1549 | /// <summary> |
|
1541 | /// Requests the UUID of the parcel in a remote region at a specified location |
1550 | /// Requests the UUID of the parcel in a remote region at a specified location |
|
1542 | /// </summary> |
1551 | /// </summary> |
|
1543 | /// <param name="location">Location of the parcel in the remote region</param> |
1552 | /// <param name="location">Location of the parcel in the remote region</param> |
|
1544 | /// <param name="regionHandle">Remote region handle</param> |
1553 | /// <param name="regionHandle">Remote region handle</param> |
|
1545 | /// <param name="regionID">Remote region UUID</param> |
1554 | /// <param name="regionID">Remote region UUID</param> |
|
1546 | /// <returns>If successful UUID of the remote parcel, UUID.Zero otherwise</returns> |
1555 | /// <returns>If successful UUID of the remote parcel, UUID.Zero otherwise</returns> |
|
1547 | public UUID RequestRemoteParcelID(Vector3 location, ulong regionHandle, UUID regionID) |
1556 | public UUID RequestRemoteParcelID(Vector3 location, ulong regionHandle, UUID regionID) |
|
1548 | { |
1557 | { |
|
1549 | if (Client.Network.CurrentSim == null || Client.Network.CurrentSim.Caps == null) |
1558 | if (Client.Network.CurrentSim == null || Client.Network.CurrentSim.Caps == null) |
|
1550 | return UUID.Zero; |
1559 | return UUID.Zero; |
|
1551 | |
1560 | |
|
1552 | Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("RemoteParcelRequest"); |
1561 | Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("RemoteParcelRequest"); |
|
1553 | |
1562 | |
|
1554 | if (url != null) |
1563 | if (url != null) |
|
1555 | { |
1564 | { |
|
1556 | RemoteParcelRequestRequest msg = new RemoteParcelRequestRequest(); |
1565 | RemoteParcelRequestRequest msg = new RemoteParcelRequestRequest(); |
|
1557 | msg.Location = location; |
1566 | msg.Location = location; |
|
1558 | msg.RegionHandle = regionHandle; |
1567 | msg.RegionHandle = regionHandle; |
|
1559 | msg.RegionID = regionID; |
1568 | msg.RegionID = regionID; |
|
1560 | |
1569 | |
|
1561 | try |
1570 | try |
|
1562 | { |
1571 | { |
|
1563 | CapsClient request = new CapsClient(url); |
1572 | CapsClient request = new CapsClient(url); |
|
1564 | OSD result = request.GetResponse(msg.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT); |
1573 | OSD result = request.GetResponse(msg.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT); |
|
1565 | RemoteParcelRequestReply response = new RemoteParcelRequestReply(); |
1574 | RemoteParcelRequestReply response = new RemoteParcelRequestReply(); |
|
1566 | response.Deserialize((OSDMap)result); |
1575 | response.Deserialize((OSDMap)result); |
|
1567 | return response.ParcelID; |
1576 | return response.ParcelID; |
|
1568 | } |
1577 | } |
|
1569 | catch (Exception) |
1578 | catch (Exception) |
|
1570 | { |
1579 | { |
|
1571 | Logger.Log("Failed to fetch remote parcel ID", Helpers.LogLevel.Debug, Client); |
1580 | Logger.Log("Failed to fetch remote parcel ID", Helpers.LogLevel.Debug, Client); |
|
1572 | } |
1581 | } |
|
1573 | } |
1582 | } |
|
1574 | |
1583 | |
|
1575 | return UUID.Zero; |
1584 | return UUID.Zero; |
|
1576 | |
1585 | |
|
1577 | } |
1586 | } |
|
1578 | |
1587 | |
|
1579 | /// <summary> |
1588 | /// <summary> |
|
1580 | /// Retrieves information on resources used by the parcel |
1589 | /// Retrieves information on resources used by the parcel |
|
1581 | /// </summary> |
1590 | /// </summary> |
|
1582 | /// <param name="parcelID">UUID of the parcel</param> |
1591 | /// <param name="parcelID">UUID of the parcel</param> |
|
1583 | /// <param name="getDetails">Should per object resource usage be requested</param> |
1592 | /// <param name="getDetails">Should per object resource usage be requested</param> |
|
1584 | /// <param name="callback">Callback invoked when the request is complete</param> |
1593 | /// <param name="callback">Callback invoked when the request is complete</param> |
|
1585 | public void GetParcelResouces(UUID parcelID, bool getDetails, LandResourcesCallback callback) |
1594 | public void GetParcelResouces(UUID parcelID, bool getDetails, LandResourcesCallback callback) |
|
1586 | { |
1595 | { |
|
1587 | try |
1596 | try |
|
1588 | { |
1597 | { |
|
1589 | Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("LandResources"); |
1598 | Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("LandResources"); |
|
1590 | CapsClient request = new CapsClient(url); |
1599 | CapsClient request = new CapsClient(url); |
|
1591 | |
1600 | |
|
1592 | request.OnComplete += delegate(CapsClient client, OSD result, Exception error) |
1601 | request.OnComplete += delegate(CapsClient client, OSD result, Exception error) |
|
1593 | { |
1602 | { |
|
1594 | try |
1603 | try |
|
1595 | { |
1604 | { |
|
1596 | if (result == null || error != null) |
1605 | if (result == null || error != null) |
|
1597 | { |
1606 | { |
|
1598 | callback(false, null); |
1607 | callback(false, null); |
|
1599 | } |
1608 | } |
|
1600 | LandResourcesMessage response = new LandResourcesMessage(); |
1609 | LandResourcesMessage response = new LandResourcesMessage(); |
|
1601 | response.Deserialize((OSDMap)result); |
1610 | response.Deserialize((OSDMap)result); |
|
1602 | |
1611 | |
|
1603 | CapsClient summaryRequest = new CapsClient(response.ScriptResourceSummary); |
1612 | CapsClient summaryRequest = new CapsClient(response.ScriptResourceSummary); |
|
1604 | OSD summaryResponse = summaryRequest.GetResponse(Client.Settings.CAPS_TIMEOUT); |
1613 | OSD summaryResponse = summaryRequest.GetResponse(Client.Settings.CAPS_TIMEOUT); |
|
1605 | |
1614 | |
|
1606 | LandResourcesInfo res = new LandResourcesInfo(); |
1615 | LandResourcesInfo res = new LandResourcesInfo(); |
|
1607 | res.Deserialize((OSDMap)summaryResponse); |
1616 | res.Deserialize((OSDMap)summaryResponse); |
|
1608 | |
1617 | |
|
1609 | if (response.ScriptResourceDetails != null && getDetails) |
1618 | if (response.ScriptResourceDetails != null && getDetails) |
|
1610 | { |
1619 | { |
|
1611 | CapsClient detailRequest = new CapsClient(response.ScriptResourceDetails); |
1620 | CapsClient detailRequest = new CapsClient(response.ScriptResourceDetails); |
|
1612 | OSD detailResponse = detailRequest.GetResponse(Client.Settings.CAPS_TIMEOUT); |
1621 | OSD detailResponse = detailRequest.GetResponse(Client.Settings.CAPS_TIMEOUT); |
|
1613 | res.Deserialize((OSDMap)detailResponse); |
1622 | res.Deserialize((OSDMap)detailResponse); |
|
1614 | } |
1623 | } |
|
1615 | callback(true, res); |
1624 | callback(true, res); |
|
1616 | } |
1625 | } |
|
1617 | catch (Exception ex) |
1626 | catch (Exception ex) |
|
1618 | { |
1627 | { |
|
1619 | Logger.Log("Failed fetching land resources", Helpers.LogLevel.Error, Client, ex); |
1628 | Logger.Log("Failed fetching land resources", Helpers.LogLevel.Error, Client, ex); |
|
1620 | callback(false, null); |
1629 | callback(false, null); |
|
1621 | } |
1630 | } |
|
1622 | }; |
1631 | }; |
|
1623 | |
1632 | |
|
1624 | LandResourcesRequest param = new LandResourcesRequest(); |
1633 | LandResourcesRequest param = new LandResourcesRequest(); |
|
1625 | param.ParcelID = parcelID; |
1634 | param.ParcelID = parcelID; |
|
1626 | request.BeginGetResponse(param.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT); |
1635 | request.BeginGetResponse(param.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT); |
|
1627 | |
1636 | |
|
1628 | } |
1637 | } |
|
1629 | catch (Exception ex) |
1638 | catch (Exception ex) |
|
1630 | { |
1639 | { |
|
1631 | Logger.Log("Failed fetching land resources:", Helpers.LogLevel.Error, Client, ex); |
1640 | Logger.Log("Failed fetching land resources:", Helpers.LogLevel.Error, Client, ex); |
|
1632 | callback(false, null); |
1641 | callback(false, null); |
|
1633 | } |
1642 | } |
|
1634 | } |
1643 | } |
|
1635 | |
1644 | |
|
1636 | #endregion Public Methods |
1645 | #endregion Public Methods |
|
1637 | |
1646 | |
|
1638 | #region Packet Handlers |
1647 | #region Packet Handlers |
|
1639 | |
1648 | |
|
1640 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
1649 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
|
1641 | /// <param name="sender">The sender</param> |
1650 | /// <param name="sender">The sender</param> |
|
1642 | /// <param name="e">The EventArgs object containing the packet data</param> |
1651 | /// <param name="e">The EventArgs object containing the packet data</param> |
|
1643 | /// <remarks>Raises the <see cref="ParcelDwellReply"/> event</remarks> |
1652 | /// <remarks>Raises the <see cref="ParcelDwellReply"/> event</remarks> |
|
1644 | protected void ParcelDwellReplyHandler(object sender, PacketReceivedEventArgs e) |
1653 | protected void ParcelDwellReplyHandler(object sender, PacketReceivedEventArgs e) |
|
1645 | { |
1654 | { |
|
1646 | if (m_DwellReply != null || Client.Settings.ALWAYS_REQUEST_PARCEL_DWELL == true) |
1655 | if (m_DwellReply != null || Client.Settings.ALWAYS_REQUEST_PARCEL_DWELL == true) |
|
1647 | { |
1656 | { |
|
1648 | Packet packet = e.Packet; |
1657 | Packet packet = e.Packet; |
|
1649 | Simulator simulator = e.Simulator; |
1658 | Simulator simulator = e.Simulator; |
|
1650 | |
1659 | |
|
1651 | ParcelDwellReplyPacket dwell = (ParcelDwellReplyPacket)packet; |
1660 | ParcelDwellReplyPacket dwell = (ParcelDwellReplyPacket)packet; |
|
1652 | |
1661 | |
|
1653 | lock (simulator.Parcels.Dictionary) |
1662 | lock (simulator.Parcels.Dictionary) |
|
1654 | { |
1663 | { |
|
1655 | if (simulator.Parcels.Dictionary.ContainsKey(dwell.Data.LocalID)) |
1664 | if (simulator.Parcels.Dictionary.ContainsKey(dwell.Data.LocalID)) |
|
1656 | { |
1665 | { |
|
1657 | Parcel parcel = simulator.Parcels.Dictionary[dwell.Data.LocalID]; |
1666 | Parcel parcel = simulator.Parcels.Dictionary[dwell.Data.LocalID]; |
|
1658 | parcel.Dwell = dwell.Data.Dwell; |
1667 | parcel.Dwell = dwell.Data.Dwell; |
|
1659 | simulator.Parcels.Dictionary[dwell.Data.LocalID] = parcel; |
1668 | simulator.Parcels.Dictionary[dwell.Data.LocalID] = parcel; |
|
1660 | } |
1669 | } |
|
1661 | } |
1670 | } |
|
1662 | |
1671 | |
|
1663 | if (m_DwellReply != null) |
1672 | if (m_DwellReply != null) |
|
1664 | { |
1673 | { |
|
1665 | OnParcelDwellReply(new ParcelDwellReplyEventArgs(dwell.Data.ParcelID, dwell.Data.LocalID, dwell.Data.Dwell)); |
1674 | OnParcelDwellReply(new ParcelDwellReplyEventArgs(dwell.Data.ParcelID, dwell.Data.LocalID, dwell.Data.Dwell)); |
|
1666 | } |
1675 | } |
|
1667 | } |
1676 | } |
|
1668 | } |
1677 | } |
|
1669 | |
1678 | |
|
1670 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
1679 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
|
1671 | /// <param name="sender">The sender</param> |
1680 | /// <param name="sender">The sender</param> |
|
1672 | /// <param name="e">The EventArgs object containing the packet data</param> |
1681 | /// <param name="e">The EventArgs object containing the packet data</param> |
|
1673 | /// <remarks>Raises the <see cref="ParcelInfoReply"/> event</remarks> |
1682 | /// <remarks>Raises the <see cref="ParcelInfoReply"/> event</remarks> |
|
1674 | protected void ParcelInfoReplyHandler(object sender, PacketReceivedEventArgs e) |
1683 | protected void ParcelInfoReplyHandler(object sender, PacketReceivedEventArgs e) |
|
1675 | { |
1684 | { |
|
1676 | if (m_ParcelInfo != null) |
1685 | if (m_ParcelInfo != null) |
|
1677 | { |
1686 | { |
|
1678 | Packet packet = e.Packet; |
1687 | Packet packet = e.Packet; |
|
1679 | ParcelInfoReplyPacket info = (ParcelInfoReplyPacket)packet; |
1688 | ParcelInfoReplyPacket info = (ParcelInfoReplyPacket)packet; |
|
1680 | |
1689 | |
|
1681 | ParcelInfo parcelInfo = new ParcelInfo(); |
1690 | ParcelInfo parcelInfo = new ParcelInfo(); |
|
1682 | |
1691 | |
|
1683 | parcelInfo.ActualArea = info.Data.ActualArea; |
1692 | parcelInfo.ActualArea = info.Data.ActualArea; |
|
1684 | parcelInfo.AuctionID = info.Data.AuctionID; |
1693 | parcelInfo.AuctionID = info.Data.AuctionID; |
|
1685 | parcelInfo.BillableArea = info.Data.BillableArea; |
1694 | parcelInfo.BillableArea = info.Data.BillableArea; |
|
1686 | parcelInfo.Description = Utils.BytesToString(info.Data.Desc); |
1695 | parcelInfo.Description = Utils.BytesToString(info.Data.Desc); |
|
1687 | parcelInfo.Dwell = info.Data.Dwell; |
1696 | parcelInfo.Dwell = info.Data.Dwell; |
|
1688 | parcelInfo.GlobalX = info.Data.GlobalX; |
1697 | parcelInfo.GlobalX = info.Data.GlobalX; |
|
1689 | parcelInfo.GlobalY = info.Data.GlobalY; |
1698 | parcelInfo.GlobalY = info.Data.GlobalY; |
|
1690 | parcelInfo.GlobalZ = info.Data.GlobalZ; |
1699 | parcelInfo.GlobalZ = info.Data.GlobalZ; |
|
1691 | parcelInfo.ID = info.Data.ParcelID; |
1700 | parcelInfo.ID = info.Data.ParcelID; |
|
1692 | parcelInfo.Mature = ((info.Data.Flags & 1) != 0) ? true : false; |
1701 | parcelInfo.Mature = ((info.Data.Flags & 1) != 0) ? true : false; |
|
1693 | parcelInfo.Name = Utils.BytesToString(info.Data.Name); |
1702 | parcelInfo.Name = Utils.BytesToString(info.Data.Name); |
|
1694 | parcelInfo.OwnerID = info.Data.OwnerID; |
1703 | parcelInfo.OwnerID = info.Data.OwnerID; |
|
1695 | parcelInfo.SalePrice = info.Data.SalePrice; |
1704 | parcelInfo.SalePrice = info.Data.SalePrice; |
|
1696 | parcelInfo.SimName = Utils.BytesToString(info.Data.SimName); |
1705 | parcelInfo.SimName = Utils.BytesToString(info.Data.SimName); |
|
1697 | parcelInfo.SnapshotID = info.Data.SnapshotID; |
1706 | parcelInfo.SnapshotID = info.Data.SnapshotID; |
|
1698 | |
1707 | |
|
1699 | OnParcelInfoReply(new ParcelInfoReplyEventArgs(parcelInfo)); |
1708 | OnParcelInfoReply(new ParcelInfoReplyEventArgs(parcelInfo)); |
|
1700 | } |
1709 | } |
|
1701 | } |
1710 | } |
|
1702 | |
1711 | |
|
1703 | protected void ParcelPropertiesReplyHandler(string capsKey, IMessage message, Simulator simulator) |
1712 | protected void ParcelPropertiesReplyHandler(string capsKey, IMessage message, Simulator simulator) |
|
1704 | { |
1713 | { |
|
1705 | if (m_ParcelProperties != null || Client.Settings.PARCEL_TRACKING == true) |
1714 | if (m_ParcelProperties != null || Client.Settings.PARCEL_TRACKING == true) |
|
1706 | { |
1715 | { |
|
1707 | ParcelPropertiesMessage msg = (ParcelPropertiesMessage)message; |
1716 | ParcelPropertiesMessage msg = (ParcelPropertiesMessage)message; |
|
1708 | |
1717 | |
|
1709 | Parcel parcel = new Parcel(msg.LocalID); |
1718 | Parcel parcel = new Parcel(msg.LocalID); |
|
1710 | |
1719 | |
|
1711 | parcel.AABBMax = msg.AABBMax; |
1720 | parcel.AABBMax = msg.AABBMax; |
|
1712 | parcel.AABBMin = msg.AABBMin; |
1721 | parcel.AABBMin = msg.AABBMin; |
|
1713 | parcel.Area = msg.Area; |
1722 | parcel.Area = msg.Area; |
|
1714 | parcel.AuctionID = msg.AuctionID; |
1723 | parcel.AuctionID = msg.AuctionID; |
|
1715 | parcel.AuthBuyerID = msg.AuthBuyerID; |
1724 | parcel.AuthBuyerID = msg.AuthBuyerID; |
|
1716 | parcel.Bitmap = msg.Bitmap; |
1725 | parcel.Bitmap = msg.Bitmap; |
|
1717 | parcel.Category = msg.Category; |
1726 | parcel.Category = msg.Category; |
|
1718 | parcel.ClaimDate = msg.ClaimDate; |
1727 | parcel.ClaimDate = msg.ClaimDate; |
|
1719 | parcel.ClaimPrice = msg.ClaimPrice; |
1728 | parcel.ClaimPrice = msg.ClaimPrice; |
|
1720 | parcel.Desc = msg.Desc; |
1729 | parcel.Desc = msg.Desc; |
|
1721 | parcel.Flags = msg.ParcelFlags; |
1730 | parcel.Flags = msg.ParcelFlags; |
|
1722 | parcel.GroupID = msg.GroupID; |
1731 | parcel.GroupID = msg.GroupID; |
|
1723 | parcel.GroupPrims = msg.GroupPrims; |
1732 | parcel.GroupPrims = msg.GroupPrims; |
|
1724 | parcel.IsGroupOwned = msg.IsGroupOwned; |
1733 | parcel.IsGroupOwned = msg.IsGroupOwned; |
|
1725 | parcel.Landing = msg.LandingType; |
1734 | parcel.Landing = msg.LandingType; |
|
1726 | parcel.MaxPrims = msg.MaxPrims; |
1735 | parcel.MaxPrims = msg.MaxPrims; |
|
1727 | parcel.Media.MediaAutoScale = msg.MediaAutoScale; |
1736 | parcel.Media.MediaAutoScale = msg.MediaAutoScale; |
|
1728 | parcel.Media.MediaID = msg.MediaID; |
1737 | parcel.Media.MediaID = msg.MediaID; |
|
1729 | parcel.Media.MediaURL = msg.MediaURL; |
1738 | parcel.Media.MediaURL = msg.MediaURL; |
|
1730 | parcel.MusicURL = msg.MusicURL; |
1739 | parcel.MusicURL = msg.MusicURL; |
|
1731 | parcel.Name = msg.Name; |
1740 | parcel.Name = msg.Name; |
|
1732 | parcel.OtherCleanTime = msg.OtherCleanTime; |
1741 | parcel.OtherCleanTime = msg.OtherCleanTime; |
|
1733 | parcel.OtherCount = msg.OtherCount; |
1742 | parcel.OtherCount = msg.OtherCount; |
|
1734 | parcel.OtherPrims = msg.OtherPrims; |
1743 | parcel.OtherPrims = msg.OtherPrims; |
|
1735 | parcel.OwnerID = msg.OwnerID; |
1744 | parcel.OwnerID = msg.OwnerID; |
|
1736 | parcel.OwnerPrims = msg.OwnerPrims; |
1745 | parcel.OwnerPrims = msg.OwnerPrims; |
|
1737 | parcel.ParcelPrimBonus = msg.ParcelPrimBonus; |
1746 | parcel.ParcelPrimBonus = msg.ParcelPrimBonus; |
|
1738 | parcel.PassHours = msg.PassHours; |
1747 | parcel.PassHours = msg.PassHours; |
|
1739 | parcel.PassPrice = msg.PassPrice; |
1748 | parcel.PassPrice = msg.PassPrice; |
|
1740 | parcel.PublicCount = msg.PublicCount; |
1749 | parcel.PublicCount = msg.PublicCount; |
|
1741 | parcel.RegionDenyAgeUnverified = msg.RegionDenyAgeUnverified; |
1750 | parcel.RegionDenyAgeUnverified = msg.RegionDenyAgeUnverified; |
|
1742 | parcel.RegionDenyAnonymous = msg.RegionDenyAnonymous; |
1751 | parcel.RegionDenyAnonymous = msg.RegionDenyAnonymous; |
|
1743 | parcel.RegionPushOverride = msg.RegionPushOverride; |
1752 | parcel.RegionPushOverride = msg.RegionPushOverride; |
|
1744 | parcel.RentPrice = msg.RentPrice; |
1753 | parcel.RentPrice = msg.RentPrice; |
|
1745 | ParcelResult result = msg.RequestResult; |
1754 | ParcelResult result = msg.RequestResult; |
|
1746 | parcel.SalePrice = msg.SalePrice; |
1755 | parcel.SalePrice = msg.SalePrice; |
|
1747 | int selectedPrims = msg.SelectedPrims; |
1756 | int selectedPrims = msg.SelectedPrims; |
|
1748 | parcel.SelfCount = msg.SelfCount; |
1757 | parcel.SelfCount = msg.SelfCount; |
|
1749 | int sequenceID = msg.SequenceID; |
1758 | int sequenceID = msg.SequenceID; |
|
1750 | parcel.SimWideMaxPrims = msg.SimWideMaxPrims; |
1759 | parcel.SimWideMaxPrims = msg.SimWideMaxPrims; |
|
1751 | parcel.SimWideTotalPrims = msg.SimWideTotalPrims; |
1760 | parcel.SimWideTotalPrims = msg.SimWideTotalPrims; |
|
1752 | bool snapSelection = msg.SnapSelection; |
1761 | bool snapSelection = msg.SnapSelection; |
|
1753 | parcel.SnapshotID = msg.SnapshotID; |
1762 | parcel.SnapshotID = msg.SnapshotID; |
|
1754 | parcel.Status = msg.Status; |
1763 | parcel.Status = msg.Status; |
|
1755 | parcel.TotalPrims = msg.TotalPrims; |
1764 | parcel.TotalPrims = msg.TotalPrims; |
|
1756 | parcel.UserLocation = msg.UserLocation; |
1765 | parcel.UserLocation = msg.UserLocation; |
|
1757 | parcel.UserLookAt = msg.UserLookAt; |
1766 | parcel.UserLookAt = msg.UserLookAt; |
|
1758 | parcel.Media.MediaDesc = msg.MediaDesc; |
1767 | parcel.Media.MediaDesc = msg.MediaDesc; |
|
1759 | parcel.Media.MediaHeight = msg.MediaHeight; |
1768 | parcel.Media.MediaHeight = msg.MediaHeight; |
|
1760 | parcel.Media.MediaWidth = msg.MediaWidth; |
1769 | parcel.Media.MediaWidth = msg.MediaWidth; |
|
1761 | parcel.Media.MediaLoop = msg.MediaLoop; |
1770 | parcel.Media.MediaLoop = msg.MediaLoop; |
|
1762 | parcel.Media.MediaType = msg.MediaType; |
1771 | parcel.Media.MediaType = msg.MediaType; |
|
1763 | parcel.ObscureMedia = msg.ObscureMedia; |
1772 | parcel.ObscureMedia = msg.ObscureMedia; |
|
1764 | parcel.ObscureMusic = msg.ObscureMusic; |
1773 | parcel.ObscureMusic = msg.ObscureMusic; |
|
- | 1774 | parcel.SeeAVs = msg.SeeAVs; |
||
- | 1775 | parcel.AnyAVSounds = msg.AnyAVSounds; |
||
- | 1776 | parcel.GroupAVSounds = msg.GroupAVSounds; |
||
1765 | |
1777 | |
|
1766 | if (Client.Settings.PARCEL_TRACKING) |
1778 | if (Client.Settings.PARCEL_TRACKING) |
|
1767 | { |
1779 | { |
|
1768 | lock (simulator.Parcels.Dictionary) |
1780 | lock (simulator.Parcels.Dictionary) |
|
1769 | simulator.Parcels.Dictionary[parcel.LocalID] = parcel; |
1781 | simulator.Parcels.Dictionary[parcel.LocalID] = parcel; |
|
1770 | |
1782 | |
|
1771 | bool set = false; |
1783 | bool set = false; |
|
1772 | int y, x, index, bit; |
1784 | int y, x, index, bit; |
|
1773 | for (y = 0; y < 64; y++) |
1785 | for (y = 0; y < 64; y++) |
|
1774 | { |
1786 | { |
|
1775 | for (x = 0; x < 64; x++) |
1787 | for (x = 0; x < 64; x++) |
|
1776 | { |
1788 | { |
|
1777 | index = (y * 64) + x; |
1789 | index = (y * 64) + x; |
|
1778 | bit = index % 8; |
1790 | bit = index % 8; |
|
1779 | index >>= 3; |
1791 | index >>= 3; |
|
1780 | |
1792 | |
|
1781 | if ((parcel.Bitmap[index] & (1 << bit)) != 0) |
1793 | if ((parcel.Bitmap[index] & (1 << bit)) != 0) |
|
1782 | { |
1794 | { |
|
1783 | simulator.ParcelMap[y, x] = parcel.LocalID; |
1795 | simulator.ParcelMap[y, x] = parcel.LocalID; |
|
1784 | set = true; |
1796 | set = true; |
|
1785 | } |
1797 | } |
|
1786 | } |
1798 | } |
|
1787 | } |
1799 | } |
|
1788 | |
1800 | |
|
1789 | if (!set) |
1801 | if (!set) |
|
1790 | { |
1802 | { |
|
1791 | Logger.Log("Received a parcel with a bitmap that did not map to any locations", |
1803 | Logger.Log("Received a parcel with a bitmap that did not map to any locations", |
|
1792 | Helpers.LogLevel.Warning); |
1804 | Helpers.LogLevel.Warning); |
|
1793 | } |
1805 | } |
|
1794 | } |
1806 | } |
|
1795 | |
1807 | |
|
1796 | if (sequenceID.Equals(int.MaxValue) && WaitForSimParcel != null) |
1808 | if (sequenceID.Equals(int.MaxValue) && WaitForSimParcel != null) |
|
1797 | WaitForSimParcel.Set(); |
1809 | WaitForSimParcel.Set(); |
|
1798 | |
1810 | |
|
1799 | // auto request acl, will be stored in parcel tracking dictionary if enabled |
1811 | // auto request acl, will be stored in parcel tracking dictionary if enabled |
|
1800 | if (Client.Settings.ALWAYS_REQUEST_PARCEL_ACL) |
1812 | if (Client.Settings.ALWAYS_REQUEST_PARCEL_ACL) |
|
1801 | Client.Parcels.RequestParcelAccessList(simulator, parcel.LocalID, |
1813 | Client.Parcels.RequestParcelAccessList(simulator, parcel.LocalID, |
|
1802 | AccessList.Both, sequenceID); |
1814 | AccessList.Both, sequenceID); |
|
1803 | |
1815 | |
|
1804 | // auto request dwell, will be stored in parcel tracking dictionary if enables |
1816 | // auto request dwell, will be stored in parcel tracking dictionary if enables |
|
1805 | if (Client.Settings.ALWAYS_REQUEST_PARCEL_DWELL) |
1817 | if (Client.Settings.ALWAYS_REQUEST_PARCEL_DWELL) |
|
1806 | Client.Parcels.RequestDwell(simulator, parcel.LocalID); |
1818 | Client.Parcels.RequestDwell(simulator, parcel.LocalID); |
|
1807 | |
1819 | |
|
1808 | // Fire the callback for parcel properties being received |
1820 | // Fire the callback for parcel properties being received |
|
1809 | if (m_ParcelProperties != null) |
1821 | if (m_ParcelProperties != null) |
|
1810 | { |
1822 | { |
|
1811 | OnParcelProperties(new ParcelPropertiesEventArgs(simulator, parcel, result, selectedPrims, sequenceID, snapSelection)); |
1823 | OnParcelProperties(new ParcelPropertiesEventArgs(simulator, parcel, result, selectedPrims, sequenceID, snapSelection)); |
|
1812 | } |
1824 | } |
|
1813 | |
1825 | |
|
1814 | // Check if all of the simulator parcels have been retrieved, if so fire another callback |
1826 | // Check if all of the simulator parcels have been retrieved, if so fire another callback |
|
1815 | if (simulator.IsParcelMapFull() && m_SimParcelsDownloaded != null) |
1827 | if (simulator.IsParcelMapFull() && m_SimParcelsDownloaded != null) |
|
1816 | { |
1828 | { |
|
1817 | OnSimParcelsDownloaded(new SimParcelsDownloadedEventArgs(simulator, simulator.Parcels, simulator.ParcelMap)); |
1829 | OnSimParcelsDownloaded(new SimParcelsDownloadedEventArgs(simulator, simulator.Parcels, simulator.ParcelMap)); |
|
1818 | } |
1830 | } |
|
1819 | } |
1831 | } |
|
1820 | } |
1832 | } |
|
1821 | |
1833 | |
|
1822 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
1834 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
|
1823 | /// <param name="sender">The sender</param> |
1835 | /// <param name="sender">The sender</param> |
|
1824 | /// <param name="e">The EventArgs object containing the packet data</param> |
1836 | /// <param name="e">The EventArgs object containing the packet data</param> |
|
1825 | /// <remarks>Raises the <see cref="ParcelAccessListReply"/> event</remarks> |
1837 | /// <remarks>Raises the <see cref="ParcelAccessListReply"/> event</remarks> |
|
1826 | protected void ParcelAccessListReplyHandler(object sender, PacketReceivedEventArgs e) |
1838 | protected void ParcelAccessListReplyHandler(object sender, PacketReceivedEventArgs e) |
|
1827 | { |
1839 | { |
|
1828 | if (m_ParcelACL != null || Client.Settings.ALWAYS_REQUEST_PARCEL_ACL == true) |
1840 | if (m_ParcelACL != null || Client.Settings.ALWAYS_REQUEST_PARCEL_ACL == true) |
|
1829 | { |
1841 | { |
|
1830 | Packet packet = e.Packet; |
1842 | Packet packet = e.Packet; |
|
1831 | Simulator simulator = e.Simulator; |
1843 | Simulator simulator = e.Simulator; |
|
1832 | |
1844 | |
|
1833 | ParcelAccessListReplyPacket reply = (ParcelAccessListReplyPacket)packet; |
1845 | ParcelAccessListReplyPacket reply = (ParcelAccessListReplyPacket)packet; |
|
1834 | |
1846 | |
|
1835 | List<ParcelAccessEntry> accessList = new List<ParcelAccessEntry>(reply.List.Length); |
1847 | List<ParcelAccessEntry> accessList = new List<ParcelAccessEntry>(reply.List.Length); |
|
1836 | |
1848 | |
|
1837 | for (int i = 0; i < reply.List.Length; i++) |
1849 | for (int i = 0; i < reply.List.Length; i++) |
|
1838 | { |
1850 | { |
|
1839 | ParcelAccessEntry pae = new ParcelAccessEntry(); |
1851 | ParcelAccessEntry pae = new ParcelAccessEntry(); |
|
1840 | pae.AgentID = reply.List[i].ID; |
1852 | pae.AgentID = reply.List[i].ID; |
|
1841 | pae.Time = Utils.UnixTimeToDateTime((uint)reply.List[i].Time); |
1853 | pae.Time = Utils.UnixTimeToDateTime((uint)reply.List[i].Time); |
|
1842 | pae.Flags = (AccessList)reply.List[i].Flags; |
1854 | pae.Flags = (AccessList)reply.List[i].Flags; |
|
1843 | |
1855 | |
|
1844 | accessList.Add(pae); |
1856 | accessList.Add(pae); |
|
1845 | } |
1857 | } |
|
1846 | |
1858 | |
|
1847 | lock (simulator.Parcels.Dictionary) |
1859 | lock (simulator.Parcels.Dictionary) |
|
1848 | { |
1860 | { |
|
1849 | if (simulator.Parcels.Dictionary.ContainsKey(reply.Data.LocalID)) |
1861 | if (simulator.Parcels.Dictionary.ContainsKey(reply.Data.LocalID)) |
|
1850 | { |
1862 | { |
|
1851 | Parcel parcel = simulator.Parcels.Dictionary[reply.Data.LocalID]; |
1863 | Parcel parcel = simulator.Parcels.Dictionary[reply.Data.LocalID]; |
|
1852 | if ((AccessList)reply.Data.Flags == AccessList.Ban) |
1864 | if ((AccessList)reply.Data.Flags == AccessList.Ban) |
|
1853 | parcel.AccessBlackList = accessList; |
1865 | parcel.AccessBlackList = accessList; |
|
1854 | else |
1866 | else |
|
1855 | parcel.AccessWhiteList = accessList; |
1867 | parcel.AccessWhiteList = accessList; |
|
1856 | |
1868 | |
|
1857 | simulator.Parcels.Dictionary[reply.Data.LocalID] = parcel; |
1869 | simulator.Parcels.Dictionary[reply.Data.LocalID] = parcel; |
|
1858 | } |
1870 | } |
|
1859 | } |
1871 | } |
|
1860 | |
1872 | |
|
1861 | |
1873 | |
|
1862 | if (m_ParcelACL != null) |
1874 | if (m_ParcelACL != null) |
|
1863 | { |
1875 | { |
|
1864 | OnParcelAccessListReply(new ParcelAccessListReplyEventArgs(simulator, reply.Data.SequenceID, reply.Data.LocalID, |
1876 | OnParcelAccessListReply(new ParcelAccessListReplyEventArgs(simulator, reply.Data.SequenceID, reply.Data.LocalID, |
|
1865 | reply.Data.Flags, accessList)); |
1877 | reply.Data.Flags, accessList)); |
|
1866 | } |
1878 | } |
|
1867 | } |
1879 | } |
|
1868 | } |
1880 | } |
|
1869 | |
1881 | |
|
1870 | protected void ParcelObjectOwnersReplyHandler(string capsKey, IMessage message, Simulator simulator) |
1882 | protected void ParcelObjectOwnersReplyHandler(string capsKey, IMessage message, Simulator simulator) |
|
1871 | { |
1883 | { |
|
1872 | if (m_ParcelObjectOwnersReply != null) |
1884 | if (m_ParcelObjectOwnersReply != null) |
|
1873 | { |
1885 | { |
|
1874 | List<ParcelPrimOwners> primOwners = new List<ParcelPrimOwners>(); |
1886 | List<ParcelPrimOwners> primOwners = new List<ParcelPrimOwners>(); |
|
1875 | |
1887 | |
|
1876 | ParcelObjectOwnersReplyMessage msg = (ParcelObjectOwnersReplyMessage)message; |
1888 | ParcelObjectOwnersReplyMessage msg = (ParcelObjectOwnersReplyMessage)message; |
|
1877 | |
1889 | |
|
1878 | for (int i = 0; i < msg.PrimOwnersBlock.Length; i++) |
1890 | for (int i = 0; i < msg.PrimOwnersBlock.Length; i++) |
|
1879 | { |
1891 | { |
|
1880 | ParcelPrimOwners primOwner = new ParcelPrimOwners(); |
1892 | ParcelPrimOwners primOwner = new ParcelPrimOwners(); |
|
1881 | primOwner.OwnerID = msg.PrimOwnersBlock[i].OwnerID; |
1893 | primOwner.OwnerID = msg.PrimOwnersBlock[i].OwnerID; |
|
1882 | primOwner.Count = msg.PrimOwnersBlock[i].Count; |
1894 | primOwner.Count = msg.PrimOwnersBlock[i].Count; |
|
1883 | primOwner.IsGroupOwned = msg.PrimOwnersBlock[i].IsGroupOwned; |
1895 | primOwner.IsGroupOwned = msg.PrimOwnersBlock[i].IsGroupOwned; |
|
1884 | primOwner.OnlineStatus = msg.PrimOwnersBlock[i].OnlineStatus; |
1896 | primOwner.OnlineStatus = msg.PrimOwnersBlock[i].OnlineStatus; |
|
1885 | primOwner.NewestPrim = msg.PrimOwnersBlock[i].TimeStamp; |
1897 | primOwner.NewestPrim = msg.PrimOwnersBlock[i].TimeStamp; |
|
1886 | |
1898 | |
|
1887 | primOwners.Add(primOwner); |
1899 | primOwners.Add(primOwner); |
|
1888 | } |
1900 | } |
|
1889 | |
1901 | |
|
1890 | OnParcelObjectOwnersReply(new ParcelObjectOwnersReplyEventArgs(simulator, primOwners)); |
1902 | OnParcelObjectOwnersReply(new ParcelObjectOwnersReplyEventArgs(simulator, primOwners)); |
|
1891 | } |
1903 | } |
|
1892 | } |
1904 | } |
|
1893 | |
1905 | |
|
1894 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
1906 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
|
1895 | /// <param name="sender">The sender</param> |
1907 | /// <param name="sender">The sender</param> |
|
1896 | /// <param name="e">The EventArgs object containing the packet data</param> |
1908 | /// <param name="e">The EventArgs object containing the packet data</param> |
|
1897 | /// <remarks>Raises the <see cref="ForceSelectObjectsReply"/> event</remarks> |
1909 | /// <remarks>Raises the <see cref="ForceSelectObjectsReply"/> event</remarks> |
|
1898 | protected void SelectParcelObjectsReplyHandler(object sender, PacketReceivedEventArgs e) |
1910 | protected void SelectParcelObjectsReplyHandler(object sender, PacketReceivedEventArgs e) |
|
1899 | { |
1911 | { |
|
1900 | if (m_ForceSelectObjects != null) |
1912 | if (m_ForceSelectObjects != null) |
|
1901 | { |
1913 | { |
|
1902 | Packet packet = e.Packet; |
1914 | Packet packet = e.Packet; |
|
1903 | Simulator simulator = e.Simulator; |
1915 | Simulator simulator = e.Simulator; |
|
1904 | |
1916 | |
|
1905 | ForceObjectSelectPacket reply = (ForceObjectSelectPacket)packet; |
1917 | ForceObjectSelectPacket reply = (ForceObjectSelectPacket)packet; |
|
1906 | List<uint> objectIDs = new List<uint>(reply.Data.Length); |
1918 | List<uint> objectIDs = new List<uint>(reply.Data.Length); |
|
1907 | |
1919 | |
|
1908 | for (int i = 0; i < reply.Data.Length; i++) |
1920 | for (int i = 0; i < reply.Data.Length; i++) |
|
1909 | { |
1921 | { |
|
1910 | objectIDs.Add(reply.Data[i].LocalID); |
1922 | objectIDs.Add(reply.Data[i].LocalID); |
|
1911 | } |
1923 | } |
|
1912 | |
1924 | |
|
1913 | OnForceSelectObjectsReply(new ForceSelectObjectsReplyEventArgs(simulator, objectIDs, reply._Header.ResetList)); |
1925 | OnForceSelectObjectsReply(new ForceSelectObjectsReplyEventArgs(simulator, objectIDs, reply._Header.ResetList)); |
|
1914 | } |
1926 | } |
|
1915 | } |
1927 | } |
|
1916 | |
1928 | |
|
1917 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
1929 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
|
1918 | /// <param name="sender">The sender</param> |
1930 | /// <param name="sender">The sender</param> |
|
1919 | /// <param name="e">The EventArgs object containing the packet data</param> |
1931 | /// <param name="e">The EventArgs object containing the packet data</param> |
|
1920 | /// <remarks>Raises the <see cref="ParcelMediaUpdateReply"/> event</remarks> |
1932 | /// <remarks>Raises the <see cref="ParcelMediaUpdateReply"/> event</remarks> |
|
1921 | protected void ParcelMediaUpdateHandler(object sender, PacketReceivedEventArgs e) |
1933 | protected void ParcelMediaUpdateHandler(object sender, PacketReceivedEventArgs e) |
|
1922 | { |
1934 | { |
|
1923 | if (m_ParcelMediaUpdateReply != null) |
1935 | if (m_ParcelMediaUpdateReply != null) |
|
1924 | { |
1936 | { |
|
1925 | Packet packet = e.Packet; |
1937 | Packet packet = e.Packet; |
|
1926 | Simulator simulator = e.Simulator; |
1938 | Simulator simulator = e.Simulator; |
|
1927 | |
1939 | |
|
1928 | ParcelMediaUpdatePacket reply = (ParcelMediaUpdatePacket)packet; |
1940 | ParcelMediaUpdatePacket reply = (ParcelMediaUpdatePacket)packet; |
|
1929 | ParcelMedia media = new ParcelMedia(); |
1941 | ParcelMedia media = new ParcelMedia(); |
|
1930 | |
1942 | |
|
1931 | media.MediaAutoScale = (reply.DataBlock.MediaAutoScale == (byte)0x1) ? true : false; |
1943 | media.MediaAutoScale = (reply.DataBlock.MediaAutoScale == (byte)0x1) ? true : false; |
|
1932 | media.MediaID = reply.DataBlock.MediaID; |
1944 | media.MediaID = reply.DataBlock.MediaID; |
|
1933 | media.MediaDesc = Utils.BytesToString(reply.DataBlockExtended.MediaDesc); |
1945 | media.MediaDesc = Utils.BytesToString(reply.DataBlockExtended.MediaDesc); |
|
1934 | media.MediaHeight = reply.DataBlockExtended.MediaHeight; |
1946 | media.MediaHeight = reply.DataBlockExtended.MediaHeight; |
|
1935 | media.MediaLoop = ((reply.DataBlockExtended.MediaLoop & 1) != 0) ? true : false; |
1947 | media.MediaLoop = ((reply.DataBlockExtended.MediaLoop & 1) != 0) ? true : false; |
|
1936 | media.MediaType = Utils.BytesToString(reply.DataBlockExtended.MediaType); |
1948 | media.MediaType = Utils.BytesToString(reply.DataBlockExtended.MediaType); |
|
1937 | media.MediaWidth = reply.DataBlockExtended.MediaWidth; |
1949 | media.MediaWidth = reply.DataBlockExtended.MediaWidth; |
|
1938 | media.MediaURL = Utils.BytesToString(reply.DataBlock.MediaURL); |
1950 | media.MediaURL = Utils.BytesToString(reply.DataBlock.MediaURL); |
|
1939 | |
1951 | |
|
1940 | OnParcelMediaUpdateReply(new ParcelMediaUpdateReplyEventArgs(simulator, media)); |
1952 | OnParcelMediaUpdateReply(new ParcelMediaUpdateReplyEventArgs(simulator, media)); |
|
1941 | } |
1953 | } |
|
1942 | } |
1954 | } |
|
1943 | |
1955 | |
|
1944 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
1956 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
|
1945 | /// <param name="sender">The sender</param> |
1957 | /// <param name="sender">The sender</param> |
|
1946 | /// <param name="e">The EventArgs object containing the packet data</param> |
1958 | /// <param name="e">The EventArgs object containing the packet data</param> |
|
1947 | protected void ParcelOverlayHandler(object sender, PacketReceivedEventArgs e) |
1959 | protected void ParcelOverlayHandler(object sender, PacketReceivedEventArgs e) |
|
1948 | { |
1960 | { |
|
1949 | const int OVERLAY_COUNT = 4; |
1961 | const int OVERLAY_COUNT = 4; |
|
1950 | Packet packet = e.Packet; |
1962 | Packet packet = e.Packet; |
|
1951 | Simulator simulator = e.Simulator; |
1963 | Simulator simulator = e.Simulator; |
|
1952 | |
1964 | |
|
1953 | ParcelOverlayPacket overlay = (ParcelOverlayPacket)packet; |
1965 | ParcelOverlayPacket overlay = (ParcelOverlayPacket)packet; |
|
1954 | |
1966 | |
|
1955 | if (overlay.ParcelData.SequenceID >= 0 && overlay.ParcelData.SequenceID < OVERLAY_COUNT) |
1967 | if (overlay.ParcelData.SequenceID >= 0 && overlay.ParcelData.SequenceID < OVERLAY_COUNT) |
|
1956 | { |
1968 | { |
|
1957 | int length = overlay.ParcelData.Data.Length; |
1969 | int length = overlay.ParcelData.Data.Length; |
|
1958 | |
1970 | |
|
1959 | Buffer.BlockCopy(overlay.ParcelData.Data, 0, simulator.ParcelOverlay, |
1971 | Buffer.BlockCopy(overlay.ParcelData.Data, 0, simulator.ParcelOverlay, |
|
1960 | overlay.ParcelData.SequenceID * length, length); |
1972 | overlay.ParcelData.SequenceID * length, length); |
|
1961 | simulator.ParcelOverlaysReceived++; |
1973 | simulator.ParcelOverlaysReceived++; |
|
1962 | |
1974 | |
|
1963 | if (simulator.ParcelOverlaysReceived >= OVERLAY_COUNT) |
1975 | if (simulator.ParcelOverlaysReceived >= OVERLAY_COUNT) |
|
1964 | { |
1976 | { |
|
1965 | // TODO: ParcelOverlaysReceived should become internal, and reset to zero every |
1977 | // TODO: ParcelOverlaysReceived should become internal, and reset to zero every |
|
1966 | // time it hits four. Also need a callback here |
1978 | // time it hits four. Also need a callback here |
|
1967 | } |
1979 | } |
|
1968 | } |
1980 | } |
|
1969 | else |
1981 | else |
|
1970 | { |
1982 | { |
|
1971 | Logger.Log("Parcel overlay with sequence ID of " + overlay.ParcelData.SequenceID + |
1983 | Logger.Log("Parcel overlay with sequence ID of " + overlay.ParcelData.SequenceID + |
|
1972 | " received from " + simulator.ToString(), Helpers.LogLevel.Warning, Client); |
1984 | " received from " + simulator.ToString(), Helpers.LogLevel.Warning, Client); |
|
1973 | } |
1985 | } |
|
1974 | } |
1986 | } |
|
1975 | |
1987 | |
|
1976 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
1988 | /// <summary>Process an incoming packet and raise the appropriate events</summary> |
|
1977 | /// <param name="sender">The sender</param> |
1989 | /// <param name="sender">The sender</param> |
|
1978 | /// <param name="e">The EventArgs object containing the packet data</param> |
1990 | /// <param name="e">The EventArgs object containing the packet data</param> |
|
1979 | /// <remarks>Raises the <see cref="ParcelMediaCommand"/> event</remarks> |
1991 | /// <remarks>Raises the <see cref="ParcelMediaCommand"/> event</remarks> |
|
1980 | protected void ParcelMediaCommandMessagePacketHandler(object sender, PacketReceivedEventArgs e) |
1992 | protected void ParcelMediaCommandMessagePacketHandler(object sender, PacketReceivedEventArgs e) |
|
1981 | { |
1993 | { |
|
1982 | if (m_ParcelMediaCommand != null) |
1994 | if (m_ParcelMediaCommand != null) |
|
1983 | { |
1995 | { |
|
1984 | Packet packet = e.Packet; |
1996 | Packet packet = e.Packet; |
|
1985 | Simulator simulator = e.Simulator; |
1997 | Simulator simulator = e.Simulator; |
|
1986 | |
1998 | |
|
1987 | ParcelMediaCommandMessagePacket pmc = (ParcelMediaCommandMessagePacket)packet; |
1999 | ParcelMediaCommandMessagePacket pmc = (ParcelMediaCommandMessagePacket)packet; |
|
1988 | ParcelMediaCommandMessagePacket.CommandBlockBlock block = pmc.CommandBlock; |
2000 | ParcelMediaCommandMessagePacket.CommandBlockBlock block = pmc.CommandBlock; |
|
1989 | |
2001 | |
|
1990 | OnParcelMediaCommand(new ParcelMediaCommandEventArgs(simulator, pmc.Header.Sequence, (ParcelFlags)block.Flags, |
2002 | OnParcelMediaCommand(new ParcelMediaCommandEventArgs(simulator, pmc.Header.Sequence, (ParcelFlags)block.Flags, |
|
1991 | (ParcelMediaCommand)block.Command, block.Time)); |
2003 | (ParcelMediaCommand)block.Command, block.Time)); |
|
1992 | } |
2004 | } |
|
1993 | } |
2005 | } |
|
1994 | |
2006 | |
|
1995 | #endregion Packet Handlers |
2007 | #endregion Packet Handlers |
|
1996 | } |
2008 | } |
|
1997 | #region EventArgs classes |
2009 | #region EventArgs classes |
|
1998 | |
2010 | |
|
1999 | /// <summary>Contains a parcels dwell data returned from the simulator in response to an <see cref="RequestParcelDwell"/></summary> |
2011 | /// <summary>Contains a parcels dwell data returned from the simulator in response to an <see cref="RequestParcelDwell"/></summary> |
|
2000 | public class ParcelDwellReplyEventArgs : EventArgs |
2012 | public class ParcelDwellReplyEventArgs : EventArgs |
|
2001 | { |
2013 | { |
|
2002 | private readonly UUID m_ParcelID; |
2014 | private readonly UUID m_ParcelID; |
|
2003 | private readonly int m_LocalID; |
2015 | private readonly int m_LocalID; |
|
2004 | private readonly float m_Dwell; |
2016 | private readonly float m_Dwell; |
|
2005 | |
2017 | |
|
2006 | /// <summary>Get the global ID of the parcel</summary> |
2018 | /// <summary>Get the global ID of the parcel</summary> |
|
2007 | public UUID ParcelID { get { return m_ParcelID; } } |
2019 | public UUID ParcelID { get { return m_ParcelID; } } |
|
2008 | /// <summary>Get the simulator specific ID of the parcel</summary> |
2020 | /// <summary>Get the simulator specific ID of the parcel</summary> |
|
2009 | public int LocalID { get { return m_LocalID; } } |
2021 | public int LocalID { get { return m_LocalID; } } |
|
2010 | /// <summary>Get the calculated dwell</summary> |
2022 | /// <summary>Get the calculated dwell</summary> |
|
2011 | public float Dwell { get { return m_Dwell; } } |
2023 | public float Dwell { get { return m_Dwell; } } |
|
2012 | |
2024 | |
|
2013 | /// <summary> |
2025 | /// <summary> |
|
2014 | /// Construct a new instance of the ParcelDwellReplyEventArgs class |
2026 | /// Construct a new instance of the ParcelDwellReplyEventArgs class |
|
2015 | /// </summary> |
2027 | /// </summary> |
|
2016 | /// <param name="parcelID">The global ID of the parcel</param> |
2028 | /// <param name="parcelID">The global ID of the parcel</param> |
|
2017 | /// <param name="localID">The simulator specific ID of the parcel</param> |
2029 | /// <param name="localID">The simulator specific ID of the parcel</param> |
|
2018 | /// <param name="dwell">The calculated dwell for the parcel</param> |
2030 | /// <param name="dwell">The calculated dwell for the parcel</param> |
|
2019 | public ParcelDwellReplyEventArgs(UUID parcelID, int localID, float dwell) |
2031 | public ParcelDwellReplyEventArgs(UUID parcelID, int localID, float dwell) |
|
2020 | { |
2032 | { |
|
2021 | this.m_ParcelID = parcelID; |
2033 | this.m_ParcelID = parcelID; |
|
2022 | this.m_LocalID = localID; |
2034 | this.m_LocalID = localID; |
|
2023 | this.m_Dwell = dwell; |
2035 | this.m_Dwell = dwell; |
|
2024 | } |
2036 | } |
|
2025 | } |
2037 | } |
|
2026 | |
2038 | |
|
2027 | /// <summary>Contains basic parcel information data returned from the |
2039 | /// <summary>Contains basic parcel information data returned from the |
|
2028 | /// simulator in response to an <see cref="RequestParcelInfo"/> request</summary> |
2040 | /// simulator in response to an <see cref="RequestParcelInfo"/> request</summary> |
|
2029 | public class ParcelInfoReplyEventArgs : EventArgs |
2041 | public class ParcelInfoReplyEventArgs : EventArgs |
|
2030 | { |
2042 | { |
|
2031 | private readonly ParcelInfo m_Parcel; |
2043 | private readonly ParcelInfo m_Parcel; |
|
2032 | |
2044 | |
|
2033 | /// <summary>Get the <see cref="ParcelInfo"/> object containing basic parcel info</summary> |
2045 | /// <summary>Get the <see cref="ParcelInfo"/> object containing basic parcel info</summary> |
|
2034 | public ParcelInfo Parcel { get { return m_Parcel; } } |
2046 | public ParcelInfo Parcel { get { return m_Parcel; } } |
|
2035 | |
2047 | |
|
2036 | /// <summary> |
2048 | /// <summary> |
|
2037 | /// Construct a new instance of the ParcelInfoReplyEventArgs class |
2049 | /// Construct a new instance of the ParcelInfoReplyEventArgs class |
|
2038 | /// </summary> |
2050 | /// </summary> |
|
2039 | /// <param name="parcel">The <see cref="ParcelInfo"/> object containing basic parcel info</param> |
2051 | /// <param name="parcel">The <see cref="ParcelInfo"/> object containing basic parcel info</param> |
|
2040 | public ParcelInfoReplyEventArgs(ParcelInfo parcel) |
2052 | public ParcelInfoReplyEventArgs(ParcelInfo parcel) |
|
2041 | { |
2053 | { |
|
2042 | this.m_Parcel = parcel; |
2054 | this.m_Parcel = parcel; |
|
2043 | } |
2055 | } |
|
2044 | } |
2056 | } |
|
2045 | |
2057 | |
|
2046 | /// <summary>Contains basic parcel information data returned from the simulator in response to an <see cref="RequestParcelInfo"/> request</summary> |
2058 | /// <summary>Contains basic parcel information data returned from the simulator in response to an <see cref="RequestParcelInfo"/> request</summary> |
|
2047 | public class ParcelPropertiesEventArgs : EventArgs |
2059 | public class ParcelPropertiesEventArgs : EventArgs |
|
2048 | { |
2060 | { |
|
2049 | private readonly Simulator m_Simulator; |
2061 | private readonly Simulator m_Simulator; |
|
2050 | private Parcel m_Parcel; |
2062 | private Parcel m_Parcel; |
|
2051 | private readonly ParcelResult m_Result; |
2063 | private readonly ParcelResult m_Result; |
|
2052 | private readonly int m_SelectedPrims; |
2064 | private readonly int m_SelectedPrims; |
|
2053 | private readonly int m_SequenceID; |
2065 | private readonly int m_SequenceID; |
|
2054 | private readonly bool m_SnapSelection; |
2066 | private readonly bool m_SnapSelection; |
|
2055 | |
2067 | |
|
2056 | /// <summary>Get the simulator the parcel is located in</summary> |
2068 | /// <summary>Get the simulator the parcel is located in</summary> |
|
2057 | public Simulator Simulator { get { return m_Simulator; } } |
2069 | public Simulator Simulator { get { return m_Simulator; } } |
|
2058 | /// <summary>Get the <see cref="Parcel"/> object containing the details</summary> |
2070 | /// <summary>Get the <see cref="Parcel"/> object containing the details</summary> |
|
2059 | /// <remarks>If Result is NoData, this object will not contain valid data</remarks> |
2071 | /// <remarks>If Result is NoData, this object will not contain valid data</remarks> |
|
2060 | public Parcel Parcel { get { return m_Parcel; } } |
2072 | public Parcel Parcel { get { return m_Parcel; } } |
|
2061 | /// <summary>Get the result of the request</summary> |
2073 | /// <summary>Get the result of the request</summary> |
|
2062 | public ParcelResult Result { get { return m_Result; } } |
2074 | public ParcelResult Result { get { return m_Result; } } |
|
2063 | /// <summary>Get the number of primitieves your agent is |
2075 | /// <summary>Get the number of primitieves your agent is |
|
2064 | /// currently selecting and or sitting on in this parcel</summary> |
2076 | /// currently selecting and or sitting on in this parcel</summary> |
|
2065 | public int SelectedPrims { get { return m_SelectedPrims; } } |
2077 | public int SelectedPrims { get { return m_SelectedPrims; } } |
|
2066 | /// <summary>Get the user assigned ID used to correlate a request with |
2078 | /// <summary>Get the user assigned ID used to correlate a request with |
|
2067 | /// these results</summary> |
2079 | /// these results</summary> |
|
2068 | public int SequenceID { get { return m_SequenceID; } } |
2080 | public int SequenceID { get { return m_SequenceID; } } |
|
2069 | /// <summary>TODO:</summary> |
2081 | /// <summary>TODO:</summary> |
|
2070 | public bool SnapSelection { get { return m_SnapSelection; } } |
2082 | public bool SnapSelection { get { return m_SnapSelection; } } |
|
2071 | |
2083 | |
|
2072 | /// <summary> |
2084 | /// <summary> |
|
2073 | /// Construct a new instance of the ParcelPropertiesEventArgs class |
2085 | /// Construct a new instance of the ParcelPropertiesEventArgs class |
|
2074 | /// </summary> |
2086 | /// </summary> |
|
2075 | /// <param name="simulator">The <see cref="Parcel"/> object containing the details</param> |
2087 | /// <param name="simulator">The <see cref="Parcel"/> object containing the details</param> |
|
2076 | /// <param name="parcel">The <see cref="Parcel"/> object containing the details</param> |
2088 | /// <param name="parcel">The <see cref="Parcel"/> object containing the details</param> |
|
2077 | /// <param name="result">The result of the request</param> |
2089 | /// <param name="result">The result of the request</param> |
|
2078 | /// <param name="selectedPrims">The number of primitieves your agent is |
2090 | /// <param name="selectedPrims">The number of primitieves your agent is |
|
2079 | /// currently selecting and or sitting on in this parcel</param> |
2091 | /// currently selecting and or sitting on in this parcel</param> |
|
2080 | /// <param name="sequenceID">The user assigned ID used to correlate a request with |
2092 | /// <param name="sequenceID">The user assigned ID used to correlate a request with |
|
2081 | /// these results</param> |
2093 | /// these results</param> |
|
2082 | /// <param name="snapSelection">TODO:</param> |
2094 | /// <param name="snapSelection">TODO:</param> |
|
2083 | public ParcelPropertiesEventArgs(Simulator simulator, Parcel parcel, ParcelResult result, int selectedPrims, |
2095 | public ParcelPropertiesEventArgs(Simulator simulator, Parcel parcel, ParcelResult result, int selectedPrims, |
|
2084 | int sequenceID, bool snapSelection) |
2096 | int sequenceID, bool snapSelection) |
|
2085 | { |
2097 | { |
|
2086 | this.m_Simulator = simulator; |
2098 | this.m_Simulator = simulator; |
|
2087 | this.m_Parcel = parcel; |
2099 | this.m_Parcel = parcel; |
|
2088 | this.m_Result = result; |
2100 | this.m_Result = result; |
|
2089 | this.m_SelectedPrims = selectedPrims; |
2101 | this.m_SelectedPrims = selectedPrims; |
|
2090 | this.m_SequenceID = sequenceID; |
2102 | this.m_SequenceID = sequenceID; |
|
2091 | this.m_SnapSelection = snapSelection; |
2103 | this.m_SnapSelection = snapSelection; |
|
2092 | } |
2104 | } |
|
2093 | } |
2105 | } |
|
2094 | |
2106 | |
|
2095 | /// <summary>Contains blacklist and whitelist data returned from the simulator in response to an <see cref="RequestParcelAccesslist"/> request</summary> |
2107 | /// <summary>Contains blacklist and whitelist data returned from the simulator in response to an <see cref="RequestParcelAccesslist"/> request</summary> |
|
2096 | public class ParcelAccessListReplyEventArgs : EventArgs |
2108 | public class ParcelAccessListReplyEventArgs : EventArgs |
|
2097 | { |
2109 | { |
|
2098 | private readonly Simulator m_Simulator; |
2110 | private readonly Simulator m_Simulator; |
|
2099 | private readonly int m_SequenceID; |
2111 | private readonly int m_SequenceID; |
|
2100 | private readonly int m_LocalID; |
2112 | private readonly int m_LocalID; |
|
2101 | private readonly uint m_Flags; |
2113 | private readonly uint m_Flags; |
|
2102 | private readonly List<ParcelManager.ParcelAccessEntry> m_AccessList; |
2114 | private readonly List<ParcelManager.ParcelAccessEntry> m_AccessList; |
|
2103 | |
2115 | |
|
2104 | /// <summary>Get the simulator the parcel is located in</summary> |
2116 | /// <summary>Get the simulator the parcel is located in</summary> |
|
2105 | public Simulator Simulator { get { return m_Simulator; } } |
2117 | public Simulator Simulator { get { return m_Simulator; } } |
|
2106 | /// <summary>Get the user assigned ID used to correlate a request with |
2118 | /// <summary>Get the user assigned ID used to correlate a request with |
|
2107 | /// these results</summary> |
2119 | /// these results</summary> |
|
2108 | public int SequenceID { get { return m_SequenceID; } } |
2120 | public int SequenceID { get { return m_SequenceID; } } |
|
2109 | /// <summary>Get the simulator specific ID of the parcel</summary> |
2121 | /// <summary>Get the simulator specific ID of the parcel</summary> |
|
2110 | public int LocalID { get { return m_LocalID; } } |
2122 | public int LocalID { get { return m_LocalID; } } |
|
2111 | /// <summary>TODO:</summary> |
2123 | /// <summary>TODO:</summary> |
|
2112 | public uint Flags { get { return m_Flags; } } |
2124 | public uint Flags { get { return m_Flags; } } |
|
2113 | /// <summary>Get the list containing the white/blacklisted agents for the parcel</summary> |
2125 | /// <summary>Get the list containing the white/blacklisted agents for the parcel</summary> |
|
2114 | public List<ParcelManager.ParcelAccessEntry> AccessList { get { return m_AccessList; } } |
2126 | public List<ParcelManager.ParcelAccessEntry> AccessList { get { return m_AccessList; } } |
|
2115 | |
2127 | |
|
2116 | /// <summary> |
2128 | /// <summary> |
|
2117 | /// Construct a new instance of the ParcelAccessListReplyEventArgs class |
2129 | /// Construct a new instance of the ParcelAccessListReplyEventArgs class |
|
2118 | /// </summary> |
2130 | /// </summary> |
|
2119 | /// <param name="simulator">The simulator the parcel is located in</param> |
2131 | /// <param name="simulator">The simulator the parcel is located in</param> |
|
2120 | /// <param name="sequenceID">The user assigned ID used to correlate a request with |
2132 | /// <param name="sequenceID">The user assigned ID used to correlate a request with |
|
2121 | /// these results</param> |
2133 | /// these results</param> |
|
2122 | /// <param name="localID">The simulator specific ID of the parcel</param> |
2134 | /// <param name="localID">The simulator specific ID of the parcel</param> |
|
2123 | /// <param name="flags">TODO:</param> |
2135 | /// <param name="flags">TODO:</param> |
|
2124 | /// <param name="accessEntries">The list containing the white/blacklisted agents for the parcel</param> |
2136 | /// <param name="accessEntries">The list containing the white/blacklisted agents for the parcel</param> |
|
2125 | public ParcelAccessListReplyEventArgs(Simulator simulator, int sequenceID, int localID, uint flags, List<ParcelManager.ParcelAccessEntry> accessEntries) |
2137 | public ParcelAccessListReplyEventArgs(Simulator simulator, int sequenceID, int localID, uint flags, List<ParcelManager.ParcelAccessEntry> accessEntries) |
|
2126 | { |
2138 | { |
|
2127 | this.m_Simulator = simulator; |
2139 | this.m_Simulator = simulator; |
|
2128 | this.m_SequenceID = sequenceID; |
2140 | this.m_SequenceID = sequenceID; |
|
2129 | this.m_LocalID = localID; |
2141 | this.m_LocalID = localID; |
|
2130 | this.m_Flags = flags; |
2142 | this.m_Flags = flags; |
|
2131 | this.m_AccessList = accessEntries; |
2143 | this.m_AccessList = accessEntries; |
|
2132 | } |
2144 | } |
|
2133 | } |
2145 | } |
|
2134 | |
2146 | |
|
2135 | /// <summary>Contains blacklist and whitelist data returned from the |
2147 | /// <summary>Contains blacklist and whitelist data returned from the |
|
2136 | /// simulator in response to an <see cref="RequestParcelAccesslist"/> request</summary> |
2148 | /// simulator in response to an <see cref="RequestParcelAccesslist"/> request</summary> |
|
2137 | public class ParcelObjectOwnersReplyEventArgs : EventArgs |
2149 | public class ParcelObjectOwnersReplyEventArgs : EventArgs |
|
2138 | { |
2150 | { |
|
2139 | private readonly Simulator m_Simulator; |
2151 | private readonly Simulator m_Simulator; |
|
2140 | private readonly List<ParcelManager.ParcelPrimOwners> m_Owners; |
2152 | private readonly List<ParcelManager.ParcelPrimOwners> m_Owners; |
|
2141 | |
2153 | |
|
2142 | /// <summary>Get the simulator the parcel is located in</summary> |
2154 | /// <summary>Get the simulator the parcel is located in</summary> |
|
2143 | public Simulator Simulator { get { return m_Simulator; } } |
2155 | public Simulator Simulator { get { return m_Simulator; } } |
|
2144 | /// <summary>Get the list containing prim ownership counts</summary> |
2156 | /// <summary>Get the list containing prim ownership counts</summary> |
|
2145 | public List<ParcelManager.ParcelPrimOwners> PrimOwners { get { return m_Owners; } } |
2157 | public List<ParcelManager.ParcelPrimOwners> PrimOwners { get { return m_Owners; } } |
|
2146 | |
2158 | |
|
2147 | /// <summary> |
2159 | /// <summary> |
|
2148 | /// Construct a new instance of the ParcelObjectOwnersReplyEventArgs class |
2160 | /// Construct a new instance of the ParcelObjectOwnersReplyEventArgs class |
|
2149 | /// </summary> |
2161 | /// </summary> |
|
2150 | /// <param name="simulator">The simulator the parcel is located in</param> |
2162 | /// <param name="simulator">The simulator the parcel is located in</param> |
|
2151 | /// <param name="primOwners">The list containing prim ownership counts</param> |
2163 | /// <param name="primOwners">The list containing prim ownership counts</param> |
|
2152 | public ParcelObjectOwnersReplyEventArgs(Simulator simulator, List<ParcelManager.ParcelPrimOwners> primOwners) |
2164 | public ParcelObjectOwnersReplyEventArgs(Simulator simulator, List<ParcelManager.ParcelPrimOwners> primOwners) |
|
2153 | { |
2165 | { |
|
2154 | this.m_Simulator = simulator; |
2166 | this.m_Simulator = simulator; |
|
2155 | this.m_Owners = primOwners; |
2167 | this.m_Owners = primOwners; |
|
2156 | } |
2168 | } |
|
2157 | } |
2169 | } |
|
2158 | |
2170 | |
|
2159 | /// <summary>Contains the data returned when all parcel data has been retrieved from a simulator</summary> |
2171 | /// <summary>Contains the data returned when all parcel data has been retrieved from a simulator</summary> |
|
2160 | public class SimParcelsDownloadedEventArgs : EventArgs |
2172 | public class SimParcelsDownloadedEventArgs : EventArgs |
|
2161 | { |
2173 | { |
|
2162 | private readonly Simulator m_Simulator; |
2174 | private readonly Simulator m_Simulator; |
|
2163 | private readonly InternalDictionary<int, Parcel> m_Parcels; |
2175 | private readonly InternalDictionary<int, Parcel> m_Parcels; |
|
2164 | private readonly int[,] m_ParcelMap; |
2176 | private readonly int[,] m_ParcelMap; |
|
2165 | |
2177 | |
|
2166 | /// <summary>Get the simulator the parcel data was retrieved from</summary> |
2178 | /// <summary>Get the simulator the parcel data was retrieved from</summary> |
|
2167 | public Simulator Simulator { get { return m_Simulator; } } |
2179 | public Simulator Simulator { get { return m_Simulator; } } |
|
2168 | /// <summary>A dictionary containing the parcel data where the key correlates to the ParcelMap entry</summary> |
2180 | /// <summary>A dictionary containing the parcel data where the key correlates to the ParcelMap entry</summary> |
|
2169 | public InternalDictionary<int, Parcel> Parcels { get { return m_Parcels; } } |
2181 | public InternalDictionary<int, Parcel> Parcels { get { return m_Parcels; } } |
|
2170 | /// <summary>Get the multidimensional array containing a x,y grid mapped |
2182 | /// <summary>Get the multidimensional array containing a x,y grid mapped |
|
2171 | /// to each 64x64 parcel's LocalID.</summary> |
2183 | /// to each 64x64 parcel's LocalID.</summary> |
|
2172 | public int[,] ParcelMap { get { return m_ParcelMap; } } |
2184 | public int[,] ParcelMap { get { return m_ParcelMap; } } |
|
2173 | |
2185 | |
|
2174 | /// <summary> |
2186 | /// <summary> |
|
2175 | /// Construct a new instance of the SimParcelsDownloadedEventArgs class |
2187 | /// Construct a new instance of the SimParcelsDownloadedEventArgs class |
|
2176 | /// </summary> |
2188 | /// </summary> |
|
2177 | /// <param name="simulator">The simulator the parcel data was retrieved from</param> |
2189 | /// <param name="simulator">The simulator the parcel data was retrieved from</param> |
|
2178 | /// <param name="simParcels">The dictionary containing the parcel data</param> |
2190 | /// <param name="simParcels">The dictionary containing the parcel data</param> |
|
2179 | /// <param name="parcelMap">The multidimensional array containing a x,y grid mapped |
2191 | /// <param name="parcelMap">The multidimensional array containing a x,y grid mapped |
|
2180 | /// to each 64x64 parcel's LocalID.</param> |
2192 | /// to each 64x64 parcel's LocalID.</param> |
|
2181 | public SimParcelsDownloadedEventArgs(Simulator simulator, InternalDictionary<int, Parcel> simParcels, int[,] parcelMap) |
2193 | public SimParcelsDownloadedEventArgs(Simulator simulator, InternalDictionary<int, Parcel> simParcels, int[,] parcelMap) |
|
2182 | { |
2194 | { |
|
2183 | this.m_Simulator = simulator; |
2195 | this.m_Simulator = simulator; |
|
2184 | this.m_Parcels = simParcels; |
2196 | this.m_Parcels = simParcels; |
|
2185 | this.m_ParcelMap = parcelMap; |
2197 | this.m_ParcelMap = parcelMap; |
|
2186 | } |
2198 | } |
|
2187 | } |
2199 | } |
|
2188 | |
2200 | |
|
2189 | /// <summary>Contains the data returned when a <see cref="RequestForceSelectObjects"/> request</summary> |
2201 | /// <summary>Contains the data returned when a <see cref="RequestForceSelectObjects"/> request</summary> |
|
2190 | public class ForceSelectObjectsReplyEventArgs : EventArgs |
2202 | public class ForceSelectObjectsReplyEventArgs : EventArgs |
|
2191 | { |
2203 | { |
|
2192 | private readonly Simulator m_Simulator; |
2204 | private readonly Simulator m_Simulator; |
|
2193 | private readonly List<uint> m_ObjectIDs; |
2205 | private readonly List<uint> m_ObjectIDs; |
|
2194 | private readonly bool m_ResetList; |
2206 | private readonly bool m_ResetList; |
|
2195 | |
2207 | |
|
2196 | /// <summary>Get the simulator the parcel data was retrieved from</summary> |
2208 | /// <summary>Get the simulator the parcel data was retrieved from</summary> |
|
2197 | public Simulator Simulator { get { return m_Simulator; } } |
2209 | public Simulator Simulator { get { return m_Simulator; } } |
|
2198 | /// <summary>Get the list of primitive IDs</summary> |
2210 | /// <summary>Get the list of primitive IDs</summary> |
|
2199 | public List<uint> ObjectIDs { get { return m_ObjectIDs; } } |
2211 | public List<uint> ObjectIDs { get { return m_ObjectIDs; } } |
|
2200 | /// <summary>true if the list is clean and contains the information |
2212 | /// <summary>true if the list is clean and contains the information |
|
2201 | /// only for a given request</summary> |
2213 | /// only for a given request</summary> |
|
2202 | public bool ResetList { get { return m_ResetList; } } |
2214 | public bool ResetList { get { return m_ResetList; } } |
|
2203 | |
2215 | |
|
2204 | /// <summary> |
2216 | /// <summary> |
|
2205 | /// Construct a new instance of the ForceSelectObjectsReplyEventArgs class |
2217 | /// Construct a new instance of the ForceSelectObjectsReplyEventArgs class |
|
2206 | /// </summary> |
2218 | /// </summary> |
|
2207 | /// <param name="simulator">The simulator the parcel data was retrieved from</param> |
2219 | /// <param name="simulator">The simulator the parcel data was retrieved from</param> |
|
2208 | /// <param name="objectIDs">The list of primitive IDs</param> |
2220 | /// <param name="objectIDs">The list of primitive IDs</param> |
|
2209 | /// <param name="resetList">true if the list is clean and contains the information |
2221 | /// <param name="resetList">true if the list is clean and contains the information |
|
2210 | /// only for a given request</param> |
2222 | /// only for a given request</param> |
|
2211 | public ForceSelectObjectsReplyEventArgs(Simulator simulator, List<uint> objectIDs, bool resetList) |
2223 | public ForceSelectObjectsReplyEventArgs(Simulator simulator, List<uint> objectIDs, bool resetList) |
|
2212 | { |
2224 | { |
|
2213 | this.m_Simulator = simulator; |
2225 | this.m_Simulator = simulator; |
|
2214 | this.m_ObjectIDs = objectIDs; |
2226 | this.m_ObjectIDs = objectIDs; |
|
2215 | this.m_ResetList = resetList; |
2227 | this.m_ResetList = resetList; |
|
2216 | } |
2228 | } |
|
2217 | } |
2229 | } |
|
2218 | |
2230 | |
|
2219 | /// <summary>Contains data when the media data for a parcel the avatar is on changes</summary> |
2231 | /// <summary>Contains data when the media data for a parcel the avatar is on changes</summary> |
|
2220 | public class ParcelMediaUpdateReplyEventArgs : EventArgs |
2232 | public class ParcelMediaUpdateReplyEventArgs : EventArgs |
|
2221 | { |
2233 | { |
|
2222 | private readonly Simulator m_Simulator; |
2234 | private readonly Simulator m_Simulator; |
|
2223 | private readonly ParcelMedia m_ParcelMedia; |
2235 | private readonly ParcelMedia m_ParcelMedia; |
|
2224 | |
2236 | |
|
2225 | /// <summary>Get the simulator the parcel media data was updated in</summary> |
2237 | /// <summary>Get the simulator the parcel media data was updated in</summary> |
|
2226 | public Simulator Simulator { get { return m_Simulator; } } |
2238 | public Simulator Simulator { get { return m_Simulator; } } |
|
2227 | /// <summary>Get the updated media information</summary> |
2239 | /// <summary>Get the updated media information</summary> |
|
2228 | public ParcelMedia Media { get { return m_ParcelMedia; } } |
2240 | public ParcelMedia Media { get { return m_ParcelMedia; } } |
|
2229 | |
2241 | |
|
2230 | /// <summary> |
2242 | /// <summary> |
|
2231 | /// Construct a new instance of the ParcelMediaUpdateReplyEventArgs class |
2243 | /// Construct a new instance of the ParcelMediaUpdateReplyEventArgs class |
|
2232 | /// </summary> |
2244 | /// </summary> |
|
2233 | /// <param name="simulator">the simulator the parcel media data was updated in</param> |
2245 | /// <param name="simulator">the simulator the parcel media data was updated in</param> |
|
2234 | /// <param name="media">The updated media information</param> |
2246 | /// <param name="media">The updated media information</param> |
|
2235 | public ParcelMediaUpdateReplyEventArgs(Simulator simulator, ParcelMedia media) |
2247 | public ParcelMediaUpdateReplyEventArgs(Simulator simulator, ParcelMedia media) |
|
2236 | { |
2248 | { |
|
2237 | this.m_Simulator = simulator; |
2249 | this.m_Simulator = simulator; |
|
2238 | this.m_ParcelMedia = media; |
2250 | this.m_ParcelMedia = media; |
|
2239 | } |
2251 | } |
|
2240 | } |
2252 | } |
|
2241 | |
2253 | |
|
2242 | /// <summary>Contains the media command for a parcel the agent is currently on</summary> |
2254 | /// <summary>Contains the media command for a parcel the agent is currently on</summary> |
|
2243 | public class ParcelMediaCommandEventArgs : EventArgs |
2255 | public class ParcelMediaCommandEventArgs : EventArgs |
|
2244 | { |
2256 | { |
|
2245 | private readonly Simulator m_Simulator; |
2257 | private readonly Simulator m_Simulator; |
|
2246 | private readonly uint m_Sequence; |
2258 | private readonly uint m_Sequence; |
|
2247 | private readonly ParcelFlags m_ParcelFlags; |
2259 | private readonly ParcelFlags m_ParcelFlags; |
|
2248 | private readonly ParcelMediaCommand m_MediaCommand; |
2260 | private readonly ParcelMediaCommand m_MediaCommand; |
|
2249 | private readonly float m_Time; |
2261 | private readonly float m_Time; |
|
2250 | |
2262 | |
|
2251 | /// <summary>Get the simulator the parcel media command was issued in</summary> |
2263 | /// <summary>Get the simulator the parcel media command was issued in</summary> |
|
2252 | public Simulator Simulator { get { return m_Simulator; } } |
2264 | public Simulator Simulator { get { return m_Simulator; } } |
|
2253 | /// <summary></summary> |
2265 | /// <summary></summary> |
|
2254 | public uint Sequence { get { return m_Sequence; } } |
2266 | public uint Sequence { get { return m_Sequence; } } |
|
2255 | /// <summary></summary> |
2267 | /// <summary></summary> |
|
2256 | public ParcelFlags ParcelFlags { get { return m_ParcelFlags; } } |
2268 | public ParcelFlags ParcelFlags { get { return m_ParcelFlags; } } |
|
2257 | /// <summary>Get the media command that was sent</summary> |
2269 | /// <summary>Get the media command that was sent</summary> |
|
2258 | public ParcelMediaCommand MediaCommand { get { return m_MediaCommand; } } |
2270 | public ParcelMediaCommand MediaCommand { get { return m_MediaCommand; } } |
|
2259 | /// <summary></summary> |
2271 | /// <summary></summary> |
|
2260 | public float Time { get { return m_Time; } } |
2272 | public float Time { get { return m_Time; } } |
|
2261 | |
2273 | |
|
2262 | /// <summary> |
2274 | /// <summary> |
|
2263 | /// Construct a new instance of the ParcelMediaCommandEventArgs class |
2275 | /// Construct a new instance of the ParcelMediaCommandEventArgs class |
|
2264 | /// </summary> |
2276 | /// </summary> |
|
2265 | /// <param name="simulator">The simulator the parcel media command was issued in</param> |
2277 | /// <param name="simulator">The simulator the parcel media command was issued in</param> |
|
2266 | /// <param name="sequence"></param> |
2278 | /// <param name="sequence"></param> |
|
2267 | /// <param name="flags"></param> |
2279 | /// <param name="flags"></param> |
|
2268 | /// <param name="command">The media command that was sent</param> |
2280 | /// <param name="command">The media command that was sent</param> |
|
2269 | /// <param name="time"></param> |
2281 | /// <param name="time"></param> |
|
2270 | public ParcelMediaCommandEventArgs(Simulator simulator, uint sequence, ParcelFlags flags, ParcelMediaCommand command, float time) |
2282 | public ParcelMediaCommandEventArgs(Simulator simulator, uint sequence, ParcelFlags flags, ParcelMediaCommand command, float time) |
|
2271 | { |
2283 | { |
|
2272 | this.m_Simulator = simulator; |
2284 | this.m_Simulator = simulator; |
|
2273 | this.m_Sequence = sequence; |
2285 | this.m_Sequence = sequence; |
|
2274 | this.m_ParcelFlags = flags; |
2286 | this.m_ParcelFlags = flags; |
|
2275 | this.m_MediaCommand = command; |
2287 | this.m_MediaCommand = command; |
|
2276 | this.m_Time = time; |
2288 | this.m_Time = time; |
|
2277 | } |
2289 | } |
|
2278 | } |
2290 | } |
|
2279 | #endregion |
2291 | #endregion |
|
2280 | } |
2292 | } |
|
2281 | |
2293 | |