camino-devel
[Top][All Lists]
Advanced

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

[Camino-devel] camino/src/common MsgCoder.cpp MsgCoder.h MsgDe...


From: Pascal Audoux
Subject: [Camino-devel] camino/src/common MsgCoder.cpp MsgCoder.h MsgDe...
Date: Sun, 09 Mar 2003 10:11:17 -0500

CVSROOT:        /cvsroot/camino
Module name:    camino
Changes by:     Pascal Audoux <address@hidden>  03/03/09 10:11:17

Modified files:
        src/common     : MsgCoder.cpp MsgCoder.h MsgDecoder.cpp 
                         MsgDecoder.h 

Log message:
        add message 'PlayerCompletes'

Patches:
Index: camino/src/common/MsgCoder.cpp
diff -u camino/src/common/MsgCoder.cpp:1.14 camino/src/common/MsgCoder.cpp:1.15
--- camino/src/common/MsgCoder.cpp:1.14 Sun Mar  2 11:46:04 2003
+++ camino/src/common/MsgCoder.cpp      Sun Mar  9 10:11:15 2003
@@ -2,7 +2,7 @@
 **
 ** Camino
 **
-** Version : $Id: MsgCoder.cpp,v 1.14 2003/03/02 16:46:04 pfremy Exp $
+** Version : $Id: MsgCoder.cpp,v 1.15 2003/03/09 15:11:15 Audoux Exp $
 **
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 14/01/2003
@@ -102,6 +102,15 @@
        
        device()->flush();
 }
+
+void MsgCoder::sendPlayerCompletes( Tile * tile )
+{
+       *this << PlayerCompletes << 0;
+       sendTile( tile );
+
+       device()->flush();
+}
+
 void MsgCoder::sendMoveRejected( Tile * tile )
 {
        *this << MoveRejected << 0;
Index: camino/src/common/MsgCoder.h
diff -u camino/src/common/MsgCoder.h:1.14 camino/src/common/MsgCoder.h:1.15
--- camino/src/common/MsgCoder.h:1.14   Sun Mar  2 11:46:04 2003
+++ camino/src/common/MsgCoder.h        Sun Mar  9 10:11:16 2003
@@ -3,7 +3,7 @@
 ** Camino
 **
 **
-** Version : $Id: MsgCoder.h,v 1.14 2003/03/02 16:46:04 pfremy Exp $
+** Version : $Id: MsgCoder.h,v 1.15 2003/03/09 15:11:16 Audoux Exp $
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 14/01/2003
 ** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -63,6 +63,7 @@
        TilesForYou,            //! Server distributes one or many tiles to a 
client
        ActivePlayer,           //! Server informs all client which player is 
active
        PlayerPlaysAMove,       //! Client informs server about its move
+       PlayerCompletes,        //! Client informs server about its completion
        MoveRejected,           //! Server refuses the last move of the client
        UpdateBoard,            //! Server notifies a new tile on the board
 
@@ -115,7 +116,9 @@
        void sendTeamIsBeingChosen();
        void sendTeamsComposition();
        void sendActivePlayer( QString playerName );
+
        void sendPlayerPlaysAMove( Tile * tile );
+       void sendPlayerCompletes( Tile * tile );
        void sendMoveRejected( Tile * tile );
        void sendUpdateBoard( Tile * tile, bool removeTile = false);
 
Index: camino/src/common/MsgDecoder.cpp
diff -u camino/src/common/MsgDecoder.cpp:1.12 
camino/src/common/MsgDecoder.cpp:1.13
--- camino/src/common/MsgDecoder.cpp:1.12       Sun Mar  2 11:46:05 2003
+++ camino/src/common/MsgDecoder.cpp    Sun Mar  9 10:11:16 2003
@@ -2,7 +2,7 @@
 **
 ** Camino
 **
-** Version : $Id: MsgDecoder.cpp,v 1.12 2003/03/02 16:46:05 pfremy Exp $
+** Version : $Id: MsgDecoder.cpp,v 1.13 2003/03/09 15:11:16 Audoux Exp $
 **
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 15/01/2003
@@ -92,8 +92,11 @@
                        decodeActivePlayer();
                        break;
                case PlayerPlaysAMove:
-                               decodePlayerPlaysAMove();
-                               break;
+                       decodePlayerPlaysAMove();
+                       break;
+               case PlayerCompletes:
+                       decodePlayerCompletes();
+                       break;
                case MoveRejected:
                        decodeMoveRejected();
                        break;
@@ -247,6 +250,18 @@
        Tile * tile = decodeTile();
        recvPlayerPlaysAMove( tile );
 }
+
+void MsgDecoder::recvPlayerCompletes( Tile * /* tile */ )
+{
+       qDebug( "MsgDecoder::recvPlayerCompletes()" );
+}
+
+void MsgDecoder::decodePlayerCompletes()
+{
+       Tile * tile = decodeTile();
+       recvPlayerCompletes( tile );
+}
+
 
 Tile * MsgDecoder::decodeTile()
 {
Index: camino/src/common/MsgDecoder.h
diff -u camino/src/common/MsgDecoder.h:1.14 camino/src/common/MsgDecoder.h:1.15
--- camino/src/common/MsgDecoder.h:1.14 Sun Mar  2 11:46:05 2003
+++ camino/src/common/MsgDecoder.h      Sun Mar  9 10:11:16 2003
@@ -5,7 +5,7 @@
 ** MsgDecoder.h
 ** Decoder for socket msg
 **
-** Version : $Id: MsgDecoder.h,v 1.14 2003/03/02 16:46:05 pfremy Exp $
+** Version : $Id: MsgDecoder.h,v 1.15 2003/03/09 15:11:16 Audoux Exp $
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 14/01/2003
 ** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -65,6 +65,7 @@
        virtual void recvTilesForYou( Tile::TileType /* tile */ );
        virtual void recvActivePlayer( QString playerName );
        virtual void recvPlayerPlaysAMove( Tile * tile );
+       virtual void recvPlayerCompletes( Tile * tile );
        virtual void recvMoveRejected( Tile * tile );
        virtual void recvUpdateBoard( Tile * tile, bool removeTile );
 
@@ -114,6 +115,7 @@
        void decodeTilesForYou();
        void decodeActivePlayer();
        void decodePlayerPlaysAMove();
+       void decodePlayerCompletes();
        void decodeMoveRejected();
        void decodeUpdateBoard();
 




reply via email to

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