Client is telling the server that he is ready for a level Client only
| 808 | // Client is telling the server that he is ready for a level |
| 809 | // Client only |
| 810 | void MultiSendReadyForLevel() { |
| 811 | ASSERT(Netgame.local_role != LR_SERVER); |
| 812 | |
| 813 | uint8_t data[MAX_GAME_DATA_SIZE]; |
| 814 | int count = 0; |
| 815 | int size_offset; |
| 816 | |
| 817 | mprintf(0, "Sending ready for level!\n"); |
| 818 | |
| 819 | char pshipmodel[PAGENAME_LEN]; |
| 820 | Current_pilot.get_ship(pshipmodel); |
| 821 | |
| 822 | int ship_index = FindShipName(pshipmodel); |
| 823 | if (ship_index < 0) |
| 824 | ship_index = 0; |
| 825 | |
| 826 | size_offset = START_DATA(MP_READY_FOR_LEVEL, data, &count); |
| 827 | |
| 828 | MultiAddByte(Player_num, data, &count); |
| 829 | |
| 830 | // Send ship for anti-cheating purposes (CHEAP and EASILY HACKABLE!) |
| 831 | int len = strlen(Ships[ship_index].name) + 1; |
| 832 | MultiAddByte(len, data, &count); |
| 833 | memcpy(&data[count], Ships[ship_index].name, len); |
| 834 | count += len; |
| 835 | |
| 836 | END_DATA(count, data, size_offset); |
| 837 | |
| 838 | // Send it out |
| 839 | nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count); |
| 840 | } |
| 841 | |
| 842 | extern int Multi_packet_tracking[]; |
| 843 | // Clears all connections |
no test coverage detected