| 844 | } |
| 845 | |
| 846 | NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_JOIN(Packet &p) |
| 847 | { |
| 848 | if (this->status != STATUS_INACTIVE) { |
| 849 | /* Illegal call, return error and ignore the packet */ |
| 850 | return this->SendError(NETWORK_ERROR_NOT_EXPECTED); |
| 851 | } |
| 852 | |
| 853 | if (_network_game_info.clients_on >= _settings_client.network.max_clients) { |
| 854 | /* Turns out we are full. Inform the user about this. */ |
| 855 | return this->SendError(NETWORK_ERROR_FULL); |
| 856 | } |
| 857 | |
| 858 | std::string client_revision = p.Recv_string(NETWORK_REVISION_LENGTH); |
| 859 | uint32_t newgrf_version = p.Recv_uint32(); |
| 860 | |
| 861 | Debug(net, 9, "client[{}] Receive_CLIENT_JOIN(): client_revision={}, newgrf_version={}", this->client_id, client_revision, newgrf_version); |
| 862 | |
| 863 | /* Check if the client has revision control enabled */ |
| 864 | if (!IsNetworkCompatibleVersion(client_revision) || _openttd_newgrf_version != newgrf_version) { |
| 865 | /* Different revisions!! */ |
| 866 | return this->SendError(NETWORK_ERROR_WRONG_REVISION); |
| 867 | } |
| 868 | |
| 869 | return this->SendAuthRequest(); |
| 870 | } |
| 871 | |
| 872 | NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_IDENTIFY(Packet &p) |
| 873 | { |
nothing calls this directly
no test coverage detected