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

Function SendGameStartPacket

netgames/monsterball/monsterball.cpp:1798–1827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1796}
1797
1798void SendGameStartPacket(int pnum) {
1799 int i, count = 0;
1800 uint8_t data[MAX_GAME_DATA_SIZE];
1801
1802 DMFCBase->StartPacket(data, SPID_NEWPLAYER, &count);
1803
1804 // add the team scores
1805 for (i = 0; i < DLLMAX_TEAMS; i++) {
1806 MultiAddInt(TeamScores[i], data, &count);
1807 }
1808
1809 int8_t temp;
1810 int p;
1811
1812 // who has the Monsterball if anyone
1813 if (ValidateOwner(&p, NULL)) {
1814 temp = p;
1815 } else {
1816 temp = -1;
1817 }
1818 MultiAddByte(temp, data, &count);
1819
1820 // number of teams
1821 temp = NumOfTeams;
1822 MultiAddByte(temp, data, &count);
1823
1824 // we're done
1825 DLLmprintf(0, "Sending Game State to %s\n", dPlayers[pnum].callsign);
1826 DMFCBase->SendPacket(data, count, pnum);
1827}
1828
1829bool GetMonsterballInfo(int id) {
1830 if (id == -1)

Callers 1

OnGameStateRequestFunction · 0.70

Calls 5

MultiAddIntFunction · 0.85
ValidateOwnerFunction · 0.85
MultiAddByteFunction · 0.85
StartPacketMethod · 0.80
SendPacketMethod · 0.80

Tested by

no test coverage detected