|
@@ -13,12 +13,14 @@
|
|
|
#include "game_info.h"
|
|
|
#include "../../core/bitmath_func.hpp"
|
|
|
#include "../../company_base.h"
|
|
|
#include "../../date_func.h"
|
|
|
#include "../../debug.h"
|
|
|
#include "../../map_func.h"
|
|
|
#include "../../game/game.hpp"
|
|
|
#include "../../game/game_info.hpp"
|
|
|
#include "../../settings_type.h"
|
|
|
#include "../../string_func.h"
|
|
|
#include "../../rev.h"
|
|
|
#include "../network_func.h"
|
|
|
#include "../network.h"
|
|
|
#include "packet.h"
|
|
@@ -192,12 +194,17 @@ void SerializeNetworkGameInfo(Packet *p,
|
|
|
* The parts must be read in the same order as they are sent!
|
|
|
*/
|
|
|
|
|
|
/* Update the documentation in game_info.h on changes
|
|
|
* to the NetworkGameInfo wire-protocol! */
|
|
|
|
|
|
/* NETWORK_GAME_INFO_VERSION = 5 */
|
|
|
GameInfo *game_info = Game::GetInfo();
|
|
|
p->Send_uint32(game_info == nullptr ? -1 : (uint32)game_info->GetVersion());
|
|
|
p->Send_string(game_info == nullptr ? "" : game_info->GetName());
|
|
|
|
|
|
/* NETWORK_GAME_INFO_VERSION = 4 */
|
|
|
{
|
|
|
/* Only send the GRF Identification (GRF_ID and MD5 checksum) of
|
|
|
* the GRFs that are needed, i.e. the ones that the server has
|
|
|
* selected in the NewGRF GUI and not the ones that are used due
|
|
|
* to the fact that they are in [newgrf-static] in openttd.cfg */
|
|
@@ -257,12 +264,18 @@ void DeserializeNetworkGameInfo(Packet *
|
|
|
*/
|
|
|
|
|
|
/* Update the documentation in game_info.h on changes
|
|
|
* to the NetworkGameInfo wire-protocol! */
|
|
|
|
|
|
switch (game_info_version) {
|
|
|
case 5: {
|
|
|
info->gamescript_version = (int)p->Recv_uint32();
|
|
|
info->gamescript_name = p->Recv_string(NETWORK_NAME_LENGTH);
|
|
|
FALLTHROUGH;
|
|
|
}
|
|
|
|
|
|
case 4: {
|
|
|
GRFConfig **dst = &info->grfconfig;
|
|
|
uint i;
|
|
|
uint num_grfs = p->Recv_uint8();
|
|
|
|
|
|
/* Broken/bad data. It cannot have that many NewGRFs. */
|