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

Function MultiMatchPlayerToAddress

Descent3/multi.cpp:2272–2282  ·  view source on GitHub ↗

Returns to the slot number of the player that the passed in address belongs to

Source from the content-addressed store, hash-verified

2270
2271// Returns to the slot number of the player that the passed in address belongs to
2272int MultiMatchPlayerToAddress(network_address *from_addr) {
2273 int i;
2274 for (i = 0; i < MAX_NET_PLAYERS; i++) {
2275 if (NetPlayers[i].flags & NPF_CONNECTED) {
2276 if (!(memcmp(from_addr, &NetPlayers[i].addr, sizeof(network_address))))
2277 return i;
2278 }
2279 }
2280 // mprintf(0,"Got a packet from unconnected player?!\n");
2281 return -1;
2282}
2283
2284// Gets info about a player
2285// Server only

Callers 1

MultiProcessBigDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected