Mirage Source
HDSN ban rte 9 - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: HDSN ban rte 9 (/showthread.php?tid=843)



HDSN ban rte 9 - Nemesis - 22-03-2007

I recently added HDSN banning to my engine and I'm sort of stumped with the run time error 9 I'm getting. It'd be better to just post it rather than try to explain.

Code:
Function IsBanned(ByVal IP As String) As Boolean

Dim FileName As String, fIP As String, fName As String
Dim f As Long
'Dim b As Integer
Dim BIp As String
Dim I As Integer

    IsBanned = False
    
    FileName = App.Path & "\banlist.ini"
    
    For I = 0 To MAX_BANS
        If Ban(I).BannedIP  "" Then
              BIp = Ban(I).BannedIP
              If IP = BIp Then
                  IsBanned = True
                  Exit Function
              Else
                  IsBanned = False
              End If
        End If
    Next I
    
End Function

The line that is highlighted is
Code:
If Ban(I).BannedIP  "" Then

When I hold my mouse over it I get...
Code:
Ban(I).BannedIP =

If anyone can help that'd be really cool. Thanks.

Edit* Same exact thing with.

Code:
Function IsBannedHD(ByVal HD As String) As Boolean

Dim FileName As String
Dim bHD As String
Dim I As Integer

    IsBannedHD = False
    
    FileName = App.Path & "\banlist.ini"
    
    For I = 0 To MAX_BANS
        If Ban(I).BannedHD  "" Then
              bHD = Ban(I).BannedHD
              If HD = bHD Then
                  IsBannedHD = True
                  Exit Function
              Else
                  IsBannedHD = False
              End If
        End If
    Next I
    
End Function


On line
Code:
If Ban(I).BannedHD  "" Then
and when I hover over it it gives me the same basic thing as above.

If I try to put On Error Resume Next it just says I'm banned from the server so go figure -_-.


- Nemesis - 22-03-2007

Yeah it was originally set As String. (I) is going out of range for some reason. On top of that, when I boot the server it isn't writing a banlist.ini and it doesn't crash until someone attempts to log in.