SV_AddIP_f.
(List<String> args, GameExportsImpl gameExports)
| 154 | * SV_AddIP_f. |
| 155 | */ |
| 156 | private static void SVCmd_AddIP_f(List<String> args, GameExportsImpl gameExports) { |
| 157 | int i; |
| 158 | |
| 159 | if (args.size() < 3) { |
| 160 | gameExports.gameImports.cprintf(null, Defines.PRINT_HIGH, |
| 161 | "Usage: addip <ip-mask>\n"); |
| 162 | return; |
| 163 | } |
| 164 | |
| 165 | for (i = 0; i < numipfilters; i++) |
| 166 | if (ipfilters[i].compare == 0xffffffff) |
| 167 | break; // free spot |
| 168 | if (i == numipfilters) { |
| 169 | if (numipfilters == MAX_IPFILTERS) { |
| 170 | gameExports.gameImports.cprintf(null, Defines.PRINT_HIGH, |
| 171 | "IP filter list is full\n"); |
| 172 | return; |
| 173 | } |
| 174 | numipfilters++; |
| 175 | } |
| 176 | |
| 177 | if (!StringToFilter(args.get(2), ipfilters[i], gameExports)) |
| 178 | ipfilters[i].compare = 0xffffffff; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * SV_RemoveIP_f. |
no test coverage detected