Added more notice log infos.

This commit is contained in:
Martin Edenhofer 2013-06-11 08:18:18 +02:00
parent 9cdd2a94ea
commit a34f2e9a67

View file

@ -185,7 +185,7 @@ EventMachine.run {
else else
data['data']['recipient']['user_id'].each { |user_id| data['data']['recipient']['user_id'].each { |user_id|
if local_client[:user][:id].to_i == user_id.to_i if local_client[:user][:id].to_i == user_id.to_i
log 'notice', "send broadcast to (user_id=#{user_id})", local_client_id log 'notice', "send broadcast from (#{client_id.to_s}) to (user_id=#{user_id})", local_client_id
if local_client[:meta][:type] == 'websocket' && @clients[ local_client_id ] if local_client[:meta][:type] == 'websocket' && @clients[ local_client_id ]
@clients[ local_client_id ][:websocket].send( "[#{msg}]" ) @clients[ local_client_id ][:websocket].send( "[#{msg}]" )
else else
@ -199,13 +199,15 @@ EventMachine.run {
# broadcast every client # broadcast every client
else else
log 'notice', "send broadcast", local_client_id log 'notice', "send broadcast from (#{client_id.to_s})", local_client_id
if local_client[:meta][:type] == 'websocket' && @clients[ local_client_id ] if local_client[:meta][:type] == 'websocket' && @clients[ local_client_id ]
@clients[ local_client_id ][:websocket].send( "[#{msg}]" ) @clients[ local_client_id ][:websocket].send( "[#{msg}]" )
else else
Session.send( local_client_id, data ) Session.send( local_client_id, data )
end end
end end
else
log 'notice', "do not send broadcast to it self", client_id
end end
} }
end end