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 12:42:51 -0500

CVSROOT:        /cvsroot/camino
Module name:    camino
Changes by:     Pascal Audoux <address@hidden>  03/03/09 12:42:50

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

Log message:
        manage 'trash' move

Patches:
Index: camino/src/common/MsgCoder.cpp
diff -u camino/src/common/MsgCoder.cpp:1.15 camino/src/common/MsgCoder.cpp:1.16
--- camino/src/common/MsgCoder.cpp:1.15 Sun Mar  9 10:11:15 2003
+++ camino/src/common/MsgCoder.cpp      Sun Mar  9 12:42:49 2003
@@ -2,7 +2,7 @@
 **
 ** Camino
 **
-** Version : $Id: MsgCoder.cpp,v 1.15 2003/03/09 15:11:15 Audoux Exp $
+** Version : $Id: MsgCoder.cpp,v 1.16 2003/03/09 17:42:49 Audoux Exp $
 **
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 14/01/2003
@@ -106,6 +106,14 @@
 void MsgCoder::sendPlayerCompletes( Tile * tile )
 {
        *this << PlayerCompletes << 0;
+       sendTile( tile );
+
+       device()->flush();
+}
+
+void MsgCoder::sendPlayerTrash( Tile * tile )
+{
+       *this << PlayerTrash << 0;
        sendTile( tile );
 
        device()->flush();
Index: camino/src/common/MsgCoder.h
diff -u camino/src/common/MsgCoder.h:1.15 camino/src/common/MsgCoder.h:1.16
--- camino/src/common/MsgCoder.h:1.15   Sun Mar  9 10:11:16 2003
+++ camino/src/common/MsgCoder.h        Sun Mar  9 12:42:49 2003
@@ -3,7 +3,7 @@
 ** Camino
 **
 **
-** Version : $Id: MsgCoder.h,v 1.15 2003/03/09 15:11:16 Audoux Exp $
+** Version : $Id: MsgCoder.h,v 1.16 2003/03/09 17:42:49 Audoux Exp $
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 14/01/2003
 ** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -64,6 +64,7 @@
        ActivePlayer,           //! Server informs all client which player is 
active
        PlayerPlaysAMove,       //! Client informs server about its move
        PlayerCompletes,        //! Client informs server about its completion
+       PlayerTrash,            //! Client trashes a tile
        MoveRejected,           //! Server refuses the last move of the client
        UpdateBoard,            //! Server notifies a new tile on the board
 
@@ -119,6 +120,7 @@
 
        void sendPlayerPlaysAMove( Tile * tile );
        void sendPlayerCompletes( Tile * tile );
+       void sendPlayerTrash( 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.13 
camino/src/common/MsgDecoder.cpp:1.14
--- camino/src/common/MsgDecoder.cpp:1.13       Sun Mar  9 10:11:16 2003
+++ camino/src/common/MsgDecoder.cpp    Sun Mar  9 12:42:49 2003
@@ -2,7 +2,7 @@
 **
 ** Camino
 **
-** Version : $Id: MsgDecoder.cpp,v 1.13 2003/03/09 15:11:16 Audoux Exp $
+** Version : $Id: MsgDecoder.cpp,v 1.14 2003/03/09 17:42:49 Audoux Exp $
 **
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 15/01/2003
@@ -97,6 +97,9 @@
                case PlayerCompletes:
                        decodePlayerCompletes();
                        break;
+               case PlayerTrash:
+                       decodePlayerTrash();
+                       break;
                case MoveRejected:
                        decodeMoveRejected();
                        break;
@@ -262,6 +265,16 @@
        recvPlayerCompletes( tile );
 }
 
+void MsgDecoder::recvPlayerTrash( Tile * /* tile */ )
+{
+       qDebug( "MsgDecoder::recvPlayerTrash()" );
+}
+
+void MsgDecoder::decodePlayerTrash()
+{
+       Tile * tile = decodeTile();
+       recvPlayerTrash( tile );
+}
 
 Tile * MsgDecoder::decodeTile()
 {
Index: camino/src/common/MsgDecoder.h
diff -u camino/src/common/MsgDecoder.h:1.15 camino/src/common/MsgDecoder.h:1.16
--- camino/src/common/MsgDecoder.h:1.15 Sun Mar  9 10:11:16 2003
+++ camino/src/common/MsgDecoder.h      Sun Mar  9 12:42:49 2003
@@ -5,7 +5,7 @@
 ** MsgDecoder.h
 ** Decoder for socket msg
 **
-** Version : $Id: MsgDecoder.h,v 1.15 2003/03/09 15:11:16 Audoux Exp $
+** Version : $Id: MsgDecoder.h,v 1.16 2003/03/09 17:42:49 Audoux Exp $
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 14/01/2003
 ** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -66,6 +66,7 @@
        virtual void recvActivePlayer( QString playerName );
        virtual void recvPlayerPlaysAMove( Tile * tile );
        virtual void recvPlayerCompletes( Tile * tile );
+       virtual void recvPlayerTrash( Tile * tile );
        virtual void recvMoveRejected( Tile * tile );
        virtual void recvUpdateBoard( Tile * tile, bool removeTile );
 
@@ -116,6 +117,7 @@
        void decodeActivePlayer();
        void decodePlayerPlaysAMove();
        void decodePlayerCompletes();
+       void decodePlayerTrash();
        void decodeMoveRejected();
        void decodeUpdateBoard();
 




reply via email to

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