stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src include/master.h network/master.c...


From: Jimmy Salmon
Subject: [Stratagus-CVS] stratagus/src include/master.h network/master.c...
Date: Tue, 14 Oct 2003 18:44:32 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Jimmy Salmon <address@hidden>   03/10/14 18:44:31

Modified files:
        src/include    : master.h 
        src/network    : master.c 
        src/ui         : menus.c 

Log message:
        Cleaned up some metaserver code

Patches:
Index: stratagus/src/include/master.h
diff -u stratagus/src/include/master.h:1.11 stratagus/src/include/master.h:1.12
--- stratagus/src/include/master.h:1.11 Tue Oct 14 04:50:39 2003
+++ stratagus/src/include/master.h      Tue Oct 14 18:44:31 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: master.h,v 1.11 2003/10/14 08:50:39 mr-russ Exp $
+//     $Id: master.h,v 1.12 2003/10/14 22:44:31 jsalmon3 Exp $
 
 #ifndef __MASTER_H__
 #define __MASTER_H__
@@ -56,8 +56,8 @@
 
 extern int MetaInit(void);
 extern int MetaClose(void);
-extern int MetaServerOK(char **reply);
+extern int MetaServerOK(char* reply);
 extern int SendMetaCommand(char* command, char* format, ...);
-extern int RecvMetaReply(char **reply);
+extern int RecvMetaReply(char** reply);
 
 #endif // !__MASTER_H__
Index: stratagus/src/network/master.c
diff -u stratagus/src/network/master.c:1.15 stratagus/src/network/master.c:1.16
--- stratagus/src/network/master.c:1.15 Tue Oct 14 04:50:40 2003
+++ stratagus/src/network/master.c      Tue Oct 14 18:44:31 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: master.c,v 1.15 2003/10/14 08:50:40 mr-russ Exp $
+//     $Id: master.c,v 1.16 2003/10/14 22:44:31 jsalmon3 Exp $
 
 //@{
 
@@ -113,7 +113,7 @@
        //TODO: Notify player that connection was aborted...
        return -1;
     } else {
-       if (MetaServerOK(&reply)) {
+       if (MetaServerOK(reply)) {
            free(reply);
            return 0;
        } else {
@@ -140,9 +140,9 @@
 **
 **     @return 1 OK, 0 Error.
 */
-global int MetaServerOK(char** reply)
+global int MetaServerOK(char* reply)
 {
-    return !strcmp("OK\r\n", *reply) || !strcmp("OK\n", *reply);
+    return !strcmp("OK\r\n", reply) || !strcmp("OK\n", reply);
 }
 
 /**
@@ -243,7 +243,7 @@
     if (!(p = malloc(n + 1))) {
        return -1;
     }
-    buf[n]='\0';
+    buf[n] = '\0';
     strcpy(p, buf);
 
     *reply = p;
Index: stratagus/src/ui/menus.c
diff -u stratagus/src/ui/menus.c:1.561 stratagus/src/ui/menus.c:1.562
--- stratagus/src/ui/menus.c:1.561      Sat Oct 11 23:21:37 2003
+++ stratagus/src/ui/menus.c    Tue Oct 14 18:44:31 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: menus.c,v 1.561 2003/10/12 03:21:37 mr-russ Exp $
+//     $Id: menus.c,v 1.562 2003/10/14 22:44:31 jsalmon3 Exp $
 
 //@{
 
@@ -7246,7 +7246,7 @@
 **     FIXME: docu
 */
 local void MultiGameMasterReport(void)
-{

+{
 //     EndMenu();
     VideoLockScreen();
     MenusSetBackground();
@@ -7285,41 +7285,41 @@
 ** Mohydine: Right now, because I find it simpler, the client is sending n 
commands, one for each online game.
 ** TODO: well, redo this :)
 */
-local void MultiMetaServerGameSetupInit(Menuitem *mi)
+local void MultiMetaServerGameSetupInit(Menuitem* mi)
 {
     int i;
     int j;
     int k;
     int numparams;
     int nummenus;
-    char **reply;
+    char* reply;
        
-    SendMetaCommand("GameList","");
+    SendMetaCommand("GameList", "");
     reply = NULL;
     //receive
     //check okay
     
     // Meta server only sends matching version
     // Only Displays games from Matching version
-       nummenus=5;
-       i=1;
-       k=0;
-       numparams=4; //TODO: To be changed if more params are sent
+       nummenus = 5;
+       i = 1;
+       k = 0;
+       numparams = 4; //TODO: To be changed if more params are sent
        
        //Retrieve list of online game from the meta server
-       for (j=4; j <= nummenus*(numparams+1); j = j + numparams + 1) { // loop 
over the number of items in the menu
+       for (j = 4; j <= nummenus * (numparams + 1); j += numparams + 1) { // 
loop over the number of items in the menu
            //TODO: hard coded.
            // Check if connection to meta server is there.
-           SendMetaCommand("NextGameInList",""); 
-           i=RecvMetaReply(reply);
+           SendMetaCommand("NextGameInList", ""); 
+           i = RecvMetaReply(&reply);
            if (i == 0) {
                // fill the menus with the right info.
-               mi->menu->Items[j].d.text.text="Nick"; 
-               mi->menu->Items[j+1].d.text.text="IP";
-               mi->menu->Items[j+2].d.text.text="OS";
-               mi->menu->Items[j+3].d.text.text="Engine Version";
+               mi->menu->Items[j].d.text.text = "Nick"; 
+               mi->menu->Items[j + 1].d.text.text = "IP";
+               mi->menu->Items[j + 2].d.text.text = "OS";
+               mi->menu->Items[j + 3].d.text.text = "Engine Version";
            }
-           k++;
+           ++k;
        }
        //      mi->menu->Items[4].d.text.text=TheMessage->Nickname; 
        //      mi->menu->Items[9].d.text.text=TheMessage->Nickname; 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]