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

fix shared update #988

Merged
merged 12 commits into from
Oct 1, 2023
Merged

fix shared update #988

merged 12 commits into from
Oct 1, 2023

Conversation

hakos47
Copy link
Contributor

@hakos47 hakos47 commented Jun 7, 2023

It's a temporary fix while we see how to do it better. but this in principle fixes the error that when a client entered it did not get the table of items etc updated. since shared_scripts does not serve to update information on both sides (client, server) it would fix problems with addItems, addItem, etc.

It is not the best solution. but it's a temporary fix

Description

Checklist

  • [ x] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • [ x] My code fits the style guidelines.
  • [ x] My PR fits the contribution guidelines.

It's a temporary fix while we see how to do it better. but this in principle fixes the error that when a client entered it did not get the table of items etc updated. since shared_scripts does not serve to update information on both sides (client, server) it would fix problems with addItems, addItem, etc.

It is not the best solution. but it's a temporary fix
@amantu-qbit
Copy link

Great work

@amantu-qbit
Copy link

Also, why don't just push the whole QBshared table to client?

@GhzGarage GhzGarage self-assigned this Sep 23, 2023
@hakos47
Copy link
Contributor Author

hakos47 commented Sep 25, 2023

Also, why don't just push the whole QBshared table to client?

The idea is good, but I think we should review it in more detail, as it could be an excessive burden. We should consider more efficient alternatives.

@hakos47
Copy link
Contributor Author

hakos47 commented Sep 28, 2023

Also, why don't just push the whole QBshared table to client?

I've changed the system and made it receive the information upon connection. I believe it works better than the previous one, at least in the tests I've conducted, and it fixes all the problems with job updates, vehicles, etc.

@sirhvd
Copy link

sirhvd commented Sep 29, 2023

I think you forgot to add "src" when using TriggerClientEvent.
TriggerClientEvent('QBCore:Client:SharedUpdate', src, QBCore.Shared)

server/events.lua Outdated Show resolved Hide resolved
@GhzGarage GhzGarage added enhancement New feature or request good first issue Good for newcomers labels Sep 29, 2023
@GhzGarage GhzGarage merged commit fa5bf97 into qbcore-framework:main Oct 1, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] QBCore.Functions.AddJob [BUG] QBCore.Functions.AddItem(itemName, info) has never worked as intended
4 participants