Skip to content
Permalink
Browse files

Use GetTickCount64() and Currency type for queue timing

Another possible fix for #6
  • Loading branch information...
Davnit committed Nov 15, 2017
1 parent 13e6c53 commit f65063b7ca47b38c34141999efc61114afbac3b5
Showing with 7 additions and 7 deletions.
  1. +4 −4 trunk/clsBNCSQueue.cls
  2. +3 −3 trunk/frmChat.frm
@@ -39,7 +39,7 @@ Attribute VB_Exposed = False
' PRIVATE VARIABLES
Option Explicit

Private LastSent As Double
Private LastSent As Currency
Private Credits As Long

' /** Note on implementation: This will assume that all previous packets have already been sent. Don't call this multiple
@@ -55,14 +55,14 @@ Public Function GetDelay(ByVal sText As String) As Long

If Credits < BotVars.QueueMaxCredits Then
' Adjust credits up
Credits = Credits + ((GetTickCount() - LastSent) / BotVars.QueueCreditRate)
Credits = Credits + ((modDateTime.GetTickCountMS() - LastSent) / BotVars.QueueCreditRate)

If Credits > BotVars.QueueMaxCredits Then
Credits = BotVars.QueueMaxCredits
End If
End If

LastSent = GetTickCount()
LastSent = modDateTime.GetTickCountMS()
' int thisByteDelay = byteCost;
ThisByteDelay = byteCost

@@ -90,7 +90,7 @@ End Function

Public Sub ClearQueue()
Credits = 0
LastSent = GetTickCount()
LastSent = modDateTime.GetTickCountMS()
' TODO: Clear the actual queue
End Sub

@@ -6816,14 +6816,14 @@ Function AddQ(ByVal Message As String, Optional msg_priority As Integer = -1, _
Dim currChar As Long
Dim Send As String
Dim Command As String
Dim GTC As Double
Dim GTC As Currency
Dim Q As clsQueueObj
Dim delay As Long
Dim Index As Long
Dim s As String ' temp string for settings
Dim MaxLength As Integer ' stores max length for split (with override)

Static LastGTC As Double
Static LastGTC As Currency
Static BanCount As Integer

strTmp = Message
@@ -6996,7 +6996,7 @@ Function AddQ(ByVal Message As String, Optional msg_priority As Integer = -1, _
' add to the queue!
For i = LBound(Splt) To UBound(Splt)
' store current tick
GTC = GetTickCount()
GTC = modDateTime.GetTickCountMS()

' store working copy
Send = Splt(i)

0 comments on commit f65063b

Please sign in to comment.
You can’t perform that action at this time.