OSDN Git Service

* [shogi-server]
[shogi-server/shogi-server.git] / shogi_server / game_result.rb
index 81a438a..0dd90f1 100644 (file)
@@ -109,10 +109,10 @@ class GameResult
     add_observer LoggingObserver.new
 
     if League::Floodgate.game_name?(@game.game_name) &&
-       @game.sente.player_id &&
-       @game.gote.player_id &&
-       $options["floodgate-history"]
-      add_observer League::Floodgate::History.factory
+       @game.sente.player_id && @game.gote.player_id
+      path = League::Floodgate.history_file_path(@game.game_name) 
+      history = League::Floodgate::History.factory(path)
+      add_observer history if history
     end
   end