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

feat: live database updates #661

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

BerkieBb
Copy link
Contributor

@BerkieBb BerkieBb commented Jan 14, 2025

Description

This PR introduces Live Database Updates. It changes how player data is updated by making sure only the any updated playerdata field is updated specifically in the database each 15 seconds (configurable). This is not directly live, but live enough to ensure data gets updated fast.

I also cleaned up the codebase a bit with this PR.

I have tested this myself and fixed bugs along but it's best to make sure this gets tested with others as well. However don't test in production until a few have tested in a test environment.

This also adds 2 new events that will be triggered from SetPlayerData in qbx_core/server/player.lua
qbx_core:client:setPlayerData
qbx_core:server:setPlayerData

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

server/storage/players.lua Outdated Show resolved Hide resolved
server/storage/players.lua Outdated Show resolved Hide resolved
server/player.lua Outdated Show resolved Hide resolved
server/player.lua Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

2 participants