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

Function MultiDoLevelEnded

Descent3/multi.cpp:3571–3596  ·  view source on GitHub ↗

server is telling us the level has ended

Source from the content-addressed store, hash-verified

3569
3570// server is telling us the level has ended
3571void MultiDoLevelEnded(uint8_t *data) {
3572 int count = 0;
3573 SKIP_HEADER(data, &count);
3574
3575 int success = MultiGetByte(data, &count);
3576 Multi_next_level = MultiGetByte(data, &count);
3577
3578 // Make sure we're not being fooled
3579 if (Multi_next_level < 1 || Multi_next_level > Current_mission.num_levels)
3580 Multi_next_level = -1;
3581
3582 mprintf(0, "Doing level ended! Next level=%d\n", Multi_next_level);
3583
3584 if (success)
3585 SetGameState(GAMESTATE_LVLEND);
3586 else
3587 SetGameState(GAMESTATE_LVLFAILED);
3588
3589 NetPlayers[Player_num].sequence = NETSEQ_LEVEL_END;
3590
3591 Multi_bail_ui_menu = true;
3592
3593 CallGameDLL(EVT_CLIENT_GAMELEVELEND, &DLLInfo);
3594 CallMultiDLL(MT_EVT_GAME_OVER);
3595 ScoreAPIGameOver();
3596}
3597
3598// Tells all the clients to end the level
3599void MultiSendLevelEnded(int success, int next_level) {

Callers 1

MultiProcessDataFunction · 0.85

Calls 6

SKIP_HEADERFunction · 0.85
MultiGetByteFunction · 0.85
SetGameStateFunction · 0.85
CallGameDLLFunction · 0.85
CallMultiDLLFunction · 0.85
ScoreAPIGameOverFunction · 0.85

Tested by

no test coverage detected