OSDN Git Service

Fix a bug. Now it can show %%RATING even if it has no rated player.
[shogi-server/shogi-server.git] / shogi-server
index 6a45917..3b93486 100755 (executable)
@@ -362,9 +362,10 @@ class Player < RatedPlayer
         when /^%%RATING/
           players = LEAGUE.rated_players
           players.sort {|a,b| b.rate <=> a.rate}.each do |p|
-            write_safe("%s (%s) \t %4d @%s\n" % 
+            write_safe("##[RATING]%s (%s) \t %4d @%s\n" % 
                        [p.name, p.id, p.rate, p.modified_at.strftime("%Y-%m-%d")])
           end
+          write_safe("##[RATING] +OK\n")
         when /^%%GAME\s*$/
           if ((@status == "connected") || (@status == "game_waiting"))
             @status = "connected"