[Tux4kids-commits] r1041 - tuxmath/branches/lan/server

akash gangil gangil-guest at alioth.debian.org
Sat Jun 13 14:38:10 UTC 2009


Author: gangil-guest
Date: 2009-06-13 14:38:09 +0000 (Sat, 13 Jun 2009)
New Revision: 1041

Modified:
   tuxmath/branches/lan/server/mathcards.c
   tuxmath/branches/lan/server/server.c
   tuxmath/branches/lan/server/testclient.c
Log:
Little progress

Modified: tuxmath/branches/lan/server/mathcards.c
===================================================================
--- tuxmath/branches/lan/server/mathcards.c	2009-06-13 13:21:13 UTC (rev 1040)
+++ tuxmath/branches/lan/server/mathcards.c	2009-06-13 14:38:09 UTC (rev 1041)
@@ -1447,7 +1447,7 @@
     return;
   mcdprintf("Copying '%s' to '%s', ", src->formula_string,dest->formula_string);
   mcdprintf("copying '%s' to '%s'\n", src->answer_string, dest->answer_string);
-  strncpy(dest->formula_string, src->formula_string, 1);
+  strncpy(dest->formula_string, src->formula_string, max_formula_size);
   strncpy(dest->answer_string, src->answer_string, max_answer_size);
   mcdprintf("Card is: '%s', '%s'\n", dest->formula_string, dest->answer_string);
   dest->answer = src->answer;

Modified: tuxmath/branches/lan/server/server.c
===================================================================
--- tuxmath/branches/lan/server/server.c	2009-06-13 13:21:13 UTC (rev 1040)
+++ tuxmath/branches/lan/server/server.c	2009-06-13 14:38:09 UTC (rev 1041)
@@ -44,7 +44,7 @@
         }
  
         /* Resolving the host using NULL make network interface to listen */
-        if (SDLNet_ResolveHost(&ip, NULL, 2940) < 0)
+        if (SDLNet_ResolveHost(&ip, NULL, 4767) < 0)
         {
                 fprintf(stderr, "SDLNet_ResolveHost: %s\n", SDLNet_GetError());
                 exit(EXIT_FAILURE);
@@ -134,19 +134,23 @@
 						              return 0;
 						             }
 					                }
-					          fc->answer_string="";
-					          fc->formula_string="";
+					    //      fc->answer_string="";
+					    //      fc->formula_string="";
  
-
-                                                      
-
-
+						    
                                                     if (!MC_NextQuestion(fc))
                                                     { 
                                                       /* no more questions available - cannot create comet.  */
                                                       return 0;
                                                     }
                                                      
+                                                    printf("WILL SEND >>          %s\n",fc->formula_string);
+                                                    printf("          %s\n",fc->answer_string);
+						    printf("          %d\n",fc->answer);
+  						    printf("          %d\n",fc->difficulty);
+
+
+
                                                     if(!SendQuestion(fc))
                                                     {
       				                       printf("Unable to send Question\n");

Modified: tuxmath/branches/lan/server/testclient.c
===================================================================
--- tuxmath/branches/lan/server/testclient.c	2009-06-13 13:21:13 UTC (rev 1040)
+++ tuxmath/branches/lan/server/testclient.c	2009-06-13 14:38:09 UTC (rev 1041)
@@ -99,6 +99,7 @@
 
 
         SDLNet_TCP_Recv(sd,fc->formula_string,4);
+        printf("RECEIVED >>          %s\n",fc->formula_string);  
 	SDLNet_TCP_Send(sd,ch,1); 		                  // send a conformation that the 1st item has been received				
 	SDLNet_TCP_Recv(sd,fc->answer_string,4);
         SDLNet_TCP_Send(sd,ch,1);




More information about the Tux4kids-commits mailing list