diff options
author | lbsa71 | 2007-09-19 00:30:55 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-19 00:30:55 +0000 |
commit | 8f0b03597b0bc8ea6873af9a55495407fae1ec56 (patch) | |
tree | f9f4de38379aebf2223ad4cb10a3d9ebcfa52a4f /OpenSim/Region/Environment/Modules/XferModule.cs | |
parent | * Moved SendLogoutPacket back to IClientAPI. (diff) | |
download | opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.zip opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.gz opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.bz2 opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.xz |
* Modernized ScriptManager to new interface-based module calls.
* 'remove redundant this qualifier' ftw
Diffstat (limited to 'OpenSim/Region/Environment/Modules/XferModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/XferModule.cs | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/OpenSim/Region/Environment/Modules/XferModule.cs b/OpenSim/Region/Environment/Modules/XferModule.cs index 216d10a..7f8c5c1 100644 --- a/OpenSim/Region/Environment/Modules/XferModule.cs +++ b/OpenSim/Region/Environment/Modules/XferModule.cs | |||
@@ -1,13 +1,10 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using libsecondlife; |
4 | 4 | using OpenSim.Framework.Interfaces; | |
5 | using libsecondlife; | 5 | using OpenSim.Region.Environment.Interfaces; |
6 | using OpenSim.Framework.Interfaces; | 6 | using OpenSim.Region.Environment.Scenes; |
7 | using OpenSim.Framework.Utilities; | 7 | |
8 | using OpenSim.Region.Environment.Scenes; | ||
9 | using OpenSim.Region.Environment.Interfaces; | ||
10 | |||
11 | namespace OpenSim.Region.Environment.Modules | 8 | namespace OpenSim.Region.Environment.Modules |
12 | { | 9 | { |
13 | public class XferModule : IRegionModule, IXfer | 10 | public class XferModule : IRegionModule, IXfer |
@@ -18,8 +15,7 @@ namespace OpenSim.Region.Environment.Modules | |||
18 | private Scene m_scene; | 15 | private Scene m_scene; |
19 | 16 | ||
20 | public XferModule() | 17 | public XferModule() |
21 | { | 18 | { |
22 | |||
23 | } | 19 | } |
24 | 20 | ||
25 | public void Initialise(Scene scene) | 21 | public void Initialise(Scene scene) |
@@ -31,13 +27,11 @@ namespace OpenSim.Region.Environment.Modules | |||
31 | } | 27 | } |
32 | 28 | ||
33 | public void PostInitialise() | 29 | public void PostInitialise() |
34 | { | 30 | { |
35 | |||
36 | } | 31 | } |
37 | 32 | ||
38 | public void CloseDown() | 33 | public void CloseDown() |
39 | { | 34 | { |
40 | |||
41 | } | 35 | } |
42 | 36 | ||
43 | public string GetName() | 37 | public string GetName() |
@@ -67,7 +61,7 @@ namespace OpenSim.Region.Environment.Modules | |||
67 | lock (NewFiles) | 61 | lock (NewFiles) |
68 | { | 62 | { |
69 | if (NewFiles.ContainsKey(fileName)) | 63 | if (NewFiles.ContainsKey(fileName)) |
70 | { | 64 | { |
71 | if (!Transfers.ContainsKey(xferID)) | 65 | if (!Transfers.ContainsKey(xferID)) |
72 | { | 66 | { |
73 | byte[] fileData = NewFiles[fileName]; | 67 | byte[] fileData = NewFiles[fileName]; |
@@ -82,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules | |||
82 | 76 | ||
83 | public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet) | 77 | public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet) |
84 | { | 78 | { |
85 | if (this.Transfers.ContainsKey(xferID)) | 79 | if (Transfers.ContainsKey(xferID)) |
86 | { | 80 | { |
87 | Transfers[xferID].AckPacket(packet); | 81 | Transfers[xferID].AckPacket(packet); |
88 | } | 82 | } |
@@ -125,8 +119,7 @@ namespace OpenSim.Region.Environment.Modules | |||
125 | } | 119 | } |
126 | 120 | ||
127 | public XferDownLoad() | 121 | public XferDownLoad() |
128 | { | 122 | { |
129 | |||
130 | } | 123 | } |
131 | 124 | ||
132 | public void StartSend() | 125 | public void StartSend() |
@@ -142,10 +135,10 @@ namespace OpenSim.Region.Environment.Modules | |||
142 | } | 135 | } |
143 | else | 136 | else |
144 | { | 137 | { |
145 | byte[] transferData = new byte[1000 +4]; | 138 | byte[] transferData = new byte[1000 + 4]; |
146 | Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); | 139 | Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); |
147 | Array.Copy(Data, 0, transferData, 4, 1000); | 140 | Array.Copy(Data, 0, transferData, 4, 1000); |
148 | Client.SendXferPacket(XferID, 0 , transferData); | 141 | Client.SendXferPacket(XferID, 0, transferData); |
149 | Packet++; | 142 | Packet++; |
150 | DataPointer = 1000; | 143 | DataPointer = 1000; |
151 | } | 144 | } |
@@ -167,7 +160,7 @@ namespace OpenSim.Region.Environment.Modules | |||
167 | { | 160 | { |
168 | byte[] transferData = new byte[Data.Length - DataPointer]; | 161 | byte[] transferData = new byte[Data.Length - DataPointer]; |
169 | Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); | 162 | Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); |
170 | uint endPacket = Packet |= (uint)0x80000000; | 163 | uint endPacket = Packet |= (uint) 0x80000000; |
171 | Client.SendXferPacket(XferID, endPacket, transferData); | 164 | Client.SendXferPacket(XferID, endPacket, transferData); |
172 | Packet++; | 165 | Packet++; |
173 | DataPointer += (Data.Length - DataPointer); | 166 | DataPointer += (Data.Length - DataPointer); |
@@ -177,4 +170,4 @@ namespace OpenSim.Region.Environment.Modules | |||
177 | } | 170 | } |
178 | } | 171 | } |
179 | } | 172 | } |
180 | } | 173 | } \ No newline at end of file |