Skip to content

fix: iw3/t4 DVAR_CODINFO flag value - #250

Open
regenerance wants to merge 3 commits into
michaeloliverx:mainfrom
regenerance:iw3-t4-DVAR_CODINFO-fix
Open

regenerance wants to merge 3 commits into
michaeloliverx:mainfrom
regenerance:iw3-t4-DVAR_CODINFO-fix

Conversation

@regenerance

Copy link
Copy Markdown
Contributor

Summary

Fixes the DVAR_CODINFO flag value.

DVAR_CODINFO was incorrectly defined as 0x100, which prevented dvars using this flag from being properly updated/synchronized to connected clients.

The correct value is:

DVAR_CODINFO = 0x08

This restores the expected client-side dvar propagation behavior.

…server do not propely apply to clients and mem is not properly patched according to host.
Comment thread src/game/iw3/mp/structs.h
DVAR_FLAG_NONE = 0x0,
DVAR_ARCHIVE = 0x1,
DVAR_CODINFO = 0x100, // On change, this is sent to all clients (if you are host)
DVAR_CODINFO = 0x08, // On change, this is sent to all clients (if you are host) - 8u is correct and stops lag for other clients and ensure proper updates

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think this change is correct.

The stock IW3 GScr_MakeDvarServerInfo explicitly adds 0x100 to existing dvars, and registers new ones with 0x4100:

result->flags |= 0x100u;
Dvar_RegisterString(..., 0x4100u, ...);

KisakCOD matches this as well:

Dvar_AddFlags(dvar, 256);

and the server update path checks dvar_modifiedFlags & 0x100 before updating CS_CODINFO.

0x08 is the SYSTEMINFO flag and appears to use a separate replication path, so changing DVAR_CODINFO from 0x100 to 0x08 would not be equivalent.

I remember testing this in game with connected clients and the no barriers worked for everyone? Is this not the case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I'll explain a little about what happens.. When the dvar happens, it will change for the clients, BUT they experience a state of where the memory only appears patched for the host and not the others.

Example. no barriers on iw3 and t4 will work for other clients, but they lag in those areas as if their console memory was not patched.

By switching it to this, it appears that the lag and updates are fixed. I highly suggest taking the time to test with myself or others and you can see exactly what I mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants