|
@@ -3,26 +3,24 @@
|
|
|
/*
|
|
|
* 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 {
|
|
|
private:
|
|
|
struct PacketReader *savegame; ///< Packet reader for reading the savegame.
|
|
|
byte token; ///< The token we need to send back to the server to prove we're the right client.
|
|
|
|
|
|
/** Status of the connection with the server. */
|
|
|
enum ServerStatus {
|
|
|
STATUS_INACTIVE, ///< The client is not connected nor active.
|
|
|
STATUS_COMPANY_INFO, ///< We are trying to get company information.
|
|
@@ -109,15 +107,13 @@ public:
|
|
|
|
|
|
/** Helper to make the code look somewhat nicer. */
|
|
|
typedef ClientNetworkGameSocketHandler MyClient;
|
|
|
|
|
|
void NetworkClient_Connected();
|
|
|
void NetworkClientSetCompanyPassword(const char *password);
|
|
|
|
|
|
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 */
|