From 0c03a48fb2060eda4d288e2d2ca4e650ce000b4b Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Wed, 4 Feb 2009 00:01:36 +0000 Subject: - add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it - trim trailing whitespace --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 260 ++++++++++----------- .../Region/ClientStack/LindenUDP/LLFileTransfer.cs | 28 +-- .../Region/ClientStack/LindenUDP/LLImageManager.cs | 52 ++--- 3 files changed, 170 insertions(+), 170 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 96a274c..42dbbee 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -63,9 +63,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP /* private variables */ private readonly UUID m_sessionId; private readonly UUID m_secureSessionId = UUID.Zero; - + private int m_debugPacketLevel; - + private readonly AssetCache m_assetCache; private int m_cachedTextureSerial; private Timer m_clientPingTimer; @@ -355,7 +355,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_groupPowers.ContainsKey(groupID)) return m_groupPowers[groupID]; - + return 0; } @@ -454,8 +454,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_circuitCode = circuitCode; m_userEndPoint = remoteEP; - m_proxyEndPoint = proxyEP; - + m_proxyEndPoint = proxyEP; + m_firstName = sessionInfo.LoginInfo.First; m_lastName = sessionInfo.LoginInfo.Last; m_startpos = sessionInfo.LoginInfo.StartPos; @@ -473,7 +473,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); m_PacketHandler.SynchronizeClient = SynchronizeClient; m_PacketHandler.OnPacketStats += PopulateStats; - + RegisterLocalPacketHandlers(); m_imageManager = new LLImageManager(this, m_assetCache,Scene.RequestModuleInterface()); } @@ -501,7 +501,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Shut down timers m_clientPingTimer.Stop(); - + // This is just to give the client a reasonable chance of // flushing out all it's packets. There should probably // be a better mechanism here @@ -538,7 +538,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_log.DebugFormat( "[CLIENT]: Close has been called with shutdownCircuit = {0} for {1} attached to scene {2}", shutdownCircuit, Name, m_scene.RegionInfo.RegionName); - + m_imageManager.Close(); m_PacketHandler.Flush(); @@ -716,14 +716,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP { info = packet.Type.ToString(); } - + Console.WriteLine(m_circuitCode + ":" + direction + ": " + info); } } /// /// Main packet processing loop for the UDP component of the client session. Both incoming and outgoing - /// packets are processed here. + /// packets are processed here. /// protected virtual void ClientLoop() { @@ -733,12 +733,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP while (IsActive) { LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue(); - + if (nextPacket.Incoming) { DebugPacket("IN", nextPacket.Packet); m_PacketHandler.ProcessInPacket(nextPacket); - } + } else { DebugPacket("OUT", nextPacket.Packet); @@ -821,14 +821,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_clientThread.Name = "ClientThread"; m_clientThread.IsBackground = true; m_clientThread.Start(); - ThreadTracker.Add(m_clientThread); + ThreadTracker.Add(m_clientThread); } - + /// /// Run a user session. This method lies at the base of the entire client thread. /// protected virtual void RunUserSession() - { + { //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US) //otherwise it will override this and use the system default Culture.SetCurrentCulture(); @@ -838,7 +838,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // This sets up all the timers InitNewClient(); ClientLoop(); - } + } catch (Exception e) { if (e is ThreadAbortException) @@ -1065,7 +1065,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; public event ClassifiedDelete OnClassifiedDelete; public event ClassifiedDelete OnClassifiedGodDelete; - + public event EventNotificationAddRequest OnEventNotificationAddRequest; public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; public event EventGodDelete OnEventGodDelete; @@ -1078,14 +1078,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void ActivateGesture(UUID assetId, UUID gestureId) { } - + public void DeactivateGesture(UUID assetId, UUID gestureId) { } // Sound public void SoundTrigger(UUID soundId, UUID owerid, UUID Objectid,UUID ParentId,float Gain, Vector3 Position,UInt64 Handle) - { + { } #region Scene/Avatar to Client @@ -1330,7 +1330,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(map, patches); layerpack.Header.Zerocoded = true; - + OutPacket(layerpack, ThrottleOutPacketType.Land); } @@ -1410,11 +1410,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP agentData.child = false; agentData.firstname = m_firstName; agentData.lastname = m_lastName; - + ICapabilitiesModule capsModule = m_scene.RequestModuleInterface(); agentData.CapsPath = capsModule.GetCapsPath(m_agentId); agentData.ChildrenCapSeeds = new Dictionary(capsModule.GetChildrenSeeds(m_agentId)); - + return agentData; } @@ -1852,21 +1852,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP inventoryReply.Header.Zerocoded = true; OutPacket(inventoryReply, ThrottleOutPacketType.Asset); } - + /// IClientAPI.SendBulkUpdateInventory(InventoryFolderBase) public void SendBulkUpdateInventory(InventoryFolderBase folderBase) { // XXX: Nasty temporary move that will be resolved shortly InventoryFolderImpl folder = (InventoryFolderImpl)folderBase; - + // We will use the same transaction id for all the separate packets to be sent out in this update. UUID transactionId = UUID.Random(); - - List folderDataBlocks + + List folderDataBlocks = new List(); - + SendBulkUpdateInventoryRecursive(folder, ref folderDataBlocks, transactionId); - + if (folderDataBlocks.Count > 0) { // We'll end up with some unsent folder blocks if there were some empty folders at the end of the list @@ -1874,16 +1874,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP BulkUpdateInventoryPacket bulkUpdate = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory); bulkUpdate.Header.Zerocoded = true; - + bulkUpdate.AgentData.AgentID = AgentId; - bulkUpdate.AgentData.TransactionID = transactionId; - bulkUpdate.FolderData = folderDataBlocks.ToArray(); - - //Console.WriteLine("SendBulkUpdateInventory :" + bulkUpdate); - OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); + bulkUpdate.AgentData.TransactionID = transactionId; + bulkUpdate.FolderData = folderDataBlocks.ToArray(); + + //Console.WriteLine("SendBulkUpdateInventory :" + bulkUpdate); + OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); } } - + /// /// Recursively construct bulk update packets to send folders and items /// @@ -1891,11 +1891,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// private void SendBulkUpdateInventoryRecursive( - InventoryFolderImpl folder, ref List folderDataBlocks, + InventoryFolderImpl folder, ref List folderDataBlocks, UUID transactionId) - { + { folderDataBlocks.Add(GenerateBulkUpdateFolderDataBlock(folder)); - + const int MAX_ITEMS_PER_PACKET = 5; // If there are any items then we have to start sending them off in this packet - the next folder will have @@ -1909,10 +1909,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP bulkUpdate.Header.Zerocoded = true; bulkUpdate.AgentData.AgentID = AgentId; - bulkUpdate.AgentData.TransactionID = transactionId; - bulkUpdate.FolderData = folderDataBlocks.ToArray(); - - int itemsToSend = (items.Count > MAX_ITEMS_PER_PACKET ? MAX_ITEMS_PER_PACKET : items.Count); + bulkUpdate.AgentData.TransactionID = transactionId; + bulkUpdate.FolderData = folderDataBlocks.ToArray(); + + int itemsToSend = (items.Count > MAX_ITEMS_PER_PACKET ? MAX_ITEMS_PER_PACKET : items.Count); bulkUpdate.ItemData = new BulkUpdateInventoryPacket.ItemDataBlock[itemsToSend]; for (int i = 0; i < itemsToSend; i++) @@ -1921,51 +1921,51 @@ namespace OpenSim.Region.ClientStack.LindenUDP bulkUpdate.ItemData[i] = GenerateBulkUpdateItemDataBlock(items[items.Count - 1]); items.RemoveAt(items.Count - 1); } - + //Console.WriteLine("SendBulkUpdateInventoryRecursive :" + bulkUpdate); OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); - + folderDataBlocks = new List(); - + // If we're going to be sending another items packet then it needs to contain just the folder to which those // items belong. if (items.Count > 0) folderDataBlocks.Add(GenerateBulkUpdateFolderDataBlock(folder)); - } - + } + List subFolders = folder.RequestListOfFolderImpls(); foreach (InventoryFolderImpl subFolder in subFolders) { SendBulkUpdateInventoryRecursive(subFolder, ref folderDataBlocks, transactionId); - } + } } - + /// /// Generate a bulk update inventory data block for the given folder /// /// - /// + /// private BulkUpdateInventoryPacket.FolderDataBlock GenerateBulkUpdateFolderDataBlock(InventoryFolderBase folder) { BulkUpdateInventoryPacket.FolderDataBlock folderBlock = new BulkUpdateInventoryPacket.FolderDataBlock(); - + folderBlock.FolderID = folder.ID; folderBlock.ParentID = folder.ParentID; folderBlock.Type = -1; - folderBlock.Name = Utils.StringToBytes(folder.Name); - + folderBlock.Name = Utils.StringToBytes(folder.Name); + return folderBlock; } - + /// - /// Generate a bulk update inventory data block for the given item + /// Generate a bulk update inventory data block for the given item /// /// /// private BulkUpdateInventoryPacket.ItemDataBlock GenerateBulkUpdateItemDataBlock(InventoryItemBase item) { BulkUpdateInventoryPacket.ItemDataBlock itemBlock = new BulkUpdateInventoryPacket.ItemDataBlock(); - + itemBlock.ItemID = item.ID; itemBlock.AssetID = item.AssetID; itemBlock.CreatorID = item.Creator; @@ -1996,7 +1996,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP itemBlock.ItemID, itemBlock.FolderID, (uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All); - + return itemBlock; } @@ -2396,17 +2396,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(viewertime, ThrottleOutPacketType.Task); */ } - + public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) { ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); packet.Effect = effectBlocks; - + packet.AgentData.AgentID = AgentId; packet.AgentData.SessionID = SessionId; packet.Header.Reliable = false; packet.Header.Zerocoded = true; - OutPacket(packet, ThrottleOutPacketType.Task); + OutPacket(packet, ThrottleOutPacketType.Task); } public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, @@ -2439,7 +2439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Gesture #region Appearance/ Wearables Methods - + public void SendWearables(AvatarWearable[] wearables, int serial) { AgentWearablesUpdatePacket aw = (AgentWearablesUpdatePacket)PacketPool.Instance.GetPacket(PacketType.AgentWearablesUpdate); @@ -2457,9 +2457,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP awb.AssetID = wearables[i].AssetID; awb.ItemID = wearables[i].ItemID; aw.WearableData[i] = awb; - + // m_log.DebugFormat( -// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", +// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", // awb.ItemID, awb.AssetID, i, Name); } @@ -2489,7 +2489,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) { //m_log.DebugFormat("[CLIENT]: Sending animations to {0}", Name); - + AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); // TODO: don't create new blocks if recycling an old packet ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; @@ -2546,16 +2546,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// Send a terse positional/rotation/velocity update about an avatar to the client. This avatar can be that of - /// the client itself. + /// the client itself. /// public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, Vector3 velocity, Quaternion rotation) { if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) - rotation = Quaternion.Identity; + rotation = Quaternion.Identity; //m_log.DebugFormat("[CLIENT]: Sending rotation {0} for {1} to {2}", rotation, localID, Name); - + ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateAvatarImprovedBlock(localID, position, velocity, rotation); ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); @@ -2567,7 +2567,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP terse.Header.Reliable = false; terse.Header.Zerocoded = true; - + OutPacket(terse, ThrottleOutPacketType.Task); } @@ -2593,7 +2593,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP loc.Index = ib; loc.Header.Reliable = false; loc.Header.Zerocoded = true; - + OutPacket(loc, ThrottleOutPacketType.Task); } @@ -2808,7 +2808,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP im.Header.Zerocoded = true; OutPacket(im, ThrottleOutPacketType.Texture); } - + public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) { ImagePacketPacket im = new ImagePacketPacket(); @@ -2816,13 +2816,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP im.ImageID.Packet = partNumber; im.ImageID.ID = imageUuid; im.ImageData.Data = imageData; - - OutPacket(im, ThrottleOutPacketType.Texture); + + OutPacket(im, ThrottleOutPacketType.Texture); } - + public void SendImageNotFound(UUID imageid) { - ImageNotInDatabasePacket notFoundPacket + ImageNotInDatabasePacket notFoundPacket = (ImageNotInDatabasePacket)PacketPool.Instance.GetPacket(PacketType.ImageNotInDatabase); notFoundPacket.ImageID.ID = imageid; @@ -2845,9 +2845,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP pack.Region.ObjectCapacity = stats.ObjectCapacity; //pack.Region = //stats.RegionBlock; pack.Stat = stats.StatsBlock; - + pack.Header.Reliable = false; - + OutPacket(pack, ThrottleOutPacketType.Task); } @@ -3129,7 +3129,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP updatePacket.ParcelData.IsGroupOwned = landData.IsGroupOwned; updatePacket.ParcelData.LandingType = landData.LandingType; updatePacket.ParcelData.LocalID = landData.LocalID; - + if (landData.Area > 0) { updatePacket.ParcelData.MaxPrims = parcelObjectCapacity; @@ -3138,10 +3138,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP { updatePacket.ParcelData.MaxPrims = 0; } - + updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; - updatePacket.ParcelData.MediaID = landData.MediaID; - updatePacket.ParcelData.MediaURL = LLUtil.StringToPacketBytes(landData.MediaURL); + updatePacket.ParcelData.MediaID = landData.MediaID; + updatePacket.ParcelData.MediaURL = LLUtil.StringToPacketBytes(landData.MediaURL); updatePacket.ParcelData.MusicURL = LLUtil.StringToPacketBytes(landData.MusicURL); updatePacket.ParcelData.Name = Utils.StringToBytes(landData.Name); updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; @@ -4162,7 +4162,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// This is the starting point for sending a simulator packet out to the client. - /// + /// /// Please do not call this from outside the LindenUDP client stack. /// /// @@ -4244,13 +4244,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (ProcessPacketMethod(Pack)) { //there is a handler registered that handled this packet type - + // in the end, we dereference this, so we have to check if it's null if (m_imageManager != null) m_imageManager.ProcessImageQueue(3); return; } - + // Main packet processing conditional switch (Pack.Type) { @@ -4266,7 +4266,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.ChatFromViewer: ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; @@ -4296,7 +4296,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerChatFromClient(this, args); } break; - + case PacketType.AvatarPropertiesUpdate: AvatarPropertiesUpdatePacket Packet = (AvatarPropertiesUpdatePacket)Pack; @@ -4335,7 +4335,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.ImprovedInstantMessage: ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack; string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); @@ -4383,7 +4383,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.DeclineFriendship: DeclineFriendshipPacket dfriendpack = (DeclineFriendshipPacket)Pack; - + if (OnDenyFriendRequest != null) { OnDenyFriendRequest(this, @@ -4391,7 +4391,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP dfriendpack.TransactionBlock.TransactionID, null); } - break; + break; case PacketType.TerminateFriendship: TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack; @@ -4404,7 +4404,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerTerminateFriendship(this, listOwnerAgentID, exFriendID); } break; - + case PacketType.RezObject: RezObjectPacket rezPacket = (RezObjectPacket)Pack; @@ -4418,8 +4418,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP rezPacket.RezData.FromTaskID); } break; - - case PacketType.DeRezObject: + + case PacketType.DeRezObject: DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) Pack; handlerDeRezObject = OnDeRezObject; if (handlerDeRezObject != null) @@ -4427,8 +4427,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP foreach (DeRezObjectPacket.ObjectDataBlock data in DeRezPacket.ObjectData) { - // It just so happens that the values on the DeRezAction enumerator match the Destination - // values given by a Second Life client + // It just so happens that the values on the DeRezAction enumerator match the Destination + // values given by a Second Life client handlerDeRezObject(this, data.ObjectLocalID, DeRezPacket.AgentBlock.GroupID, (DeRezAction)DeRezPacket.AgentBlock.Destination, @@ -4436,7 +4436,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } break; - + case PacketType.ModifyLand: ModifyLandPacket modify = (ModifyLandPacket)Pack; //m_log.Info("[LAND]: LAND:" + modify.ToString()); @@ -4461,7 +4461,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.RegionHandshakeReply: handlerRegionHandShakeReply = OnRegionHandShakeReply; @@ -4471,7 +4471,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.AgentWearablesRequest: handlerRequestWearables = OnRequestWearables; @@ -4488,7 +4488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.AgentSetAppearance: AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack; @@ -4537,7 +4537,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } break; - + case PacketType.RezSingleAttachmentFromInv: handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; if (handlerRezSingleAttachment != null) @@ -4548,7 +4548,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.DetachAttachmentIntoInv: handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; if (handlerDetachAttachmentIntoInv != null) @@ -4561,7 +4561,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerDetachAttachmentIntoInv(itemID, this); } break; - + case PacketType.ObjectAttach: if (OnObjectAttach != null) { @@ -4578,7 +4578,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } break; - + case PacketType.ObjectDetach: ObjectDetachPacket dett = (ObjectDetachPacket)Pack; for (int j = 0; j < dett.ObjectData.Length; j++) @@ -4592,7 +4592,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.ObjectDrop: ObjectDropPacket dropp = (ObjectDropPacket)Pack; for (int j = 0; j < dropp.ObjectData.Length; j++) @@ -4605,7 +4605,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } break; - + case PacketType.SetAlwaysRun: SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack; @@ -4614,7 +4614,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); break; - + case PacketType.CompleteAgentMovement: handlerCompleteMovementToRegion = OnCompleteMovementToRegion; if (handlerCompleteMovementToRegion != null) @@ -4624,7 +4624,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerCompleteMovementToRegion = null; break; - + case PacketType.AgentUpdate: if (OnAgentUpdate != null) { @@ -4653,7 +4653,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP //agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotationa); } break; - + case PacketType.AgentAnimation: AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; @@ -4680,7 +4680,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } break; - + case PacketType.AgentRequestSit: if (OnAgentRequestSit != null) { @@ -4692,7 +4692,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); } break; - + case PacketType.AgentSit: if (OnAgentSit != null) { @@ -4705,7 +4705,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } break; - + case PacketType.SoundTrigger: SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack; handlerSoundTrigger = OnSoundTrigger; @@ -4718,7 +4718,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.AvatarPickerRequest: AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData; @@ -4732,7 +4732,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Utils.BytesToString(querydata.Name)); } break; - + case PacketType.AgentDataUpdateRequest: AgentDataUpdateRequestPacket avRequestDataUpdatePacket = (AgentDataUpdateRequestPacket)Pack; @@ -5108,10 +5108,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.ObjectName: ObjectNamePacket objName = (ObjectNamePacket)Pack; - + handlerObjectName = null; for (int i = 0; i < objName.ObjectData.Length; i++) - { + { handlerObjectName = OnObjectName; if (handlerObjectName != null) { @@ -5243,7 +5243,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack; handlerObjectClickAction = OnObjectClickAction; - if (handlerObjectClickAction != null) + if (handlerObjectClickAction != null) { foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) { @@ -5302,7 +5302,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.TransferRequest: //Console.WriteLine("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); - + TransferRequestPacket transfer = (TransferRequestPacket)Pack; //Console.WriteLine("Transfer Request: " + transfer.ToString()); // Validate inventory transfers @@ -5346,12 +5346,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (userInfo == null) { m_log.ErrorFormat( - "[CLIENT]: Could not resolve user {0} for caps inventory update", + "[CLIENT]: Could not resolve user {0} for caps inventory update", AgentId); break; } - + if (userInfo.RootFolder == null) break; @@ -5881,7 +5881,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.TeleportLocationRequest: TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; // Console.WriteLine(tpLocReq.ToString()); @@ -6693,11 +6693,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP // TODO: handle this packet //m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet"); break; - + case PacketType.InventoryDescendents: // TODO: handle this packet //m_log.Warn("[CLIENT]: unhandled InventoryDescent packet"); - + break; case PacketType.DirPlacesQuery: DirPlacesQueryPacket dirPlacesQueryPacket = (DirPlacesQueryPacket)Pack; @@ -6775,7 +6775,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OnEventInfoRequest(this, eventInfoRequestPacket.EventData.EventID); } break; - + case PacketType.ParcelSetOtherCleanTime: ParcelSetOtherCleanTimePacket parcelSetOtherCleanTimePacket = (ParcelSetOtherCleanTimePacket)Pack; handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime; @@ -7516,7 +7516,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } public void SendAgentOnline(UUID[] agentIDs) - { + { OnlineNotificationPacket onp = new OnlineNotificationPacket(); OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length]; for (int i = 0; i < agentIDs.Length; i++) @@ -7682,7 +7682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { Transfer.TransferInfo.Params = new byte[20]; Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); - int assType = req.AssetInf.Type; + int assType = req.AssetInf.Metadata.Type; Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); } else if (req.AssetRequestSource == 3) @@ -7901,7 +7901,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { case "ReliableIsImportant": return m_PacketHandler.ReliableIsImportant.ToString(); - + default: break; } @@ -8340,7 +8340,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP dg.AgentData = new AgentDropGroupPacket.AgentDataBlock(); dg.AgentData.AgentID = AgentId; dg.AgentData.GroupID = groupID; - + OutPacket(dg, ThrottleOutPacketType.Task); } @@ -8352,7 +8352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP an.AgentData = new AvatarNotesReplyPacket.AgentDataBlock(); an.AgentData.AgentID = AgentId; - + an.Data = new AvatarNotesReplyPacket.DataBlock(); an.Data.TargetID = targetID; an.Data.Notes = Utils.StringToBytes(text); @@ -8369,7 +8369,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ap.AgentData = new AvatarPicksReplyPacket.AgentDataBlock(); ap.AgentData.AgentID = AgentId; ap.AgentData.TargetID = targetID; - + ap.Data = new AvatarPicksReplyPacket.DataBlock[picks.Count]; int i = 0; @@ -8393,7 +8393,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock(); ac.AgentData.AgentID = AgentId; ac.AgentData.TargetID = targetID; - + ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifieds.Count]; int i = 0; @@ -8416,7 +8416,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP pd.AgentData = new ParcelDwellReplyPacket.AgentDataBlock(); pd.AgentData.AgentID = AgentId; - + pd.Data = new ParcelDwellReplyPacket.DataBlock(); pd.Data.LocalID = localID; pd.Data.ParcelID = parcelID; @@ -8437,7 +8437,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ur.AgentData = new UserInfoReplyPacket.AgentDataBlock(); ur.AgentData.AgentID = AgentId; - + ur.UserData = new UserInfoReplyPacket.UserDataBlock(); ur.UserData.IMViaEMail = imViaEmail; ur.UserData.DirectoryVisibility = Utils.StringToBytes(Visible); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs index 517de34..d2d86b9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { /// /// A work in progress, to contain the SL specific file transfer code that is currently in various region modules - /// This file currently contains multiple classes that need to be split out into their own files. + /// This file currently contains multiple classes that need to be split out into their own files. /// public class LLFileTransfer : IClientFileTransfer { @@ -206,13 +206,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP private void Initialise(UUID fileID, string fileName) { m_asset = new AssetBase(); - m_asset.FullID = fileID; - m_asset.Type = type; + m_asset.Metadata.FullID = fileID; + m_asset.Metadata.Type = type; m_asset.Data = new byte[0]; - m_asset.Name = fileName; - m_asset.Description = "empty"; - m_asset.Local = true; - m_asset.Temporary = true; + m_asset.Metadata.Name = fileName; + m_asset.Metadata.Description = "empty"; + m_asset.Metadata.Local = true; + m_asset.Metadata.Temporary = true; mXferID = Util.GetNextXferID(); } @@ -223,13 +223,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void RequestStartXfer(IClientAPI pRemoteClient) { - if (!String.IsNullOrEmpty(m_asset.Name)) + if (!String.IsNullOrEmpty(m_asset.Metadata.Name)) { - pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); + pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, Utils.StringToBytes(m_asset.Metadata.Name)); } else { - pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); + pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]); } } @@ -238,7 +238,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - /// + /// public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) { if (mXferID == xferID) @@ -273,7 +273,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUploadDone = UploadDone; if (handlerUploadDone != null) { - handlerUploadDone(m_asset.Name, m_asset.FullID, mXferID, m_asset.Data, remoteClient); + handlerUploadDone(m_asset.Metadata.Name, m_asset.Metadata.FullID, mXferID, m_asset.Data, remoteClient); } } @@ -282,7 +282,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerAbort = UploadAborted; if (handlerAbort != null) { - handlerAbort(m_asset.Name, m_asset.FullID, mXferID, remoteClient); + handlerAbort(m_asset.Metadata.Name, m_asset.Metadata.FullID, mXferID, remoteClient); } } } @@ -373,4 +373,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 3b21c85..f903c45 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Priority Queue for images. Contains lots of data /// private readonly IPriorityQueue> pq = new IntervalHeap>(); - + /// /// Dictionary of PriorityQueue handles by AssetId /// @@ -87,7 +87,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP //if (req.RequestType == 1) // avatar body texture! // return; - + AddQueueItem(req.RequestedAssetID, (int)req.Priority + 100000); //if (pq[PQHandles[req.RequestedAssetID]].data.Missing) //{ @@ -96,9 +96,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // //if (pq[PQHandles[req.RequestedAssetID]].data.HasData && pq[PQHandles[req.RequestedAssetID]].data.Layers.Length > 0) //{ - + //} - + pq[PQHandles[req.RequestedAssetID]].data.requestedUUID = req.RequestedAssetID; pq[PQHandles[req.RequestedAssetID]].data.Priority = (int)req.Priority; @@ -118,7 +118,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return; //Console.WriteLine("AssetCallback for assetId" + assetID); - + if (asset == null || asset.Data == null) { lock (pq) @@ -132,12 +132,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP pq[PQHandles[assetID]].data.asset = asset; - + //lock (pq[PQHandles[assetID]].data) pq[PQHandles[assetID]].data.Update((int)pq[PQHandles[assetID]].data.Priority, pq[PQHandles[assetID]].data.CurrentPacket); - - - + + + } /// @@ -174,7 +174,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Is the asset missing? if (process.data.Missing) { - + //m_client.sendtextur pq[h] -= 90000; /* @@ -191,7 +191,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Substitute a blank image process.data.asset = MissingSubstitute; process.data.Missing = false; - + // If the priority is less then -4billion, the client has forgotten about it. if (pq[h] < -400000000) { @@ -224,7 +224,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP j2kDecodedCallback(process.data.AssetId, new OpenJPEG.J2KLayerInfo[0]); } - + } // Are we waiting? else if (!process.data.J2KDecodeWaiting) @@ -259,10 +259,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP //pq[h] = process; } - + // uncomment the following line to see the upper most asset and the priority //Console.WriteLine(process.ToString()); - + // Lower priority to give the next image a chance to bubble up pq[h] -= 50000; } @@ -318,7 +318,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } } - + /// /// Adds an image to the queue and update priority @@ -336,7 +336,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { h = PQHandles[AssetId]; pq[h] = pq[h].SetPriority(priority); - + } else { @@ -354,7 +354,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void Close() { m_shuttingdown = true; - + lock (pq) { while (!pq.IsEmpty) @@ -362,7 +362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP pq.DeleteMin(); } } - + lock (PQHandles) PQHandles.Clear(); @@ -423,7 +423,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public UUID AssetId { - get { return m_asset_ref.FullID; } + get { return m_asset_ref.Metadata.FullID; } } /// @@ -544,7 +544,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// true if a packet was sent, false if not public bool SendPacket(LLClientView client) { - // If we've hit the end of the send or if the client set -1, return false. + // If we've hit the end of the send or if the client set -1, return false. if (CurrentPacket > StopPacket || StopPacket == -1) return false; @@ -564,7 +564,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else { - + // Send first packet byte[] firstImageData = new byte[FIRST_IMAGE_PACKET_SIZE]; try { Buffer.BlockCopy(m_asset_ref.Data, 0, firstImageData, 0, FIRST_IMAGE_PACKET_SIZE); } @@ -585,7 +585,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // figure out if we're on the last packet, if so, use the last packet size. If not, use 1000. // we know that the total image size is greater then 1000 if we're here int imagePacketSize = (CurrentPacket == (TexturePacketCount() ) ) ? LastPacketSize() : IMAGE_PACKET_SIZE; - + //if (imagePacketSize > 0) // imagePacketSize = IMAGE_PACKET_SIZE; //if (imagePacketSize != 1000) @@ -611,7 +611,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); } catch (Exception e) { - Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), + Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), imageData.Length, imagePacketSize, CurrentPacket,StopPacket,TexturePacketCount())); Console.WriteLine(e.ToString()); //m_log.Error("Texture data copy failed for " + m_asset_ref.FullID.ToString()); @@ -622,7 +622,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Send next packet to the client client.SendImageNextPart((ushort)(CurrentPacket - 1), requestedUUID, imageData); - + ++CurrentPacket; if (atEnd) @@ -630,7 +630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } - + } /// @@ -676,7 +676,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public static Prio operator -(Prio tp, int delta) { - if (tp.priority - delta < 0) + if (tp.priority - delta < 0) return new Prio(tp.data, tp.priority - delta); else return new Prio(tp.data, 0); -- cgit v1.1