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

Functionality to automatically restore the citizen folder #3048

Open
Yorick20022 opened this issue Jan 2, 2025 · 8 comments
Open

Functionality to automatically restore the citizen folder #3048

Yorick20022 opened this issue Jan 2, 2025 · 8 comments
Labels
enhancement Feature or other request that adds functionality or improved usability triage Needs a preliminary assessment to determine the urgency and required action

Comments

@Yorick20022
Copy link

What happened?

This is not a bug report but rather a feature request, there is not a feature request template so I was advised to use this template but write it as if it were a feature request.

So the problem is that people replace their entire citizen folder because the instructions from their graphic mod say to do so. This often results in weird errors that make the game immediately crash on start or those mods can just be straight up malicious without users knowing.

Expected result

What I would expect from this feature is that it would restore the citizen folder with default content once it detects that the folder is modified.

Reproduction steps

Importancy

Slight inconvenience

Area(s)

FiveM, RedM

Specific version(s)

Additional information

No response

@Yorick20022 Yorick20022 added bug triage Needs a preliminary assessment to determine the urgency and required action labels Jan 2, 2025
@github-actions github-actions bot added the RedM Issues/PRs related to RedM label Jan 2, 2025
@gtasnail
Copy link

gtasnail commented Jan 2, 2025

👍

@Mathu-lmn
Copy link
Contributor

So you request to remove the ability to edit the citizen folder ?

@AvarianKnight
Copy link
Contributor

The citizen folder should already be self healing, do you mean the common folder?

@Gogsi
Copy link

Gogsi commented Jan 2, 2025

Some mods modify the common and platform folders inside FiveM\FiveM.app\citizen. For example this graphics mod . All of this can easily be done with an .rpf mod installed in FiveM\FiveM.app\mods instead, which to me seems like the intended way to do it, although it's undocumented as far as I can tell. That allows users to easily uninstall such mods in case they start causing issues/users don't like them.

While we're somewhat on the topic, I feel that in addition to this, something else should be done regarding pure mode. Currently it's possible to alter hitboxes, spawn new vehicles, etc. by either editing citizen or adding an rpf mod in mods. You can "easily" fix this with pure mode but that restricts you to 2 (afaik) pre-approved mods (one of which has been caught modifying other files before). Many servers don't want to force pure mode 1 because their users want to have different graphics/audio mods than the approved once. I'm not sure what the right solution is here - expand the pure mode "programme" or somehow allow the filtering of loaded client mods.

@Gogsi
Copy link

Gogsi commented Jan 2, 2025

As discovered by @TheIndra55, the mods folder was added as a replacement for modifying citizen/platform and citizen/common in 7fea51e but modifying them was reintroduced in 5e63c2f, probably because of backlash from the sudden change

@AvarianKnight
Copy link
Contributor

AvarianKnight commented Jan 2, 2025

I'd assume the backlash was also if you don't use a mod thats been done through cfxs modding stuff (which I'm not sure if it supports doing game mods but don't quote me on that) you couldn't use the mod without CFX MOD DEV MODE ENABLED which was probably annoying

@gtasnail
Copy link

gtasnail commented Jan 2, 2025

It's possible to replace anything via the mods folder rpf format like you would via citizen folder modifications with less mess afaik

import os

def genassembly():
    xml = '''<?xml version="1.0" encoding="UTF-8"?>
<package version="2.0" id="{481AAA15-9F9B-42B0-A0B0-3B2DD1474949}" target="Five">
<metadata>
<name>Hello</name>
<version>
<major>1</major>
<minor>3</minor>
<tag>kypo</tag>
</version>
<author>
<displayName>rfp testing</displayName>
</author>
<description>Testing stuff</description>
</metadata>
<colors>
<headerBackground useBlackTextColor="False">$FF808080</headerBackground>
<iconBackground>$FF3B5998</iconBackground>
</colors>
<content>
<archive path="common.rpf" createIfNotExist="False" type="RPF7">'''

 
    
    def add_entries(path='.'): ## we are in common.rpf should be ran inside of FiveM.app\citizen\common\
        entries = []
        for root, dirs, files in os.walk(path):
            rel_path = os.path.relpath(root, path)
            if rel_path == '.':
                rel_path = ''

            for file in files:
                if not file.endswith('.py'):  
                    source = os.path.join(rel_path, file).replace('\\', '/')
                    if source.startswith('./'):
                        source = source[2:]
                    entries.append(f'<add source="{source}">{source}</add>')
                    
        return '\n'.join(entries)

    xml += '\n' + add_entries() + '''
</archive>

</content>
</package>'''

    with open('assembly.xml', 'w') as f:
        f.write(xml)


genassembly()

Here is a basic python script to generate a assembly for rpf file out of citizen folder modifications (example)

to use it just run it inside of FiveM.app\citizen\common and it'll generate a assembly.xml for your citizen folder then just create a .rpf with a content folder and put everything from \citizen\common\ inside of content folder and put assembly in root of rpf

the rpf folder should look like the images provided
image
image
image

you can even replace fxc files :)

image
https://github.com/gtasnail/fxc-converter/tree/master/example-shaders

@AvarianKnight
Copy link
Contributor

Yea looks like the this check was updated in f027e69 to show whenever players have mods enabled instead and always allow mods (unless they're in pure mode, which was added in 6142464)

In my opinion the platform folder should probably just be deprecated (and show some UI pop up similar to the Cfx login when loading that they will stop working in the future)

@FabianTerhorst FabianTerhorst added enhancement Feature or other request that adds functionality or improved usability and removed bug RedM Issues/PRs related to RedM labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature or other request that adds functionality or improved usability triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

6 participants