SMFv3 integration - #710
Conversation
|
I will relent on letting you have user IDs in these requests but we need it to be at least 1 major version away (i.e. v9) and we need to have a deprecation warning in the v8 series |
|
Why are you propagating the userid everywhere, to then only use it to check the game platform when the platform itself is also in the request jwt? |
|
I had that same question ^^ cc @AnthonyFuller |
I realise now that this is only an issue when both log in at the same time, which is not as likely but still possible I guess. |
|
I believe as part of cross progression, you can now only have one of those linked profiles connected at a given time. |
|
The main issue logistically in propagating either the user ID or platform through is just whether the JWT is available; the user ID is less disruptive because so many paths already have it as a parameter, and to SMF integration it's all the same. It's also more useful to expose to plugins because user-specific contract logic is a legitimate use-case (and I can think of more that you can do with user-specific contracts than platform-specific contracts) |
Introduces `modEnabledForUser` and `modEnabledForGame` from #710 and deprecates the existing `modIsInstalled` in favour of the new functions. SMFv2 does not actually provide the necessary data to check the mod version, or information for a specific game, so these functions currently have the exact same behaviour as `modIsInstalled`. Nonetheless, they have the same signature as the ones in #710, so will help get developers in the habit of specifying the correct information. -------- #### General - [x] I've run Prettier to format any changed files - [x] I've verified that my changes work, and included a test plan -------- #### Testing - [x] I have added or considered adding unit/integration tests that cover any code changes
|
I think looks good so far, but if we're doing the contracts and campaigns per deployment, we should be doing the unlockables and entrances per deployment too; so maybe change those into a hook/tap system as well. |
|
Something like this maybe in configSwizzleManager export const configModifierHooks: HookMap<
SyncHook<
[
/** configData */ object,
/** gameVersion */ string,
/** userId */ string,
]
>
> = new HookMap(() => new SyncHook())
export function getUserVersionedConfig<T = unknown>(
configKey: keyof typeof configs,
gameVersion: GameVersion,
userId: string,
clone: boolean = true,
): T {
const configData = getVersionedConfig(configKey, gameVersion, clone)
configModifierHooks.for(configKey).call(configData, gameVersion, userId)
return configData
} |
As title. Updates the existing contracts, unlockables and plugin integration with SMF, and expands it to also cover locations, entrances, agency pickups and campaigns.
Does not work with SMFv2, so shouldn't be merged until SMFv3 release. Also contains breaking changes, including finally removing the mod-checking API that was deprecated years ago.
General
Testing