Permalink
Browse files

README

  • Loading branch information...
1 parent 5c36938 commit 908a957a541ef1238d43cc2f0f714c579e424d23 @bduggan committed Sep 26, 2012
Showing with 2 additions and 8 deletions.
  1. +1 −1 README
  2. +0 −1 bird
  3. +1 −6 house
View
@@ -6,7 +6,7 @@ SYNOPSIS
Start the server :
- ./house daemon --listen http://localhost:3001 --websocket 3600
+ ./house daemon --listen http://localhost:3001
Start clients which connect to the server :
View
@@ -127,7 +127,6 @@ sub init_connection {
write_status();
}
write_server_msg( $msg->{msg}) if $msg->{msg};
- Mojo::IOLoop->stop if $msg->{fly_away};
}
else {
write_chat_msg($msg->{id} ,$msg->{msg});
View
@@ -25,16 +25,11 @@ websocket '/door' => sub {
my ( $c, $msg ) = @_;
$msg =~ /hello, i am (.*)$/
- or return $c->app->log->debug("invalid greeting '$msg'");
+ or return $c->app->debug("invalid greeting '$msg'");
my $id = $1;
return $c->app->debug('reserved id "server"')
if $id eq 'server'; # reserved
$c->app->log->debug("connect from $id");
- if (exists($birds{$id})) {
- $c->app->log->debug("conflicting user $id");
- $c->tx->send($j->encode({ id => 'server', fly_away => 1, msg => "user $id is already connected"}));
- return;
- }
$birds{$id} = $c->tx;
$c->tx->send( $j->encode({id => 'server', birds => [keys %birds]}) );
$c->on(finish =>

0 comments on commit 908a957

Please sign in to comment.