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

unhardcode banned races #1874

Open
Pospelove opened this issue Mar 16, 2024 · 2 comments
Open

unhardcode banned races #1874

Pospelove opened this issue Mar 16, 2024 · 2 comments

Comments

@Pospelove
Copy link
Contributor

follow up #1805

@Pospelove Pospelove reopened this Apr 8, 2024
@Pospelove Pospelove changed the title unhardcode bunned races unhardcode banned races Aug 11, 2024
@Pospelove
Copy link
Contributor Author

@ellipsis-dev plan

Copy link

ellipsis-dev bot commented Aug 11, 2024

🚀 This implementation plan was created by @ellipsis-dev

Tag me (@ellipsis-dev) in a comment with guidance if you want me to replan or to implement this plan.

Implementation Plan

Step 1: Implement race ban check

Path: skymp5-client/src/sync/appearance.ts
In applyAppearanceCommon, check isRaceBanned(raceId) before setting NPC race. Implement isRaceBanned(raceId: number): boolean to read from config/bannedRaces.json.

Step 2: Create banned races JSON

Path: config/bannedRaces.json
Create config/bannedRaces.json with an array of banned race IDs, e.g., [1, 2, 3].

Step 3: Read banned races from JSON

Path: skymp5-client/src/sync/appearance.ts
In isRaceBanned, use fs.promises.readFile to read config/bannedRaces.json. Parse with JSON.parse. Handle file I/O and JSON errors. Return true if raceId is in the parsed array, else false.


Questions? Check out our documentation. Leave 👍/👎 on this plan to give us feedback.

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

No branches or pull requests

1 participant