Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSQC: Initial support. #147

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

CSQC: Initial support. #147

wants to merge 11 commits into from

Conversation

dsvensson
Copy link
Collaborator

Draft PR until #145 has been merged, and a bit more functionality has been implemented.

Minimal support for client to download and execute, and notify outdated clients that they're missing out:

void(float apilevel, string enginename, float engineversion) CSQC_Init =
{
    print("Hello World\n");
}

MapExtFieldPtr takes a parameter name and returns an opaque field
token. In agreement with FTE this token contains some random bits
that are verified and stripped on use to avoid mods hardcoding field
offsets, which would over time lead to engine incompatibilities.

SetExtFieldPtr takes an entnum, a field token, a pointer to some
data as well as size which, if token and size is valid, performs a
memcpy of the data to the field referenced.

GetExtFieldPtr is the inverse of SetExtFieldPtr with same parameters.

Availability of above functions is determined via Map_Extension.
Allows entities to add three bytes of color modifiers where 0
is unset, 32 is 1.0f thus no color changes, and above 1.0 goes
into overbright territory.
As outdated clients have a broken implementation of FTE_PEXT_TRANS
these will not read the PF_EXTRA_PFS byte and the network protocol
will go out of sync unless this extension is disabled.

Once disabled, the client will work just fine, just that transparent
entities will be opaque.

Another workaround is for the client to set cl_pext_alpha to 0.
@dsvensson dsvensson force-pushed the csqc branch 2 times, most recently from e73228a to 69a14f6 Compare November 13, 2024 13:13
This can at a later point be extended to support svcfte_precache
to for example load next map while clients show scores via the
DP_SV_PRECACHEANYTIME extension.
Forward port of Reki's initial implementation.
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.

1 participant