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

Function MultiFindFreeSlot

Descent3/multi.cpp:3780–3792  ·  view source on GitHub ↗

Returns an index of a unconnected slot Returns -1 if there are none

Source from the content-addressed store, hash-verified

3778// Returns an index of a unconnected slot
3779// Returns -1 if there are none
3780int MultiFindFreeSlot() {
3781 if (Netgame.local_role != LR_SERVER) {
3782 return -1;
3783 }
3784
3785 for (int i = 0; i < MAX_PLAYERS; i++) {
3786 if ((NetPlayers[i].flags & (NPF_CONNECTED | NPF_MT_READING_PILOT | NPF_MT_WRITING_PILOT)) == 0)
3787 return i;
3788 //(!(NetPlayers[i].flags & NPF_CONNECTED))
3789 }
3790
3791 return -1;
3792}
3793
3794// Someone is asking to join our game
3795// Tell them if its ok

Callers 1

MultiDoAskToJoinFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected