-
Notifications
You must be signed in to change notification settings - Fork 0
/
IPBan.frm
206 lines (186 loc) · 5.1 KB
/
IPBan.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
VERSION 5.00
Begin VB.Form IPBan
BorderStyle = 1 'Fixed Single
Caption = "IP Ban Options"
ClientHeight = 3195
ClientLeft = 1785
ClientTop = 2130
ClientWidth = 4620
Icon = "IPBan.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4620
Begin VB.CommandButton Command7
Caption = "Close"
Default = -1 'True
Height = 375
Left = 2880
TabIndex = 7
Top = 2760
Width = 1575
End
Begin VB.CommandButton Command5
Caption = "Ban x.*.*.*"
Height = 375
Left = 2880
TabIndex = 6
Top = 2160
Width = 1575
End
Begin VB.CommandButton Command4
Caption = "Ban x.x.*.*"
Height = 375
Left = 2880
TabIndex = 5
Top = 1680
Width = 1575
End
Begin VB.CommandButton Command3
Caption = "Ban x.x.x.*"
Height = 375
Left = 2880
TabIndex = 4
Top = 1200
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "<< Add to ban list"
Height = 375
Left = 2880
TabIndex = 3
Top = 0
Width = 1695
End
Begin VB.TextBox ip
Height = 285
Left = 2880
TabIndex = 2
Top = 360
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "Remove from list"
Height = 375
Left = 2880
TabIndex = 1
Top = 720
Width = 1575
End
Begin VB.ListBox iplist
Height = 3180
Left = 0
MultiSelect = 2 'Extended
Sorted = -1 'True
TabIndex = 0
Top = 0
Width = 2775
End
End
Attribute VB_Name = "IPBan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub RefreshList()
a$ = Main.servRconAns$("listip")
k = InStr(a$, Chr$(10))
If k Then a$ = Mid$(a$, k + 1)
iplist.Clear
Do
If Left$(a$, 1) = Chr$(0) Then Exit Do
k = InStr(a$, Chr$(10))
If k = 0 Then Exit Do
i$ = Left$(a$, k - 1)
a$ = Mid$(a$, k + 1)
iplist.AddItem i$
Loop
End Sub
Private Sub Command1_Click()
TTT = False
k = iplist.ListCount
If iplist.ListCount = 0 Then Exit Sub
For o = 0 To iplist.ListIndex
k = iplist.Selected(o)
If k = True Then
dummy = Main.servRconAns$("removeip " + Main.subst$(iplist.List(o), " ", ""))
TTT = True
End If
Next
If TTT Then RefreshList
End Sub
Private Sub Command2_Click()
If ip.text > "" Then
dummy = Main.servRconAns$("addip " + ip.text)
RefreshList
End If
End Sub
Private Sub Command3_Click()
TTT = False
If iplist.ListCount = 0 Then Exit Sub
For o = 0 To iplist.ListIndex
k = iplist.Selected(o)
If k = True Then
kt = Val(Right$(iplist.List(o), 3))
If kt = 0 Then
dummy = MsgBox("That ip is already banned.")
Else
nip$ = Left$(iplist.List(o), 12) + "0"
nip$ = Main.subst$(nip$, " ", "")
dummy = Main.servRconAns$("addip " + nip$)
TTT = True
End If
End If
Next
If TTT Then RefreshList
End Sub
Private Sub Command4_Click()
TTT = False
If iplist.ListCount = 0 Then Exit Sub
For o = 0 To iplist.ListIndex
k = iplist.Selected(o)
If k = True Then
kt = Val(Right$(iplist.List(o), 3))
kt2 = Val(Left$(Right$(iplist.List(o), 7), 3))
If kt = 0 And kt2 = 0 Then
dummy = MsgBox("That ip is already banned.")
Else
nip$ = Left$(iplist.List(o), 9) + "0.0"
nip$ = Main.subst$(nip$, " ", "")
dummy = Main.servRconAns$("addip " + nip$)
TTT = True
End If
End If
Next
If TTT Then RefreshList
End Sub
Private Sub Command5_Click()
TTT = False
If iplist.ListCount = 0 Then Exit Sub
For o = 0 To iplist.ListIndex
k = iplist.Selected(o)
If k = True Then
kt = Val(Right$(iplist.List(o), 3))
kt2 = Val(Left$(Right$(iplist.List(o), 7), 3))
kt3 = Val(Left$(Right$(iplist.List(o), 11), 3))
If kt = 0 And kt2 = 0 Then
dummy = MsgBox("That ip is already banned.")
Else
nip$ = Left$(iplist.List(o), 4) + "0.0.0"
nip$ = Main.subst$(nip$, " ", "")
dummy = Main.servRconAns$("addip " + nip$)
TTT = True
End If
End If
Next
If TTT Then RefreshList
End Sub
Private Sub Command6_Click()
End Sub
Private Sub Command7_Click()
Unload Me
Me.Visible = False
End Sub
Private Sub Form_Load()
GFS "Ip listing", iplist
End Sub