diff options
author | lbsa71 | 2007-09-20 23:28:08 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-20 23:28:08 +0000 |
commit | 101369e25ad4e72233e4855be4b82d1647233a6c (patch) | |
tree | 58b2a7dfcf83d474cba77f8d16f6c0de4d2f4ec2 /OpenSim/Region/Environment | |
parent | Rev 1971 : The Lbsa71 vintage commit (diff) | |
download | opensim-SC-101369e25ad4e72233e4855be4b82d1647233a6c.zip opensim-SC-101369e25ad4e72233e4855be4b82d1647233a6c.tar.gz opensim-SC-101369e25ad4e72233e4855be4b82d1647233a6c.tar.bz2 opensim-SC-101369e25ad4e72233e4855be4b82d1647233a6c.tar.xz |
* Some more presence refactoring
Diffstat (limited to '')
5 files changed, 469 insertions, 469 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 048d2b4..a6e47f3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -8,428 +8,433 @@ using OpenSim.Framework.Types; | |||
8 | using OpenSim.Framework.Utilities; | 8 | using OpenSim.Framework.Utilities; |
9 | using OpenSim.Region.Physics.Manager; | 9 | using OpenSim.Region.Physics.Manager; |
10 | 10 | ||
11 | namespace OpenSim.Region.Environment.Scenes | 11 | namespace OpenSim.Region.Environment.Scenes |
12 | { | 12 | { |
13 | public partial class Scene | 13 | public partial class Scene |
14 | { | 14 | { |
15 | //split these method into this partial as a lot of these (hopefully) are only temporary and won't be needed once Caps is more complete | 15 | //split these method into this partial as a lot of these (hopefully) are only temporary and won't be needed once Caps is more complete |
16 | // or at least some of they can be moved somewhere else | 16 | // or at least some of they can be moved somewhere else |
17 | 17 | ||
18 | public void AddInventoryItem(LLUUID userID, InventoryItemBase item) | 18 | public void AddInventoryItem(LLUUID avatarId, InventoryItemBase item) |
19 | { | 19 | { |
20 | if (Avatars.ContainsKey(userID)) | 20 | ScenePresence avatar; |
21 | { | 21 | |
22 | AddInventoryItem(Avatars[userID].ControllingClient, item); | 22 | if ( TryGetAvatar( avatarId, out avatar )) |
23 | } | 23 | { |
24 | } | 24 | AddInventoryItem(avatar.ControllingClient, item); |
25 | 25 | } | |
26 | public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) | 26 | } |
27 | { | 27 | |
28 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 28 | public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) |
29 | if (userInfo != null) | 29 | { |
30 | { | 30 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
31 | userInfo.AddItem(remoteClient.AgentId, item); | 31 | if (userInfo != null) |
32 | remoteClient.SendInventoryItemUpdate(item); | 32 | { |
33 | } | 33 | userInfo.AddItem(remoteClient.AgentId, item); |
34 | } | 34 | remoteClient.SendInventoryItemUpdate(item); |
35 | 35 | } | |
36 | public LLUUID CapsUpdateInventoryItemAsset(LLUUID userID, LLUUID itemID, byte[] data) | 36 | } |
37 | { | 37 | |
38 | if (Avatars.ContainsKey(userID)) | 38 | public LLUUID CapsUpdateInventoryItemAsset(LLUUID avatarId, LLUUID itemID, byte[] data) |
39 | { | 39 | { |
40 | return CapsUpdateInventoryItemAsset(Avatars[userID].ControllingClient, itemID, data); | 40 | ScenePresence avatar; |
41 | } | 41 | |
42 | return LLUUID.Zero; | 42 | if (TryGetAvatar(avatarId, out avatar)) |
43 | } | 43 | { |
44 | 44 | return CapsUpdateInventoryItemAsset(avatar.ControllingClient, itemID, data); | |
45 | public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data) | 45 | } |
46 | { | 46 | |
47 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 47 | return LLUUID.Zero; |
48 | if (userInfo != null) | 48 | } |
49 | { | 49 | |
50 | if (userInfo.RootFolder != null) | 50 | public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data) |
51 | { | 51 | { |
52 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | 52 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
53 | if (item != null) | 53 | if (userInfo != null) |
54 | { | 54 | { |
55 | AssetBase asset; | 55 | if (userInfo.RootFolder != null) |
56 | asset = new AssetBase(); | 56 | { |
57 | asset.FullID = LLUUID.Random(); | 57 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); |
58 | asset.Type = (sbyte) item.assetType; | 58 | if (item != null) |
59 | asset.InvType = (sbyte) item.invType; | 59 | { |
60 | asset.Name = item.inventoryName; | 60 | AssetBase asset; |
61 | asset.Data = data; | 61 | asset = new AssetBase(); |
62 | commsManager.AssetCache.AddAsset(asset); | 62 | asset.FullID = LLUUID.Random(); |
63 | 63 | asset.Type = (sbyte) item.assetType; | |
64 | item.assetID = asset.FullID; | 64 | asset.InvType = (sbyte) item.invType; |
65 | userInfo.UpdateItem(remoteClient.AgentId, item); | 65 | asset.Name = item.inventoryName; |
66 | 66 | asset.Data = data; | |
67 | // remoteClient.SendInventoryItemUpdate(item); | 67 | commsManager.AssetCache.AddAsset(asset); |
68 | if (item.invType == 7) | 68 | |
69 | { | 69 | item.assetID = asset.FullID; |
70 | //do we want to know about updated note cards? | 70 | userInfo.UpdateItem(remoteClient.AgentId, item); |
71 | } | 71 | |
72 | else if (item.invType == 10) | 72 | // remoteClient.SendInventoryItemUpdate(item); |
73 | { | 73 | if (item.invType == 7) |
74 | // do we want to know about updated scripts | 74 | { |
75 | } | 75 | //do we want to know about updated note cards? |
76 | 76 | } | |
77 | return (asset.FullID); | 77 | else if (item.invType == 10) |
78 | } | 78 | { |
79 | } | 79 | // do we want to know about updated scripts |
80 | } | 80 | } |
81 | return LLUUID.Zero; | 81 | |
82 | } | 82 | return (asset.FullID); |
83 | 83 | } | |
84 | } | ||
85 | } | ||
86 | return LLUUID.Zero; | ||
87 | } | ||
88 | |||
84 | public void UDPUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, | 89 | public void UDPUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, |
85 | LLUUID itemID) | 90 | LLUUID itemID) |
86 | { | 91 | { |
87 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 92 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
88 | if (userInfo != null) | 93 | if (userInfo != null) |
89 | { | 94 | { |
90 | if (userInfo.RootFolder != null) | 95 | if (userInfo.RootFolder != null) |
91 | { | 96 | { |
92 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | 97 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); |
93 | if (item != null) | 98 | if (item != null) |
94 | { | 99 | { |
95 | AgentAssetTransactions transactions = | 100 | AgentAssetTransactions transactions = |
96 | commsManager.TransactionsManager.GetUserTransActions(remoteClient.AgentId); | 101 | commsManager.TransactionsManager.GetUserTransActions(remoteClient.AgentId); |
97 | if (transactions != null) | 102 | if (transactions != null) |
98 | { | 103 | { |
99 | AssetBase asset = null; | 104 | AssetBase asset = null; |
100 | bool addToCache = false; | 105 | bool addToCache = false; |
101 | 106 | ||
102 | asset = commsManager.AssetCache.GetAsset(assetID); | 107 | asset = commsManager.AssetCache.GetAsset(assetID); |
103 | if (asset == null) | 108 | if (asset == null) |
104 | { | 109 | { |
105 | asset = transactions.GetTransactionAsset(transactionID); | 110 | asset = transactions.GetTransactionAsset(transactionID); |
106 | addToCache = true; | 111 | addToCache = true; |
107 | } | 112 | } |
108 | 113 | ||
109 | if (asset != null) | 114 | if (asset != null) |
110 | { | 115 | { |
111 | if (asset.FullID == assetID) | 116 | if (asset.FullID == assetID) |
112 | { | 117 | { |
113 | asset.Name = item.inventoryName; | 118 | asset.Name = item.inventoryName; |
114 | asset.Description = item.inventoryDescription; | 119 | asset.Description = item.inventoryDescription; |
115 | asset.InvType = (sbyte) item.invType; | 120 | asset.InvType = (sbyte) item.invType; |
116 | asset.Type = (sbyte) item.assetType; | 121 | asset.Type = (sbyte) item.assetType; |
117 | item.assetID = asset.FullID; | 122 | item.assetID = asset.FullID; |
118 | 123 | ||
119 | if (addToCache) | 124 | if (addToCache) |
120 | { | 125 | { |
121 | commsManager.AssetCache.AddAsset(asset); | 126 | commsManager.AssetCache.AddAsset(asset); |
122 | } | 127 | } |
123 | 128 | ||
124 | userInfo.UpdateItem(remoteClient.AgentId, item); | 129 | userInfo.UpdateItem(remoteClient.AgentId, item); |
125 | } | 130 | } |
126 | } | 131 | } |
127 | } | 132 | } |
128 | } | 133 | } |
129 | } | 134 | } |
130 | } | 135 | } |
131 | } | 136 | } |
132 | 137 | ||
133 | /// <summary> | 138 | /// <summary> |
134 | /// temporary method to test out creating new inventory items | 139 | /// temporary method to test out creating new inventory items |
135 | /// </summary> | 140 | /// </summary> |
136 | /// <param name="remoteClient"></param> | 141 | /// <param name="remoteClient"></param> |
137 | /// <param name="transActionID"></param> | 142 | /// <param name="transActionID"></param> |
138 | /// <param name="folderID"></param> | 143 | /// <param name="folderID"></param> |
139 | /// <param name="callbackID"></param> | 144 | /// <param name="callbackID"></param> |
140 | /// <param name="description"></param> | 145 | /// <param name="description"></param> |
141 | /// <param name="name"></param> | 146 | /// <param name="name"></param> |
142 | /// <param name="invType"></param> | 147 | /// <param name="invType"></param> |
143 | /// <param name="type"></param> | 148 | /// <param name="type"></param> |
144 | /// <param name="wearableType"></param> | 149 | /// <param name="wearableType"></param> |
145 | /// <param name="nextOwnerMask"></param> | 150 | /// <param name="nextOwnerMask"></param> |
146 | public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, | 151 | public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, |
147 | uint callbackID, string description, string name, sbyte invType, sbyte type, | 152 | uint callbackID, string description, string name, sbyte invType, sbyte type, |
148 | byte wearableType, uint nextOwnerMask) | 153 | byte wearableType, uint nextOwnerMask) |
149 | { | 154 | { |
150 | if (transActionID == LLUUID.Zero) | 155 | if (transActionID == LLUUID.Zero) |
151 | { | 156 | { |
152 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 157 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
153 | if (userInfo != null) | 158 | if (userInfo != null) |
154 | { | 159 | { |
155 | AssetBase asset = new AssetBase(); | 160 | AssetBase asset = new AssetBase(); |
156 | asset.Name = name; | 161 | asset.Name = name; |
157 | asset.Description = description; | 162 | asset.Description = description; |
158 | asset.InvType = invType; | 163 | asset.InvType = invType; |
159 | asset.Type = type; | 164 | asset.Type = type; |
160 | asset.FullID = LLUUID.Random(); | 165 | asset.FullID = LLUUID.Random(); |
161 | asset.Data = new byte[1]; | 166 | asset.Data = new byte[1]; |
162 | commsManager.AssetCache.AddAsset(asset); | 167 | commsManager.AssetCache.AddAsset(asset); |
163 | 168 | ||
164 | InventoryItemBase item = new InventoryItemBase(); | 169 | InventoryItemBase item = new InventoryItemBase(); |
165 | item.avatarID = remoteClient.AgentId; | 170 | item.avatarID = remoteClient.AgentId; |
166 | item.creatorsID = remoteClient.AgentId; | 171 | item.creatorsID = remoteClient.AgentId; |
167 | item.inventoryID = LLUUID.Random(); | 172 | item.inventoryID = LLUUID.Random(); |
168 | item.assetID = asset.FullID; | 173 | item.assetID = asset.FullID; |
169 | item.inventoryDescription = description; | 174 | item.inventoryDescription = description; |
170 | item.inventoryName = name; | 175 | item.inventoryName = name; |
171 | item.assetType = invType; | 176 | item.assetType = invType; |
172 | item.invType = invType; | 177 | item.invType = invType; |
173 | item.parentFolderID = folderID; | 178 | item.parentFolderID = folderID; |
174 | item.inventoryCurrentPermissions = 2147483647; | 179 | item.inventoryCurrentPermissions = 2147483647; |
175 | item.inventoryNextPermissions = nextOwnerMask; | 180 | item.inventoryNextPermissions = nextOwnerMask; |
176 | 181 | ||
177 | userInfo.AddItem(remoteClient.AgentId, item); | 182 | userInfo.AddItem(remoteClient.AgentId, item); |
178 | remoteClient.SendInventoryItemUpdate(item); | 183 | remoteClient.SendInventoryItemUpdate(item); |
179 | } | 184 | } |
180 | } | 185 | } |
181 | else | 186 | else |
182 | { | 187 | { |
183 | commsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, | 188 | commsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, |
184 | callbackID, description, name, invType, | 189 | callbackID, description, name, invType, |
185 | type, wearableType, nextOwnerMask); | 190 | type, wearableType, nextOwnerMask); |
186 | //System.Console.WriteLine("request to create inventory item from transaction " + transActionID); | 191 | //System.Console.WriteLine("request to create inventory item from transaction " + transActionID); |
187 | } | 192 | } |
188 | } | 193 | } |
189 | 194 | ||
190 | /// <summary> | 195 | /// <summary> |
191 | /// | 196 | /// |
192 | /// </summary> | 197 | /// </summary> |
193 | /// <param name="remoteClient"></param> | 198 | /// <param name="remoteClient"></param> |
194 | /// <param name="primLocalID"></param> | 199 | /// <param name="primLocalID"></param> |
195 | public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID) | 200 | public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID) |
196 | { | 201 | { |
197 | bool hasPrim = false; | 202 | bool hasPrim = false; |
198 | foreach (EntityBase ent in Entities.Values) | 203 | foreach (EntityBase ent in Entities.Values) |
199 | { | 204 | { |
200 | if (ent is SceneObjectGroup) | 205 | if (ent is SceneObjectGroup) |
201 | { | 206 | { |
202 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID); | 207 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID); |
203 | if (hasPrim != false) | 208 | if (hasPrim != false) |
204 | { | 209 | { |
205 | bool fileChange = ((SceneObjectGroup) ent).GetPartInventoryFileName(remoteClient, primLocalID); | 210 | bool fileChange = ((SceneObjectGroup) ent).GetPartInventoryFileName(remoteClient, primLocalID); |
206 | if (fileChange) | 211 | if (fileChange) |
207 | { | 212 | { |
208 | if (XferManager != null) | 213 | if (XferManager != null) |
209 | { | 214 | { |
210 | ((SceneObjectGroup) ent).RequestInventoryFile(primLocalID, XferManager); | 215 | ((SceneObjectGroup) ent).RequestInventoryFile(primLocalID, XferManager); |
211 | } | 216 | } |
212 | } | 217 | } |
213 | break; | 218 | break; |
214 | } | 219 | } |
215 | } | 220 | } |
216 | } | 221 | } |
217 | } | 222 | } |
218 | 223 | ||
219 | public void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID) | 224 | public void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID) |
220 | { | 225 | { |
221 | bool hasPrim = false; | 226 | bool hasPrim = false; |
222 | foreach (EntityBase ent in Entities.Values) | 227 | foreach (EntityBase ent in Entities.Values) |
223 | { | 228 | { |
224 | if (ent is SceneObjectGroup) | 229 | if (ent is SceneObjectGroup) |
225 | { | 230 | { |
226 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID); | 231 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID); |
227 | if (hasPrim != false) | 232 | if (hasPrim != false) |
228 | { | 233 | { |
229 | int type = ((SceneObjectGroup) ent).RemoveInventoryItem(remoteClient, localID, itemID); | 234 | int type = ((SceneObjectGroup) ent).RemoveInventoryItem(remoteClient, localID, itemID); |
230 | ((SceneObjectGroup) ent).GetProperites(remoteClient); | 235 | ((SceneObjectGroup) ent).GetProperites(remoteClient); |
231 | if (type == 10) | 236 | if (type == 10) |
232 | { | 237 | { |
233 | EventManager.TriggerRemoveScript(localID, itemID); | 238 | EventManager.TriggerRemoveScript(localID, itemID); |
234 | } | 239 | } |
235 | } | 240 | } |
236 | } | 241 | } |
237 | } | 242 | } |
238 | } | 243 | } |
239 | 244 | ||
240 | public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) | 245 | public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) |
241 | { | 246 | { |
242 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 247 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
243 | LLUUID copyID = LLUUID.Random(); | 248 | LLUUID copyID = LLUUID.Random(); |
244 | if (userInfo != null) | 249 | if (userInfo != null) |
245 | { | 250 | { |
246 | if (userInfo.RootFolder != null) | 251 | if (userInfo.RootFolder != null) |
247 | { | 252 | { |
248 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | 253 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); |
249 | if (item != null) | 254 | if (item != null) |
250 | { | 255 | { |
251 | bool isTexture = false; | 256 | bool isTexture = false; |
252 | bool rezzed = false; | 257 | bool rezzed = false; |
253 | if (item.invType == 0) | 258 | if (item.invType == 0) |
254 | { | 259 | { |
255 | isTexture = true; | 260 | isTexture = true; |
256 | } | 261 | } |
257 | AssetBase rezAsset = commsManager.AssetCache.GetAsset(item.assetID, isTexture); | 262 | AssetBase rezAsset = commsManager.AssetCache.GetAsset(item.assetID, isTexture); |
258 | if (rezAsset != null) | 263 | if (rezAsset != null) |
259 | { | 264 | { |
260 | string script = Util.FieldToString(rezAsset.Data); | 265 | string script = Util.FieldToString(rezAsset.Data); |
261 | //Console.WriteLine("rez script "+script); | 266 | //Console.WriteLine("rez script "+script); |
262 | EventManager.TriggerRezScript(localID, copyID, script); | 267 | EventManager.TriggerRezScript(localID, copyID, script); |
263 | rezzed = true; | 268 | rezzed = true; |
264 | } | 269 | } |
265 | else | 270 | else |
266 | { | 271 | { |
267 | //lets try once more incase the asset cache is being slow getting the asset from server | 272 | //lets try once more incase the asset cache is being slow getting the asset from server |
268 | rezAsset = commsManager.AssetCache.GetAsset(item.assetID, isTexture); | 273 | rezAsset = commsManager.AssetCache.GetAsset(item.assetID, isTexture); |
269 | if (rezAsset != null) | 274 | if (rezAsset != null) |
270 | { | 275 | { |
271 | string script = Util.FieldToString(rezAsset.Data); | 276 | string script = Util.FieldToString(rezAsset.Data); |
272 | // Console.WriteLine("rez script " + script); | 277 | // Console.WriteLine("rez script " + script); |
273 | EventManager.TriggerRezScript(localID, copyID, script); | 278 | EventManager.TriggerRezScript(localID, copyID, script); |
274 | rezzed = true; | 279 | rezzed = true; |
275 | } | 280 | } |
276 | } | 281 | } |
277 | 282 | ||
278 | if (rezzed) | 283 | if (rezzed) |
279 | { | 284 | { |
280 | bool hasPrim = false; | 285 | bool hasPrim = false; |
281 | foreach (EntityBase ent in Entities.Values) | 286 | foreach (EntityBase ent in Entities.Values) |
282 | { | 287 | { |
283 | if (ent is SceneObjectGroup) | 288 | if (ent is SceneObjectGroup) |
284 | { | 289 | { |
285 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID); | 290 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID); |
286 | if (hasPrim != false) | 291 | if (hasPrim != false) |
287 | { | 292 | { |
288 | bool added = | 293 | bool added = |
289 | ((SceneObjectGroup) ent).AddInventoryItem(remoteClient, localID, item, | 294 | ((SceneObjectGroup) ent).AddInventoryItem(remoteClient, localID, item, |
290 | copyID); | 295 | copyID); |
291 | ((SceneObjectGroup) ent).GetProperites(remoteClient); | 296 | ((SceneObjectGroup) ent).GetProperites(remoteClient); |
292 | } | 297 | } |
293 | } | 298 | } |
294 | } | 299 | } |
295 | } | 300 | } |
296 | } | 301 | } |
297 | } | 302 | } |
298 | } | 303 | } |
299 | } | 304 | } |
300 | 305 | ||
301 | /// <summary> | 306 | /// <summary> |
302 | /// | 307 | /// |
303 | /// </summary> | 308 | /// </summary> |
304 | /// <param name="packet"></param> | 309 | /// <param name="packet"></param> |
305 | /// <param name="simClient"></param> | 310 | /// <param name="simClient"></param> |
306 | public void DeRezObject(Packet packet, IClientAPI remoteClient) | 311 | public void DeRezObject(Packet packet, IClientAPI remoteClient) |
307 | { | 312 | { |
308 | DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet; | 313 | DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet; |
309 | 314 | ||
310 | if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero) | 315 | if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero) |
311 | { | 316 | { |
312 | //currently following code not used (or don't know of any case of destination being zero | 317 | //currently following code not used (or don't know of any case of destination being zero |
313 | } | 318 | } |
314 | else | 319 | else |
315 | { | 320 | { |
316 | foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) | 321 | foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) |
317 | { | 322 | { |
318 | EntityBase selectedEnt = null; | 323 | EntityBase selectedEnt = null; |
319 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); | 324 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); |
320 | foreach (EntityBase ent in Entities.Values) | 325 | foreach (EntityBase ent in Entities.Values) |
321 | { | 326 | { |
322 | if (ent.LocalId == Data.ObjectLocalID) | 327 | if (ent.LocalId == Data.ObjectLocalID) |
323 | { | 328 | { |
324 | selectedEnt = ent; | 329 | selectedEnt = ent; |
325 | break; | 330 | break; |
326 | } | 331 | } |
327 | } | 332 | } |
328 | if (selectedEnt != null) | 333 | if (selectedEnt != null) |
329 | { | 334 | { |
330 | if (PermissionsMngr.CanDeRezObject(remoteClient.AgentId, ((SceneObjectGroup) selectedEnt).UUID)) | 335 | if (PermissionsMngr.CanDeRezObject(remoteClient.AgentId, ((SceneObjectGroup) selectedEnt).UUID)) |
331 | { | 336 | { |
332 | string sceneObjectXml = ((SceneObjectGroup) selectedEnt).ToXmlString(); | 337 | string sceneObjectXml = ((SceneObjectGroup) selectedEnt).ToXmlString(); |
333 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 338 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
334 | if (userInfo != null) | 339 | if (userInfo != null) |
335 | { | 340 | { |
336 | AssetBase asset = new AssetBase(); | 341 | AssetBase asset = new AssetBase(); |
337 | asset.Name = ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId); | 342 | asset.Name = ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId); |
338 | asset.Description = | 343 | asset.Description = |
339 | ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId); | 344 | ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId); |
340 | asset.InvType = 6; | 345 | asset.InvType = 6; |
341 | asset.Type = 6; | 346 | asset.Type = 6; |
342 | asset.FullID = LLUUID.Random(); | 347 | asset.FullID = LLUUID.Random(); |
343 | asset.Data = Helpers.StringToField(sceneObjectXml); | 348 | asset.Data = Helpers.StringToField(sceneObjectXml); |
344 | commsManager.AssetCache.AddAsset(asset); | 349 | commsManager.AssetCache.AddAsset(asset); |
345 | 350 | ||
346 | 351 | ||
347 | InventoryItemBase item = new InventoryItemBase(); | 352 | InventoryItemBase item = new InventoryItemBase(); |
348 | item.avatarID = remoteClient.AgentId; | 353 | item.avatarID = remoteClient.AgentId; |
349 | item.creatorsID = remoteClient.AgentId; | 354 | item.creatorsID = remoteClient.AgentId; |
350 | item.inventoryID = LLUUID.Random(); | 355 | item.inventoryID = LLUUID.Random(); |
351 | item.assetID = asset.FullID; | 356 | item.assetID = asset.FullID; |
352 | item.inventoryDescription = asset.Description; | 357 | item.inventoryDescription = asset.Description; |
353 | item.inventoryName = asset.Name; | 358 | item.inventoryName = asset.Name; |
354 | item.assetType = asset.Type; | 359 | item.assetType = asset.Type; |
355 | item.invType = asset.InvType; | 360 | item.invType = asset.InvType; |
356 | item.parentFolderID = DeRezPacket.AgentBlock.DestinationID; | 361 | item.parentFolderID = DeRezPacket.AgentBlock.DestinationID; |
357 | item.inventoryCurrentPermissions = 2147483647; | 362 | item.inventoryCurrentPermissions = 2147483647; |
358 | item.inventoryNextPermissions = 2147483647; | 363 | item.inventoryNextPermissions = 2147483647; |
359 | 364 | ||
360 | userInfo.AddItem(remoteClient.AgentId, item); | 365 | userInfo.AddItem(remoteClient.AgentId, item); |
361 | remoteClient.SendInventoryItemUpdate(item); | 366 | remoteClient.SendInventoryItemUpdate(item); |
362 | } | 367 | } |
363 | 368 | ||
364 | SceneObjectPart rootPart = | 369 | SceneObjectPart rootPart = |
365 | ((SceneObjectGroup) selectedEnt).GetChildPart(((SceneObjectGroup) selectedEnt).UUID); | 370 | ((SceneObjectGroup) selectedEnt).GetChildPart(((SceneObjectGroup) selectedEnt).UUID); |
366 | if (rootPart.PhysActor != null) | 371 | if (rootPart.PhysActor != null) |
367 | { | 372 | { |
368 | phyScene.RemovePrim(rootPart.PhysActor); | 373 | phyScene.RemovePrim(rootPart.PhysActor); |
369 | rootPart.PhysActor = null; | 374 | rootPart.PhysActor = null; |
370 | } | 375 | } |
371 | 376 | ||
372 | storageManager.DataStore.RemoveObject(((SceneObjectGroup) selectedEnt).UUID, | 377 | storageManager.DataStore.RemoveObject(((SceneObjectGroup) selectedEnt).UUID, |
373 | m_regInfo.SimUUID); | 378 | m_regInfo.SimUUID); |
374 | ((SceneObjectGroup) selectedEnt).DeleteGroup(); | 379 | ((SceneObjectGroup) selectedEnt).DeleteGroup(); |
375 | 380 | ||
376 | lock (Entities) | 381 | lock (Entities) |
377 | { | 382 | { |
378 | Entities.Remove(((SceneObjectGroup) selectedEnt).UUID); | 383 | Entities.Remove(((SceneObjectGroup) selectedEnt).UUID); |
379 | } | 384 | } |
380 | ((SceneObjectGroup) selectedEnt).DeleteParts(); | 385 | ((SceneObjectGroup) selectedEnt).DeleteParts(); |
381 | } | 386 | } |
382 | } | 387 | } |
383 | } | 388 | } |
384 | } | 389 | } |
385 | } | 390 | } |
386 | 391 | ||
387 | public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos) | 392 | public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos) |
388 | { | 393 | { |
389 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 394 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
390 | if (userInfo != null) | 395 | if (userInfo != null) |
391 | { | 396 | { |
392 | if (userInfo.RootFolder != null) | 397 | if (userInfo.RootFolder != null) |
393 | { | 398 | { |
394 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | 399 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); |
395 | if (item != null) | 400 | if (item != null) |
396 | { | 401 | { |
397 | AssetBase rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false); | 402 | AssetBase rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false); |
398 | if (rezAsset != null) | 403 | if (rezAsset != null) |
399 | { | 404 | { |
400 | AddRezObject(Util.FieldToString(rezAsset.Data), pos); | 405 | AddRezObject(Util.FieldToString(rezAsset.Data), pos); |
401 | userInfo.DeleteItem(remoteClient.AgentId, item); | 406 | userInfo.DeleteItem(remoteClient.AgentId, item); |
402 | remoteClient.SendRemoveInventoryItem(itemID); | 407 | remoteClient.SendRemoveInventoryItem(itemID); |
403 | } | 408 | } |
404 | else | 409 | else |
405 | { | 410 | { |
406 | //lets try once more incase the asset cache is being slow getting the asset from server | 411 | //lets try once more incase the asset cache is being slow getting the asset from server |
407 | rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false); | 412 | rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false); |
408 | if (rezAsset != null) | 413 | if (rezAsset != null) |
409 | { | 414 | { |
410 | AddRezObject(Util.FieldToString(rezAsset.Data), pos); | 415 | AddRezObject(Util.FieldToString(rezAsset.Data), pos); |
411 | userInfo.DeleteItem(remoteClient.AgentId, item); | 416 | userInfo.DeleteItem(remoteClient.AgentId, item); |
412 | remoteClient.SendRemoveInventoryItem(itemID); | 417 | remoteClient.SendRemoveInventoryItem(itemID); |
413 | } | 418 | } |
414 | } | 419 | } |
415 | } | 420 | } |
416 | } | 421 | } |
417 | } | 422 | } |
418 | } | 423 | } |
419 | 424 | ||
420 | private void AddRezObject(string xmlData, LLVector3 pos) | 425 | private void AddRezObject(string xmlData, LLVector3 pos) |
421 | { | 426 | { |
422 | SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); | 427 | SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); |
423 | AddEntity(group); | 428 | AddEntity(group); |
424 | group.AbsolutePosition = pos; | 429 | group.AbsolutePosition = pos; |
425 | SceneObjectPart rootPart = group.GetChildPart(group.UUID); | 430 | SceneObjectPart rootPart = group.GetChildPart(group.UUID); |
426 | if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) | 431 | if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) |
427 | rootPart.PhysActor = phyScene.AddPrim( | 432 | rootPart.PhysActor = phyScene.AddPrim( |
428 | new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, | 433 | new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, |
429 | rootPart.AbsolutePosition.Z), | 434 | rootPart.AbsolutePosition.Z), |
430 | new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), | 435 | new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), |
431 | new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, | 436 | new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, |
432 | rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); | 437 | rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); |
433 | } | 438 | } |
434 | } | 439 | } |
435 | } \ No newline at end of file | 440 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index c63424a..91b9634 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -69,13 +69,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
69 | public void InstantMessage(LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, | 69 | public void InstantMessage(LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, |
70 | uint timestamp, string fromAgentName, string message, byte dialog) | 70 | uint timestamp, string fromAgentName, string message, byte dialog) |
71 | { | 71 | { |
72 | if (Avatars.ContainsKey(toAgentID)) | 72 | if (m_scenePresences.ContainsKey(toAgentID)) |
73 | { | 73 | { |
74 | if (Avatars.ContainsKey(fromAgentID)) | 74 | if (m_scenePresences.ContainsKey(fromAgentID)) |
75 | { | 75 | { |
76 | // Local sim message | 76 | // Local sim message |
77 | ScenePresence fromAvatar = Avatars[fromAgentID]; | 77 | ScenePresence fromAvatar = m_scenePresences[fromAgentID]; |
78 | ScenePresence toAvatar = Avatars[toAgentID]; | 78 | ScenePresence toAvatar = m_scenePresences[toAgentID]; |
79 | string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname; | 79 | string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname; |
80 | toAvatar.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, toAgentID, | 80 | toAvatar.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, toAgentID, |
81 | imSessionID, fromName, dialog, timestamp); | 81 | imSessionID, fromName, dialog, timestamp); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index bdb8957..e683bce 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -52,23 +52,20 @@ using Timer = System.Timers.Timer; | |||
52 | 52 | ||
53 | namespace OpenSim.Region.Environment.Scenes | 53 | namespace OpenSim.Region.Environment.Scenes |
54 | { | 54 | { |
55 | public delegate bool FilterAvatarList(ScenePresence avatar); | ||
56 | |||
57 | public delegate void ForEachScenePresenceDelegate(ScenePresence presence); | ||
58 | |||
59 | public partial class Scene : SceneBase | 55 | public partial class Scene : SceneBase |
60 | { | 56 | { |
57 | public delegate bool FilterAvatarList(ScenePresence avatar); | ||
58 | |||
61 | protected Timer m_heartbeatTimer = new Timer(); | 59 | protected Timer m_heartbeatTimer = new Timer(); |
62 | protected Dictionary<LLUUID, ScenePresence> Avatars; | 60 | protected Dictionary<LLUUID, ScenePresence> m_scenePresences; |
63 | protected Dictionary<LLUUID, SceneObjectGroup> Prims; | 61 | protected Dictionary<LLUUID, SceneObjectGroup> m_sceneObjects; |
64 | public PhysicsScene phyScene; | ||
65 | 62 | ||
66 | /// publicized so it can be accessed from SceneObjectGroup. | 63 | /// publicized so it can be accessed from SceneObjectGroup. |
67 | protected float timeStep = 0.1f; | 64 | protected float timeStep = 0.1f; |
68 | 65 | ||
69 | private Random Rand = new Random(); | 66 | private Random Rand = new Random(); |
70 | private uint _primCount = 702000; | 67 | private uint _primCount = 702000; |
71 | private Mutex _primAllocateMutex = new Mutex(false); | 68 | private readonly Mutex _primAllocateMutex = new Mutex(false); |
72 | private int storageCount; | 69 | private int storageCount; |
73 | private int terrainCheckCount; | 70 | private int terrainCheckCount; |
74 | private int landPrimCheckCount; | 71 | private int landPrimCheckCount; |
@@ -78,7 +75,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
78 | 75 | ||
79 | public BasicQuadTreeNode QuadTree; | 76 | public BasicQuadTreeNode QuadTree; |
80 | 77 | ||
81 | private Mutex updateLock; | 78 | private readonly Mutex updateLock; |
82 | 79 | ||
83 | protected ModuleLoader m_moduleLoader; | 80 | protected ModuleLoader m_moduleLoader; |
84 | protected StorageManager storageManager; | 81 | protected StorageManager storageManager; |
@@ -108,30 +105,28 @@ namespace OpenSim.Region.Environment.Scenes | |||
108 | get { return authenticateHandler; } | 105 | get { return authenticateHandler; } |
109 | } | 106 | } |
110 | 107 | ||
111 | /// <summary> | 108 | private readonly LandManager m_LandManager; |
112 | /// | ||
113 | /// </summary> | ||
114 | public PhysicsScene PhysScene | ||
115 | { | ||
116 | set { phyScene = value; } | ||
117 | get { return (phyScene); } | ||
118 | } | ||
119 | |||
120 | private LandManager m_LandManager; | ||
121 | 109 | ||
122 | public LandManager LandManager | 110 | public LandManager LandManager |
123 | { | 111 | { |
124 | get { return m_LandManager; } | 112 | get { return m_LandManager; } |
125 | } | 113 | } |
126 | 114 | ||
127 | private EstateManager m_estateManager; | 115 | private readonly EstateManager m_estateManager; |
116 | |||
117 | private PhysicsScene phyScene; | ||
118 | public PhysicsScene PhysScene | ||
119 | { | ||
120 | set { phyScene = value; } | ||
121 | get { return (phyScene); } | ||
122 | } | ||
128 | 123 | ||
129 | public EstateManager EstateManager | 124 | public EstateManager EstateManager |
130 | { | 125 | { |
131 | get { return m_estateManager; } | 126 | get { return m_estateManager; } |
132 | } | 127 | } |
133 | 128 | ||
134 | private PermissionManager m_permissionManager; | 129 | private readonly PermissionManager m_permissionManager; |
135 | 130 | ||
136 | public PermissionManager PermissionsMngr | 131 | public PermissionManager PermissionsMngr |
137 | { | 132 | { |
@@ -140,7 +135,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
140 | 135 | ||
141 | public Dictionary<LLUUID, SceneObjectGroup> Objects | 136 | public Dictionary<LLUUID, SceneObjectGroup> Objects |
142 | { | 137 | { |
143 | get { return Prims; } | 138 | get { return m_sceneObjects; } |
144 | } | 139 | } |
145 | 140 | ||
146 | public int TimePhase | 141 | public int TimePhase |
@@ -191,8 +186,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
191 | 186 | ||
192 | MainLog.Instance.Verbose("Creating new entitities instance"); | 187 | MainLog.Instance.Verbose("Creating new entitities instance"); |
193 | Entities = new Dictionary<LLUUID, EntityBase>(); | 188 | Entities = new Dictionary<LLUUID, EntityBase>(); |
194 | Avatars = new Dictionary<LLUUID, ScenePresence>(); | 189 | m_scenePresences = new Dictionary<LLUUID, ScenePresence>(); |
195 | Prims = new Dictionary<LLUUID, SceneObjectGroup>(); | 190 | m_sceneObjects = new Dictionary<LLUUID, SceneObjectGroup>(); |
196 | 191 | ||
197 | MainLog.Instance.Verbose("Creating LandMap"); | 192 | MainLog.Instance.Verbose("Creating LandMap"); |
198 | Terrain = new TerrainEngine((int)RegionInfo.RegionLocX, (int)RegionInfo.RegionLocY); | 193 | Terrain = new TerrainEngine((int)RegionInfo.RegionLocX, (int)RegionInfo.RegionLocY); |
@@ -804,15 +799,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
804 | Entities[client.AgentId] = newAvatar; | 799 | Entities[client.AgentId] = newAvatar; |
805 | } | 800 | } |
806 | } | 801 | } |
807 | lock (Avatars) | 802 | lock (m_scenePresences) |
808 | { | 803 | { |
809 | if (Avatars.ContainsKey(client.AgentId)) | 804 | if (m_scenePresences.ContainsKey(client.AgentId)) |
810 | { | 805 | { |
811 | Avatars[client.AgentId] = newAvatar; | 806 | m_scenePresences[client.AgentId] = newAvatar; |
812 | } | 807 | } |
813 | else | 808 | else |
814 | { | 809 | { |
815 | Avatars.Add(client.AgentId, newAvatar); | 810 | m_scenePresences.Add(client.AgentId, newAvatar); |
816 | } | 811 | } |
817 | } | 812 | } |
818 | 813 | ||
@@ -841,11 +836,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
841 | } | 836 | } |
842 | }); | 837 | }); |
843 | 838 | ||
844 | lock (Avatars) | 839 | lock (m_scenePresences) |
845 | { | 840 | { |
846 | if (Avatars.ContainsKey(agentID)) | 841 | if (m_scenePresences.ContainsKey(agentID)) |
847 | { | 842 | { |
848 | Avatars.Remove(agentID); | 843 | m_scenePresences.Remove(agentID); |
849 | } | 844 | } |
850 | } | 845 | } |
851 | lock (Entities) | 846 | lock (Entities) |
@@ -865,18 +860,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
865 | 860 | ||
866 | #endregion | 861 | #endregion |
867 | 862 | ||
868 | #region Request Avatars List Methods | 863 | #region Request m_scenePresences List Methods |
869 | 864 | ||
870 | //The idea is to have a group of method that return a list of avatars meeting some requirement | 865 | //The idea is to have a group of method that return a list of avatars meeting some requirement |
871 | // ie it could be all Avatars within a certain range of the calling prim/avatar. | 866 | // ie it could be all m_scenePresences within a certain range of the calling prim/avatar. |
872 | 867 | ||
873 | /// <summary> | 868 | /// <summary> |
874 | /// Request a List of all Avatars in this World | 869 | /// Request a List of all m_scenePresences in this World |
875 | /// </summary> | 870 | /// </summary> |
876 | /// <returns></returns> | 871 | /// <returns></returns> |
877 | public List<ScenePresence> GetScenePresences() | 872 | public List<ScenePresence> GetScenePresences() |
878 | { | 873 | { |
879 | List<ScenePresence> result = new List<ScenePresence>(Avatars.Values); | 874 | List<ScenePresence> result = new List<ScenePresence>(m_scenePresences.Values); |
880 | 875 | ||
881 | return result; | 876 | return result; |
882 | } | 877 | } |
@@ -892,14 +887,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
892 | } | 887 | } |
893 | 888 | ||
894 | /// <summary> | 889 | /// <summary> |
895 | /// Request a filtered list of Avatars in this World | 890 | /// Request a filtered list of m_scenePresences in this World |
896 | /// </summary> | 891 | /// </summary> |
897 | /// <returns></returns> | 892 | /// <returns></returns> |
898 | public List<ScenePresence> GetScenePresences(FilterAvatarList filter) | 893 | public List<ScenePresence> GetScenePresences(FilterAvatarList filter) |
899 | { | 894 | { |
900 | List<ScenePresence> result = new List<ScenePresence>(); | 895 | List<ScenePresence> result = new List<ScenePresence>(); |
901 | 896 | ||
902 | foreach (ScenePresence avatar in Avatars.Values) | 897 | foreach (ScenePresence avatar in m_scenePresences.Values) |
903 | { | 898 | { |
904 | if (filter(avatar)) | 899 | if (filter(avatar)) |
905 | { | 900 | { |
@@ -917,9 +912,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
917 | /// <returns></returns> | 912 | /// <returns></returns> |
918 | public ScenePresence GetScenePresence(LLUUID avatarID) | 913 | public ScenePresence GetScenePresence(LLUUID avatarID) |
919 | { | 914 | { |
920 | if (Avatars.ContainsKey(avatarID)) | 915 | if (m_scenePresences.ContainsKey(avatarID)) |
921 | { | 916 | { |
922 | return Avatars[avatarID]; | 917 | return m_scenePresences[avatarID]; |
923 | } | 918 | } |
924 | return null; | 919 | return null; |
925 | } | 920 | } |
@@ -928,9 +923,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
928 | /// | 923 | /// |
929 | /// </summary> | 924 | /// </summary> |
930 | /// <param name="whatToDo"></param> | 925 | /// <param name="whatToDo"></param> |
931 | public void ForEachScenePresence(ForEachScenePresenceDelegate whatToDo) | 926 | public void ForEachScenePresence(Action<ScenePresence> whatToDo) |
932 | { | 927 | { |
933 | foreach (ScenePresence presence in Avatars.Values) | 928 | foreach (ScenePresence presence in m_scenePresences.Values) |
934 | { | 929 | { |
935 | whatToDo(presence); | 930 | whatToDo(presence); |
936 | } | 931 | } |
@@ -1031,9 +1026,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1031 | { | 1026 | { |
1032 | if (regionHandle == m_regInfo.RegionHandle) | 1027 | if (regionHandle == m_regInfo.RegionHandle) |
1033 | { | 1028 | { |
1034 | if (Avatars.ContainsKey(agentID)) | 1029 | if (m_scenePresences.ContainsKey(agentID)) |
1035 | { | 1030 | { |
1036 | Avatars[agentID].MakeAvatar(position, isFlying); | 1031 | m_scenePresences[agentID].MakeAvatar(position, isFlying); |
1037 | } | 1032 | } |
1038 | } | 1033 | } |
1039 | } | 1034 | } |
@@ -1098,11 +1093,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1098 | { | 1093 | { |
1099 | if (regionHandle == m_regionHandle) | 1094 | if (regionHandle == m_regionHandle) |
1100 | { | 1095 | { |
1101 | if (Avatars.ContainsKey(remoteClient.AgentId)) | 1096 | if (m_scenePresences.ContainsKey(remoteClient.AgentId)) |
1102 | { | 1097 | { |
1103 | remoteClient.SendTeleportLocationStart(); | 1098 | remoteClient.SendTeleportLocationStart(); |
1104 | remoteClient.SendLocalTeleport(position, lookAt, flags); | 1099 | remoteClient.SendLocalTeleport(position, lookAt, flags); |
1105 | Avatars[remoteClient.AgentId].Teleport(position); | 1100 | m_scenePresences[remoteClient.AgentId].Teleport(position); |
1106 | } | 1101 | } |
1107 | } | 1102 | } |
1108 | else | 1103 | else |
@@ -1184,9 +1179,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1184 | public void SendUrlToUser(LLUUID avatarID, string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, | 1179 | public void SendUrlToUser(LLUUID avatarID, string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, |
1185 | string message, string url) | 1180 | string message, string url) |
1186 | { | 1181 | { |
1187 | if (Avatars.ContainsKey(avatarID)) | 1182 | if (m_scenePresences.ContainsKey(avatarID)) |
1188 | { | 1183 | { |
1189 | Avatars[avatarID].ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, message, url); | 1184 | m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, message, url); |
1190 | } | 1185 | } |
1191 | } | 1186 | } |
1192 | 1187 | ||
@@ -1200,7 +1195,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1200 | 1195 | ||
1201 | public void SendGeneralAlert(string message) | 1196 | public void SendGeneralAlert(string message) |
1202 | { | 1197 | { |
1203 | foreach (ScenePresence presence in Avatars.Values) | 1198 | foreach (ScenePresence presence in m_scenePresences.Values) |
1204 | { | 1199 | { |
1205 | presence.ControllingClient.SendAlertMessage(message); | 1200 | presence.ControllingClient.SendAlertMessage(message); |
1206 | } | 1201 | } |
@@ -1208,15 +1203,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1208 | 1203 | ||
1209 | public void SendAlertToUser(LLUUID agentID, string message, bool modal) | 1204 | public void SendAlertToUser(LLUUID agentID, string message, bool modal) |
1210 | { | 1205 | { |
1211 | if (Avatars.ContainsKey(agentID)) | 1206 | if (m_scenePresences.ContainsKey(agentID)) |
1212 | { | 1207 | { |
1213 | Avatars[agentID].ControllingClient.SendAgentAlertMessage(message, modal); | 1208 | m_scenePresences[agentID].ControllingClient.SendAgentAlertMessage(message, modal); |
1214 | } | 1209 | } |
1215 | } | 1210 | } |
1216 | 1211 | ||
1217 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) | 1212 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) |
1218 | { | 1213 | { |
1219 | foreach (ScenePresence presence in Avatars.Values) | 1214 | foreach (ScenePresence presence in m_scenePresences.Values) |
1220 | { | 1215 | { |
1221 | if ((presence.Firstname == firstName) && (presence.Lastname == lastName)) | 1216 | if ((presence.Firstname == firstName) && (presence.Lastname == lastName)) |
1222 | { | 1217 | { |
@@ -1405,7 +1400,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1405 | internal bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) | 1400 | internal bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) |
1406 | { | 1401 | { |
1407 | ScenePresence presence; | 1402 | ScenePresence presence; |
1408 | if (Avatars.TryGetValue(avatarId, out presence)) | 1403 | if (m_scenePresences.TryGetValue(avatarId, out presence)) |
1409 | { | 1404 | { |
1410 | if (!presence.childAgent) | 1405 | if (!presence.childAgent) |
1411 | { | 1406 | { |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 08c8d59..890008d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -314,7 +314,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
314 | /// may need to create a new Physics actor. | 314 | /// may need to create a new Physics actor. |
315 | if (dupe.RootPart.PhysActor != null) | 315 | if (dupe.RootPart.PhysActor != null) |
316 | { | 316 | { |
317 | dupe.RootPart.PhysActor = m_scene.phyScene.AddPrim( | 317 | dupe.RootPart.PhysActor = m_scene.PhysScene.AddPrim( |
318 | new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, | 318 | new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, |
319 | dupe.RootPart.AbsolutePosition.Z), | 319 | dupe.RootPart.AbsolutePosition.Z), |
320 | new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), | 320 | new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 538e46c..bcffe39 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -291,7 +291,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
291 | 291 | ||
292 | private void RemoveFromPhysicalScene() | 292 | private void RemoveFromPhysicalScene() |
293 | { | 293 | { |
294 | m_scene.phyScene.RemoveAvatar( this.PhysActor ); | 294 | m_scene.PhysScene.RemoveAvatar( this.PhysActor ); |
295 | } | 295 | } |
296 | 296 | ||
297 | /// <summary> | 297 | /// <summary> |
@@ -844,7 +844,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
844 | 844 | ||
845 | public void AddToPhysicalScene( ) | 845 | public void AddToPhysicalScene( ) |
846 | { | 846 | { |
847 | PhysicsScene scene = m_scene.phyScene; | 847 | PhysicsScene scene = m_scene.PhysScene; |
848 | 848 | ||
849 | PhysicsVector pVec = | 849 | PhysicsVector pVec = |
850 | new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, | 850 | new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, |