@@ -425,7 +425,7 @@ void Packet::Recv_string(std::string &buffer, StringValidationSettings settings)
|
|||||||
|
|
||||||
size_t length = ttd_strnlen((const char *)(this->buffer.data() + this->pos), this->Size() - this->pos - 1);
|
size_t length = ttd_strnlen((const char *)(this->buffer.data() + this->pos), this->Size() - this->pos - 1);
|
||||||
buffer.assign((const char *)(this->buffer.data() + this->pos), length);
|
buffer.assign((const char *)(this->buffer.data() + this->pos), length);
|
||||||
this->pos += (uint)length + 1;
|
this->pos += (PacketSize)length + 1;
|
||||||
str_validate_inplace(buffer, settings);
|
str_validate_inplace(buffer, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ void NetworkUDPSocketHandler::SendNetworkGameInfo(Packet *p, const NetworkGameIn
|
|||||||
for (c = info->grfconfig; c != nullptr; c = c->next) {
|
for (c = info->grfconfig; c != nullptr; c = c->next) {
|
||||||
if (!HasBit(c->flags, GCF_STATIC)) count++;
|
if (!HasBit(c->flags, GCF_STATIC)) count++;
|
||||||
}
|
}
|
||||||
p->Send_uint8(std::min<uint>(count, NETWORK_MAX_GRF_COUNT)); // Send number of GRFs
|
p->Send_uint8(static_cast<uint8>(std::min<uint>(count, NETWORK_MAX_GRF_COUNT))); // Send number of GRFs
|
||||||
|
|
||||||
/* Send actual GRF Identifications */
|
/* Send actual GRF Identifications */
|
||||||
uint index = 0;
|
uint index = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user