2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file network_server.h Server part of the network protocol. */
|
|
|
|
|
2004-12-04 17:54:56 +00:00
|
|
|
#ifndef NETWORK_SERVER_H
|
|
|
|
#define NETWORK_SERVER_H
|
|
|
|
|
|
|
|
#ifdef ENABLE_NETWORK
|
|
|
|
|
|
|
|
DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP);
|
2008-12-23 09:47:42 +00:00
|
|
|
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR_QUIT)(NetworkClientSocket *cs, ClientID client_id, NetworkErrorCode errorno);
|
|
|
|
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR)(NetworkClientSocket *cs, NetworkErrorCode error);
|
2004-12-04 17:54:56 +00:00
|
|
|
DEF_SERVER_SEND_COMMAND(PACKET_SERVER_SHUTDOWN);
|
|
|
|
DEF_SERVER_SEND_COMMAND(PACKET_SERVER_NEWGAME);
|
2009-02-09 02:57:15 +00:00
|
|
|
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientSocket *cs, uint16 colour, const char *command);
|
2009-01-23 22:18:06 +00:00
|
|
|
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_MOVE)(NetworkClientSocket *cs, uint16 client_id, CompanyID company_id);
|
2004-12-04 17:54:56 +00:00
|
|
|
|
2008-12-23 09:47:42 +00:00
|
|
|
bool NetworkServer_ReadPackets(NetworkClientSocket *cs);
|
2005-07-29 21:55:49 +00:00
|
|
|
void NetworkServer_Tick(bool send_frame);
|
2005-10-19 19:38:35 +00:00
|
|
|
|
2006-10-12 14:59:27 +00:00
|
|
|
#else /* ENABLE_NETWORK */
|
|
|
|
/* Network function stubs when networking is disabled */
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static inline void NetworkServerMonthlyLoop() {}
|
|
|
|
static inline void NetworkServerYearlyLoop() {}
|
2006-10-12 14:59:27 +00:00
|
|
|
|
2004-12-04 17:54:56 +00:00
|
|
|
#endif /* ENABLE_NETWORK */
|
|
|
|
|
2005-09-18 20:56:44 +00:00
|
|
|
#endif /* NETWORK_SERVER_H */
|