[gnome-chess] engines: print unknown commands at debug level



commit 9f2e84470db107a9da2c5d3bad4e94c692a686c8
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Oct 13 13:31:02 2013 -0500

    engines: print unknown commands at debug level
    
    The UCI parser was treating unknown commands as warnings, and the CECP
    parser was ignoring them completely. In reality these are usually
    benign, but could be a real problem.

 src/chess-engine-cecp.vala |    4 ++++
 src/chess-engine-uci.vala  |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/chess-engine-cecp.vala b/src/chess-engine-cecp.vala
index ee19571..8dce0ec 100644
--- a/src/chess-engine-cecp.vala
+++ b/src/chess-engine-cecp.vala
@@ -91,6 +91,10 @@ public class ChessEngineCECP : ChessEngine
             {
                 offer_draw ();
             }
+            else
+            {
+                debug ("Unknown command: '%s'", line);
+            }
 
             buffer = buffer[offset+1:buffer.length];
         }
diff --git a/src/chess-engine-uci.vala b/src/chess-engine-uci.vala
index 333e3d3..cbf7d4b 100644
--- a/src/chess-engine-uci.vala
+++ b/src/chess-engine-uci.vala
@@ -118,7 +118,7 @@ public class ChessEngineUCI : ChessEngine
                     break;
 
                 default:
-                    warning ("Unknown command: '%s'", line);
+                    debug ("Unknown command: '%s'", line);
                     break;
                 }
             }


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