[Tux4kids-commits] r999 - tuxmath/branches/lan/src
akash gangil
gangil-guest at alioth.debian.org
Thu May 28 19:09:27 UTC 2009
Author: gangil-guest
Date: 2009-05-28 19:09:27 +0000 (Thu, 28 May 2009)
New Revision: 999
Added:
tuxmath/branches/lan/src/network.h
Modified:
tuxmath/branches/lan/src/Makefile.am
tuxmath/branches/lan/src/network.c
tuxmath/branches/lan/src/titlescreen.c
Log:
Adding network.h
Modified: tuxmath/branches/lan/src/Makefile.am
===================================================================
--- tuxmath/branches/lan/src/Makefile.am 2009-05-28 15:23:27 UTC (rev 998)
+++ tuxmath/branches/lan/src/Makefile.am 2009-05-28 19:09:27 UTC (rev 999)
@@ -49,7 +49,8 @@
SDL_rotozoom.c \
lessons.c \
scandir.c \
- pixels.c
+ pixels.c \
+ network.c
# HACK "TuxMath" is the Windows program, whereas "tuxmath" is the Unix program
@@ -85,7 +86,8 @@
gettext.h \
scandir.h \
pixels.h \
- compiler.h
+ compiler.h \
+ network.h
WINDRES=@WINDRES@
Modified: tuxmath/branches/lan/src/network.c
===================================================================
--- tuxmath/branches/lan/src/network.c 2009-05-28 15:23:27 UTC (rev 998)
+++ tuxmath/branches/lan/src/network.c 2009-05-28 19:09:27 UTC (rev 999)
@@ -19,7 +19,7 @@
TCPsocket sock;
Uint16 portnum;
-portnum=(Uint16) strtol(port,NULL,0);
+portnum=(Uint16) strtol(&port,NULL,0);
// initialize SDL
if(SDL_Init(0)==-1)
@@ -37,7 +37,7 @@
// Resolve the argument into an IPaddress type
-if(SDLNet_ResolveHost(&ip,*host,portnum)==-1)
+if(SDLNet_ResolveHost(&ip,host,portnum)==-1)
{
printf("SDLNet_ResolveHost: %s\n",SDLNet_GetError());
exit(3);
@@ -82,10 +82,10 @@
}
-portnum=(Uint16)strtol(port,NULL,0);
+portnum=(Uint16)strtol(&port,NULL,0);
// Resolve the argument into an IPaddress type
-if(SDLNet_ResolveHost(&ip,NULL,portum)==-1)
+if(SDLNet_ResolveHost(&ip,NULL,portnum)==-1)
{
printf("SDLNet_ResolveHost: %s\n",SDLNet_GetError());
exit(3);
@@ -129,7 +129,7 @@
remoteip->port);
*/
-
+}
return(0);
}
Added: tuxmath/branches/lan/src/network.h
===================================================================
--- tuxmath/branches/lan/src/network.h (rev 0)
+++ tuxmath/branches/lan/src/network.h 2009-05-28 19:09:27 UTC (rev 999)
@@ -0,0 +1,15 @@
+#ifndef NETWORK_H
+#define NETWORK_H
+
+/*
+
+network.h - Provides routines for various networking functions to be used
+ in the LAN multiplayer game.
+
+
+*/
+
+int lan_server_connect(int port);
+int lan_client_connect(char *host,int port);
+
+#endif // NETWORK_H
Modified: tuxmath/branches/lan/src/titlescreen.c
===================================================================
--- tuxmath/branches/lan/src/titlescreen.c 2009-05-28 15:23:27 UTC (rev 998)
+++ tuxmath/branches/lan/src/titlescreen.c 2009-05-28 19:09:27 UTC (rev 999)
@@ -36,6 +36,7 @@
#include "multiplayer.h"
#include "mathcards.h"
#include "setup.h" //for cleanup()
+#include "network.h"
#include "loaders.h"
#include "credits.h"
#include "highscore.h"
@@ -884,7 +885,7 @@
// lan_client_set_parameter(HOST, host);
// lan_client_set_parameter(PORT, port);
- // lan_client_connect(host,port);
+ // lan_client_connect(host,port);
game();
}
More information about the Tux4kids-commits
mailing list