Polls for a connection message so we can finally join this game Client only
| 499 | // Polls for a connection message so we can finally join this game |
| 500 | // Client only |
| 501 | void MultiPollForConnectionAccepted() { |
| 502 | float start_time; |
| 503 | int connected = 0; |
| 504 | uint8_t data[MAX_RECEIVE_SIZE]; |
| 505 | |
| 506 | start_time = timer_GetTime(); |
| 507 | |
| 508 | while ((timer_GetTime() - start_time < JOIN_POLL_TIME) && !connected) { |
| 509 | int size; |
| 510 | while ((size = nw_ReceiveReliable(NetPlayers[Player_num].reliable_socket, data, MAX_RECEIVE_SIZE)) > 0) { |
| 511 | MultiProcessBigData(data, size, &Netgame.server_address); |
| 512 | |
| 513 | if (NetPlayers[Player_num].flags & NPF_CONNECTED) { |
| 514 | connected = 1; |
| 515 | } |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | if (!connected) { |
| 520 | mprintf(0, "Couldn't get a connection_accepted packet for some reason!\n"); |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | // Gets a new connection to a new client set up |
| 525 | // This does not mean the client will enter the game, just that the server |
no test coverage detected