Tell the client that they may run to a particular frame. */
| 614 | |
| 615 | /** Tell the client that they may run to a particular frame. */ |
| 616 | NetworkRecvStatus ServerNetworkGameSocketHandler::SendFrame() |
| 617 | { |
| 618 | auto p = std::make_unique<Packet>(this, PACKET_SERVER_FRAME); |
| 619 | p->Send_uint32(_frame_counter); |
| 620 | p->Send_uint32(_frame_counter_max); |
| 621 | #ifdef ENABLE_NETWORK_SYNC_EVERY_FRAME |
| 622 | p->Send_uint32(_sync_seed_1); |
| 623 | #ifdef NETWORK_SEND_DOUBLE_SEED |
| 624 | p->Send_uint32(_sync_seed_2); |
| 625 | #endif |
| 626 | #endif |
| 627 | |
| 628 | /* If token equals 0, we need to make a new token and send that. */ |
| 629 | if (this->last_token == 0) { |
| 630 | this->last_token = InteractiveRandomRange(UINT8_MAX - 1) + 1; |
| 631 | p->Send_uint8(this->last_token); |
| 632 | } |
| 633 | |
| 634 | this->SendPacket(std::move(p)); |
| 635 | return NETWORK_RECV_STATUS_OKAY; |
| 636 | } |
| 637 | |
| 638 | /** Request the client to sync. */ |
| 639 | NetworkRecvStatus ServerNetworkGameSocketHandler::SendSync() |
no test coverage detected