]> dxcluster.net Git - spider.git/blob - perl/Thingy/Hello.pm
111abf8b2a46cc48e05ff1b60a025193055b6d28
[spider.git] / perl / Thingy / Hello.pm
1 #
2 # Hello Thingy handling
3 #
4 # $Id$
5 #
6 # Copyright (c) 2005 Dirk Koopman G1TLH
7 #
8
9 use strict;
10
11 package Thingy::Hello;
12
13 use vars qw($VERSION $BRANCH);
14 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
15 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
16 $main::build += $VERSION;
17 $main::branch += $BRANCH;
18
19 use DXChannel;
20 use DXDebug;
21 use Verify;
22 use Thingy;
23
24 use vars qw(@ISA);
25 @ISA = qw(Thingy);
26
27 sub gen_Aranea
28 {
29         my $thing = shift;
30         unless ($thing->{Aranea}) {
31                 my $auth = $thing->{auth} = Verify->new($main::mycall, $main::systime);
32                 $thing->{Aranea} = Aranea::genmsg($thing, 'HELLO', sw=>'DXSpider',
33                                                                                   v=>$main::version,
34                                                                                   b=>$main::build,
35                                                                                   auth=>$auth->challenge($main::me->user->passphrase)
36                                                                           );
37         }
38         return $thing->{Aranea};
39 }
40
41 sub from_Aranea
42 {
43         my $line = shift;
44         my $thing = Aranea::input($line);
45         return unless $thing;
46 }
47 1;