| Mirage Source http://miragesource.net/forums/ |
|
| HDSN ban rte 9 http://miragesource.net/forums/viewtopic.php?f=201&t=1553 |
Page 1 of 1 |
| Author: | Nemesis [ Thu Mar 22, 2007 3:35 pm ] |
| Post subject: | HDSN ban rte 9 |
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 = <Subscript out of range> 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 -_-. |
|
| Author: | one [ Thu Mar 22, 2007 5:05 pm ] |
| Post subject: | |
what kind of variable is your .BannedIP? Set it as String |
|
| Author: | Nemesis [ Thu Mar 22, 2007 5:46 pm ] |
| Post subject: | |
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. |
|
| Author: | one [ Thu Mar 22, 2007 6:14 pm ] |
| Post subject: | |
uhm, seems like you changed alot in your ban system, i cant help you since i dont know your code... may you post the other parts of your bancode? like Public Ban(1 To MAX_BANS) As BanRec Type BanRec.... etc Public Const MAX_BANS = ? or send me your code, that would be easier |
|
| Author: | Lea [ Fri Mar 23, 2007 1:25 am ] |
| Post subject: | |
For i = 0 to MAX_BANS - 1 But... why would you want a maximum number of bans? |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|