changed log file names

This commit is contained in:
Jeena Paradies 2011-05-05 14:29:36 +02:00
parent b39ad8e97f
commit e6ff8b6f16
2 changed files with 5 additions and 5 deletions

View file

@ -11,7 +11,7 @@ class Chat
include GGSDelegate include GGSDelegate
include MyRandom include MyRandom
@@log_file_path = "/tmp/ggs-log.csv" @@log_file_path = "/tmp/ggs-ping-log.csv"
@@bot_threads = [] @@bot_threads = []
def initialize(is_bot=false, table_token="") def initialize(is_bot=false, table_token="")
@ -26,8 +26,8 @@ class Chat
table_token = gets.chomp unless @is_bot table_token = gets.chomp unless @is_bot
@ggs_network = GGSNetwork.new(self, table_token) @ggs_network = GGSNetwork.new(self, table_token)
#@ggs_network.connect("192.168.0.2", 9000) @ggs_network.connect("192.168.0.2", 9000)
@ggs_network.connect("localhost", 9000) #@ggs_network.connect("localhost", 9000)
end end
def ggsNetworkReady(ggs_network, am_i_host) def ggsNetworkReady(ggs_network, am_i_host)
@ -146,7 +146,7 @@ class Chat
end end
def pong(server_log) def pong(server_log)
time = (Time.now - @start_ping).to_s time = ((Time.now - @start_ping) * 1000).to_s
say "<pong: #{time} #{server_log}>" say "<pong: #{time} #{server_log}>"
File.open(@@log_file_path, 'a') {|f| f.write(time << ",#{server_log}\n") } unless @log.nil? File.open(@@log_file_path, 'a') {|f| f.write(time << ",#{server_log}\n") } unless @log.nil?

View file

@ -45,7 +45,7 @@ handle_cast({add_one, Type}, St) ->
handle_cast(print, St) -> handle_cast(print, St) ->
CS = length(ggs_coordinator:get_all_players()), CS = length(ggs_coordinator:get_all_players()),
S = lists:concat([CS,";",St#ate.server_messages,";",St#ate.client_messages]), S = lists:concat([CS,";",St#ate.server_messages,";",St#ate.client_messages]),
log("/tmp/ggs-log.csv", S), log("/tmp/ggs-mps-log.csv", S),
io:fwrite("CS:~w | CM:~w | SM:~w |~n", [CS, St#ate.server_messages, St#ate.client_messages]), io:fwrite("CS:~w | CM:~w | SM:~w |~n", [CS, St#ate.server_messages, St#ate.client_messages]),
{noreply, St}; {noreply, St};