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

Create export for forcing update #33

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

Conversation

luxu-gg
Copy link

@luxu-gg luxu-gg commented Nov 22, 2023

First of all sorry for the whitespace edits. (Using github desktop is better for this)
Since this is a very popular resource, I was constantly asked for adding compatibility, so I had to fork it.

This pull request creates a new export called 'forceUpdate'.
I essentialy removed part of the code inside the forceUpdate event and made it a funciton.
Without this fork, nobody is able to change the weather from the server side which is bad since some people may use other methods to check for permissions and also the event doesn't take a source param so it relies on it being called from the client 100% of the time.

@pushkart2
Copy link

pushkart2 commented Nov 22, 2023

https://github.com/dsheedes/cd_easytime/blob/main/server/server.lua#L74C8-L74C24

It already has permissions check to avoid exploits.
So even if you trigger from client, it anyways would work the same way.

@luxu-gg
Copy link
Author

luxu-gg commented Nov 22, 2023

Sure, but I don't want to trigger it from the client since I already do perm checking in my own server side logic.
I rather call it from a server side export which is also safe and it's similar to qb-weathersync.

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