Skip to content

Commit

Permalink
Replaced GetTickCount with its 64-bit counterpart (GetTickCount64)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbielsa1 committed Dec 6, 2024
1 parent 7d1d3f2 commit d54ea68
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 189 deletions.
2 changes: 0 additions & 2 deletions Codigo/General.bas
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,6 @@ Sub Main()
' Configuracion de los sockets
' ----------------------------------------------------

314 Call GetHoraActual

316 HoraMundo = GetTickCount() - DuracionDia \ 2

318 frmCargando.Visible = False
Expand Down
1 change: 0 additions & 1 deletion Codigo/ModEventos.bas
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Attribute VB_Name = "ModEventos"
'
'
'
Public HoraEvento As Byte

Public TiempoRestanteEvento As Byte

Expand Down
85 changes: 35 additions & 50 deletions Codigo/Protocol.bas
Original file line number Diff line number Diff line change
Expand Up @@ -9191,67 +9191,52 @@ HandleCancelarExit_Err:
End Sub

Private Sub HandleEventoInfo(ByVal UserIndex As Integer)
'Author: Pablo Mercavides

On Error GoTo HandleEventoInfo_Err

100 With UserList(UserIndex)

102 If EventoActivo Then
104 Call WriteConsoleMsg(UserIndex, PublicidadEvento & ". Tiempo restante: " & TiempoRestanteEvento & " minuto(s).", e_FontTypeNames.FONTTYPE_New_Eventos)
Else
106 Call WriteConsoleMsg(UserIndex, "Eventos> Actualmente no hay ningun evento en curso.", e_FontTypeNames.FONTTYPE_New_Eventos)
On Error GoTo ErrorHandler

End If
102 If EventoActivo Then
104 Call WriteConsoleMsg(UserIndex, PublicidadEvento & ". Tiempo restante: " & TiempoRestanteEvento & " minuto(s).", e_FontTypeNames.FONTTYPE_New_Eventos)
Else
106 Call WriteConsoleMsg(UserIndex, "Eventos> Actualmente no hay ningun evento en curso.", e_FontTypeNames.FONTTYPE_New_Eventos)
End If

Dim i As Byte
Dim encontre As Boolean
Dim HoraProximo As Byte

108 If Not HoraEvento + 1 >= 24 Then

110 For i = HoraEvento + 1 To 23

112 If Evento(i).Tipo <> 0 Then
114 encontre = True
116 HoraProximo = i
Exit For

End If

118 Next i

End If
Dim foundNextEvent As Boolean
Dim nextEventHour As Long

120 If encontre = False Then

122 For i = 0 To HoraEvento

124 If Evento(i).Tipo <> 0 Then
126 encontre = True
128 HoraProximo = i
Exit For

End If

130 Next i
Dim i As Long

'Check if there's another event before the day ends.
110 For i = Hour(Now) + 1 To 23
112 If Evento(i).Tipo <> 0 Then
114 foundNextEvent = True
116 nextEventHour = i
Exit For
End If
118 Next i

132 If encontre Then
134 Call WriteConsoleMsg(UserIndex, "Eventos> El proximo evento " & DescribirEvento(HoraProximo) & " iniciara a las " & HoraProximo & ":00 horas.", e_FontTypeNames.FONTTYPE_New_Eventos)
Else
136 Call WriteConsoleMsg(UserIndex, "Eventos> No hay eventos proximos.", e_FontTypeNames.FONTTYPE_New_Eventos)

End If

End With
'We couldn't find any. Check if there's an event on
'the next day.
120 If Not foundNextEvent Then
122 For i = 0 To Hour(Now)
124 If Evento(i).Tipo <> 0 Then
126 foundNextEvent = True
128 nextEventHour = i
Exit For
End If
130 Next i
End If

132 If foundNextEvent Then
134 Call WriteConsoleMsg(UserIndex, "Eventos> El proximo evento " & DescribirEvento(nextEventHour) & " iniciara a las " & nextEventHour & ":00 horas.", e_FontTypeNames.FONTTYPE_New_Eventos)
Else
136 Call WriteConsoleMsg(UserIndex, "Eventos> No hay eventos proximos.", e_FontTypeNames.FONTTYPE_New_Eventos)
End If

Exit Sub

HandleEventoInfo_Err:
ErrorHandler:
138 Call TraceError(Err.Number, Err.Description, "Protocol.HandleEventoInfo", Erl)
140

End Sub

Private Sub HandleCrearEvento(ByVal UserIndex As Integer)
Expand Down
80 changes: 42 additions & 38 deletions Codigo/Protocol_GmCommands.bas
Original file line number Diff line number Diff line change
Expand Up @@ -4170,48 +4170,52 @@ ErrHandler:
End Sub

Public Sub HandleEventoInfo(ByVal UserIndex As Integer)
'Author: Pablo Mercavides
On Error GoTo HandleEventoInfo_Err

100 With UserList(UserIndex)
102 If EventoActivo Then
104 Call WriteConsoleMsg(UserIndex, PublicidadEvento & ". Tiempo restante: " & TiempoRestanteEvento & " minuto(s).", e_FontTypeNames.FONTTYPE_New_Eventos)
Else
106 Call WriteConsoleMsg(UserIndex, "Eventos> Actualmente no hay ningun evento en curso.", e_FontTypeNames.FONTTYPE_New_Eventos)
End If

Dim i As Byte
Dim encontre As Boolean
Dim HoraProximo As Byte

108 If Not HoraEvento + 1 >= 24 Then
110 For i = HoraEvento + 1 To 23
112 If Evento(i).Tipo <> 0 Then
114 encontre = True
116 HoraProximo = i
Exit For
End If
118 Next i
End If
On Error GoTo ErrorHandler

102 If EventoActivo Then
104 Call WriteConsoleMsg(UserIndex, PublicidadEvento & ". Tiempo restante: " & TiempoRestanteEvento & " minuto(s).", e_FontTypeNames.FONTTYPE_New_Eventos)
Else
106 Call WriteConsoleMsg(UserIndex, "Eventos> Actualmente no hay ningun evento en curso.", e_FontTypeNames.FONTTYPE_New_Eventos)
End If

Dim foundNextEvent As Boolean
Dim nextEventHour As Long

Dim i As Long

'Check if there's another event before the day ends.
110 For i = Hour(Now) + 1 To 23
112 If Evento(i).Tipo <> 0 Then
114 foundNextEvent = True
116 nextEventHour = i
Exit For
End If
118 Next i

'We couldn't find any. Check if there's an event on
'the next day.
120 If Not foundNextEvent Then
122 For i = 0 To Hour(Now)
124 If Evento(i).Tipo <> 0 Then
126 foundNextEvent = True
128 nextEventHour = i
Exit For
End If
130 Next i
End If

132 If foundNextEvent Then
134 Call WriteConsoleMsg(UserIndex, "Eventos> El proximo evento " & DescribirEvento(nextEventHour) & " iniciara a las " & nextEventHour & ":00 horas.", e_FontTypeNames.FONTTYPE_New_Eventos)
Else
136 Call WriteConsoleMsg(UserIndex, "Eventos> No hay eventos proximos.", e_FontTypeNames.FONTTYPE_New_Eventos)
End If

120 If encontre = False Then
122 For i = 0 To HoraEvento
124 If Evento(i).Tipo <> 0 Then
126 encontre = True
128 HoraProximo = i
Exit For
End If
130 Next i
End If
132 If encontre Then
134 Call WriteConsoleMsg(UserIndex, "Eventos> El proximo evento " & DescribirEvento(HoraProximo) & " iniciara a las " & HoraProximo & ":00 horas.", e_FontTypeNames.FONTTYPE_New_Eventos)
Else
136 Call WriteConsoleMsg(UserIndex, "Eventos> No hay eventos proximos.", e_FontTypeNames.FONTTYPE_New_Eventos)
End If
End With
Exit Sub
HandleEventoInfo_Err:

ErrorHandler:
138 Call TraceError(Err.Number, Err.Description, "Protocol.HandleEventoInfo", Erl)

End Sub

Public Sub HandleCrearEvento(ByVal UserIndex As Integer)
Expand Down
81 changes: 19 additions & 62 deletions Codigo/frmMain.frm
Original file line number Diff line number Diff line change
Expand Up @@ -1435,77 +1435,30 @@ Command9_Click_Err:
End Sub

Private Sub EstadoTimer_Timer()
On Error GoTo EstadoTimer_Timer_Err
Call GetHoraActual
Dim i As Long
Dim PerformanceTimer As Long

On Error GoTo ErrorHandler

Dim PerformanceTimer As Long
Call PerformanceTestStart(PerformanceTimer)

Dim i As Long
For i = 1 To Baneos.Count
If Baneos(i).FechaLiberacion <= Now Then
Call SendData(SendTarget.ToAdmins, 0, PrepareMessageConsoleMsg("Servidor » Se ha concluido la sentencia de ban para " & Baneos(i).name & ".", e_FontTypeNames.FONTTYPE_SERVER))
Call UnBan(Baneos(i).Name)
Call UnBan(Baneos(i).name)
Call Baneos.Remove(i)
Call SaveBans
End If
Next

Select Case frmMain.lblhora.Caption
Case "0:00:00"
HoraEvento = 0
Case "1:00:00"
HoraEvento = 1
Case "2:00:00"
HoraEvento = 2
Case "3:00:00"
HoraEvento = 3
Case "4:00:00"
HoraEvento = 4
Case "5:00:00"
HoraEvento = 5
Case "6:00:00"
HoraEvento = 6
Case "7:00:00"
HoraEvento = 7
Case "8:00:00"
HoraEvento = 8
Case "9:00:00"
HoraEvento = 9
Case "10:00:00"
HoraEvento = 10
Case "11:00:00"
HoraEvento = 11
Case "12:00:00"
HoraEvento = 12
Case "13:00:00"
HoraEvento = 13
Case "14:00:00"
HoraEvento = 14
Case "15:00:00"
HoraEvento = 15
Case "16:00:00"
HoraEvento = 16
Case "17:00:00"
HoraEvento = 17
Case "18:00:00"
HoraEvento = 18
Case "19:00:00"
HoraEvento = 19
Case "20:00:00"
HoraEvento = 20
Case "21:00:00"
HoraEvento = 21
Case "22:00:00"
HoraEvento = 22
Case "23:00:00"
HoraEvento = 23
Case Else
Exit Sub
End Select
Call CheckEvento(HoraEvento)
Call CheckEvento(Hour(Now))

Call PerformTimeLimitCheck(PerformanceTimer, "FrmMain EstadoTimer_Timer", 100)
Exit Sub
EstadoTimer_Timer_Err:

ErrorHandler:
Call TraceError(Err.Number, Err.Description, "frmMain.EstadoTimer_Timer", Erl)

End Sub

Private Sub Evento_Timer()
Expand Down Expand Up @@ -1651,7 +1604,8 @@ End Sub

Private Sub HoraFantasia_Timer()

On Error GoTo HoraFantasia_Timer_Err
On Error GoTo ErrorHandler

If Lloviendo Then
Label6.Caption = "Lloviendo"
Else
Expand All @@ -1663,10 +1617,13 @@ Private Sub HoraFantasia_Timer()
Else
Label7.Caption = "Sin nubes"
End If
frmMain.Label4.Caption = GetTimeFormated

frmMain.Label4.Caption = Format(Now, "hh:mm")
Exit Sub
HoraFantasia_Timer_Err:

ErrorHandler:
Call TraceError(Err.Number, Err.Description, "frmMain.HoraFantasia_Timer", Erl)

End Sub


Expand Down
Loading

0 comments on commit d54ea68

Please sign in to comment.