src/network/network_data.h
author rubidium
Sun, 25 May 2008 19:17:03 +0000
changeset 9354 845e07db4549
parent 9337 ab6e0234bacc
permissions -rw-r--r--
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
-Codechange: move all Settings into substructs of _settings in a way that they are logically grouped.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1977
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1977
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: 8276
diff changeset
     3
/** @file network_data.h Internal functions. */
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: 8276
diff changeset
     4
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     5
#ifndef NETWORK_DATA_H
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     6
#define NETWORK_DATA_H
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     7
7098
02887279c5fe (svn r10365) -Fix: compiling without png and networking support under MSVC.
rubidium
parents: 6248
diff changeset
     8
#include "../openttd.h"
9337
ab6e0234bacc (svn r13229) -Codechange: replace some global variables that are only initialised once and always with the same value with enums.
rubidium
parents: 9111
diff changeset
     9
#include "../console_type.h"
7098
02887279c5fe (svn r10365) -Fix: compiling without png and networking support under MSVC.
rubidium
parents: 6248
diff changeset
    10
#include "network.h"
8276
245f1b131d64 (svn r11840) -Codechange: split network.h so not everything in there needs to be included when wanting to know whether we are a server.
rubidium
parents: 7098
diff changeset
    11
#include "network_internal.h"
7098
02887279c5fe (svn r10365) -Fix: compiling without png and networking support under MSVC.
rubidium
parents: 6248
diff changeset
    12
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    13
// Is the network enabled?
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    14
#ifdef ENABLE_NETWORK
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    15
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents: 5339
diff changeset
    16
#include "core/os_abstraction.h"
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: 5619
diff changeset
    17
#include "core/core.h"
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents: 5339
diff changeset
    18
#include "core/config.h"
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents: 5339
diff changeset
    19
#include "core/packet.h"
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: 5619
diff changeset
    20
#include "core/tcp.h"
5469
7edfc643abbc (svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents: 5339
diff changeset
    21
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    22
#define MAX_TEXT_MSG_LEN 1024 /* long long long long sentences :-) */
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    23
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    24
// The client-info-server-index is always 1
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    25
#define NETWORK_SERVER_INDEX 1
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    26
#define NETWORK_EMPTY_INDEX 0
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    27
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    28
enum MapPacket {
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    29
	MAP_PACKET_START,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    30
	MAP_PACKET_NORMAL,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    31
	MAP_PACKET_END,
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    32
};
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    33
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    34
enum NetworkErrorCode {
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    35
	NETWORK_ERROR_GENERAL, // Try to use thisone like never
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    36
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    37
	// Signals from clients
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    38
	NETWORK_ERROR_DESYNC,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    39
	NETWORK_ERROR_SAVEGAME_FAILED,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    40
	NETWORK_ERROR_CONNECTION_LOST,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    41
	NETWORK_ERROR_ILLEGAL_PACKET,
5872
63eafeb3f393 (svn r8461) -Feature: check for NewGRF compatability before actually downloading the map from a game server when connecting from the command prompt and internal console.
rubidium
parents: 5624
diff changeset
    42
	NETWORK_ERROR_NEWGRF_MISMATCH,
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    43
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    44
	// Signals from servers
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    45
	NETWORK_ERROR_NOT_AUTHORIZED,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    46
	NETWORK_ERROR_NOT_EXPECTED,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    47
	NETWORK_ERROR_WRONG_REVISION,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    48
	NETWORK_ERROR_NAME_IN_USE,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    49
	NETWORK_ERROR_WRONG_PASSWORD,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    50
	NETWORK_ERROR_PLAYER_MISMATCH, // Happens in CLIENT_COMMAND
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    51
	NETWORK_ERROR_KICKED,
748
fa61195ee8a8 (svn r1204) -Add: [Network] Added some cheaters-protection (money-cheat mostly)
truelight
parents: 722
diff changeset
    52
	NETWORK_ERROR_CHEATER,
2879
365ecd52f2db (svn r3427) - Feature: Allow seeing and setting the maximum amount of companies and spectators for a server. This can be changed/viewed during runtime as well in the console.
Darkvater
parents: 2859
diff changeset
    53
	NETWORK_ERROR_FULL,
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    54
};
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    55
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    56
// Actions that can be used for NetworkTextMessage
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    57
enum NetworkAction {
722
f420fa9bd521 (svn r1174) -Fix: [Network] All strings can now be translated (no more hardcoded strings)
truelight
parents: 716
diff changeset
    58
	NETWORK_ACTION_JOIN,
f420fa9bd521 (svn r1174) -Fix: [Network] All strings can now be translated (no more hardcoded strings)
truelight
parents: 716
diff changeset
    59
	NETWORK_ACTION_LEAVE,
4944
f597859bba38 (svn r6932) -Codechange: Send server messages with format NETWORK_ACTION_SERVER_MESSAGE so it is
Darkvater
parents: 4912
diff changeset
    60
	NETWORK_ACTION_SERVER_MESSAGE,
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    61
	NETWORK_ACTION_CHAT,
4906
935e6280c093 (svn r6876) -Codechange: Change the naming of _PLAYER in DESTTYPE_PLAYER/NETWORK_ACTION_CHAT_PLAYER
Darkvater
parents: 4887
diff changeset
    62
	NETWORK_ACTION_CHAT_COMPANY,
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    63
	NETWORK_ACTION_CHAT_CLIENT,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    64
	NETWORK_ACTION_GIVE_MONEY,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    65
	NETWORK_ACTION_NAME_CHANGE,
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    66
};
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    67
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    68
enum NetworkPasswordType {
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    69
	NETWORK_GAME_PASSWORD,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    70
	NETWORK_COMPANY_PASSWORD,
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    71
};
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    72
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    73
enum DestType {
4887
71da70810c22 (svn r6824) -Feature: Change the functionality of the chat window. SHIFT+ENTER (SHIFT+T)
Darkvater
parents: 4883
diff changeset
    74
	DESTTYPE_BROADCAST, ///< Send message/notice to all players (All)
4906
935e6280c093 (svn r6876) -Codechange: Change the naming of _PLAYER in DESTTYPE_PLAYER/NETWORK_ACTION_CHAT_PLAYER
Darkvater
parents: 4887
diff changeset
    75
	DESTTYPE_TEAM,    ///< Send message/notice to everyone playing the same company (Team)
4887
71da70810c22 (svn r6824) -Feature: Change the functionality of the chat window. SHIFT+ENTER (SHIFT+T)
Darkvater
parents: 4883
diff changeset
    76
	DESTTYPE_CLIENT,    ///< Send message/notice to only a certain player (Private)
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    77
};
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    78
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    79
// following externs are instantiated at network.cpp
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    80
extern CommandPacket *_local_command_queue;
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    81
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    82
// Here we keep track of the clients
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    83
//  (and the client uses [0] for his own communication)
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: 5619
diff changeset
    84
extern NetworkTCPSocketHandler _clients[MAX_CLIENTS];
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    85
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    86
#define DEREF_CLIENT(i) (&_clients[i])
716
8af847728d5b (svn r1168) -Cleanup: [Network] Cleaned the network code a bit. Added 'const'
truelight
parents: 668
diff changeset
    87
// This returns the NetworkClientInfo from a NetworkClientState
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    88
#define DEREF_CLIENT_INFO(cs) (&_network_client_info[cs - _clients])
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    89
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    90
// Macros to make life a bit more easier
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    91
#define DEF_CLIENT_RECEIVE_COMMAND(type) NetworkRecvStatus NetworkPacketReceive_ ## type ## _command(Packet *p)
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5872
diff changeset
    92
#define DEF_CLIENT_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command()
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    93
#define DEF_CLIENT_SEND_COMMAND_PARAM(type) void NetworkPacketSend_ ## type ## _command
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: 5619
diff changeset
    94
#define DEF_SERVER_RECEIVE_COMMAND(type) void NetworkPacketReceive_ ## type ## _command(NetworkTCPSocketHandler *cs, Packet *p)
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: 5619
diff changeset
    95
#define DEF_SERVER_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command(NetworkTCPSocketHandler *cs)
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    96
#define DEF_SERVER_SEND_COMMAND_PARAM(type) void NetworkPacketSend_ ## type ## _command
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    97
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    98
#define SEND_COMMAND(type) NetworkPacketSend_ ## type ## _command
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    99
#define RECEIVE_COMMAND(type) NetworkPacketReceive_ ## type ## _command
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   100
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: 5619
diff changeset
   101
#define FOR_ALL_CLIENTS(cs) for (cs = _clients; cs != endof(_clients) && cs->IsConnected(); cs++)
4883
c9c7d15c0b0b (svn r6820) -Codechange: Some more const correctness, coding style.
Darkvater
parents: 4880
diff changeset
   102
#define FOR_ALL_ACTIVE_CLIENT_INFOS(ci) for (ci = _network_client_info; ci != endof(_network_client_info); ci++) if (ci->client_index != NETWORK_EMPTY_INDEX)
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   103
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   104
void NetworkExecuteCommand(CommandPacket *cp);
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: 5619
diff changeset
   105
void NetworkAddCommandQueue(NetworkTCPSocketHandler *cs, CommandPacket *cp);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   106
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   107
// from network.c
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: 5619
diff changeset
   108
void NetworkCloseClient(NetworkTCPSocketHandler *cs);
9337
ab6e0234bacc (svn r13229) -Codechange: replace some global variables that are only initialised once and always with the same value with enums.
rubidium
parents: 9111
diff changeset
   109
void CDECL NetworkTextMessage(NetworkAction action, ConsoleColour color, bool self_send, const char *name, const char *str, ...);
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: 5619
diff changeset
   110
void NetworkGetClientName(char *clientname, size_t size, const NetworkTCPSocketHandler *cs);
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: 5619
diff changeset
   111
uint NetworkCalculateLag(const NetworkTCPSocketHandler *cs);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5872
diff changeset
   112
byte NetworkGetCurrentLanguageIndex();
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   113
NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index);
2859
ed471404f531 (svn r3407) - Feature: Kick and ban now with IP numbers.
Darkvater
parents: 2498
diff changeset
   114
NetworkClientInfo *NetworkFindClientInfoFromIP(const char *ip);
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: 5619
diff changeset
   115
NetworkTCPSocketHandler *NetworkFindClientStateFromIndex(uint16 client_index);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   116
unsigned long NetworkResolveHost(const char *hostname);
4912
0f51b47cb983 (svn r6884) -Codechange: Add strict bounds checking in string formatting system.
Darkvater
parents: 4906
diff changeset
   117
char* GetNetworkErrorMsg(char* buf, NetworkErrorCode err, const char* last);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   118
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   119
#endif /* ENABLE_NETWORK */
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
   120
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2186
diff changeset
   121
#endif /* NETWORK_DATA_H */