Tells the client that we're done sending objects
| 965 | |
| 966 | // Tells the client that we're done sending objects |
| 967 | void MultiSendDoneObjects(int slot) { |
| 968 | int size; |
| 969 | uint8_t data[MAX_GAME_DATA_SIZE]; |
| 970 | int count = 0; |
| 971 | |
| 972 | mprintf(0, "Sending done objects\n"); |
| 973 | |
| 974 | // Take the level checksum and clone it. |
| 975 | MD5 playermd5(*Level_md5); |
| 976 | // Generate a random salt value and send it to the client. |
| 977 | int salt = ps_rand(); |
| 978 | // process the salt through the md5 |
| 979 | playermd5.update(salt); |
| 980 | // process the ships through the md5 |
| 981 | for (int i = 0; i < MAX_SHIPS; i++) |
| 982 | if (Ships[i].used) |
| 983 | MultiProcessShipChecksum(&playermd5, i); |
| 984 | // save the digest value in the netplayer slot |
| 985 | playermd5.digest(NetPlayers[slot].digest); |
| 986 | |
| 987 | size = START_DATA(MP_DONE_OBJECTS, data, &count); |
| 988 | MultiAddInt(salt, data, &count); |
| 989 | END_DATA(count, data, size); |
| 990 | |
| 991 | nw_SendReliable(NetPlayers[slot].reliable_socket, data, count); |
| 992 | } |
| 993 | |
| 994 | // Tells the client that we're done sending the world states |
| 995 | void MultiSendDoneWorldStates(int slot) { |
no test coverage detected