Request the game password. */
| 431 | |
| 432 | /** Request the game password. */ |
| 433 | NetworkRecvStatus ServerNetworkGameSocketHandler::SendAuthRequest() |
| 434 | { |
| 435 | Debug(net, 9, "client[{}] SendAuthRequest()", this->client_id); |
| 436 | |
| 437 | /* Invalid packet when status is anything but STATUS_INACTIVE or STATUS_AUTH_GAME. */ |
| 438 | if (this->status != STATUS_INACTIVE && status != STATUS_AUTH_GAME) return this->CloseConnection(NETWORK_RECV_STATUS_MALFORMED_PACKET); |
| 439 | |
| 440 | Debug(net, 9, "client[{}] status = AUTH_GAME", this->client_id); |
| 441 | this->status = STATUS_AUTH_GAME; |
| 442 | |
| 443 | /* Reset 'lag' counters */ |
| 444 | this->last_frame = this->last_frame_server = _frame_counter; |
| 445 | |
| 446 | if (this->authentication_handler == nullptr) { |
| 447 | this->authentication_handler = NetworkAuthenticationServerHandler::Create(&_password_provider, &_authorized_key_handler); |
| 448 | } |
| 449 | |
| 450 | auto p = std::make_unique<Packet>(this, PACKET_SERVER_AUTH_REQUEST); |
| 451 | this->authentication_handler->SendRequest(*p); |
| 452 | |
| 453 | this->SendPacket(std::move(p)); |
| 454 | return NETWORK_RECV_STATUS_OKAY; |
| 455 | } |
| 456 | |
| 457 | /** Notify the client that the authentication has completed and tell that for the remainder of this socket encryption is enabled. */ |
| 458 | NetworkRecvStatus ServerNetworkGameSocketHandler::SendEnableEncryption() |
no test coverage detected