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

Method LoadClientinfo

client/src/main/java/jake2/client/CL_parse.java:311–434  ·  view source on GitHub ↗
(clientinfo_t ci, String s)

Source from the content-addressed store, hash-verified

309 * ================
310 */
311 public static void LoadClientinfo(clientinfo_t ci, String s) {
312 //char model_name[MAX_QPATH];
313 //char skin_name[MAX_QPATH];
314 //char model_filename[MAX_QPATH];
315 //char skin_filename[MAX_QPATH];
316 //char weapon_filename[MAX_QPATH];
317
318 String model_name, skin_name, model_filename, skin_filename, weapon_filename;
319
320 ci.cinfo = s;
321 //ci.cinfo[sizeof(ci.cinfo) - 1] = 0;
322
323 // isolate the player's name
324 ci.name = s;
325 //ci.name[sizeof(ci.name) - 1] = 0;
326
327 int t = s.indexOf('\\');
328 //t = strstr(s, "\\");
329
330 if (t != -1) {
331 ci.name = s.substring(0, t);
332 s = s.substring(t + 1, s.length());
333 //s = t + 1;
334 }
335
336 if (ClientGlobals.cl_noskins.value != 0 || s.length() == 0) {
337
338 model_filename = ("players/male/tris.md2");
339 weapon_filename = ("players/male/weapon.md2");
340 skin_filename = ("players/male/grunt.pcx");
341 ci.iconname = ("/players/male/grunt_i.pcx");
342
343 ci.model = ClientGlobals.re.RegisterModel(model_filename);
344
345 ci.weaponmodel = new model_t[Defines.MAX_CLIENTWEAPONMODELS];
346 ci.weaponmodel[0] = ClientGlobals.re.RegisterModel(weapon_filename);
347 ci.skin = ClientGlobals.re.RegisterSkin(skin_filename);
348 ci.icon = ClientGlobals.re.RegisterPic(ci.iconname);
349
350 } else {
351 // isolate the model name
352
353 int pos = s.indexOf('/');
354
355 if (pos == -1)
356 pos = s.indexOf('/');
357 if (pos == -1) {
358 pos = 0;
359 Com.Error(Defines.ERR_FATAL, "Invalid model name:" + s);
360 }
361
362 model_name = s.substring(0, pos);
363
364 // isolate the skin name
365 skin_name = s.substring(pos + 1, s.length());
366
367 // model file
368 model_filename = "players/" + model_name + "/tris.md2";

Callers 2

PrepRefreshMethod · 0.95
ParseClientinfoMethod · 0.95

Calls 5

ErrorMethod · 0.95
RegisterModelMethod · 0.65
RegisterSkinMethod · 0.65
RegisterPicMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected