projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
start ping work
[spider.git]
/
perl
/
Thingy
/
Hello.pm
diff --git
a/perl/Thingy/Hello.pm
b/perl/Thingy/Hello.pm
index 3eb72d61bd9eb937ff346f8ed49d8a0548fb566e..6c64302662e8bb505cd22bf5215c525a9c1c7c47 100644
(file)
--- a/
perl/Thingy/Hello.pm
+++ b/
perl/Thingy/Hello.pm
@@
-39,11
+39,11
@@
sub gen_Aranea
if ($thing->{user}) {
$thing->{h} ||= $dxchan->here;
} else {
if ($thing->{user}) {
$thing->{h} ||= $dxchan->here;
} else {
- $thing->add_auth;
$thing->{sw} ||= 'DXSp';
$thing->{sw} ||= 'DXSp';
- $thing->{v} ||= $main::version;
- $thing->{b} ||= $main::build;
+ $thing->{v} ||= $main::
me->
version;
+ $thing->{b} ||= $main::
me->
build;
$thing->{h} ||= $main::me->here;
$thing->{h} ||= $main::me->here;
+ $thing->add_auth;
}
$thing->{Aranea} = Aranea::genmsg($thing, [qw(sw h v b s auth)]);
}
$thing->{Aranea} = Aranea::genmsg($thing, [qw(sw h v b s auth)]);
@@
-90,7
+90,7
@@
sub handle
$thing->send($dxchan);
# broadcast our configuration to the world
$thing->send($dxchan);
# broadcast our configuration to the world
- $thing = Thingy::Rt->new_
l
cf;
+ $thing = Thingy::Rt->new_cf;
$thing->broadcast;
}
}
$thing->broadcast;
}
}
@@
-113,17
+113,18
@@
sub handle
if (my $user = $thing->{user}) {
my $ur = Route::get($user);
unless ($ur) {
if (my $user = $thing->{user}) {
my $ur = Route::get($user);
unless ($ur) {
- my $uref = DXUser->get_current($user) || Thingy::Hello::_upd_user_rec($user, $origin)->put;
+ my @ref;
+ my $uref = DXUser->get_current($user) || Thingy::Rt::_upd_user_rec($user, $origin)->put;
if ($uref->is_node || $uref->is_aranea) {
if ($uref->is_node || $uref->is_aranea) {
- $ur = $nref->add($user, $thing->{v}, $thing->{h});
- push @{$thing->{pc19n}}, $ur if $ur;
+ push @ref, $nref->add($user, $thing->{v} || 0, $thing->{h} || 0);
+ push @{$thing->{pc19n}}, @ref if @ref;
+ do $_->np(1) for @ref;
} else {
$thing->{pc16n} = $nref;
} else {
$thing->{pc16n} = $nref;
-
$ur = $nref->add_user($user, $thing->{h}
);
- $thing->{pc16u} =
[$ur]
;
+
push @ref, $nref->add_user($user, $thing->{h} || 0
);
+ $thing->{pc16u} =
\@ref if @ref
;
}
}
}
}
- $ur->np(1);
} else {
$nref->version($thing->{v}) unless $nref->version;
$nref->build($thing->{b}) unless $nref->build;
} else {
$nref->version($thing->{v}) unless $nref->version;
$nref->build($thing->{b}) unless $nref->build;