Files
@ r17613:a9b2554a5d79
Branch filter:
Location: cpp/openttd-patchpack/source/src/openttd.h - annotation
r17613:a9b2554a5d79
2.2 KiB
text/x-c
(svn r22387) -Fix-ish [FS#4601]: Windows' recv seems to return "graceful closed" before having passed the remaining buffer which causes OpenTTD to think all connections are "incorrectly" terminated, i.e. without the "I'm leaving" packet from the client. So let the client wait a tiny bit after sending the "I'm leaving" packet and before gracefully closing the connection
r5475:3f5cd13d1b63 r8989:ff553dd7e4c1 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r9111:983de9c5a848 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r11847:235c011992a8 r11847:235c011992a8 r17330:ddf80ef4b607 r11222:f66b1fc27a15 r8121:d05602c69734 r8121:d05602c69734 r11222:f66b1fc27a15 r8121:d05602c69734 r8121:d05602c69734 r17330:ddf80ef4b607 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r12635:3d67c34135d4 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r11223:d5864a79dfb6 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r15173:a59afd6301a6 r12502:8d1b2c0c955a r12502:8d1b2c0c955a r12502:8d1b2c0c955a r12502:8d1b2c0c955a r12502:8d1b2c0c955a r12502:8d1b2c0c955a r6427:94a91cd8da86 r6427:94a91cd8da86 r11222:f66b1fc27a15 r11223:d5864a79dfb6 r8121:d05602c69734 r11847:235c011992a8 r11847:235c011992a8 r11847:235c011992a8 r13520:b28b2da3bc7b r13520:b28b2da3bc7b r13520:b28b2da3bc7b r13520:b28b2da3bc7b r13520:b28b2da3bc7b r13520:b28b2da3bc7b r13607:a7e0aef7f832 r13607:a7e0aef7f832 r13607:a7e0aef7f832 r11847:235c011992a8 r14900:c679fdaeebe6 r11847:235c011992a8 r11847:235c011992a8 r11847:235c011992a8 r11847:235c011992a8 r8121:d05602c69734 r17264:fce9f3d3fb3f r17264:fce9f3d3fb3f r17264:fce9f3d3fb3f r17264:fce9f3d3fb3f r17264:fce9f3d3fb3f r17264:fce9f3d3fb3f r5475:3f5cd13d1b63 | /* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file openttd.h Some generic types. */
#ifndef OPENTTD_H
#define OPENTTD_H
#include "core/enum_type.hpp"
/** Mode which defines the state of the game. */
enum GameMode {
GM_MENU,
GM_NORMAL,
GM_EDITOR,
};
/** Mode which defines what mode we're switching to. */
enum SwitchMode {
SM_NONE,
SM_NEWGAME,
SM_RESTARTGAME,
SM_EDITOR,
SM_LOAD,
SM_MENU,
SM_SAVE,
SM_GENRANDLAND,
SM_LOAD_SCENARIO,
SM_START_HEIGHTMAP,
SM_LOAD_HEIGHTMAP,
};
/* Display Options */
enum DisplayOptions {
DO_SHOW_TOWN_NAMES = 0,
DO_SHOW_STATION_NAMES = 1,
DO_SHOW_SIGNS = 2,
DO_FULL_ANIMATION = 3,
DO_FULL_DETAIL = 5,
DO_SHOW_WAYPOINT_NAMES = 6,
};
extern GameMode _game_mode;
extern SwitchMode _switch_mode;
extern bool _exit_game;
/** Modes of pausing we've got */
enum PauseMode {
PM_UNPAUSED = 0, ///< A normal unpaused game
PM_PAUSED_NORMAL = 1 << 0, ///< A game normally paused
PM_PAUSED_SAVELOAD = 1 << 1, ///< A game paused for saving/loading
PM_PAUSED_JOIN = 1 << 2, ///< A game paused for 'pause_on_join'
PM_PAUSED_ERROR = 1 << 3, ///< A game paused because a (critical) error
PM_PAUSED_ACTIVE_CLIENTS = 1 << 4, ///< A game paused for 'min_active_clients'
/* Pause mode bits when paused for network reasons */
PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
};
DECLARE_ENUM_AS_BIT_SET(PauseMode)
typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
/** The current pause mode */
extern PauseModeByte _pause_mode;
void AskExitGame();
void AskExitToGameMenu();
int ttd_main(int argc, char *argv[]);
void HandleExitGameRequest();
#endif /* OPENTTD_H */
|