OSDN Git Service

Provided more test cases for Monitor features.
[shogi-server/shogi-server.git] / shogi_server / command.rb
index 403d5b9..d661f90 100644 (file)
@@ -288,8 +288,8 @@ module ShogiServer
     def ==(rhs)
       return rhs != nil &&
              rhs.is_a?(MonitorHandler) &&
-             @player = rhs.player &&
-             @type   = rhs.type
+             @player == rhs.player &&
+             @type   == rhs.type
     end
 
     def write_safe(game_id, str)
@@ -374,10 +374,17 @@ module ShogiServer
     end
   end
 
-  class Monitor2OffCommand < MonitorOffCommand # same
+  class Monitor2OffCommand < MonitorOffCommand
     def initialize(str, player, game)
       super
     end
+
+    def call
+      if (@game)
+        @game.monitoroff(MonitorHandler2.new(@player))
+      end
+      return :continue
+    end
   end
 
   # Command of HELP