MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MultiSendReadyForLevel

Function MultiSendReadyForLevel

Descent3/multi_connect.cpp:810–840  ·  view source on GitHub ↗

Client is telling the server that he is ready for a level Client only

Source from the content-addressed store, hash-verified

808// Client is telling the server that he is ready for a level
809// Client only
810void 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
842extern int Multi_packet_tracking[];
843// Clears all connections

Callers 1

MultiPollForLevelInfoFunction · 0.85

Calls 6

FindShipNameFunction · 0.85
START_DATAFunction · 0.85
MultiAddByteFunction · 0.85
END_DATAFunction · 0.85
nw_SendReliableFunction · 0.85
get_shipMethod · 0.80

Tested by

no test coverage detected