diff options
Diffstat (limited to 'OpenSim.RegionServer/SimClient.cs')
-rw-r--r-- | OpenSim.RegionServer/SimClient.cs | 99 |
1 files changed, 58 insertions, 41 deletions
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index d463c75..698053d 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs | |||
@@ -71,6 +71,13 @@ namespace OpenSim | |||
71 | private AgentAssetUpload UploadAssets; | 71 | private AgentAssetUpload UploadAssets; |
72 | private LLUUID newAssetFolder = LLUUID.Zero; | 72 | private LLUUID newAssetFolder = LLUUID.Zero; |
73 | private bool debug = false; | 73 | private bool debug = false; |
74 | private World m_world; | ||
75 | private Dictionary<uint, SimClient> m_clientThreads; | ||
76 | private AssetCache m_assetCache; | ||
77 | private IGridServer m_gridServer; | ||
78 | private OpenSimApplication m_application; | ||
79 | private InventoryCache m_inventoryCache; | ||
80 | private bool m_sandboxMode; | ||
74 | 81 | ||
75 | private void ack_pack(Packet Pack) | 82 | private void ack_pack(Packet Pack) |
76 | { | 83 | { |
@@ -105,15 +112,15 @@ namespace OpenSim | |||
105 | switch (Pack.Type) | 112 | switch (Pack.Type) |
106 | { | 113 | { |
107 | case PacketType.CompleteAgentMovement: | 114 | case PacketType.CompleteAgentMovement: |
108 | ClientAvatar.CompleteMovement(OpenSimRoot.Instance.LocalWorld); | 115 | ClientAvatar.CompleteMovement(m_world); |
109 | ClientAvatar.SendInitialPosition(); | 116 | ClientAvatar.SendInitialPosition(); |
110 | break; | 117 | break; |
111 | case PacketType.RegionHandshakeReply: | 118 | case PacketType.RegionHandshakeReply: |
112 | OpenSimRoot.Instance.LocalWorld.SendLayerData(this); | 119 | m_world.SendLayerData(this); |
113 | break; | 120 | break; |
114 | case PacketType.AgentWearablesRequest: | 121 | case PacketType.AgentWearablesRequest: |
115 | ClientAvatar.SendInitialAppearance(); | 122 | ClientAvatar.SendInitialAppearance(); |
116 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 123 | foreach (SimClient client in m_clientThreads.Values) |
117 | { | 124 | { |
118 | if (client.AgentID != this.AgentID) | 125 | if (client.AgentID != this.AgentID) |
119 | { | 126 | { |
@@ -122,7 +129,7 @@ namespace OpenSim | |||
122 | client.ClientAvatar.SendAppearanceToOtherAgent(this); | 129 | client.ClientAvatar.SendAppearanceToOtherAgent(this); |
123 | } | 130 | } |
124 | } | 131 | } |
125 | OpenSimRoot.Instance.LocalWorld.GetInitialPrims(this); | 132 | m_world.GetInitialPrims(this); |
126 | break; | 133 | break; |
127 | case PacketType.AgentIsNowWearing: | 134 | case PacketType.AgentIsNowWearing: |
128 | AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack; | 135 | AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack; |
@@ -134,7 +141,7 @@ namespace OpenSim | |||
134 | this.ClientAvatar.SetAppearance(appear); | 141 | this.ClientAvatar.SetAppearance(appear); |
135 | break; | 142 | break; |
136 | case PacketType.ObjectAdd: | 143 | case PacketType.ObjectAdd: |
137 | OpenSimRoot.Instance.LocalWorld.AddNewPrim((ObjectAddPacket)Pack, this); | 144 | m_world.AddNewPrim((ObjectAddPacket)Pack, this); |
138 | break; | 145 | break; |
139 | case PacketType.ObjectLink: | 146 | case PacketType.ObjectLink: |
140 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); | 147 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); |
@@ -146,7 +153,7 @@ namespace OpenSim | |||
146 | ObjectShapePacket shape = (ObjectShapePacket)Pack; | 153 | ObjectShapePacket shape = (ObjectShapePacket)Pack; |
147 | for (int i = 0; i < shape.ObjectData.Length; i++) | 154 | for (int i = 0; i < shape.ObjectData.Length; i++) |
148 | { | 155 | { |
149 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) | 156 | foreach (Entity ent in m_world.Entities.Values) |
150 | { | 157 | { |
151 | if (ent.localid == shape.ObjectData[i].ObjectLocalID) | 158 | if (ent.localid == shape.ObjectData[i].ObjectLocalID) |
152 | { | 159 | { |
@@ -163,7 +170,7 @@ namespace OpenSim | |||
163 | if (multipleupdate.ObjectData[i].Type == 9) //change position | 170 | if (multipleupdate.ObjectData[i].Type == 9) //change position |
164 | { | 171 | { |
165 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 172 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
166 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) | 173 | foreach (Entity ent in m_world.Entities.Values) |
167 | { | 174 | { |
168 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) | 175 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) |
169 | { | 176 | { |
@@ -177,7 +184,7 @@ namespace OpenSim | |||
177 | else if (multipleupdate.ObjectData[i].Type == 10)//rotation | 184 | else if (multipleupdate.ObjectData[i].Type == 10)//rotation |
178 | { | 185 | { |
179 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); | 186 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); |
180 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) | 187 | foreach (Entity ent in m_world.Entities.Values) |
181 | { | 188 | { |
182 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) | 189 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) |
183 | { | 190 | { |
@@ -190,7 +197,7 @@ namespace OpenSim | |||
190 | { | 197 | { |
191 | 198 | ||
192 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); | 199 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); |
193 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) | 200 | foreach (Entity ent in m_world.Entities.Values) |
194 | { | 201 | { |
195 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) | 202 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) |
196 | { | 203 | { |
@@ -204,13 +211,13 @@ namespace OpenSim | |||
204 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; | 211 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; |
205 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) | 212 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) |
206 | { | 213 | { |
207 | OpenSimRoot.Instance.AssetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image); | 214 | m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image); |
208 | } | 215 | } |
209 | break; | 216 | break; |
210 | case PacketType.TransferRequest: | 217 | case PacketType.TransferRequest: |
211 | //Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request"); | 218 | //Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request"); |
212 | TransferRequestPacket transfer = (TransferRequestPacket)Pack; | 219 | TransferRequestPacket transfer = (TransferRequestPacket)Pack; |
213 | OpenSimRoot.Instance.AssetCache.AddAssetRequest(this, transfer); | 220 | m_assetCache.AddAssetRequest(this, transfer); |
214 | break; | 221 | break; |
215 | case PacketType.AgentUpdate: | 222 | case PacketType.AgentUpdate: |
216 | ClientAvatar.HandleUpdate((AgentUpdatePacket)Pack); | 223 | ClientAvatar.HandleUpdate((AgentUpdatePacket)Pack); |
@@ -230,18 +237,18 @@ namespace OpenSim | |||
230 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; | 237 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; |
231 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); | 238 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); |
232 | kill.ObjectData[0].ID = this.ClientAvatar.localid; | 239 | kill.ObjectData[0].ID = this.ClientAvatar.localid; |
233 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 240 | foreach (SimClient client in m_clientThreads.Values) |
234 | { | 241 | { |
235 | client.OutPacket(kill); | 242 | client.OutPacket(kill); |
236 | } | 243 | } |
237 | OpenSimRoot.Instance.GridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode); | 244 | m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode); |
238 | lock (OpenSimRoot.Instance.LocalWorld.Entities) | 245 | lock (m_world.Entities) |
239 | { | 246 | { |
240 | OpenSimRoot.Instance.LocalWorld.Entities.Remove(this.AgentID); | 247 | m_world.Entities.Remove(this.AgentID); |
241 | } | 248 | } |
242 | //need to do other cleaning up here too | 249 | //need to do other cleaning up here too |
243 | OpenSimRoot.Instance.ClientThreads.Remove(this.CircuitCode); //this.userEP); | 250 | m_clientThreads.Remove(this.CircuitCode); //this.userEP); |
244 | OpenSimRoot.Instance.Application.RemoveClientCircuit(this.CircuitCode); | 251 | m_application.RemoveClientCircuit(this.CircuitCode); |
245 | this.ClientThread.Abort(); | 252 | this.ClientThread.Abort(); |
246 | break; | 253 | break; |
247 | case PacketType.ChatFromViewer: | 254 | case PacketType.ChatFromViewer: |
@@ -258,7 +265,7 @@ namespace OpenSim | |||
258 | reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0"); | 265 | reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0"); |
259 | reply.ChatData.OwnerID = this.AgentID; | 266 | reply.ChatData.OwnerID = this.AgentID; |
260 | reply.ChatData.SourceID = this.AgentID; | 267 | reply.ChatData.SourceID = this.AgentID; |
261 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 268 | foreach (SimClient client in m_clientThreads.Values) |
262 | { | 269 | { |
263 | client.OutPacket(reply); | 270 | client.OutPacket(reply); |
264 | } | 271 | } |
@@ -267,7 +274,7 @@ namespace OpenSim | |||
267 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; | 274 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; |
268 | for (int i = 0; i < imagePack.ObjectData.Length; i++) | 275 | for (int i = 0; i < imagePack.ObjectData.Length; i++) |
269 | { | 276 | { |
270 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) | 277 | foreach (Entity ent in m_world.Entities.Values) |
271 | { | 278 | { |
272 | if (ent.localid == imagePack.ObjectData[i].ObjectLocalID) | 279 | if (ent.localid == imagePack.ObjectData[i].ObjectLocalID) |
273 | { | 280 | { |
@@ -278,7 +285,7 @@ namespace OpenSim | |||
278 | break; | 285 | break; |
279 | case PacketType.ObjectFlagUpdate: | 286 | case PacketType.ObjectFlagUpdate: |
280 | ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; | 287 | ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; |
281 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) | 288 | foreach (Entity ent in m_world.Entities.Values) |
282 | { | 289 | { |
283 | if (ent.localid == flags.AgentData.ObjectLocalID) | 290 | if (ent.localid == flags.AgentData.ObjectLocalID) |
284 | { | 291 | { |
@@ -306,7 +313,7 @@ namespace OpenSim | |||
306 | break; | 313 | break; |
307 | case PacketType.CreateInventoryFolder: | 314 | case PacketType.CreateInventoryFolder: |
308 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; | 315 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; |
309 | OpenSimRoot.Instance.InventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type); | 316 | m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type); |
310 | Console.WriteLine(Pack.ToString()); | 317 | Console.WriteLine(Pack.ToString()); |
311 | break; | 318 | break; |
312 | case PacketType.CreateInventoryItem: | 319 | case PacketType.CreateInventoryItem: |
@@ -320,11 +327,11 @@ namespace OpenSim | |||
320 | case PacketType.FetchInventory: | 327 | case PacketType.FetchInventory: |
321 | //Console.WriteLine("fetch item packet"); | 328 | //Console.WriteLine("fetch item packet"); |
322 | FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; | 329 | FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; |
323 | OpenSimRoot.Instance.InventoryCache.FetchInventory(this, FetchInventory); | 330 | m_inventoryCache.FetchInventory(this, FetchInventory); |
324 | break; | 331 | break; |
325 | case PacketType.FetchInventoryDescendents: | 332 | case PacketType.FetchInventoryDescendents: |
326 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; | 333 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; |
327 | OpenSimRoot.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch); | 334 | m_inventoryCache.FetchInventoryDescendents(this, Fetch); |
328 | break; | 335 | break; |
329 | case PacketType.UpdateInventoryItem: | 336 | case PacketType.UpdateInventoryItem: |
330 | UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; | 337 | UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; |
@@ -332,17 +339,17 @@ namespace OpenSim | |||
332 | { | 339 | { |
333 | if (update.InventoryData[i].TransactionID != LLUUID.Zero) | 340 | if (update.InventoryData[i].TransactionID != LLUUID.Zero) |
334 | { | 341 | { |
335 | AssetBase asset = OpenSimRoot.Instance.AssetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); | 342 | AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); |
336 | if (asset != null) | 343 | if (asset != null) |
337 | { | 344 | { |
338 | OpenSimRoot.Instance.InventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset); | 345 | m_inventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset); |
339 | } | 346 | } |
340 | else | 347 | else |
341 | { | 348 | { |
342 | asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); | 349 | asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); |
343 | if (asset != null) | 350 | if (asset != null) |
344 | { | 351 | { |
345 | OpenSimRoot.Instance.InventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset); | 352 | m_inventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset); |
346 | } | 353 | } |
347 | } | 354 | } |
348 | } | 355 | } |
@@ -350,7 +357,7 @@ namespace OpenSim | |||
350 | break; | 357 | break; |
351 | case PacketType.ViewerEffect: | 358 | case PacketType.ViewerEffect: |
352 | ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; | 359 | ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; |
353 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 360 | foreach (SimClient client in m_clientThreads.Values) |
354 | { | 361 | { |
355 | if (client.AgentID != this.AgentID) | 362 | if (client.AgentID != this.AgentID) |
356 | { | 363 | { |
@@ -362,7 +369,7 @@ namespace OpenSim | |||
362 | break; | 369 | break; |
363 | case PacketType.DeRezObject: | 370 | case PacketType.DeRezObject: |
364 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); | 371 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); |
365 | OpenSimRoot.Instance.LocalWorld.DeRezObject((DeRezObjectPacket)Pack, this); | 372 | m_world.DeRezObject((DeRezObjectPacket)Pack, this); |
366 | break; | 373 | break; |
367 | } | 374 | } |
368 | } | 375 | } |
@@ -501,11 +508,11 @@ namespace OpenSim | |||
501 | if (Pack.Header.Zerocoded) | 508 | if (Pack.Header.Zerocoded) |
502 | { | 509 | { |
503 | int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); | 510 | int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); |
504 | OpenSimRoot.Instance.Application.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, CircuitCode);//userEP); | 511 | m_application.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, CircuitCode);//userEP); |
505 | } | 512 | } |
506 | else | 513 | else |
507 | { | 514 | { |
508 | OpenSimRoot.Instance.Application.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, CircuitCode); //userEP); | 515 | m_application.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, CircuitCode); //userEP); |
509 | } | 516 | } |
510 | } | 517 | } |
511 | catch (Exception) | 518 | catch (Exception) |
@@ -569,14 +576,22 @@ namespace OpenSim | |||
569 | this.PacketQueue.Enqueue(item); | 576 | this.PacketQueue.Enqueue(item); |
570 | } | 577 | } |
571 | 578 | ||
572 | public SimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack) | 579 | public SimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, World world, Dictionary<uint, SimClient> clientThreads, AssetCache assetCache, IGridServer gridServer, OpenSimApplication application, InventoryCache inventoryCache, bool sandboxMode) |
573 | { | 580 | { |
581 | m_world = world; | ||
582 | m_clientThreads = clientThreads; | ||
583 | m_assetCache = assetCache; | ||
584 | m_gridServer = gridServer; | ||
585 | m_application = application; | ||
586 | m_inventoryCache = inventoryCache; | ||
587 | m_sandboxMode = sandboxMode; | ||
588 | |||
574 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request"); | 589 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request"); |
575 | cirpack = initialcirpack; | 590 | cirpack = initialcirpack; |
576 | userEP = remoteEP; | 591 | userEP = remoteEP; |
577 | PacketQueue = new BlockingQueue<QueItem>(); | 592 | PacketQueue = new BlockingQueue<QueItem>(); |
578 | 593 | ||
579 | this.UploadAssets = new AgentAssetUpload(this); | 594 | this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache ); |
580 | AckTimer = new System.Timers.Timer(500); | 595 | AckTimer = new System.Timers.Timer(500); |
581 | AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); | 596 | AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); |
582 | AckTimer.Start(); | 597 | AckTimer.Start(); |
@@ -608,14 +623,16 @@ namespace OpenSim | |||
608 | protected virtual void InitNewClient() | 623 | protected virtual void InitNewClient() |
609 | { | 624 | { |
610 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); | 625 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); |
611 | OpenSimRoot.Instance.LocalWorld.AddViewerAgent(this); | 626 | |
612 | world.Entity tempent = OpenSimRoot.Instance.LocalWorld.Entities[this.AgentID]; | 627 | m_world.AddViewerAgent(this); |
628 | world.Entity tempent = m_world.Entities[this.AgentID]; | ||
629 | |||
613 | this.ClientAvatar = (world.Avatar)tempent; | 630 | this.ClientAvatar = (world.Avatar)tempent; |
614 | } | 631 | } |
615 | 632 | ||
616 | protected virtual void AuthUser() | 633 | protected virtual void AuthUser() |
617 | { | 634 | { |
618 | AuthenticateResponse sessionInfo = OpenSimRoot.Instance.GridServers.GridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code); | 635 | AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code); |
619 | if (!sessionInfo.Authorised) | 636 | if (!sessionInfo.Authorised) |
620 | { | 637 | { |
621 | //session/circuit not authorised | 638 | //session/circuit not authorised |
@@ -638,23 +655,23 @@ namespace OpenSim | |||
638 | } | 655 | } |
639 | 656 | ||
640 | // Create Inventory, currently only works for sandbox mode | 657 | // Create Inventory, currently only works for sandbox mode |
641 | if (OpenSimRoot.Instance.Sandbox) | 658 | if (m_sandboxMode) |
642 | { | 659 | { |
643 | if (sessionInfo.LoginInfo.InventoryFolder != null) | 660 | if (sessionInfo.LoginInfo.InventoryFolder != null) |
644 | { | 661 | { |
645 | this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder); | 662 | this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder); |
646 | if (sessionInfo.LoginInfo.BaseFolder != null) | 663 | if (sessionInfo.LoginInfo.BaseFolder != null) |
647 | { | 664 | { |
648 | OpenSimRoot.Instance.InventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder); | 665 | m_inventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder); |
649 | this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder; | 666 | this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder; |
650 | AssetBase[] inventorySet = OpenSimRoot.Instance.AssetCache.CreateNewInventorySet(this.AgentID); | 667 | AssetBase[] inventorySet = m_assetCache.CreateNewInventorySet(this.AgentID); |
651 | if (inventorySet != null) | 668 | if (inventorySet != null) |
652 | { | 669 | { |
653 | for (int i = 0; i < inventorySet.Length; i++) | 670 | for (int i = 0; i < inventorySet.Length; i++) |
654 | { | 671 | { |
655 | if (inventorySet[i] != null) | 672 | if (inventorySet[i] != null) |
656 | { | 673 | { |
657 | OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]); | 674 | m_inventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]); |
658 | } | 675 | } |
659 | } | 676 | } |
660 | } | 677 | } |
@@ -670,8 +687,8 @@ namespace OpenSim | |||
670 | { | 687 | { |
671 | AgentInventory inventory = new AgentInventory(); | 688 | AgentInventory inventory = new AgentInventory(); |
672 | inventory.AgentID = this.AgentID; | 689 | inventory.AgentID = this.AgentID; |
673 | OpenSimRoot.Instance.InventoryCache.AddNewAgentsInventory(inventory); | 690 | m_inventoryCache.AddNewAgentsInventory(inventory); |
674 | OpenSimRoot.Instance.InventoryCache.CreateNewInventoryFolder(this, baseFolder); | 691 | m_inventoryCache.CreateNewInventoryFolder(this, baseFolder); |
675 | } | 692 | } |
676 | } | 693 | } |
677 | } | 694 | } |