tron@2186: /* $Id$ */ tron@2186: truelight@543: #ifndef NETWORK_SERVER_H truelight@543: #define NETWORK_SERVER_H truelight@543: truelight@543: #ifdef ENABLE_NETWORK truelight@543: truelight@543: DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP); truelight@716: DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR_QUIT)(NetworkClientState *cs, uint16 client_index, NetworkErrorCode errorno); truelight@716: DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR)(NetworkClientState *cs, NetworkErrorCode error); truelight@543: DEF_SERVER_SEND_COMMAND(PACKET_SERVER_SHUTDOWN); truelight@543: DEF_SERVER_SEND_COMMAND(PACKET_SERVER_NEWGAME); truelight@1026: DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientState *cs, uint16 color, const char *command); truelight@543: truelight@543: bool NetworkFindName(char new_name[NETWORK_NAME_LENGTH]); truelight@839: void NetworkServer_HandleChat(NetworkAction action, DestType desttype, int dest, const char *msg, uint16 from_index); truelight@543: truelight@716: bool NetworkServer_ReadPackets(NetworkClientState *cs); ludde@2235: void NetworkServer_Tick(bool send_frame); truelight@716: void NetworkServerMonthlyLoop(void); truelight@785: void NetworkServerYearlyLoop(void); truelight@543: tron@2548: static inline const char* GetPlayerIP(const NetworkClientInfo* ci) tron@2548: { tron@2548: return inet_ntoa(*(const struct in_addr*)&ci->client_ip); tron@2548: } Darkvater@2538: truelight@543: #endif /* ENABLE_NETWORK */ truelight@543: Darkvater@2436: #endif /* NETWORK_SERVER_H */