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

Method SendTeamAssignment

netgames/dmfc/dmfcpackets.cpp:264–278  ·  view source on GitHub ↗

DMFCBase::SendTeamAssignment A DMFC Special Packet function, this sends a team assignment packet to all the players. Server only. playernum = player to change teams team = new team

Source from the content-addressed store, hash-verified

262// playernum = player to change teams
263// team = new team
264void DMFCBase::SendTeamAssignment(int playernum, int team, bool spew_onrespawn) {
265 if (GetLocalRole() != LR_SERVER)
266 return;
267
268 uint8_t data[MAX_GAME_DATA_SIZE];
269 int count = 0;
270
271 StartPacket(data, SPID_TEAMASSIGNMENT, &count);
272
273 MultiAddByte((spew_onrespawn) ? 1 : 0, data, &count);
274 MultiAddInt(playernum, data, &count);
275 MultiAddInt(team, data, &count);
276
277 SendPacket(data, count, SP_ALL);
278}
279
280// DMFCBase::GetTeamAssignmentPacket
281//

Callers 1

Calls 2

MultiAddByteFunction · 0.85
MultiAddIntFunction · 0.85

Tested by

no test coverage detected