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

Method ParseConfigString

client/src/main/java/jake2/client/CL_parse.java:452–495  ·  view source on GitHub ↗
(ConfigStringMessage configMsg)

Source from the content-addressed store, hash-verified

450 * ================ CL_ParseConfigString ================
451 */
452 public static void ParseConfigString(ConfigStringMessage configMsg) {
453 if (configMsg.index < 0 || configMsg.index >= Defines.MAX_CONFIGSTRINGS)
454 Com.Error(Defines.ERR_DROP, "configstring > MAX_CONFIGSTRINGS");
455
456 client_state_t clientState = ClientGlobals.cl;
457 String olds = clientState.configstrings[configMsg.index];
458 clientState.configstrings[configMsg.index] = configMsg.config;
459
460 // do something apropriate
461
462 if (configMsg.index >= Defines.CS_LIGHTS
463 && configMsg.index < Defines.CS_LIGHTS + Defines.MAX_LIGHTSTYLES) {
464
465 CL_fx.SetLightstyle(configMsg.index - Defines.CS_LIGHTS);
466
467 } else if (configMsg.index == Defines.CS_CDTRACK) {
468 if (clientState.refresh_prepped)
469 CDAudio.Play(Lib.atoi(clientState.configstrings[Defines.CS_CDTRACK]), true);
470
471 } else if (configMsg.index >= Defines.CS_MODELS && configMsg.index < Defines.CS_MODELS + Defines.MAX_MODELS) {
472 if (clientState.refresh_prepped) {
473 clientState.model_draw[configMsg.index - Defines.CS_MODELS] = ClientGlobals.re
474 .RegisterModel(clientState.configstrings[configMsg.index]);
475 if (clientState.configstrings[configMsg.index].startsWith("*"))
476 clientState.model_clip[configMsg.index - Defines.CS_MODELS] = ClientGlobals.cm.InlineModel(clientState.configstrings[configMsg.index]);
477 else
478 clientState.model_clip[configMsg.index - Defines.CS_MODELS] = null;
479 }
480 } else if (configMsg.index >= Defines.CS_SOUNDS
481 && configMsg.index < Defines.CS_SOUNDS + Defines.MAX_MODELS) {
482 if (clientState.refresh_prepped)
483 clientState.sound_precache[configMsg.index - Defines.CS_SOUNDS] = S
484 .RegisterSound(clientState.configstrings[configMsg.index]);
485 } else if (configMsg.index >= Defines.CS_IMAGES
486 && configMsg.index < Defines.CS_IMAGES + Defines.MAX_MODELS) {
487 if (clientState.refresh_prepped)
488 clientState.image_precache[configMsg.index - Defines.CS_IMAGES] = ClientGlobals.re
489 .RegisterPic(clientState.configstrings[configMsg.index]);
490 } else if (configMsg.index >= Defines.CS_PLAYERSKINS
491 && configMsg.index < Defines.CS_PLAYERSKINS + Defines.MAX_CLIENTS) {
492 if (clientState.refresh_prepped && !olds.equals(configMsg.config))
493 ParseClientinfo(configMsg.index - Defines.CS_PLAYERSKINS);
494 }
495 }
496
497 /*
498 * =====================================================================

Callers 1

ParseServerMessageMethod · 0.95

Calls 10

ErrorMethod · 0.95
SetLightstyleMethod · 0.95
PlayMethod · 0.95
atoiMethod · 0.95
RegisterSoundMethod · 0.95
ParseClientinfoMethod · 0.95
InlineModelMethod · 0.80
RegisterModelMethod · 0.65
RegisterPicMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected