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

Function MultiSendLeaveGame

Descent3/multi.cpp:3427–3451  ·  view source on GitHub ↗

Tell everyone I'm quitting

Source from the content-addressed store, hash-verified

3425
3426// Tell everyone I'm quitting
3427void MultiSendLeaveGame() {
3428 uint8_t data[MAX_GAME_DATA_SIZE];
3429 int count = 0;
3430 int size_offset;
3431
3432 mprintf(0, "Sending leave game!\n");
3433
3434 if (Netgame.local_role == LR_SERVER) {
3435 size_offset = START_DATA(MP_SERVER_QUIT, data, &count, 1);
3436
3437 ShowProgressScreen(TXT_MLTSHUTDOWN);
3438
3439 } else {
3440 size_offset = START_DATA(MP_LEAVE_GAME, data, &count);
3441 MultiAddByte(Player_num, data, &count);
3442 }
3443
3444 END_DATA(count, data, size_offset);
3445
3446 if (Netgame.local_role == LR_SERVER) {
3447 MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_REQUEST_BUILDINGS);
3448 } else {
3449 nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count);
3450 }
3451}
3452
3453// Called whenever I want to leave the game
3454void MultiLeaveGame() {

Callers 1

MultiLeaveGameFunction · 0.85

Calls 6

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

Tested by

no test coverage detected