Skip to content

feat(esx_core) Add optional player identifier type.#1675

Merged
Kenshiin13 merged 12 commits into
esx-framework:devfrom
Zykem:feature/optional-identifier-type
Aug 1, 2025
Merged

feat(esx_core) Add optional player identifier type.#1675
Kenshiin13 merged 12 commits into
esx-framework:devfrom
Zykem:feature/optional-identifier-type

Conversation

@Zykem

@Zykem Zykem commented Jul 20, 2025

Copy link
Copy Markdown
Member

Description

This PR introduces a configurable way to choose the player identifier type used by ESX.
Currently, es_extended hardcodes the "license" identifier, but the codebase is already compatible with other types like "steam" or "discord".

This change adds a server-side convar & Config Value to allow server owners to select their preferred identifier type without modifying the source code.


Motivation

  • Improve flexibility and customization for server owners
  • Avoid hardcoding the identifier type
  • Enable use of alternative ID systems like Discord or Steam

Implementation Details

  • Added a new convar: esx:identifier
  • Added a new config value: Config.Identifier
  • Default fallback is "license" if the convar is missing or invalid

Usage Example

Change server.cfg: "set esx:identifier discord"
Or
Change shared/config/main.lua: Config.Identifier = "discord"


PR Checklist

  • [1] 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.
  • [1] I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

@Kr3mu Kr3mu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add checking if identifier is nil due to invalid source in ESX.GetIdentifier.

@github-project-automation github-project-automation Bot moved this from 🆕 To be Discussed to In-Development in ESX Roadmap Jul 24, 2025
Kr3mu
Kr3mu previously approved these changes Jul 26, 2025

@Kr3mu Kr3mu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@github-project-automation github-project-automation Bot moved this from In-Development to Ready for Next Update in ESX Roadmap Jul 26, 2025

@Kr3mu Kr3mu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After small fixes with Esx.GetIdentifier in multicharacters works.
LGTM

@Kenshiin13

Copy link
Copy Markdown
Contributor

@Zykem Please update the docs so we can merge it

@Kenshiin13

Copy link
Copy Markdown
Contributor

@Kenshiin13 Kenshiin13 merged commit b9d735c into esx-framework:dev Aug 1, 2025
1 check passed
@RrybaN

RrybaN commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

i thought @Mycroft-Studios said this.

Using anything other than licence is extremely stupid, and a great way to have people exploit your server. IP: I dont even need to explain this.. i hope Discord: can create an alt account within minutes and abuse the system, Steam: can create an alt account within minutes and abuse the system, Licence2: not all users have 1

#1517 (comment)

@Zykem

Zykem commented Aug 6, 2025

Copy link
Copy Markdown
Member Author

@RrybaN

Sure, but just to clarify: this doesn't force anyone to stop using license. It's an optional tool for people who want more flexibility.

Yeah, Discord and Steam can be abused, same with literally anything if your system doesn't handle it right. But that’s on the server to secure, not the framework to block.

It’s up to each server owner to decide which identifiers to trust and how to mitigate risks. We're just providing the tools, not enforcing how they should be used. Also, this is entirely optional, no server is being forced to move away from license. At the end of the day, we all have different opinions and needs, that’s what makes open source great. Everyone can build what works best for their own use case.

@RrybaN

RrybaN commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

That's what i literally said.

I know that players can create alt accounts, and it's ultimately up to the server owner whether they want to use different licenses. For example, if you get a new PC or reformat your own PC, sometimes your license will change, and of course, you cannot retrieve your character. So, it's better to use Steam or Discord licenses in that case.

#1517 (comment)

Anyways, this is a great PR really glad to see this got merged. This is exactly what i was aiming for in my last PR #1517.

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.

5 participants