line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OSCAR::ServerCallbacks; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
26
|
$Net::OSCAR::ServerCallbacks::VERSION = '1.928'; |
4
|
|
|
|
|
|
|
} |
5
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
45
|
|
7
|
1
|
|
|
1
|
|
7
|
use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
337
|
|
8
|
|
|
|
|
|
|
sub { |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
if(exists($SCREENNAMES->{$data{screenname}})) { |
11
|
|
|
|
|
|
|
$screenname = $data{screenname}; |
12
|
|
|
|
|
|
|
my $key = sprintf("%08d", int(rand(99999999))); |
13
|
|
|
|
|
|
|
print "$screenname would like to sign on. Generated key '$key'\n"; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$SESSIONS->{$screenname} ||= {}; |
16
|
|
|
|
|
|
|
$SESSIONS->{$screenname}->{keys} ||= {}; |
17
|
|
|
|
|
|
|
$SESSIONS->{$screenname}->{sessions} ||= []; |
18
|
|
|
|
|
|
|
$SESSIONS->{$screenname}->{status} ||= { |
19
|
|
|
|
|
|
|
online => 0, |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$SESSIONS->{$screenname}->{keys}->{$key} = 1; |
23
|
|
|
|
|
|
|
$connection->proto_send(protobit => "authentication_key", protodata => {key => $key}); |
24
|
|
|
|
|
|
|
} else { |
25
|
|
|
|
|
|
|
$connection->proto_send(protobit => "authorization_response", protodata => {error => 1}); |
26
|
|
|
|
|
|
|
$session->delconn($connection); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
|