1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-13 09:39:10 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
rubidium
65d8131ef0 (svn r19742) -Release: 1.0.1 2010-04-30 21:24:33 +00:00
rubidium
233ff7cacd (svn r19741) [1.0] -Backport from trunk:
- Fix: Crash when using restart via rcon (r19722)                                                                   
- Fix: Leaking a file descriptor [FS#3785] (r19695)                                                 
- Fix: Crash when the music/graphics metadata files were unreadable [FS#3774] (r19674)
2010-04-30 21:01:21 +00:00
rubidium
b62a1ad1d5 (svn r19691) [1.0] -Prepare: 1.0.1-RC2 2010-04-21 19:52:20 +00:00
rubidium
706d321f52 (svn r19690) [1.0] -Backport from trunk:
- Fix: Desync when joining the game because of using the wrong variable (r19687)
- Fix: Truncated archives were not detected when using zlib 1.2.3. This also fixes zlib 1.2.4 compatibility, zlib 1.2.5 is bugfree (r19686)
- Fix: Towns with 3x3 and 2x2 road layouts could not expand (r19683)
- Fix: When joining a MP game all clients with company ID > 0 would be shown as if they were a spectator [FS#3775] (r19680)
- Fix: Client status was shown incorrect in the console (r19678)
2010-04-21 19:20:28 +00:00
28 changed files with 127 additions and 78 deletions

View File

@@ -1,3 +1,19 @@
1.0.1 (2010-05-01)
------------------------------------------------------------------------
- Fix: Crash when using restart via rcon (r19722)
- Fix: Leaking a file descriptor [CVE-2010-0406] [FS#3785] (r19695)
- Fix: Crash when the music/graphics metadata files were unreadable [FS#3774] (r19674)
1.0.1-RC2 (2010-04-22)
------------------------------------------------------------------------
- Fix: Desync when joining the game because of using the wrong variable (r19687)
- Fix: Truncated archives were not detected when using zlib 1.2.3. This also fixes zlib 1.2.4 compatibility, zlib 1.2.5 is bugfree (r19686)
- Fix: Towns with 3x3 and 2x2 road layouts could not expand (r19683)
- Fix: When joining a MP game all clients with company ID > 0 would be shown as if they were a spectator [FS#3775] (r19680)
- Fix: Client status was shown incorrect in the console (r19678)
1.0.1-RC1 (2010-04-17)
------------------------------------------------------------------------
- Feature: [NewGRF] Support for extended text code 0x9A 11, print qword (r19570)
@@ -7,7 +23,7 @@
- Change: Sync Debian packaging updates from Debian, but keep building a single package (r19572)
- Fix: Crash of a dedicated server if the null blitter is overridden and (after a while) there is no company 0 on new year anymore [FS#3749] (r19664)
- Fix: In rare cases, update of signals could be missed (r19663)
- Fix: Various improvements of command handling, missing error messages (r19658, r19657, r19656, r19655, r19654, r19637, r19633, r19621, r19616, r19605, r19604)
- Fix: Various improvements of command handling, missing error messages, improper validation causing crashes [CVE-2010-0402] [FS#3748] (r19658, r19657, r19656, r19655, r19654, r19637, r19633, r19621, r19616, r19605, r19604)
- Fix: Industry generation failed for large maps and lots of industry types (r19652, r19643)
- Fix: When a company is sold, move connected clients to spectators [FS#3745] (r19651)
- Fix: A client would not be properly moved when moved while joining, e.g. when entering a company's password. This caused the client to be in the wrong company (according to the rest of the clients) and the client being kicked on the first command [FS#3760] (r19648)
@@ -19,7 +35,7 @@
- Fix: Company related graphs were not updated correctly after changing the company colour [FS#3763] (r19615)
- Fix: Possible invalid read when server moves client to spectators before he finishes joining [FS#3755] (r19613)
- Fix: Crash when opening a savegame with a waypoint from around 0.4.0 [FS#3756] (r19612)
- Fix: Improve joining behaviour; kicking clients when entering passwords that was just cleared, 'connection lost' for people failing the password (r19610, r19609, r19608, r19607, r19606)
- Fix: Improve joining behaviour; kicking clients when entering passwords that was just cleared, 'connection lost' for people failing the password, access restriction circumvention [CVE-2010-0401] [FS#3754] (r19610, r19609, r19608, r19607, r19606)
- Fix: Desync debugging; false positives in the cache validity checks and saving/loading the command stream (r19619, r19617, r19602, r19601, r19600, r19596, r19593, r19592, r19589, r19587, r19586)
- Fix: Presence of online content was not properly updated after download due to duplicate slashes in the path (r19600)
- Fix: [NewGRF] Setting industry prop 0x24 to 0 caused empty station names (r19590)

View File

@@ -11,7 +11,7 @@ log() {
}
set_default() {
released_version=""
released_version="1.0.1"
ignore_extra_parameters="0"
# We set all kinds of defaults for params. Later on the user can override
@@ -55,8 +55,8 @@ set_default() {
enable_static="1"
enable_translator="0"
enable_unicode="1"
enable_assert="1"
enable_strip="0"
enable_assert="0"
enable_strip="1"
enable_universal="1"
enable_osx_g5="0"
enable_cocoa_quartz="1"

View File

@@ -1,6 +1,6 @@
OpenTTD's known bugs
Last updated: 2010-04-17
Release version: 1.0.1-RC1
Last updated: 2010-05-01
Release version: 1.0.1
------------------------------------------------------------------------
@@ -175,11 +175,3 @@ OpenTTD not properly resizing with SDL on X [FS#3305]
Window managers that are known to exhibit this behaviour are KDE's
and GNOME's. With the XFCE's and LXDE's window managers the resize
event is sent when the user releases the mouse.
Content files not properly extracted with zlib 1.2.3.5-1.2.4 [FS#3753]
With zlib 1.2.3.5 up to and including 1.2.4 the function "gzeof",
which tells when we read the whole file, is broken in such a way
that OpenTTD thinks it has extracted and written the whole file
while the last few hundred/thousand bytes are not extracted yet.
This causes problems for everything that is downloaded from the
online content system when using one of those versions of zlib.

View File

@@ -1,3 +1,15 @@
openttd (1.0.1-0) unstable; urgency=low
* New upstream release 1.0.1
-- Matthijs Kooijman <matthijs@stdin.nl> Sat, 01 May 2010 00:00:00 +0200
openttd (1.0.1~rc2-0) unstable; urgency=low
* New upstream release 1.0.1-RC2
-- Matthijs Kooijman <matthijs@stdin.nl> Wed, 21 Apr 2010 21:36:21 +0200
openttd (1.0.1~rc1-0) unstable; urgency=low
* New upstream release 1.0.1-RC1

View File

@@ -1,6 +1,6 @@
@echo off
set OPENTTD_VERSION=1.0.0
set OPENTTD_VERSION=1.0.1
set OPENSFX_VERSION=0.8.0
set NOSOUND_VERSION=0.8.0
set OPENGFX_VERSION=0.7.0

View File

@@ -2,8 +2,8 @@
!define APPV_MAJOR 1
!define APPV_MINOR 0
!define APPV_MAINT 1
!define APPV_BUILD 0
!define APPV_EXTRA "-RC1"
!define APPV_BUILD 2
!define APPV_EXTRA ""
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version

View File

@@ -39,6 +39,7 @@ Sub UpdateFiles(version)
modified = Mid(version, InStrRev(version, Chr(9)) + 1)
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
Else
version = "1.0.1"
revision = 0
modified = 1
End If

View File

@@ -60,7 +60,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -273,7 +273,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"

View File

@@ -60,7 +60,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -273,7 +273,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"

View File

@@ -61,7 +61,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -271,7 +271,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"

View File

@@ -61,7 +61,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -271,7 +271,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"

View File

@@ -1,6 +1,6 @@
OpenTTD README
Last updated: 2010-04-17
Release version: 1.0.1-RC1
Last updated: 2010-05-01
Release version: 1.0.1
------------------------------------------------------------------------

View File

@@ -108,10 +108,11 @@ struct BaseSet {
* Read the set information from a loaded ini.
* @param ini the ini to read from
* @param path the path to this ini file (for filenames)
* @param full_filename the full filename of the loaded file (for error reporting purposes)
* @param allow_empty_filename empty filenames are valid
* @return true if loading was successful.
*/
bool FillSetDetails(IniFile *ini, const char *path, bool allow_empty_filename = true);
bool FillSetDetails(IniFile *ini, const char *path, const char *full_filename, bool allow_empty_filename = true);
/**
* Get the description for the given ISO code.
@@ -238,7 +239,7 @@ enum GraphicsFileType {
struct GraphicsSet : BaseSet<GraphicsSet, MAX_GFT, DATA_DIR> {
PaletteType palette; ///< Palette of this graphics set
bool FillSetDetails(struct IniFile *ini, const char *path);
bool FillSetDetails(struct IniFile *ini, const char *path, const char *full_filename);
};
/** All data/functions related with replacing the base graphics. */
@@ -276,7 +277,7 @@ struct MusicSet : BaseSet<MusicSet, NUM_SONGS_AVAILABLE, GM_DIR> {
byte track_nr[NUM_SONGS_AVAILABLE];
byte num_available;
bool FillSetDetails(struct IniFile *ini, const char *path);
bool FillSetDetails(struct IniFile *ini, const char *path, const char *full_filename);
};
/** All data/functions related with replacing the base music */

View File

@@ -25,12 +25,13 @@ template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::availab
#define fetch_metadata(name) \
item = metadata->GetItem(name, false); \
if (item == NULL || StrEmpty(item->value)) { \
DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing", name); \
DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing.", name); \
DEBUG(grf, 0, " Is %s readable for the user running OpenTTD?", full_filename); \
return false; \
}
template <class T, size_t Tnum_files, Subdirectory Tsubdir>
bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *path, bool allow_empty_filename)
bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *path, const char *full_filename, bool allow_empty_filename)
{
memset(this, 0, sizeof(*this));
@@ -70,7 +71,7 @@ bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *p
/* Find the filename first. */
item = files->GetItem(BaseSet<T, Tnum_files, Tsubdir>::file_names[i], false);
if (item == NULL || (item->value == NULL && !allow_empty_filename)) {
DEBUG(grf, 0, "No " SET_TYPE " file for: %s", BaseSet<T, Tnum_files, Tsubdir>::file_names[i]);
DEBUG(grf, 0, "No " SET_TYPE " file for: %s (in %s)", BaseSet<T, Tnum_files, Tsubdir>::file_names[i], full_filename);
return false;
}
@@ -88,7 +89,7 @@ bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *p
/* Then find the MD5 checksum */
item = md5s->GetItem(filename, false);
if (item == NULL) {
DEBUG(grf, 0, "No MD5 checksum specified for: %s", filename);
DEBUG(grf, 0, "No MD5 checksum specified for: %s (in %s)", filename, full_filename);
return false;
}
char *c = item->value;
@@ -101,7 +102,7 @@ bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *p
} else if ('A' <= *c && *c <= 'F') {
j = *c - 'A' + 10;
} else {
DEBUG(grf, 0, "Malformed MD5 checksum specified for: %s", filename);
DEBUG(grf, 0, "Malformed MD5 checksum specified for: %s (in %s)", filename, full_filename);
return false;
}
if (i % 2 == 0) {
@@ -155,7 +156,7 @@ bool BaseMedia<Tbase_set>::AddFile(const char *filename, size_t basepath_length)
*path = '\0';
}
if (set->FillSetDetails(ini, path)) {
if (set->FillSetDetails(ini, path, filename)) {
Tbase_set *duplicate = NULL;
for (Tbase_set *c = BaseMedia<Tbase_set>::available_sets; c != NULL; c = c->next) {
if (strcmp(c->name, set->name) == 0 || c->shortname == set->shortname) {

View File

@@ -989,7 +989,7 @@ DEF_CONSOLE_CMD(ConRestart)
/* Don't copy the _newgame pointers to the real pointers, so call SwitchToMode directly */
_settings_game.game_creation.map_x = MapLogX();
_settings_game.game_creation.map_y = FindFirstBit(MapSizeY());
SwitchToMode(SM_RESTARTGAME);
_switch_mode = SM_RESTARTGAME;
return true;
}

View File

@@ -203,9 +203,9 @@ void GfxLoadSprites()
GfxInitPalettes();
}
bool GraphicsSet::FillSetDetails(IniFile *ini, const char *path)
bool GraphicsSet::FillSetDetails(IniFile *ini, const char *path, const char *full_filename)
{
bool ret = this->BaseSet<GraphicsSet, MAX_GFT, DATA_DIR>::FillSetDetails(ini, path, false);
bool ret = this->BaseSet<GraphicsSet, MAX_GFT, DATA_DIR>::FillSetDetails(ini, path, full_filename, false);
if (ret) {
IniGroup *metadata = ini->GetGroup("metadata");
IniItem *item;
@@ -213,7 +213,7 @@ bool GraphicsSet::FillSetDetails(IniFile *ini, const char *path)
fetch_metadata("palette");
this->palette = (*item->value == 'D' || *item->value == 'd') ? PAL_DOS : PAL_WINDOWS;
}
return true;
return ret;
}

View File

@@ -57,9 +57,9 @@ template <class Tbase_set>
return BaseMedia<Tbase_set>::used_set != NULL;
}
bool MusicSet::FillSetDetails(IniFile *ini, const char *path)
bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_filename)
{
bool ret = this->BaseSet<MusicSet, NUM_SONGS_AVAILABLE, GM_DIR>::FillSetDetails(ini, path);
bool ret = this->BaseSet<MusicSet, NUM_SONGS_AVAILABLE, GM_DIR>::FillSetDetails(ini, path, full_filename);
if (ret) {
this->num_available = 0;
IniGroup *names = ini->GetGroup("names");
@@ -93,5 +93,5 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path)
this->num_available++;
}
}
return true;
return ret;
}

View File

@@ -85,6 +85,7 @@ enum ClientStatus {
STATUS_DONE_MAP, ///< The client has downloaded the map
STATUS_PRE_ACTIVE, ///< The client is catching up the delayed frames
STATUS_ACTIVE, ///< The client is active within in the game
STATUS_END ///< Must ALWAYS be on the end of this list!! (period)
};
class NetworkClientSocket;

View File

@@ -453,8 +453,6 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
if (MY_CLIENT->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST;
if (!Company::IsValidID(playas)) playas = COMPANY_SPECTATOR;
ci = NetworkFindClientInfoFromClientID(client_id);
if (ci != NULL) {
if (playas == ci->client_playas && strcmp(name, ci->client_name) != 0) {
@@ -467,7 +465,7 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
/* Make sure we're in the company the server tells us to be in,
* for the rare case that we get moved while joining. */
if (client_id == _network_own_client_id) SetLocalCompany(playas);
if (client_id == _network_own_client_id) SetLocalCompany(!Company::IsValidID(playas) ? COMPANY_SPECTATOR : playas);
ci->client_playas = playas;
strecpy(ci->client_name, name, lastof(ci->client_name));

View File

@@ -373,19 +373,38 @@ static bool GunzipFile(const ContentInfo *ci)
if (fin == NULL || fout == NULL) {
ret = false;
goto exit;
}
byte buff[8192];
while (!gzeof(fin)) {
int read = gzread(fin, buff, sizeof(buff));
if (read < 0 || (size_t)read != fwrite(buff, 1, read, fout)) {
ret = false;
break;
} else {
byte buff[8192];
while (1) {
int read = gzread(fin, buff, sizeof(buff));
if (read == 0) {
/* If gzread() returns 0, either the end-of-file has been
* reached or an underlying read error has occurred.
*
* gzeof() can't be used, because:
* 1.2.5 - it is safe, 1 means 'everything was OK'
* 1.2.3.5, 1.2.4 - 0 or 1 is returned 'randomly'
* 1.2.3.3 - 1 is returned for truncated archive
*
* So we use gzerror(). When proper end of archive
* has been reached, then:
* errnum == Z_STREAM_END in 1.2.3.3,
* errnum == 0 in 1.2.4 and 1.2.5 */
int errnum;
gzerror(fin, &errnum);
if (errnum != 0 && errnum != Z_STREAM_END) ret = false;
break;
}
if (read < 0 || (size_t)read != fwrite(buff, 1, read, fout)) {
/* If gzread() returns -1, there was an error in archive */
ret = false;
break;
}
/* DO NOT DO THIS! It will fail to detect broken archive with 1.2.3.3!
* if (read < sizeof(buff)) break; */
}
}
exit:
if (fin != NULL) {
/* Closes ftmp too! */
gzclose(fin);

View File

@@ -322,7 +322,7 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP)
* nothing
*/
static FILE *file_pointer;
static FILE *file_pointer = NULL;
static uint sent_packets; // How many packets we did send succecfully last time
if (cs->status < STATUS_AUTHORIZED) {
@@ -337,9 +337,12 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP)
/* Make a dump of the current game */
if (SaveOrLoad(filename, SL_SAVE, AUTOSAVE_DIR) != SL_OK) usererror("network savedump failed");
file_pointer = FioFOpenFile(filename, "rb", AUTOSAVE_DIR);
fseek(file_pointer, 0, SEEK_END);
if (file_pointer != NULL) fclose(file_pointer);
file_pointer = FioFOpenFile(filename, "rb", AUTOSAVE_DIR);
if (file_pointer == NULL) usererror("network savedump failed - could not open just saved dump");
fseek(file_pointer, 0, SEEK_END);
if (ftell(file_pointer) == 0) usererror("network savedump failed - zero sized savegame?");
/* Now send the _frame_counter and how many packets are coming */
@@ -382,6 +385,7 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP)
* to send it is ready (maybe that happens like never ;)) */
cs->status = STATUS_DONE_MAP;
fclose(file_pointer);
file_pointer = NULL;
NetworkClientSocket *new_cs;
bool new_map_client = false;
@@ -1703,7 +1707,8 @@ void NetworkServerShowStatusToConsole()
{
static const char * const stat_str[] = {
"inactive",
"authorizing",
"authorizing (server password)",
"authorizing (company password)",
"authorized",
"waiting",
"loading map",
@@ -1711,6 +1716,7 @@ void NetworkServerShowStatusToConsole()
"ready",
"active"
};
assert_compile(lengthof(stat_str) == STATUS_END);
NetworkClientSocket *cs;
FOR_ALL_CLIENT_SOCKETS(cs) {

View File

@@ -1208,8 +1208,6 @@ void StateGameLoop()
CallWindowTickEvent();
NewsLoop();
} else {
CheckCaches();
if (_debug_desync_level > 2 && _date_fract == 0 && (_date & 0x1F) == 0) {
/* Save the desync savegame if needed. */
char name[MAX_PATH];
@@ -1217,6 +1215,8 @@ void StateGameLoop()
SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR);
}
CheckCaches();
/* All these actions has to be done from OWNER_NONE
* for multiplayer compatibility */
CompanyID old_company = _current_company;

View File

@@ -79,8 +79,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,!!REVISION!!
PRODUCTVERSION 1,0,0,!!REVISION!!
FILEVERSION 1,0,1,19742
PRODUCTVERSION 1,0,1,19742
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -98,14 +98,14 @@ BEGIN
VALUE "Comments", "This program is licensed under the GNU General Public License version 2.\0"
VALUE "CompanyName", "OpenTTD Development Team\0"
VALUE "FileDescription", "OpenTTD\0"
VALUE "FileVersion", "Development !!VERSION!!\0"
VALUE "FileVersion", "1.0.1\0"
VALUE "InternalName", "openttd\0"
VALUE "LegalCopyright", "Copyright \xA9 OpenTTD Developers 2002-2010. All Rights Reserved.\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "openttd.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "OpenTTD\0"
VALUE "ProductVersion", "Development !!VERSION!!\0"
VALUE "ProductVersion", "1.0.1\0"
VALUE "SpecialBuild", "-\0"
END
END

View File

@@ -27,7 +27,7 @@
* norev000 is for non-releases that are made on systems without
* subversion or sources that are not a checkout of subversion.
*/
const char _openttd_revision[] = "!!VERSION!!";
const char _openttd_revision[] = "1.0.1";
/**
* The text version of OpenTTD's build date.
@@ -60,11 +60,11 @@ const byte _openttd_revision_modified = !!MODIFIED!!;
* final release will always have a lower version number than the released
* version, thus making comparisions on specific revisions easy.
*/
const uint32 _openttd_newgrf_version = 1 << 28 | 0 << 24 | 0 << 20 | 0 << 19 | (!!REVISION!! & ((1 << 19) - 1));
const uint32 _openttd_newgrf_version = 1 << 28 | 0 << 24 | 1 << 20 | 1 << 19 | (19742 & ((1 << 19) - 1));
#ifdef __MORPHOS__
/**
* Variable used by MorphOS to show the version.
*/
extern const char morphos_versions_tag[] = "$VER: OpenTTD !!VERSION!! (!!DATE!!) OpenTTD Team [MorphOS, PowerPC]";
extern const char morphos_versions_tag[] = "$VER: OpenTTD 1.0.1 (!!DATE!!) OpenTTD Team [MorphOS, PowerPC]";
#endif

View File

@@ -66,9 +66,11 @@ enum RoadBits {
ROAD_S = ROAD_SE | ROAD_SW, ///< Road at the two southern edges
ROAD_W = ROAD_NW | ROAD_SW, ///< Road at the two western edges
ROAD_ALL = ROAD_X | ROAD_Y ///< Full 4-way crossing
ROAD_ALL = ROAD_X | ROAD_Y, ///< Full 4-way crossing
ROAD_END = ROAD_ALL + 1 ///< Out-of-range roadbits, used for iterations
};
DECLARE_ENUM_AS_BIT_SET(RoadBits);
template <> struct EnumPropsT<RoadBits> : MakeEnumPropsT<RoadBits, byte, ROAD_NONE, ROAD_ALL, ROAD_NONE, 4> {};
template <> struct EnumPropsT<RoadBits> : MakeEnumPropsT<RoadBits, byte, ROAD_NONE, ROAD_END, ROAD_NONE, 4> {};
#endif /* ROAD_TYPE_H */

View File

@@ -73,7 +73,7 @@ void MoveWaypointsToBaseStations()
if (wp->delete_ctr != 0) continue; // The waypoint was deleted
/* Waypoint indices were not added to the map prior to this. */
_m[wp->xy].m2 = wp->index;
_m[wp->xy].m2 = (StationID)wp->index;
if (HasBit(_m[wp->xy].m3, 4)) {
wp->spec = GetCustomStationSpec(STAT_CLASS_WAYP, _m[wp->xy].m4 + 1);

View File

@@ -481,7 +481,7 @@ int Train::GetCurrentMaxSpeed() const
int st_max_speed = 120;
int delta_v = this->cur_speed / (distance_to_go + 1);
if (this->max_speed > (this->cur_speed - delta_v)) {
if (max_speed > (this->cur_speed - delta_v)) {
st_max_speed = this->cur_speed - (delta_v / 10);
}

View File

@@ -41,10 +41,10 @@ enum TreeType {
* got two types of area, one for normal trees and one only for cacti.
*/
enum {
TREE_COUNT_TEMPERATE = TREE_SUB_ARCTIC - TREE_TEMPERATE, ///< number of treetypes on a temperate map
TREE_COUNT_SUB_ARCTIC = TREE_RAINFOREST - TREE_SUB_ARCTIC, ///< number of treetypes on a sub arctic map
TREE_COUNT_RAINFOREST = TREE_CACTUS - TREE_RAINFOREST, ///< number of treetypes for the 'green part' of a sub tropic map
TREE_COUNT_SUB_TROPICAL = TREE_SUB_TROPICAL - TREE_CACTUS, ///< number of treetypes for the 'desert part' of a sub tropic map
TREE_COUNT_TEMPERATE = TREE_SUB_ARCTIC - TREE_TEMPERATE, ///< number of treetypes on a temperate map
TREE_COUNT_SUB_ARCTIC = TREE_RAINFOREST - TREE_SUB_ARCTIC, ///< number of treetypes on a sub arctic map
TREE_COUNT_RAINFOREST = TREE_CACTUS - TREE_RAINFOREST, ///< number of treetypes for the 'rainforrest part' of a sub-tropic map
TREE_COUNT_SUB_TROPICAL = TREE_TOYLAND - TREE_SUB_TROPICAL, ///< number of treetypes for the 'sub-tropic part' of a sub-tropic map
TREE_COUNT_TOYLAND = 9 ///< number of treetypes on a toyland map
};