Files
@ r16268:9d6002e1debb
Branch filter:
Location: cpp/openttd-patchpack/source/src/network/network_client.h - annotation
r16268:9d6002e1debb
3.8 KiB
text/x-c
(svn r20979) -Fix: [NewGRF] ignore the variable for action7/9 condition type 0x0D and 0x0E as documented
r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r9111:983de9c5a848 r9111:983de9c5a848 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r14248:a9050881acd7 r14248:a9050881acd7 r16212:9367327f6880 r16224:976f6278a22b r16213:0b4dd45d6d32 r16224:976f6278a22b r16255:08842c21f00b r16214:7fd822f2f61a r16214:7fd822f2f61a r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16213:0b4dd45d6d32 r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16212:9367327f6880 r16212:9367327f6880 r16214:7fd822f2f61a r16214:7fd822f2f61a r16218:1e9669cfbb04 r16222:694bed5fd015 r16218:1e9669cfbb04 r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16214:7fd822f2f61a r16222:694bed5fd015 r16222:694bed5fd015 r16222:694bed5fd015 r16222:694bed5fd015 r16212:9367327f6880 r16212:9367327f6880 r16214:7fd822f2f61a r5475:3f5cd13d1b63 r6247:96e840dbefcc r5475:3f5cd13d1b63 r11951:a522cb996935 r11951:a522cb996935 r12134:0a6111a3288d r12134:0a6111a3288d r12134:0a6111a3288d r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 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 network_client.h Client part of the network protocol. */
#ifndef NETWORK_CLIENT_H
#define NETWORK_CLIENT_H
#ifdef ENABLE_NETWORK
#include "network_internal.h"
/** Class for handling the client side of the game connection. */
class ClientNetworkGameSocketHandler : public ZeroedMemoryAllocator, public NetworkGameSocketHandler {
protected:
friend void NetworkExecuteLocalCommandQueue();
friend void NetworkClose(bool close_admins);
static ClientNetworkGameSocketHandler *my_client;
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_FULL);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_BANNED);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_ERROR);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_COMPANY_INFO);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_NEED_GAME_PASSWORD);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_NEED_COMPANY_PASSWORD);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_WELCOME);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_WAIT);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MAP);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_JOIN);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_FRAME);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_SYNC);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_COMMAND);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_CHAT);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_QUIT);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_ERROR_QUIT);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_SHUTDOWN);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_NEWGAME);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_RCON);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_CHECK_NEWGRFS);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_MOVE);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_COMPANY_UPDATE);
DECLARE_GAME_RECEIVE_COMMAND(PACKET_SERVER_CONFIG_UPDATE);
static NetworkRecvStatus SendNewGRFsOk();
static NetworkRecvStatus SendGetMap();
static NetworkRecvStatus SendMapOk();
public:
ClientNetworkGameSocketHandler(SOCKET s);
~ClientNetworkGameSocketHandler();
NetworkRecvStatus CloseConnection(NetworkRecvStatus status);
void ClientError(NetworkRecvStatus res);
static NetworkRecvStatus SendCompanyInformationQuery();
static NetworkRecvStatus SendJoin();
static NetworkRecvStatus SendCommand(const CommandPacket *cp);
static NetworkRecvStatus SendError(NetworkErrorCode errorno);
static NetworkRecvStatus SendQuit();
static NetworkRecvStatus SendAck();
static NetworkRecvStatus SendGamePassword(const char *password);
static NetworkRecvStatus SendCompanyPassword(const char *password);
static NetworkRecvStatus SendChat(NetworkAction action, DestType type, int dest, const char *msg, int64 data);
static NetworkRecvStatus SendSetPassword(const char *password);
static NetworkRecvStatus SendSetName(const char *name);
static NetworkRecvStatus SendRCon(const char *password, const char *command);
static NetworkRecvStatus SendMove(CompanyID company, const char *password);
static void Send();
static bool Receive();
static bool GameLoop();
};
typedef ClientNetworkGameSocketHandler MyClient;
void NetworkClient_Connected();
extern CompanyID _network_join_as;
extern const char *_network_join_server_password;
extern const char *_network_join_company_password;
#endif /* ENABLE_NETWORK */
#endif /* NETWORK_CLIENT_H */
|