From f90bd59708fc6eeec115589efbd50225f1370c7e Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 22 Aug 2007 14:48:53 +0000 Subject: Fixed typo. --- OpenSim/Region/Environment/Scenes/Scene.cs | 4 +- .../Region/Environment/Scenes/SceneObjectGroup.cs | 2 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 2 +- OpenSim/Region/Environment/XferManagaer.cs | 142 --------------------- OpenSim/Region/Environment/XferManager.cs | 142 +++++++++++++++++++++ 5 files changed, 146 insertions(+), 146 deletions(-) delete mode 100644 OpenSim/Region/Environment/XferManagaer.cs create mode 100644 OpenSim/Region/Environment/XferManager.cs (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d3aafcc..45bda63 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.Environment.Scenes protected AgentCircuitManager authenticateHandler; protected RegionCommsListener regionCommsHost; protected CommunicationsManager commsManager; - protected XferManagaer xferManager; + protected XferManager xferManager; protected Dictionary capsHandlers = new Dictionary(); protected BaseHttpServer httpListener; @@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Scenes m_scriptManager = new ScriptManager(this); m_eventManager = new EventManager(); m_permissionManager = new PermissionManager(this); - xferManager = new XferManagaer(); + xferManager = new XferManager(); m_eventManager.OnParcelPrimCountAdd += m_LandManager.addPrimToLandPrimCounts; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 219de84..a9f283f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -612,7 +612,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public string RequestInventoryFile(uint localID, XferManagaer xferManager) + public string RequestInventoryFile(uint localID, XferManager xferManager) { SceneObjectPart part = this.GetChildPrim(localID); if (part != null) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 5fa79fb..8735070 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public string RequestInventoryFile(XferManagaer xferManager) + public string RequestInventoryFile(XferManager xferManager) { byte[] fileData = new byte[0]; InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, this.UUID); diff --git a/OpenSim/Region/Environment/XferManagaer.cs b/OpenSim/Region/Environment/XferManagaer.cs deleted file mode 100644 index 30fbaf0..0000000 --- a/OpenSim/Region/Environment/XferManagaer.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; - -namespace OpenSim.Region.Environment -{ - public class XferManagaer - { - public Dictionary NewFiles = new Dictionary(); - public Dictionary Transfers = new Dictionary(); - - public XferManagaer() - { - - } - - /// - /// - /// - /// - /// - /// - public void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName) - { - Console.WriteLine("xfer request for " + fileName); - lock (NewFiles) - { - if (NewFiles.ContainsKey(fileName)) - { - if (!Transfers.ContainsKey(xferID)) - { - byte[] fileData = NewFiles[fileName]; - XferDownLoad transaction = new XferDownLoad(fileName, fileData, xferID, remoteClient); - Transfers.Add(xferID, transaction); - NewFiles.Remove(fileName); - transaction.StartSend(); - } - } - } - } - - public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet) - { - if (this.Transfers.ContainsKey(xferID)) - { - Transfers[xferID].AckPacket(packet); - } - } - - public void AddNewFile(string fileName, byte[] data) - { - lock (NewFiles) - { - if (NewFiles.ContainsKey(fileName)) - { - NewFiles[fileName] = data; - } - else - { - NewFiles.Add(fileName, data); - } - } - } - - public class XferDownLoad - { - public byte[] Data = new byte[0]; - public string FileName = ""; - public ulong XferID = 0; - public int DataPointer = 0; - public uint Packet = 0; - public IClientAPI Client; - public uint Serial = 1; - private bool complete = false; - - public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client) - { - FileName = fileName; - Data = data; - XferID = xferID; - Client = client; - } - - public XferDownLoad() - { - - } - - public void StartSend() - { - if (Data.Length < 1000) - { - // for now (testing ) we only support files under 1000 bytes - byte[] transferData = new byte[Data.Length + 4]; - Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); - Array.Copy(Data, 0, transferData, 4, Data.Length); - Client.SendXferPacket(XferID, 0 + 0x80000000, transferData); - complete = true; - Console.WriteLine("xfer is under 1000 bytes"); - } - else - { - byte[] transferData = new byte[1000 +4]; - Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); - Array.Copy(Data, 0, transferData, 4, 1000); - Client.SendXferPacket(XferID, 0 , transferData); - Packet++; - DataPointer = 1000; - } - } - - public void AckPacket(uint packet) - { - if (!complete) - { - if ((Data.Length - DataPointer) > 1000) - { - byte[] transferData = new byte[1000]; - Array.Copy(Data, DataPointer, transferData, 0, 1000); - Client.SendXferPacket(XferID, Packet, transferData); - Packet++; - DataPointer += 1000; - } - else - { - byte[] transferData = new byte[Data.Length - DataPointer]; - Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); - uint endPacket = Packet |= (uint)0x80000000; - Client.SendXferPacket(XferID, endPacket, transferData); - Packet++; - DataPointer += (Data.Length - DataPointer); - complete = true; - } - } - } - } - } -} diff --git a/OpenSim/Region/Environment/XferManager.cs b/OpenSim/Region/Environment/XferManager.cs new file mode 100644 index 0000000..7a8e762 --- /dev/null +++ b/OpenSim/Region/Environment/XferManager.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using libsecondlife; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Utilities; + +namespace OpenSim.Region.Environment +{ + public class XferManager + { + public Dictionary NewFiles = new Dictionary(); + public Dictionary Transfers = new Dictionary(); + + public XferManager() + { + + } + + /// + /// + /// + /// + /// + /// + public void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName) + { + Console.WriteLine("xfer request for " + fileName); + lock (NewFiles) + { + if (NewFiles.ContainsKey(fileName)) + { + if (!Transfers.ContainsKey(xferID)) + { + byte[] fileData = NewFiles[fileName]; + XferDownLoad transaction = new XferDownLoad(fileName, fileData, xferID, remoteClient); + Transfers.Add(xferID, transaction); + NewFiles.Remove(fileName); + transaction.StartSend(); + } + } + } + } + + public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet) + { + if (this.Transfers.ContainsKey(xferID)) + { + Transfers[xferID].AckPacket(packet); + } + } + + public void AddNewFile(string fileName, byte[] data) + { + lock (NewFiles) + { + if (NewFiles.ContainsKey(fileName)) + { + NewFiles[fileName] = data; + } + else + { + NewFiles.Add(fileName, data); + } + } + } + + public class XferDownLoad + { + public byte[] Data = new byte[0]; + public string FileName = ""; + public ulong XferID = 0; + public int DataPointer = 0; + public uint Packet = 0; + public IClientAPI Client; + public uint Serial = 1; + private bool complete = false; + + public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client) + { + FileName = fileName; + Data = data; + XferID = xferID; + Client = client; + } + + public XferDownLoad() + { + + } + + public void StartSend() + { + if (Data.Length < 1000) + { + // for now (testing ) we only support files under 1000 bytes + byte[] transferData = new byte[Data.Length + 4]; + Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); + Array.Copy(Data, 0, transferData, 4, Data.Length); + Client.SendXferPacket(XferID, 0 + 0x80000000, transferData); + complete = true; + Console.WriteLine("xfer is under 1000 bytes"); + } + else + { + byte[] transferData = new byte[1000 +4]; + Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); + Array.Copy(Data, 0, transferData, 4, 1000); + Client.SendXferPacket(XferID, 0 , transferData); + Packet++; + DataPointer = 1000; + } + } + + public void AckPacket(uint packet) + { + if (!complete) + { + if ((Data.Length - DataPointer) > 1000) + { + byte[] transferData = new byte[1000]; + Array.Copy(Data, DataPointer, transferData, 0, 1000); + Client.SendXferPacket(XferID, Packet, transferData); + Packet++; + DataPointer += 1000; + } + else + { + byte[] transferData = new byte[Data.Length - DataPointer]; + Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); + uint endPacket = Packet |= (uint)0x80000000; + Client.SendXferPacket(XferID, endPacket, transferData); + Packet++; + DataPointer += (Data.Length - DataPointer); + complete = true; + } + } + } + } + } +} -- cgit v1.1