# network_server.h

Go to the documentation of this file.

    00001 /* $Id: network_server.h 18809 2010-01-15 16:41:15Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef NETWORK_SERVER_H
    00013 #define NETWORK_SERVER_H
    00014
    00015 #ifdef ENABLE_NETWORK
    00016
    00017 #include "network_internal.h"
    00018
    00019 DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP);
    00020 DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR_QUIT)(NetworkClientSocket *cs, ClientID client_id, NetworkErrorCode errorno);
    00021 DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR)(NetworkClientSocket *cs, NetworkErrorCode error);
    00022 DEF_SERVER_SEND_COMMAND(PACKET_SERVER_SHUTDOWN);
    00023 DEF_SERVER_SEND_COMMAND(PACKET_SERVER_NEWGAME);
    00024 DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientSocket *cs, uint16 colour, const char *command);
    00025 DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_MOVE)(NetworkClientSocket *cs, uint16 client_id, CompanyID company_id);
    00026
    00027 void NetworkServer_ReadPackets(NetworkClientSocket *cs);
    00028 void NetworkServer_Tick(bool send_frame);
    00029
    00030 #else /* ENABLE_NETWORK */
    00031 /* Network function stubs when networking is disabled */
    00032
    00033 static inline void NetworkServerMonthlyLoop() {}
    00034 static inline void NetworkServerYearlyLoop() {}
    00035
    00036 #endif /* ENABLE_NETWORK */
    00037
    00038 #endif /* NETWORK_SERVER_H */