mirror of https://github.com/OpenTTD/OpenTTD
(svn r1098) -Fix: server without revision build doesn't care about the client's version. Also moved all revision things where it belongs (network.c)
parent
29b844a408
commit
f1b6b1711b
10
network.c
10
network.c
|
@ -1,6 +1,16 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "network_data.h"
|
#include "network_data.h"
|
||||||
|
|
||||||
|
#if defined(WITH_REV)
|
||||||
|
extern const char _openttd_revision[];
|
||||||
|
#elif defined(WITH_REV_HACK)
|
||||||
|
#define WITH_REV
|
||||||
|
const char _openttd_revision[] = WITH_REV_HACK;
|
||||||
|
#else
|
||||||
|
const char _openttd_revision[] = NOREV_STRING;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define NETWORK_H
|
#define NETWORK_H
|
||||||
|
|
||||||
#include "network_core.h"
|
#include "network_core.h"
|
||||||
|
#define NOREV_STRING "norev000"
|
||||||
|
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
||||||
|
|
|
@ -578,6 +578,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
|
||||||
|
|
||||||
NetworkRecv_string(p, client_revision, sizeof(client_revision));
|
NetworkRecv_string(p, client_revision, sizeof(client_revision));
|
||||||
|
|
||||||
|
#ifdef WITH_REV
|
||||||
// Check if the client has revision control enabled
|
// Check if the client has revision control enabled
|
||||||
if (strncmp(NOREV_STRING, client_revision, sizeof(client_revision)) != 0) {
|
if (strncmp(NOREV_STRING, client_revision, sizeof(client_revision)) != 0) {
|
||||||
if (strncmp(_network_game_info.server_revision, client_revision, sizeof(_network_game_info.server_revision) - 1) != 0) {
|
if (strncmp(_network_game_info.server_revision, client_revision, sizeof(_network_game_info.server_revision) - 1) != 0) {
|
||||||
|
@ -587,6 +588,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
NetworkRecv_string(p, name, sizeof(name));
|
NetworkRecv_string(p, name, sizeof(name));
|
||||||
playas = NetworkRecv_uint8(p);
|
playas = NetworkRecv_uint8(p);
|
||||||
|
|
|
@ -20,13 +20,7 @@ static byte *_langpack;
|
||||||
static uint _langtab_num[32]; // Offset into langpack offs
|
static uint _langtab_num[32]; // Offset into langpack offs
|
||||||
static uint _langtab_start[32]; // Offset into langpack offs
|
static uint _langtab_start[32]; // Offset into langpack offs
|
||||||
|
|
||||||
#if defined(WITH_REV)
|
extern const char _openttd_revision[];
|
||||||
extern const char _openttd_revision[];
|
|
||||||
#elif defined(WITH_REV_HACK)
|
|
||||||
const char _openttd_revision[] = WITH_REV_HACK;
|
|
||||||
#else
|
|
||||||
const char _openttd_revision[] = NOREV_STRING;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef byte *PlayerNameGeneratorProc(byte *buffr);
|
typedef byte *PlayerNameGeneratorProc(byte *buffr);
|
||||||
|
|
||||||
|
|
1
ttd.h
1
ttd.h
|
@ -1,7 +1,6 @@
|
||||||
#ifndef TTD_H
|
#ifndef TTD_H
|
||||||
#define TTD_H
|
#define TTD_H
|
||||||
|
|
||||||
#define NOREV_STRING "norev000"
|
|
||||||
// FIXME: Include only where really needed.
|
// FIXME: Include only where really needed.
|
||||||
// include sprites
|
// include sprites
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
|
|
Loading…
Reference in New Issue