From 826a768318d071200b289ed3a93ee409759dbae3 Mon Sep 17 00:00:00 2001 From: oroborus Date: Tue, 24 Jun 2008 15:56:36 +0000 Subject: - podpora IPv6 - game server je schopny obsluhovat clientov zo sieti IPv4 a IPv6 sucastne - hrac si moze zvolit v nastaveniach, ci che pouzivat IPv4 alebo IPv6 - odkolnenie od SDL_net ( nepodporuje IPv6 ) // ale v kode este podpora SDL_Net je git-svn-id: http://opensvn.csie.org/tuxanci_ng@70 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/net_multiplayer.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/net_multiplayer.c') diff --git a/src/net_multiplayer.c b/src/net_multiplayer.c index 92e9504..a9132e3 100644 --- a/src/net_multiplayer.c +++ b/src/net_multiplayer.c @@ -31,7 +31,16 @@ int getNetTypeGame() return netGameType; } -int initNetMuliplayer(int type, char *ip, int port) +#ifdef PUBLIC_SERVER + +int initNetMulitplayerPublicServer(char *ip4, int port4, char *ip6, int port6) +{ + netGameType = NET_GAME_TYPE_SERVER; + return initUdpPublicServer(ip4, port4, ip6, port6); +} +#endif + +int initNetMuliplayer(int type, char *ip, int port, int proto) { netGameType = type; @@ -42,7 +51,7 @@ int initNetMuliplayer(int type, char *ip, int port) case NET_GAME_TYPE_SERVER : #ifdef SUPPORT_NET_UNIX_UDP - if( initUdpServer(ip, port) != 0 ) + if( initUdpServer(ip, port, proto) != 0 ) { fprintf(stderr, "Neomzem inicalizovat sietovu hru pre server !\n"); netGameType = NET_GAME_TYPE_NONE; @@ -62,7 +71,7 @@ int initNetMuliplayer(int type, char *ip, int port) #ifndef PUBLIC_SERVER case NET_GAME_TYPE_CLIENT : #ifdef SUPPORT_NET_UNIX_UDP - if( initUdpClient(ip, port) != 0 ) + if( initUdpClient(ip, port, proto) != 0 ) { fprintf(stderr, "Neomzem inicalizovat sietovu hru pre clienta !\n"); netGameType = NET_GAME_TYPE_NONE; -- cgit v1.2.3