diff options
author | MW | 2008-12-13 15:04:24 +0000 |
---|---|---|
committer | MW | 2008-12-13 15:04:24 +0000 |
commit | 40bbf886f207edd68de3a58f1f292bc613ad7cfa (patch) | |
tree | da79681d23070f903afa6ca9b30b4c829b676bc2 | |
parent | Add copyright headers. (diff) | |
download | opensim-SC-40bbf886f207edd68de3a58f1f292bc613ad7cfa.zip opensim-SC-40bbf886f207edd68de3a58f1f292bc613ad7cfa.tar.gz opensim-SC-40bbf886f207edd68de3a58f1f292bc613ad7cfa.tar.bz2 opensim-SC-40bbf886f207edd68de3a58f1f292bc613ad7cfa.tar.xz |
more work on moving FileTransfer code to the clientstack.
Still not enabled.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/IClientFileTransfer.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs | 17 |
2 files changed, 15 insertions, 7 deletions
diff --git a/OpenSim/Framework/IClientFileTransfer.cs b/OpenSim/Framework/IClientFileTransfer.cs index d033a0d..832164e 100644 --- a/OpenSim/Framework/IClientFileTransfer.cs +++ b/OpenSim/Framework/IClientFileTransfer.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -33,10 +33,11 @@ using OpenMetaverse; | |||
33 | namespace OpenSim.Framework | 33 | namespace OpenSim.Framework |
34 | { | 34 | { |
35 | public delegate void UploadComplete(string filename, UUID fileID, byte[] fileData, IClientAPI remoteClient); | 35 | public delegate void UploadComplete(string filename, UUID fileID, byte[] fileData, IClientAPI remoteClient); |
36 | public delegate void UploadAborted(string filename, ulong id, IClientAPI remoteClient); | 36 | public delegate void UploadAborted(string filename, UUID fileID, ulong transferID, IClientAPI remoteClient); |
37 | 37 | ||
38 | public interface IClientFileTransfer | 38 | public interface IClientFileTransfer |
39 | { | 39 | { |
40 | bool RequestUpload(string clientFileName, UploadComplete uploadCompleteCallback, UploadAborted abortCallback); | 40 | bool RequestUpload(string clientFileName, UploadComplete uploadCompleteCallback, UploadAborted abortCallback); |
41 | bool RequestUpload(UUID fileID, UploadComplete uploadCompleteCallback, UploadAborted abortCallback); | ||
41 | } | 42 | } |
42 | } | 43 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs index b93c37c..9d7b39e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -95,6 +95,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
95 | private bool StartUpload(XferHandler uploader, UploadComplete uploadCompleteCallback, UploadAborted abortCallback) | 95 | private bool StartUpload(XferHandler uploader, UploadComplete uploadCompleteCallback, UploadAborted abortCallback) |
96 | { | 96 | { |
97 | uploader.UploadDone += uploadCompleteCallback; | 97 | uploader.UploadDone += uploadCompleteCallback; |
98 | uploader.UploadDone += RemoveXferHandler; | ||
98 | 99 | ||
99 | if (abortCallback != null) | 100 | if (abortCallback != null) |
100 | { | 101 | { |
@@ -113,6 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
113 | { | 114 | { |
114 | // something went wrong with the xferID allocation | 115 | // something went wrong with the xferID allocation |
115 | uploader.UploadDone -= uploadCompleteCallback; | 116 | uploader.UploadDone -= uploadCompleteCallback; |
117 | uploader.UploadDone -= RemoveXferHandler; | ||
116 | if (abortCallback != null) | 118 | if (abortCallback != null) |
117 | { | 119 | { |
118 | uploader.UploadAborted -= abortCallback; | 120 | uploader.UploadAborted -= abortCallback; |
@@ -144,6 +146,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
144 | } | 146 | } |
145 | } | 147 | } |
146 | } | 148 | } |
149 | |||
150 | protected void RemoveXferHandler(string filename, UUID fileID, byte[] fileData, IClientAPI remoteClient) | ||
151 | { | ||
152 | |||
153 | } | ||
147 | } | 154 | } |
148 | 155 | ||
149 | public class XferHandler | 156 | public class XferHandler |
@@ -186,7 +193,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
186 | m_asset.FullID = fileID; | 193 | m_asset.FullID = fileID; |
187 | m_asset.Type = type; | 194 | m_asset.Type = type; |
188 | m_asset.Data = new byte[0]; | 195 | m_asset.Data = new byte[0]; |
189 | m_asset.Name = null; | 196 | m_asset.Name = String.Empty; |
190 | m_asset.Description = "empty"; | 197 | m_asset.Description = "empty"; |
191 | m_asset.Local = true; | 198 | m_asset.Local = true; |
192 | m_asset.Temporary = true; | 199 | m_asset.Temporary = true; |
@@ -200,7 +207,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
200 | 207 | ||
201 | public void RequestStartXfer(IClientAPI pRemoteClient) | 208 | public void RequestStartXfer(IClientAPI pRemoteClient) |
202 | { | 209 | { |
203 | if (m_asset.Name != null) | 210 | if (!String.IsNullOrEmpty(m_asset.Name) ) |
204 | { | 211 | { |
205 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); | 212 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); |
206 | } | 213 | } |
@@ -259,8 +266,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
259 | handlerAbort = UploadAborted; | 266 | handlerAbort = UploadAborted; |
260 | if (handlerAbort != null) | 267 | if (handlerAbort != null) |
261 | { | 268 | { |
262 | handlerAbort(m_asset.Name, mXferID, remoteClient); | 269 | handlerAbort(m_asset.Name, m_asset.FullID, mXferID, remoteClient); |
263 | } | 270 | } |
264 | } | 271 | } |
265 | } | 272 | } |
266 | } | 273 | } \ No newline at end of file |