Skip to content

Commit

Permalink
Changed the API.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiratara committed Sep 26, 2009
1 parent 6a999d1 commit c9285dd
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions lib/Chaberi/Backdoor/LoadMembers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,17 @@ sub _merge_result {

sub load {
my $self = shift;
my $lobby = Chaberi::AnyEvent::Lobby->new(
Chaberi::AnyEvent::Lobby::connect
address => $self->host,
port => $self->port,
on_go => sub { $self->go(@_); },
on_bye => sub { $self->bye(@_); },
);
sub { $self->on_connect(@_); },
;
};


sub go {
sub on_connect {
my $self = shift;
my ($lobby) = @_;
my ( $lobby ) = @_;
$self->lobby( $lobby );
$self->lobby->get_members(
ref_room_ids => $self->room_ids,
Expand All @@ -102,13 +101,8 @@ sub recieve_members {
$self->cb
;

# close lobby actor
$self->lobby->exit;
};


sub bye {
# warn 'bye';
# close lobby
$self->lobby( undef );
};


Expand Down

0 comments on commit c9285dd

Please sign in to comment.