src/network/network_server.h
author peter1138
Sun, 03 Aug 2008 17:35:08 +0000
changeset 9834 7474149531c1
parent 9428 1ba05b499957
permissions -rw-r--r--
(svn r13977) -Codechange: Let ResizeWindowForWidget() handle hidden (zero height or zero width) widgets.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1026
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1026
diff changeset
     2
9111
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 6247
diff changeset
     3
/** @file network_server.h Server part of the network protocol. */
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 6247
diff changeset
     4
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     5
#ifndef NETWORK_SERVER_H
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     6
#define NETWORK_SERVER_H
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     7
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     8
#ifdef ENABLE_NETWORK
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     9
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    10
DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP);
5624
6afe9d27430a (svn r8083) -Codechange: make a NetworkSocketHandler as base for all sockets and move a little of NetworkClientState functionality to the NetworkSocketHandler. Move the rest of the NetworkClientState to the new NetworkTCPSocketHandler class/struct, which is not yet implemented in an object oriented manner. The UDP socket handler now extends the NetworkSocketHandler instead of having a reference to a NetworkClientState.
rubidium
parents: 5475
diff changeset
    11
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR_QUIT)(NetworkTCPSocketHandler *cs, uint16 client_index, NetworkErrorCode errorno);
6afe9d27430a (svn r8083) -Codechange: make a NetworkSocketHandler as base for all sockets and move a little of NetworkClientState functionality to the NetworkSocketHandler. Move the rest of the NetworkClientState to the new NetworkTCPSocketHandler class/struct, which is not yet implemented in an object oriented manner. The UDP socket handler now extends the NetworkSocketHandler instead of having a reference to a NetworkClientState.
rubidium
parents: 5475
diff changeset
    12
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR)(NetworkTCPSocketHandler *cs, NetworkErrorCode error);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    13
DEF_SERVER_SEND_COMMAND(PACKET_SERVER_SHUTDOWN);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    14
DEF_SERVER_SEND_COMMAND(PACKET_SERVER_NEWGAME);
5624
6afe9d27430a (svn r8083) -Codechange: make a NetworkSocketHandler as base for all sockets and move a little of NetworkClientState functionality to the NetworkSocketHandler. Move the rest of the NetworkClientState to the new NetworkTCPSocketHandler class/struct, which is not yet implemented in an object oriented manner. The UDP socket handler now extends the NetworkSocketHandler instead of having a reference to a NetworkClientState.
rubidium
parents: 5475
diff changeset
    15
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkTCPSocketHandler *cs, uint16 color, const char *command);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    16
5624
6afe9d27430a (svn r8083) -Codechange: make a NetworkSocketHandler as base for all sockets and move a little of NetworkClientState functionality to the NetworkSocketHandler. Move the rest of the NetworkClientState to the new NetworkTCPSocketHandler class/struct, which is not yet implemented in an object oriented manner. The UDP socket handler now extends the NetworkSocketHandler instead of having a reference to a NetworkClientState.
rubidium
parents: 5475
diff changeset
    17
bool NetworkServer_ReadPackets(NetworkTCPSocketHandler *cs);
2235
7630c38913fd (svn r2755) Fix: Fix a desync issue with autoreplace
ludde
parents: 2186
diff changeset
    18
void NetworkServer_Tick(bool send_frame);
2538
2e9c118c5e93 (svn r3067) - Feature: allow unbanning players based on banlist-id (as well as IP).
Darkvater
parents: 2436
diff changeset
    19
4830
668bcb0a30b2 (svn r6754) -Codechange: Remove some #idef ENABLE_NETWORK specific defines. With networking
Darkvater
parents: 4490
diff changeset
    20
#else /* ENABLE_NETWORK */
668bcb0a30b2 (svn r6754) -Codechange: Remove some #idef ENABLE_NETWORK specific defines. With networking
Darkvater
parents: 4490
diff changeset
    21
/* Network function stubs when networking is disabled */
668bcb0a30b2 (svn r6754) -Codechange: Remove some #idef ENABLE_NETWORK specific defines. With networking
Darkvater
parents: 4490
diff changeset
    22
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5624
diff changeset
    23
static inline void NetworkServerMonthlyLoop() {}
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5624
diff changeset
    24
static inline void NetworkServerYearlyLoop() {}
4830
668bcb0a30b2 (svn r6754) -Codechange: Remove some #idef ENABLE_NETWORK specific defines. With networking
Darkvater
parents: 4490
diff changeset
    25
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    26
#endif /* ENABLE_NETWORK */
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    27
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2235
diff changeset
    28
#endif /* NETWORK_SERVER_H */