Skip to content

Add Discord User ID argument to onPlayerConnect when Discord RPC is connected #5266

Description

@simoofficiel

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

I would like to request an enhancement to the server-side onPlayerConnect event.

Currently:

onPlayerConnect(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber, playerVersionString)

Proposed:

onPlayerConnect(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber, playerVersionString, discordUserId)

When Discord RPC is connected and the Discord User ID is available, discordUserId should contain the player's Discord User ID.

If Discord RPC is not connected or the ID is unavailable, discordUserId should be nil.

Describe alternatives you've considered

Example:

addEventHandler("onPlayerConnect", root, function(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber, playerVersionString, discordUserId) if discordUserId then outputDebugString("Discord User ID: " .. discordUserId) end end)

Additional context

Possible use cases:

  • Discord account linking
  • Whitelist systems
  • Connection logging
  • Discord integration
  • Server security systems

For backward compatibility, the new argument should be added at the end of the existing arguments so existing resources will continue working without modification.

Security Policy

  • I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions