diff options
author | Julien Dessaux | 2014-12-07 13:33:36 +0100 |
---|---|---|
committer | Julien Dessaux | 2014-12-07 13:33:36 +0100 |
commit | ba95f067143ad3e235cdc8aecfe1fc71e3db7004 (patch) | |
tree | 4f1d7027b3b084f3139f6e6c2f1ce5e4aa73f2e7 | |
parent | Implemented TEAM election gamephase timeout and the kick system (diff) | |
download | avalon-arthur-ba95f067143ad3e235cdc8aecfe1fc71e3db7004.tar.gz avalon-arthur-ba95f067143ad3e235cdc8aecfe1fc71e3db7004.tar.bz2 avalon-arthur-ba95f067143ad3e235cdc8aecfe1fc71e3db7004.zip |
Implemented UNREGISTER
-rw-r--r-- | Avalon.pm | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -186,7 +186,14 @@ sub told { $self->start_game if $self->game_ready; } when ("REGISTERED") {} - when ("UNREGISTER") {} + when ("UNREGISTER") { + return unless $av->{registered}->{$who} or $who ~~ $av->{players}; + delete $av->{registered}->{$who}; + $self->say( channel => $av->{config}->{'game.channel'}, body => "UNREGISTERED $who" ); + if ($av->{gamephase} == GAMESTART or (scalar @args > 0 and $args[0] eq "now" and $who ~~ $av->{players})) { + $self->reset_game; + } + } when ("UNREGISTERED") {} when ("GAMESTART") {} when ("ROLE") {} |