line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Teamspeak.pm 37 2008-03-09 01:10:00Z maletin $ |
2
|
|
|
|
|
|
|
# $URL: http://svn.berlios.de/svnroot/repos/cpan-teamspeak/cpan/trunk/lib/Teamspeak.pm $ |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Teamspeak; |
5
|
2
|
|
|
2
|
|
1889
|
use Teamspeak::Channel; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
54
|
|
6
|
2
|
|
|
2
|
|
972
|
use Teamspeak::Player; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
48
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
54
|
use 5.004; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
70
|
|
9
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
64
|
|
10
|
2
|
|
|
2
|
|
3400
|
use Net::Telnet; |
|
2
|
|
|
|
|
116562
|
|
|
2
|
|
|
|
|
286
|
|
11
|
2
|
|
|
2
|
|
17
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
122
|
|
12
|
2
|
|
|
2
|
|
10
|
use vars qw( $VERSION ); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
896
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$VERSION = '0.6'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
0
|
|
|
0
|
1
|
|
my ( $class, %arg ) = @_; |
18
|
0
|
0
|
|
|
|
|
if ( $arg{type} eq 'telnet' ) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
require Teamspeak::Telnet; |
20
|
0
|
|
|
|
|
|
return Teamspeak::Telnet->new(%arg); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
elsif ( $arg{type} eq 'sql' ) { |
23
|
0
|
|
|
|
|
|
require Teamspeak::SQL; |
24
|
0
|
|
|
|
|
|
return Teamspeak::SQL->new(%arg); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
elsif ( $arg{type} eq 'web' ) { |
27
|
0
|
|
|
|
|
|
require Teamspeak::Web; |
28
|
0
|
|
|
|
|
|
return Teamspeak::Web->new(%arg); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
else { |
31
|
0
|
|
|
|
|
|
croak("unknown type $arg{type}"); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} # new |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub error { |
36
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
37
|
0
|
|
|
|
|
|
$self->{err} = 1; |
38
|
0
|
|
|
|
|
|
$self->{errstr} = $_[1]; |
39
|
0
|
|
|
|
|
|
return 0; |
40
|
|
|
|
|
|
|
} # error |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _croak { |
43
|
0
|
|
|
0
|
|
|
my ($self, $msg) = @_; |
44
|
0
|
|
0
|
|
|
|
Carp::croak($msg || $self); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |