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

Function MultiSendLevelInfo

Descent3/multi_connect.cpp:751–778  ·  view source on GitHub ↗

Server is telling the client about the level currently playing Server only

Source from the content-addressed store, hash-verified

749// Server is telling the client about the level currently playing
750// Server only
751void MultiSendLevelInfo(int slot) {
752 ASSERT(Netgame.local_role == LR_SERVER);
753 uint8_t data[MAX_GAME_DATA_SIZE];
754 int count = 0;
755 int size_offset;
756
757 size_offset = START_DATA(MP_LEVEL_INFO, data, &count);
758
759 if (Netgame.local_role == LR_SERVER) {
760 if (Players[slot].start_roomnum != -1)
761 MultiAddByte(JOIN_ANSWER_OK, data, &count);
762 else
763 MultiAddByte(JOIN_ANSWER_NO_ROOM, data, &count);
764 } else
765 MultiAddByte(JOIN_ANSWER_NOT_SERVER, data, &count);
766
767 // Do level number (of the mission)
768 mprintf(0, "Sending current mission level %d!\n", Current_mission.cur_level);
769 MultiAddByte(Current_mission.cur_level, data, &count);
770
771 // Send the difficulty
772 MultiAddByte(Netgame.difficulty, data, &count);
773
774 END_DATA(count, data, size_offset);
775
776 // Send it out
777 nw_SendReliable(NetPlayers[slot].reliable_socket, data, count);
778}
779
780// Clients says he's ready for level info
781// so send it to him

Callers 1

MultiDoReadyForLevelFunction · 0.85

Calls 4

START_DATAFunction · 0.85
MultiAddByteFunction · 0.85
END_DATAFunction · 0.85
nw_SendReliableFunction · 0.85

Tested by

no test coverage detected