| 243 | * ================== SV_NextDownload_f ================== |
| 244 | */ |
| 245 | private static void SV_NextDownload_f(List<String> args, GameImportsImpl gameImports, client_t client) { |
| 246 | |
| 247 | if (client.download == null) |
| 248 | return; |
| 249 | |
| 250 | int packet = client.downloadsize - client.downloadcount; |
| 251 | if (packet > 1024) |
| 252 | packet = 1024; |
| 253 | |
| 254 | client.downloadcount += packet; |
| 255 | int size = client.downloadsize; |
| 256 | if (size == 0) |
| 257 | size = 1; |
| 258 | byte percent = (byte) (client.downloadcount * 100 / size); |
| 259 | |
| 260 | byte[] data = new byte[packet]; |
| 261 | System.arraycopy(client.download, client.downloadcount - packet, data, 0, packet); |
| 262 | client.netchan.reliablePending.add(new DownloadMessage(data, percent)); |
| 263 | |
| 264 | if (client.downloadcount == client.downloadsize) { |
| 265 | client.download = null; |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | /* |
| 270 | * ================== SV_BeginDownload_f ================== |