barnowl_perlaim
Last change
on this file since 7a1c90d was
7a1c90d,
checked in by Geoffrey Thomas <geofft@mit.edu>, 16 years ago
|
Skeleton AIM module, and Net::OSCAR 1.925
|
-
Property mode set to
100644
|
File size:
880 bytes
|
Line | |
---|
1 | package Net::OSCAR::ServerCallbacks; |
---|
2 | use strict; |
---|
3 | use warnings; |
---|
4 | use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data); |
---|
5 | sub { |
---|
6 | |
---|
7 | if(exists($SCREENNAMES->{$data{screenname}})) { |
---|
8 | $screenname = $data{screenname}; |
---|
9 | my $key = sprintf("%08d", int(rand(99999999))); |
---|
10 | print "$screenname would like to sign on. Generated key '$key'\n"; |
---|
11 | |
---|
12 | $SESSIONS->{$screenname} ||= {}; |
---|
13 | $SESSIONS->{$screenname}->{keys} ||= {}; |
---|
14 | $SESSIONS->{$screenname}->{sessions} ||= []; |
---|
15 | $SESSIONS->{$screenname}->{status} ||= { |
---|
16 | online => 0, |
---|
17 | }; |
---|
18 | |
---|
19 | $SESSIONS->{$screenname}->{keys}->{$key} = 1; |
---|
20 | $connection->proto_send(protobit => "authentication_key", protodata => {key => $key}); |
---|
21 | } else { |
---|
22 | $connection->proto_send(protobit => "authorization_response", protodata => {error => 1}); |
---|
23 | $session->delconn($connection); |
---|
24 | } |
---|
25 | |
---|
26 | }; |
---|
27 | |
---|
Note: See
TracBrowser
for help on using the repository browser.