unify gmt offset to $r0ket::timediff

This commit is contained in:
Stefan `Sec` Zehl 2012-04-07 16:39:52 +02:00
parent 54257783cb
commit ef16649125
3 changed files with 7 additions and 6 deletions

View File

@ -14,6 +14,7 @@ use Time::HiRes;
our $verbose=0;
our $bridge; # Open device
our $quiet=0;
our $timediff=60*60*2;
### Utility
sub sprint{
@ -154,7 +155,7 @@ sub nice_mesh{
$out->{string}.=sprintf " t=%s (%+4d) rel=%s beacon=%s",
strftime("%Y-%m-%d %H:%M:%S",gmtime $out->{time}),
$out->{time}-(Time::HiRes::time+3600),
$out->{time}-(Time::HiRes::time+$timediff),
$out->{release},
resolvebeacon($out->{beacon});
}elsif($type eq "i"){

View File

@ -61,7 +61,7 @@ while(1){
$p->{generation},
$p->{release},
strftime("%Y-%m-%d %H:%M:%S",gmtime $p->{time}),
$p->{time}-(time+3600),
$p->{time}-(time+$r0ket::timediff),
r0ket::getbeacon($p->{beacon})
);
$win->refresh;

View File

@ -186,7 +186,7 @@ if($cmd =~ /^r/){
if($scmd eq "t"){
$pkt.="T";
$pkt.=chr(shift); #gen
$pkt.=pack("N",scalar(time)+2*60*60);
$pkt.=pack("N",scalar(time)+$r0ket::timediff);
$pkt.=pack("N",0);
$pkt.=pack("N",0);
@ -197,7 +197,7 @@ if($cmd =~ /^r/){
}elsif($scmd eq "a"){
$pkt.="A";
$pkt.=chr(shift); #gen
$pkt.=pack("N",scalar(time)+1*60*60+ 300);
$pkt.=pack("N",scalar(time)+$r0ket::timediff+ 300);
$pkt.= pack("C",shift||0);
$pkt.= pack("C",0);
@ -212,7 +212,7 @@ if($cmd =~ /^r/){
}elsif($scmd eq "b"){
$pkt.="B";
$pkt.=chr(shift); #gen
$pkt.=pack("N",scalar(time)+1*60*60+ 600);
$pkt.=pack("N",scalar(time)+$r0ket::timediff+ 600);
$pkt.= pack("C",shift||0);
$pkt.= pack("C",0);
@ -227,7 +227,7 @@ if($cmd =~ /^r/){
}elsif($scmd eq "c"){
$pkt.="\x1";
$pkt.=chr(shift); #gen
$pkt.=pack("N",scalar(time)+1*60*60+ 600);
$pkt.=pack("N",scalar(time)+$r0ket::timediff+ 600);
$pkt.= pack("C",shift||0);
$pkt.= pack("C",0);