| 7841 | } |
| 7842 | |
| 7843 | void MultiDoFileAck(uint8_t *data) { |
| 7844 | // If we are transferring a file, and someone ACK's us, simply send them the next bit of data they are waiting for |
| 7845 | uint8_t playernum; // Who is acking us |
| 7846 | uint32_t len_recvd; // Total number of bytes received so far |
| 7847 | int count = 0; |
| 7848 | |
| 7849 | SKIP_HEADER(data, &count); |
| 7850 | playernum = MultiGetUshort(data, &count); |
| 7851 | len_recvd = MultiGetUint(data, &count); |
| 7852 | // mprintf(0,"Got a ACK packet from %d\n",playernum); |
| 7853 | if (NetPlayers[playernum].file_xfer_flags == NETFILE_SENDING) { |
| 7854 | if (NetPlayers[playernum].file_xfer_pos == len_recvd) { |
| 7855 | SendDataChunk(playernum); |
| 7856 | } else { |
| 7857 | Int3(); // This shouldn't happen because the reliable network code should handle it |
| 7858 | } |
| 7859 | } else { |
| 7860 | mprintf(0, "Received an ACK from someone we weren't sending a file to!\n"); |
| 7861 | } |
| 7862 | } |
| 7863 | |
| 7864 | void SendDataChunk(int playernum) { |
| 7865 | int outcount = 0; |
no test coverage detected