File Coverage

blib/lib/Games/AssaultCube/Log/Line/ClientAdmin.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             # Declare our package
2             package Games::AssaultCube::Log::Line::ClientAdmin;
3              
4             # import the Moose stuff
5 1     1   2986 use Moose;
  0            
  0            
6              
7             # Initialize our version
8             use vars qw( $VERSION );
9             $VERSION = '0.04';
10              
11             extends 'Games::AssaultCube::Log::Line::Base';
12              
13             with 'Games::AssaultCube::Log::Line::Base::NickIP';
14              
15             # TODO improve validation for everything here, ha!
16              
17             has 'password' => (
18             isa => 'Int',
19             is => 'ro',
20             required => 1,
21             );
22              
23             has 'unbanned' => (
24             isa => 'Bool',
25             is => 'ro',
26             default => 0,
27             );
28              
29             has 'tostr' => (
30             isa => 'Str',
31             is => 'ro',
32             lazy => 1,
33             default => sub {
34             my $self = shift;
35             return $self->nick . " logged in as admin from " . $self->ip . " using password line: " . $self->password;
36             },
37             );
38              
39             no Moose;
40             __PACKAGE__->meta->make_immutable;
41              
42             1;
43             __END__
44              
45             =for stopwords admin configfile ip
46              
47             =head1 NAME
48              
49             Games::AssaultCube::Log::Line::ClientAdmin - Describes the ClientAdmin event in a log line
50              
51             =head1 ABSTRACT
52              
53             Describes the ClientAdmin event in a log line
54              
55             =head1 DESCRIPTION
56              
57             This module holds the "ClientAdmin" event data from a log line. Normally, you would not use this class directly
58             but via the L<Games::AssaultCube::Log::Line> class.
59              
60             This line is emitted when a client uses the admin password to gain admin status.
61              
62             =head2 Attributes
63              
64             Those attributes hold information about the event. As this class extends the L<Games::AssaultCube::Log::Line::Base>
65             class, you can also use it's attributes too.
66              
67             =head3 nick
68              
69             The nick of the client that used admin password
70              
71             =head3 ip
72              
73             The ip of the client
74              
75             =head3 password
76              
77             The line in the admin password configfile the client used as password
78              
79             =head3 unbanned
80              
81             Boolean value indicating if the client unbanned themselves using the admin login
82              
83             =head1 AUTHOR
84              
85             Apocalypse E<lt>apocal@cpan.orgE<gt>
86              
87             Props goes to the BS clan for the support!
88              
89             This project is sponsored by L<http://cubestats.net>
90              
91             =head1 COPYRIGHT AND LICENSE
92              
93             Copyright 2009 by Apocalypse
94              
95             This library is free software; you can redistribute it and/or modify
96             it under the same terms as Perl itself.
97              
98             =cut