diff options
author | Teravus Ovares | 2008-05-10 12:45:41 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-10 12:45:41 +0000 |
commit | b67f88a3a21c446f0c30e52cea45d8ff28942ec0 (patch) | |
tree | 6f41dce35dd8a94a24b73f766df39f7c1b5b7936 /OpenSim/Region/Environment/Modules/Agent | |
parent | Refactored out a few warnings related to Adam's bane OutPacket (diff) | |
download | opensim-SC_OLD-b67f88a3a21c446f0c30e52cea45d8ff28942ec0.zip opensim-SC_OLD-b67f88a3a21c446f0c30e52cea45d8ff28942ec0.tar.gz opensim-SC_OLD-b67f88a3a21c446f0c30e52cea45d8ff28942ec0.tar.bz2 opensim-SC_OLD-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/Region/Environment/Modules/Agent')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs | 33 |
1 files changed, 12 insertions, 21 deletions
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 | } |