network_server.h

Go to the documentation of this file.
00001 /* $Id: network_server.h 17617 2009-09-22 20:44:14Z 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 DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP);
00018 DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR_QUIT)(NetworkClientSocket *cs, ClientID client_id, NetworkErrorCode errorno);
00019 DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR)(NetworkClientSocket *cs, NetworkErrorCode error);
00020 DEF_SERVER_SEND_COMMAND(PACKET_SERVER_SHUTDOWN);
00021 DEF_SERVER_SEND_COMMAND(PACKET_SERVER_NEWGAME);
00022 DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientSocket *cs, uint16 colour, const char *command);
00023 DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_MOVE)(NetworkClientSocket *cs, uint16 client_id, CompanyID company_id);
00024 
00025 void NetworkServer_ReadPackets(NetworkClientSocket *cs);
00026 void NetworkServer_Tick(bool send_frame);
00027 
00028 #else /* ENABLE_NETWORK */
00029 /* Network function stubs when networking is disabled */
00030 
00031 static inline void NetworkServerMonthlyLoop() {}
00032 static inline void NetworkServerYearlyLoop() {}
00033 
00034 #endif /* ENABLE_NETWORK */
00035 
00036 #endif /* NETWORK_SERVER_H */

Generated on Tue Jan 5 21:02:55 2010 for OpenTTD by  doxygen 1.5.6