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

Function MultiDoReadyForLevel

Descent3/multi_connect.cpp:782–806  ·  view source on GitHub ↗

Clients says he's ready for level info so send it to him

Source from the content-addressed store, hash-verified

780// Clients says he's ready for level info
781// so send it to him
782void MultiDoReadyForLevel(uint8_t *data) {
783 int count = 0;
784 uint8_t slot;
785 char ship_name[PAGENAME_LEN];
786
787 // Skip header stuff
788 SKIP_HEADER(data, &count);
789
790 // Get slot number
791 slot = MultiGetByte(data, &count);
792
793 // Copy the ship name out
794 int len = MultiGetByte(data, &count);
795 memcpy(ship_name, &data[count], len);
796 count += len;
797
798 int ship_index = FindShipName(ship_name);
799 if (ship_index < 0)
800 ship_index = 0;
801
802 PlayerChangeShip(slot, ship_index);
803
804 MultiSendLevelInfo(slot);
805 NetPlayers[slot].sequence = NETSEQ_LEVEL_START;
806}
807
808// Client is telling the server that he is ready for a level
809// Client only

Callers 1

MultiProcessDataFunction · 0.85

Calls 5

SKIP_HEADERFunction · 0.85
MultiGetByteFunction · 0.85
FindShipNameFunction · 0.85
PlayerChangeShipFunction · 0.85
MultiSendLevelInfoFunction · 0.85

Tested by

no test coverage detected