Skip to content

Commit 6769538

Browse files
committed
Improve & simplify Watch offset handling.
1 parent 0c92aa8 commit 6769538

File tree

1 file changed

+12
-32
lines changed

1 file changed

+12
-32
lines changed

dlFilter.mrc

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ alias -l DLF.RenameVar {
173173
on *:signal:DLF.Initialise: { DLF.Initialise $1- }
174174
alias -l DLF.Initialise {
175175
; No incoming debug event - so need a manual reset of tick offset
176-
DLF.Watch.Offset
177176
DLF.Watch.Called DLF.Initialise : $1-
178177

179178
; Handle obsolete variables
@@ -1685,12 +1684,7 @@ alias -l DLF.Ops.AdvertsEnable {
16851684
}
16861685

16871686
on *:signal:DLF.Ops.AdvertChan: { DLF.Ops.AdvertChan $1- }
1688-
alias -l DLF.Ops.AdvertChan {
1689-
; No incoming debug event - so need a manual reset of tick offset
1690-
DLF.Watch.Offset
1691-
scon -a DLF.Ops.AdvertChanNet
1692-
}
1693-
1687+
alias -l DLF.Ops.AdvertChan { scon -a DLF.Ops.AdvertChanNet }
16941688
alias -l DLF.Ops.AdvertChanNet {
16951689
if ($server == $null) return
16961690
var %i $chan(0)
@@ -1812,8 +1806,6 @@ alias -l DLF.Ops.VersionReply {
18121806

18131807
on *:signal:DLF.Ops.AdvertPrivDLF: { DLF.Ops.AdvertPrivDLF $1- }
18141808
alias -l DLF.Ops.AdvertPrivDLF {
1815-
; No incoming debug event - so need a manual reset of tick offset
1816-
DLF.Watch.Offset
18171809
DLF.Watch.Called DLF.Ops.AdvertPrivDLF : $1-
18181810
var %idx $+($network,@,$1)
18191811
if ($hfind(DLF.ops.privateAd,%idx)) return
@@ -2012,8 +2004,6 @@ alias -l DLF.DccSend.Receiving {
20122004

20132005
alias -l DLF.DccSend.FileRcvd {
20142006
var %fn $nopath($filename)
2015-
; No incoming debug event - so need a manual reset of tick offset
2016-
DLF.Watch.Offset
20172007
DLF.Watch.Called DLF.DccSend.FileRcvd %fn : $1-
20182008
var %req $DLF.DccSend.GetRequest(%fn)
20192009
if (%req == $null) return
@@ -2115,8 +2105,6 @@ alias -l DLF.DccSend.TrustAdd {
21152105

21162106
on *:signal:DLF.DccSend.TrustRemove: DLF.DccSend.TrustRemove $1-
21172107
alias -l DLF.DccSend.TrustRemove {
2118-
; No incoming debug event - so need a manual reset of tick offset
2119-
DLF.Watch.Offset
21202108
DLF.Watch.Called DLF.DccSend.TrustRemove Trust: Removed $2-
21212109
.dcc trust -r $1
21222110
}
@@ -3033,8 +3021,6 @@ alias -l DLF.Filter.Close {
30333021

30343022
on *:signal:DLF.Win.CloseRen: { DLF.Win.CloseRen $1- }
30353023
alias -l DLF.Win.CloseRen {
3036-
; No incoming debug event - so need a manual reset of tick offset
3037-
DLF.Watch.Offset
30383024
DLF.Watch.Called DLF.Win.CloseRen : $1-
30393025
if ($window($2)) close -@ $2
30403026
if ($window($1)) renwin $1 $2
@@ -6043,10 +6029,17 @@ alias -l DLF.Watch.Called {
60436029
alias -l DLF.Watch.Log {
60446030
if ($debug == $null) return
60456031
if ($0 == 0) return
6046-
if ($1 isin <->) DLF.Watch.Offset
6047-
var %eventid
6048-
if ($eventid) %eventid = $eventid
6049-
var %l $timestamp $+ $DLF.Watch.Offset $burko(%eventid $1-)
6032+
var %ticks $ticks, %eventid
6033+
if (!$var(%DLF.watch.ticks,0)) set -e %DLF.watch.ticks %ticks
6034+
if ($eventid) {
6035+
%eventid = $eventid
6036+
if ((%DLF.watch.eventid != 0) && (%DLF.watch.eventid != $eventid)) set -e %DLF.watch.ticks %ticks
6037+
}
6038+
elseif ($1 == <-) set -e %DLF.watch.ticks %ticks
6039+
set -e %DLF.watch.eventid $eventid
6040+
%ticks = %ticks - %DLF.watch.ticks
6041+
%ticks = %ticks % 1000
6042+
var %l $timestamp $+ + $+ $base(%ticks,10,10,3) $burko(%eventid $1-)
60506043
if (@* !iswm $debug) write $debug %l
60516044
elseif ($window($debug)) {
60526045
DLF.Win.CustomTrim $debug
@@ -6059,19 +6052,6 @@ alias -l DLF.Watch.Log {
60596052
}
60606053
}
60616054

6062-
; /DLF.Watch.Offset : reset ms offset
6063-
; $DLF.Watch.Offset : returns 3-digit +ms offset value
6064-
alias -l DLF.Watch.Offset {
6065-
var %ticks $ticks
6066-
if (!$var(%DLF.offsetticks,0) || (!$isid)) {
6067-
set -e %DLF.offsetticks %ticks
6068-
if (!$isid) return
6069-
}
6070-
var %ticks %ticks - %DLF.offsetticks
6071-
%ticks = %ticks % 1000
6072-
return + $+ $base(%ticks,10,10,3)
6073-
}
6074-
60756055
alias -l DLF.Halt {
60766056
if ($0) DLF.Watch.Log $1-
60776057
else DLF.Watch.Log Halted: No details available

0 commit comments

Comments
 (0)