line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Hotline::User; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
## Copyright(c) 1998-2002 by John C. Siracusa. All rights reserved. This |
4
|
|
|
|
|
|
|
## program is free software; you can redistribute it and/or modify it under |
5
|
|
|
|
|
|
|
## the same terms as Perl itself. |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
4
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
500
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$VERSION = '0.80'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
14
|
|
|
|
|
|
|
{ |
15
|
0
|
|
|
0
|
1
|
|
my($class, @args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my($data) = join('', @args); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my($self); |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
if(@args == 5) |
|
|
0
|
|
|
|
|
|
22
|
|
|
|
|
|
|
{ |
23
|
0
|
|
|
|
|
|
$self = |
24
|
|
|
|
|
|
|
{ |
25
|
|
|
|
|
|
|
'SOCKET' => $args[0], |
26
|
|
|
|
|
|
|
'NICK' => $args[1], |
27
|
|
|
|
|
|
|
'LOGIN' => $args[2], |
28
|
|
|
|
|
|
|
'ICON' => $args[3], |
29
|
|
|
|
|
|
|
'COLOR' => $args[4], |
30
|
|
|
|
|
|
|
'INFO' => undef |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
elsif(@args == 1) |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
|
|
|
my($nick_len) = unpack("n", substr($data, 6, 2)); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
$self = |
38
|
|
|
|
|
|
|
{ |
39
|
|
|
|
|
|
|
'SOCKET' => unpack("n", substr($data, 0, 2)), |
40
|
|
|
|
|
|
|
'ICON' => unpack("n", substr($data, 2, 2)), |
41
|
|
|
|
|
|
|
'COLOR' => unpack("n", substr($data, 4, 2)), |
42
|
|
|
|
|
|
|
'NICK' => join('', substr($data, 8, $nick_len)), |
43
|
|
|
|
|
|
|
'LOGIN' => undef, |
44
|
|
|
|
|
|
|
'INFO' => undef |
45
|
|
|
|
|
|
|
}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
else |
48
|
|
|
|
|
|
|
{ |
49
|
0
|
|
|
|
|
|
$self = |
50
|
|
|
|
|
|
|
{ |
51
|
|
|
|
|
|
|
'SOCKET' => undef, |
52
|
|
|
|
|
|
|
'NICK' => undef, |
53
|
|
|
|
|
|
|
'LOGIN' => undef, |
54
|
|
|
|
|
|
|
'ICON' => undef, |
55
|
|
|
|
|
|
|
'COLOR' => undef, |
56
|
|
|
|
|
|
|
'INFO' => undef |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
bless $self, $class; |
61
|
0
|
|
|
|
|
|
return $self; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub socket |
65
|
|
|
|
|
|
|
{ |
66
|
0
|
0
|
0
|
0
|
1
|
|
$_[0]->{'SOCKET'} = $_[1] if(@_ > 1 && $_[1] =~ /^\d+$/); |
67
|
0
|
|
|
|
|
|
return $_[0]->{'SOCKET'}; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub nick |
71
|
|
|
|
|
|
|
{ |
72
|
0
|
0
|
|
0
|
1
|
|
$_[0]->{'NICK'} = $_[1] if(defined($_[1])); |
73
|
0
|
|
|
|
|
|
return $_[0]->{'NICK'}; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub login |
77
|
|
|
|
|
|
|
{ |
78
|
0
|
0
|
|
0
|
1
|
|
$_[0]->{'LOGIN'} = $_[1] if(defined($_[1])); |
79
|
0
|
|
|
|
|
|
return $_[0]->{'LOGIN'}; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub icon |
83
|
|
|
|
|
|
|
{ |
84
|
0
|
0
|
0
|
0
|
1
|
|
$_[0]->{'ICON'} = $_[1] if(@_ > 1 && $_[1] =~ /^-?\d+$/); |
85
|
0
|
|
|
|
|
|
return $_[0]->{'ICON'}; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub color |
89
|
|
|
|
|
|
|
{ |
90
|
0
|
0
|
0
|
0
|
1
|
|
$_[0]->{'COLOR'} = $_[1] if(@_ > 1 && $_[1] =~ /^\d+$/); |
91
|
0
|
|
|
|
|
|
return $_[0]->{'COLOR'}; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub info |
95
|
|
|
|
|
|
|
{ |
96
|
0
|
0
|
|
0
|
1
|
|
$_[0]->{'INFO'} = $_[1] if(defined($_[1])); |
97
|
0
|
|
|
|
|
|
return $_[0]->{'INFO'}; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |