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

Method SVCmd_AddIP_f

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

SV_AddIP_f.

(List<String> args, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

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.

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