add all the basic aranea routing + local configuration broadcasts
[spider.git] / perl / Thingy.pm
index 522e4b136d0c7ea80ff55f8c31c2e3d4f5fb3acc..8b3f3ccef0d6bc6ad75a6f512b8e4101115557c8 100644 (file)
@@ -42,6 +42,8 @@ sub new
 {
        my $class = shift;
        my $thing = {@_};
+
+       $thing->{origin} ||= $main::mycall;
        
        bless $thing, $class;
        return $thing;
@@ -171,5 +173,14 @@ sub ascii
     $dd->Quotekeys($] < 5.005 ? 1 : 0);
        return $dd->Dumpxs;
 }
+
+sub add_auth
+{
+       my $thing = shift;
+       my $s = $thing->{'s'} = sprintf "%X", int(rand() * 100000000);
+       my $auth = Verify->new("DXSp,$main::mycall,$s,$main::version,$main::build");
+       $thing->{auth} = $auth->challenge($main::me->user->passphrase);
+}
+
 1;