2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
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);
|
2004-12-19 10:17:26 +00:00
|
|
|
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR_QUIT)(NetworkClientState *cs, uint16 client_index, NetworkErrorCode errorno);
|
|
|
|
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR)(NetworkClientState *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);
|
2005-01-15 20:09:16 +00:00
|
|
|
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientState *cs, uint16 color, const char *command);
|
2004-12-04 17:54:56 +00:00
|
|
|
|
|
|
|
bool NetworkFindName(char new_name[NETWORK_NAME_LENGTH]);
|
2005-01-01 16:34:54 +00:00
|
|
|
void NetworkServer_HandleChat(NetworkAction action, DestType desttype, int dest, const char *msg, uint16 from_index);
|
2004-12-04 17:54:56 +00:00
|
|
|
|
2004-12-19 10:17:26 +00:00
|
|
|
bool NetworkServer_ReadPackets(NetworkClientState *cs);
|
2005-07-29 21:55:49 +00:00
|
|
|
void NetworkServer_Tick(bool send_frame);
|
2004-12-19 10:17:26 +00:00
|
|
|
void NetworkServerMonthlyLoop(void);
|
2004-12-23 17:37:26 +00:00
|
|
|
void NetworkServerYearlyLoop(void);
|
2004-12-04 17:54:56 +00:00
|
|
|
|
2005-10-22 06:39:32 +00:00
|
|
|
static inline const char* GetPlayerIP(const NetworkClientInfo* ci)
|
|
|
|
{
|
|
|
|
return inet_ntoa(*(const struct in_addr*)&ci->client_ip);
|
|
|
|
}
|
2005-10-19 19:38:35 +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 */
|