MCPcopy Create free account
hub / github.com/demoth/jake2 / SVCmd_RemoveIP_f

Method SVCmd_RemoveIP_f

game/src/main/java/jake2/game/GameSVCmds.java:184–206  ·  view source on GitHub ↗

SV_RemoveIP_f.

(List<String> args, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

182 * SV_RemoveIP_f.
183 */
184 private static void SVCmd_RemoveIP_f(List<String> args, GameExportsImpl gameExports) {
185 GameSVCmds.ipfilter_t f = new GameSVCmds.ipfilter_t();
186
187 if (args.size() < 3) {
188 gameExports.gameImports.cprintf(null, Defines.PRINT_HIGH,
189 "Usage: sv removeip <ip-mask>\n");
190 return;
191 }
192
193 if (!StringToFilter(args.get(2), f, gameExports))
194 return;
195
196 for (int i = 0; i < numipfilters; i++)
197 if (ipfilters[i].mask == f.mask
198 && ipfilters[i].compare == f.compare) {
199 for (int j = i + 1; j < numipfilters; j++)
200 ipfilters[j - 1] = ipfilters[j];
201 numipfilters--;
202 gameExports.gameImports.cprintf(null, Defines.PRINT_HIGH, "Removed.\n");
203 return;
204 }
205 gameExports.gameImports.cprintf(null, Defines.PRINT_HIGH, "Didn't find " + args.get(2) + ".\n");
206 }
207
208 /**
209 * SV_ListIP_f.

Callers 1

ServerCommandMethod · 0.95

Calls 4

StringToFilterMethod · 0.95
sizeMethod · 0.80
cprintfMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected