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

Function MultiDoLevelInfo

Descent3/multi_connect.cpp:721–747  ·  view source on GitHub ↗

Server is telling us about the level

Source from the content-addressed store, hash-verified

719
720// Server is telling us about the level
721void MultiDoLevelInfo(uint8_t *data) {
722 int count = 0;
723 char pshipmodel[PAGENAME_LEN];
724 Current_pilot.get_ship(pshipmodel);
725
726 int ship_index = FindShipName(pshipmodel);
727 if (ship_index < 0)
728 ship_index = 0;
729
730 // Skip header stuff
731 SKIP_HEADER(data, &count);
732
733 int join_response = MultiGetByte(data, &count);
734
735 // Get level number
736 Current_mission.cur_level = MultiGetByte(data, &count);
737
738 Netgame.difficulty = MultiGetByte(data, &count);
739
740 if ((Netgame.difficulty > 4) || (Netgame.difficulty < 0))
741 Netgame.difficulty = 2;
742
743 if (join_response != JOIN_ANSWER_OK)
744 Got_level_info = -join_response;
745 else
746 Got_level_info = 1;
747}
748
749// Server is telling the client about the level currently playing
750// Server only

Callers 1

MultiProcessDataFunction · 0.85

Calls 4

FindShipNameFunction · 0.85
SKIP_HEADERFunction · 0.85
MultiGetByteFunction · 0.85
get_shipMethod · 0.80

Tested by

no test coverage detected