| 628 | } |
| 629 | |
| 630 | NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CHECK_NEWGRFS(Packet &p) |
| 631 | { |
| 632 | if (this->status != STATUS_ENCRYPTED) return NETWORK_RECV_STATUS_MALFORMED_PACKET; |
| 633 | |
| 634 | uint grf_count = p.Recv_uint8(); |
| 635 | NetworkRecvStatus ret = NETWORK_RECV_STATUS_OKAY; |
| 636 | |
| 637 | Debug(net, 9, "Client::Receive_SERVER_CHECK_NEWGRFS(): grf_count={}", grf_count); |
| 638 | |
| 639 | /* Check all GRFs */ |
| 640 | for (; grf_count > 0; grf_count--) { |
| 641 | GRFIdentifier c; |
| 642 | DeserializeGRFIdentifier(p, c); |
| 643 | |
| 644 | /* Check whether we know this GRF */ |
| 645 | const GRFConfig *f = FindGRFConfig(c.grfid, FGCM_EXACT, &c.md5sum); |
| 646 | if (f == nullptr) { |
| 647 | /* We do not know this GRF, bail out of initialization */ |
| 648 | Debug(grf, 0, "NewGRF {:08X} not found; checksum {}", std::byteswap(c.grfid), FormatArrayAsHex(c.md5sum)); |
| 649 | ret = NETWORK_RECV_STATUS_NEWGRF_MISMATCH; |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | if (ret == NETWORK_RECV_STATUS_OKAY) { |
| 654 | /* Start receiving the map */ |
| 655 | return SendNewGRFsOk(); |
| 656 | } |
| 657 | |
| 658 | /* NewGRF mismatch, bail out */ |
| 659 | ShowErrorMessage(GetEncodedString(STR_NETWORK_ERROR_NEWGRF_MISMATCH), {}, WL_CRITICAL); |
| 660 | return ret; |
| 661 | } |
| 662 | |
| 663 | class ClientGamePasswordRequestHandler : public NetworkAuthenticationPasswordRequestHandler { |
| 664 | virtual void SendResponse() override { MyClient::SendAuthResponse(); } |
nothing calls this directly
no test coverage detected