Jump to content

Mod characters bypass SEAMLESSSWAP_CHARACTERLIST restriction in ValidateSpawnPrefabRequest


Leonardo Cox
  • Fixed

 

Wonkey is restricted to seamless swaps via the SEAMLESSSWAP_CHARACTERLIST table in the ValidateSpawnPrefabRequest function.

The obvious intention is to prevent players forcespawning as those characters via other means (like forcing wonkey to show up on the character select menu). However mod characters can't be restricted in the same way because of what looks to be an oversight.

local in_mod_char_list = table.contains(MODCHARACTERLIST, prefab_name)

 This variable 'in_mod_char_list' is set at the start of the function. Mod characters need to be in MODCHARACTERLIST in order for seamlessplayerswapper to swap to them.

if table.contains(SEAMLESSSWAP_CHARACTERLIST, prefab_name) and not allow_seamlessswap_characters then
        -- NOTES(JBK): This is not assertion level of importance but it is administrative note worthy level to know someone tried breaking things.
        in_valid_char_list = false
        print(string.format("[WERR] Player with ID %s tried spawning as %s without having permissions to do so!", user_id or "?", prefab_name or "?"))
    end

Here is the check for SEAMLESSSWAP_CHARACTERLIST, setting in_valid_char_list to false for the following block.

if in_valid_char_list then
        if skin_base == prefab_name.."_none" then
            -- If default skin, we do not need to check
            validated_skin_base = skin_base
        elseif TheInventory:CheckClientOwnership(user_id, skin_base) then
            --check if the skin_base actually belongs to the prefab
            if table.contains( PREFAB_SKINS[prefab_name], skin_base ) then
                validated_skin_base = skin_base
            end
        end
    elseif in_mod_char_list then
        --if mod character, don't use a skin
    elseif table.getn(valid_chars) > 0 then
        validated_prefab = valid_chars[1]
    else
        validated_prefab = DST_CHARACTERLIST[1]
    end

Unfortunately, in_valid_char_list set to false doesn't stop the check for in_mod_char_list, preventing the intended result of spawning as wilson.

If its not an oversight, then I'd like to ask that it gets fixed regardless to allow support for modded seamlessswap-only characters. Pretty please with cherry on top.


Steps to Reproduce

-have mod character inserted into SEAMLESSSWAP_CHARACTERLIST.

-Spawn as it, bypassing the validation check.




User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...