|
@@ -368,8 +368,11 @@ module InterconnectionPointProtocolHandler
|
|
|
|
|
|
if $user_roles.any? {|k| k.include? username}
|
|
if $user_roles.any? {|k| k.include? username}
|
|
@username = username
|
|
@username = username
|
|
-
|
|
|
|
@@connected_clients.push(self)
|
|
@@connected_clients.push(self)
|
|
|
|
+ @ping_timer = EventMachine.add_periodic_timer 90, proc { write_user("PING alive?") }
|
|
|
|
+
|
|
|
|
+ # starting a pinger
|
|
|
|
+ write_user("HELLO Hi user '#{@username}'! How are you? I'm '#{$version}'")
|
|
|
|
|
|
put_log("SYS '#{@username}' connected. Online now: #{ousers.join(", ")}")
|
|
put_log("SYS '#{@username}' connected. Online now: #{ousers.join(", ")}")
|
|
|
|
|
|
@@ -394,6 +397,8 @@ module InterconnectionPointProtocolHandler
|
|
def unbind # a connection goes bye bye
|
|
def unbind # a connection goes bye bye
|
|
if @username
|
|
if @username
|
|
@@connected_clients.delete(self)
|
|
@@connected_clients.delete(self)
|
|
|
|
+ EventMachine.cancel_timer(@ping_timer)
|
|
|
|
+
|
|
put_log "SYS '#{@username}' disconnected."
|
|
put_log "SYS '#{@username}' disconnected."
|
|
end
|
|
end
|
|
put_log "SYS Online users now: #{ousers.join(", ")}"
|
|
put_log "SYS Online users now: #{ousers.join(", ")}"
|