Cleanup: [Network] Remove C-string Recv_string and its last use

This commit is contained in:
rubidium42
2021-05-30 13:36:07 +02:00
committed by rubidium42
parent ab9b937ab7
commit bb8fd00760
3 changed files with 2 additions and 36 deletions

View File

@@ -874,13 +874,11 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_JOIN(Packet *p)
return this->SendError(NETWORK_ERROR_NOT_EXPECTED);
}
char client_revision[NETWORK_REVISION_LENGTH];
p->Recv_string(client_revision, sizeof(client_revision));
std::string client_revision = p->Recv_string(NETWORK_REVISION_LENGTH);
uint32 newgrf_version = p->Recv_uint32();
/* Check if the client has revision control enabled */
if (!IsNetworkCompatibleVersion(client_revision) || _openttd_newgrf_version != newgrf_version) {
if (!IsNetworkCompatibleVersion(client_revision.c_str()) || _openttd_newgrf_version != newgrf_version) {
/* Different revisions!! */
return this->SendError(NETWORK_ERROR_WRONG_REVISION);
}