OSDN Git Service

[shogi-server] - shogi_server/login.rb: When players are logged in, log their player_...
[shogi-server/shogi-server.git] / shogi_server / login.rb
index 79e770e..8255a1e 100644 (file)
@@ -109,7 +109,8 @@ class Login
 
   def process
     @player.write_safe(sprintf("LOGIN:%s OK\n", @player.name))
 
   def process
     @player.write_safe(sprintf("LOGIN:%s OK\n", @player.name))
-    log_message(sprintf("user %s run in %s mode", @player.name, @player.protocol))
+    log_message("user %s run in %s mode" % [(@player.rated? ? @player.player_id : @player.name),
+                                            @player.protocol])
   end
 
   def incorrect_duplicated_player(str)
   end
 
   def incorrect_duplicated_player(str)