-
Notifications
You must be signed in to change notification settings - Fork 128
Somewhat better vanilla compat #694
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
Draft
sonny-tel
wants to merge
17
commits into
R2Northstar:main
Choose a base branch
from
r2ion:vanilla++++++++
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+89
−83
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6a9e986
More vanilla compat
sonny-tel d151d14
Use dummy instead of actual p3 token
sonny-tel 9343d3e
Less hacky vanilla compat replacement
sonny-tel 43191ab
Put NSIsVanilla on all script contexts
sonny-tel 089e653
Remove pointless cast
sonny-tel f9ade31
Fix formatting
sonny-tel f333b02
Handle 3p slightly better
sonny-tel abd0bb1
Add integrity checks for vanilla stuff
sonny-tel 1b65273
Add execute call
sonny-tel 429d57f
Just wait until another cbuf_execute, avoid crash
sonny-tel e784187
Remove pointless patch
sonny-tel 59766e5
Removed wrong patch whoops
sonny-tel 7b2b7be
Fix formatting
sonny-tel 304e98c
Better check which supports older versions
sonny-tel 73e318c
Fix formatting
sonny-tel 0146cd2
Move around includes in vanilla.h
sonny-tel 6ab2fa5
Merge branch 'main' into vanilla++++++++
GeckoEidechse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #include "core/vanilla.h" | ||
| #include "engine/r2engine.h" | ||
|
|
||
| VanillaCompatibility* g_pVanillaCompatibility; | ||
|
|
||
| ConVar* Cvar_ns_skip_vanilla_integrity_check; | ||
|
|
||
| bool VanillaCompatibility::GetVanillaCompatibility() | ||
| { | ||
| if (g_pCVar->FindVar("serverfilter")->GetBool() && !g_pCVar->FindVar("ns_is_northstar_server")->GetBool() && | ||
| !g_pCVar->FindVar("ns_auth_allow_insecure")->GetBool()) | ||
| { | ||
| // replicate old behaviour | ||
| if (Cvar_ns_skip_vanilla_integrity_check->GetBool()) | ||
| return false; | ||
|
|
||
| Cbuf_AddText(Cbuf_GetCurrentPlayer(), "disconnect \"Server is outdated or evil\"", cmd_source_t::kCommandSrcCode); | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| return g_pCVar->FindVar("ns_is_northstar_server")->GetBool() == 0; | ||
| } | ||
|
|
||
| ON_DLL_LOAD_RELIESON("engine.dll", VanillaCompat, ConVar, (CModule module)) | ||
| { | ||
| Cvar_ns_skip_vanilla_integrity_check = | ||
| new ConVar("ns_skip_vanilla_integrity_check", "0", FCVAR_NONE, "Skip vanilla integrity check for compatibility with older servers"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,10 @@ | ||
| #pragma once | ||
|
|
||
| /// Determines if we are in vanilla-compatibility mode. | ||
| /// In this mode we shouldn't auth with Atlas, which prevents users from joining a | ||
| /// non-trusted server. This means that we can unrestrict client/server commands | ||
| /// as well as various other small changes for compatibility | ||
| class VanillaCompatibility | ||
| { | ||
| public: | ||
| void SetVanillaCompatibility(bool isVanilla) | ||
| { | ||
| static bool bInitialised = false; | ||
| if (bInitialised) | ||
| return; | ||
|
|
||
| bInitialised = true; | ||
| m_bIsVanillaCompatible = isVanilla; | ||
| } | ||
|
|
||
| bool GetVanillaCompatibility() | ||
| { | ||
| return m_bIsVanillaCompatible; | ||
| } | ||
|
|
||
| private: | ||
| bool m_bIsVanillaCompatible = false; | ||
| bool GetVanillaCompatibility(); | ||
| }; | ||
|
|
||
| inline VanillaCompatibility* g_pVanillaCompatibility; | ||
| extern VanillaCompatibility* g_pVanillaCompatibility; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.