Skip to content

feat(es_extended/server/modules/commands.lua): Add Validation Number#1617

Merged
FBFezz merged 13 commits into
esx-framework:devfrom
YOMAN1792:dev
Mar 4, 2025
Merged

feat(es_extended/server/modules/commands.lua): Add Validation Number#1617
FBFezz merged 13 commits into
esx-framework:devfrom
YOMAN1792:dev

Conversation

@YOMAN1792

Copy link
Copy Markdown
Contributor

Description

This prevents the use of values exceeding the IEEE 754 double-precision floating-point limit.
Entering a value higher than this limit would cause ox to stop functioning and produce the following error: SEND_NUI_MESSAGE: invalid JSON passed in frame (rapidjson error code 3).
Additionally, if you attempt to remove money exceeding this limit, ox would no longer be functioning and you would no longer be able to give any more money. This would require manually resetting your money and removing cash-based items from the database to restore normal functionality.


Motivation

This change prevents admins from unintentionally or maliciously causing issues for players.


Implementation Details

Improving server-side protections is crucial, as you can never fully anticipate the intentions of people you don’t know well.
More security is always better than less.


Usage Example

When attempting to give an item, add, or remove money, an error will be displayed if the value exceeds the maximum allowed limit: 1.79769e+308.


PR Checklist

  • My commit messages and PR title follow the Conventional Commits standard.
  • My changes have been tested locally and function as expected.
  • My PR does not introduce any breaking changes.
  • I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

Comment thread [core]/es_extended/server/classes/player.lua Outdated
Comment thread [core]/es_extended/server/classes/player.lua Outdated
@github-project-automation github-project-automation Bot moved this from 🆕 To be Discussed to In-Development in ESX Roadmap Feb 28, 2025

@FBFezz FBFezz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, LGTM

@github-project-automation github-project-automation Bot moved this from In-Development to Ready for Next Update in ESX Roadmap Mar 4, 2025
@FBFezz FBFezz merged commit 5f340ba into esx-framework:dev Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Next Update

Development

Successfully merging this pull request may close these issues.

2 participants