|
@@ -423,42 +423,34 @@ void ClientNetworkUDPSocketHandler::Rece
|
|
|
* and causes problems when showing the NewGRF list. */
|
|
|
if (StrEmpty(name)) continue;
|
|
|
|
|
|
/* Try to find the GRFTextWrapper for the name of this GRF ID and MD5sum tuple.
|
|
|
* If it exists and not resolved yet, then name of the fake GRF is
|
|
|
* overwritten with the name from the reply. */
|
|
|
GRFTextWrapper *unknown_name = FindUnknownGRFName(c.grfid, c.md5sum, false);
|
|
|
if (unknown_name != nullptr && strcmp(GetGRFStringFromGRFText(unknown_name->text), UNKNOWN_GRF_NAME_PLACEHOLDER) == 0) {
|
|
|
AddGRFTextToList(&unknown_name->text, name);
|
|
|
GRFTextWrapper unknown_name = FindUnknownGRFName(c.grfid, c.md5sum, false);
|
|
|
if (unknown_name && strcmp(GetGRFStringFromGRFText(unknown_name), UNKNOWN_GRF_NAME_PLACEHOLDER) == 0) {
|
|
|
AddGRFTextToList(unknown_name, name);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void ClientNetworkUDPSocketHandler::HandleIncomingNetworkGameInfoGRFConfig(GRFConfig *config)
|
|
|
{
|
|
|
/* Find the matching GRF file */
|
|
|
const GRFConfig *f = FindGRFConfig(config->ident.grfid, FGCM_EXACT, config->ident.md5sum);
|
|
|
if (f == nullptr) {
|
|
|
/* Don't know the GRF, so mark game incompatible and the (possibly)
|
|
|
* already resolved name for this GRF (another server has sent the
|
|
|
* name of the GRF already */
|
|
|
config->name->Release();
|
|
|
config->name = FindUnknownGRFName(config->ident.grfid, config->ident.md5sum, true);
|
|
|
config->name->AddRef();
|
|
|
config->status = GCS_NOT_FOUND;
|
|
|
} else {
|
|
|
config->filename = f->filename;
|
|
|
config->name->Release();
|
|
|
config->name = f->name;
|
|
|
config->name->AddRef();
|
|
|
config->info->Release();
|
|
|
config->info = f->info;
|
|
|
config->info->AddRef();
|
|
|
config->url->Release();
|
|
|
config->url = f->url;
|
|
|
config->url->AddRef();
|
|
|
}
|
|
|
SetBit(config->flags, GCF_COPY);
|
|
|
}
|
|
|
|
|
|
/** Broadcast to all ips */
|
|
|
static void NetworkUDPBroadCast(NetworkUDPSocketHandler *socket)
|