From 0bd907e88df535a11483b5bdcb5763a5fce0cbf5 Mon Sep 17 00:00:00 2001 From: dominik Date: Sun, 22 Aug 2004 10:23:37 +0000 Subject: (svn r106) New network core (by sign_de) Features: * network core is dynamicly loaded when needed (-n isn't needed anymore) for easy switching between single and multiplayer. But commandline shortcuts are still enabled: -n = autodetect network server -n [ip] = connect to the server * udp now uses 2 different ports - you can run 1 server and serveral clients on one pc - the clients udp-socket gets unloaded when the network game starts - the servers udp-sockets remains online to allow the network gui to detect itself * new gameinfo structure this struct is available for every online/lan game * dynamic NetworkGameList --- functions.h | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'functions.h') diff --git a/functions.h b/functions.h index f684fa055..64be83efb 100644 --- a/functions.h +++ b/functions.h @@ -121,19 +121,36 @@ int CalcBridgeLenCostFactor(int x); typedef void CommandCallback(bool success, uint tile, uint32 p1, uint32 p2); bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd); -void NetworkConnect(const char *hostname, int port); void NetworkReceive(); void NetworkSend(); void NetworkProcessCommands(); -void NetworkListen(int port); -void NetworkInitialize(const char *hostname); +void NetworkListen(); +void NetworkInitialize(); void NetworkShutdown(); void NetworkSendCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback); -void NetworkStartSync(); -void NetworkUDPListen(int port); -void NetworkUDPReceive(); +void NetworkStartSync(bool fcreset); +void NetworkClose(bool client); + void NetworkIPListInit(); -bool NetworkUDPSearchServer(); + +void NetworkCoreInit(); +void NetworkCoreShutdown(); +void NetworkCoreDisconnect(); +void NetworkCoreLoop(bool incomming); +bool NetworkCoreConnectGame(byte* b, unsigned short port); +bool NetworkCoreStartGame(); + +void NetworkLobbyShutdown(); +void NetworkLobbyInit(); + +void NetworkGameListClear(); +char * NetworkGameListAdd(); +void NetworkGameListFromLAN(); +void NetworkGameListFromInternet(); +char * NetworkGameListItem(uint16 index); + +void NetworkGameFillDefaults(); +void NetworkGameChangeDate(uint16 newdate); /* misc_cmd.c */ void PlaceTreesRandomly(); -- cgit v1.2.3-54-g00ecf