aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-10 12:45:41 +0000
committerTeravus Ovares2008-05-10 12:45:41 +0000
commitb67f88a3a21c446f0c30e52cea45d8ff28942ec0 (patch)
tree6f41dce35dd8a94a24b73f766df39f7c1b5b7936 /OpenSim
parentRefactored out a few warnings related to Adam's bane OutPacket (diff)
downloadopensim-SC-b67f88a3a21c446f0c30e52cea45d8ff28942ec0.zip
opensim-SC-b67f88a3a21c446f0c30e52cea45d8ff28942ec0.tar.gz
opensim-SC-b67f88a3a21c446f0c30e52cea45d8ff28942ec0.tar.bz2
opensim-SC-b67f88a3a21c446f0c30e52cea45d8ff28942ec0.tar.xz
* Two more OutPacket refactors. TextureSender.
* The split image packet sender doesn't like to be refactored (images don't load after it's been refactored), so left that as is for the moment.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs15
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs33
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs6
4 files changed, 35 insertions, 21 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 9927808..3ae90f3 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -936,6 +936,8 @@ namespace OpenSim.Framework
936 void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID); 936 void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID);
937 void SendConfirmXfer(ulong xferID, uint PacketID); 937 void SendConfirmXfer(ulong xferID, uint PacketID);
938 void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName); 938 void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName);
939
940 void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec);
939 941
940 byte[] GetThrottlesPacked(float multiplier); 942 byte[] GetThrottlesPacked(float multiplier);
941 943
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 053b077..8721356 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2229,6 +2229,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2229 newPack.Header.Zerocoded = true; 2229 newPack.Header.Zerocoded = true;
2230 OutPacket(newPack, ThrottleOutPacketType.Asset); 2230 OutPacket(newPack, ThrottleOutPacketType.Asset);
2231 } 2231 }
2232 public void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
2233 {
2234 ImageDataPacket im = new ImageDataPacket();
2235 im.Header.Reliable = false;
2236 im.ImageID.Packets = numParts;
2237 im.ImageID.ID = ImageUUID;
2238
2239 if (ImageSize > 0)
2240 im.ImageID.Size = ImageSize;
2241
2242 im.ImageData.Data = ImageData;
2243 im.ImageID.Codec = imageCodec;
2244 im.Header.Zerocoded = true;
2245 OutPacket(im, ThrottleOutPacketType.Texture);
2246 }
2232 #endregion 2247 #endregion
2233 2248
2234 #region Estate Data Sending Methods 2249 #region Estate Data Sending Methods
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
index e19274e..ea84436 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
@@ -150,37 +150,27 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
150 { 150 {
151 if (NumPackets == 0) 151 if (NumPackets == 0)
152 { 152 {
153 ImageDataPacket im = new ImageDataPacket(); 153
154 im.Header.Reliable = false; 154 RequestUser.SendImagePart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2);
155 im.ImageID.Packets = 1; 155
156 im.ImageID.ID = m_asset.FullID;
157 im.ImageID.Size = (uint) m_asset.Data.Length;
158 im.ImageData.Data = m_asset.Data;
159 im.ImageID.Codec = 2;
160 im.Header.Zerocoded = true;
161 RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
162 PacketCounter++; 156 PacketCounter++;
163 } 157 }
164 else 158 else
165 { 159 {
166 ImageDataPacket im = new ImageDataPacket(); 160
167 im.Header.Reliable = false; 161 byte[] ImageData1 = new byte[600];
168 im.ImageID.Packets = (ushort) (NumPackets); 162 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600);
169 im.ImageID.ID = m_asset.FullID; 163
170 im.ImageID.Size = (uint) m_asset.Data.Length; 164 RequestUser.SendImagePart((ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2);
171 im.ImageData.Data = new byte[600];
172 Array.Copy(m_asset.Data, 0, im.ImageData.Data, 0, 600);
173 im.ImageID.Codec = 2;
174 im.Header.Zerocoded = true;
175 RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
176 PacketCounter++; 165 PacketCounter++;
177 } 166 }
178 } 167 }
179 else 168 else
180 { 169 {
170 // Doesn't like to be refactored...
181 ImagePacketPacket im = new ImagePacketPacket(); 171 ImagePacketPacket im = new ImagePacketPacket();
182 im.Header.Reliable = false; 172 im.Header.Reliable = false;
183 im.ImageID.Packet = (ushort) (PacketCounter); 173 im.ImageID.Packet = (ushort)(PacketCounter);
184 im.ImageID.ID = m_asset.FullID; 174 im.ImageID.ID = m_asset.FullID;
185 int size = m_asset.Data.Length - 600 - (1000 * (PacketCounter - 1)); 175 int size = m_asset.Data.Length - 600 - (1000 * (PacketCounter - 1));
186 if (size > 1000) size = 1000; 176 if (size > 1000) size = 1000;
@@ -195,8 +185,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
195 m_asset.FullID.ToString()); 185 m_asset.FullID.ToString());
196 return; 186 return;
197 } 187 }
198 im.Header.Zerocoded = true;
199 RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); 188 RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
189
190
200 PacketCounter++; 191 PacketCounter++;
201 } 192 }
202 } 193 }
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index bc87e53..d14089b 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -522,13 +522,19 @@ namespace OpenSim.Region.Examples.SimpleModule
522 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID) 522 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID)
523 { 523 {
524 } 524 }
525
525 public void SendConfirmXfer(ulong xferID, uint PacketID) 526 public void SendConfirmXfer(ulong xferID, uint PacketID)
526 { 527 {
527 } 528 }
529
528 public void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName) 530 public void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName)
529 { 531 {
530 } 532 }
531 533
534 public void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
535 {
536 }
537
532 private void Update() 538 private void Update()
533 { 539 {
534 frame++; 540 frame++;