-
Notifications
You must be signed in to change notification settings - Fork 78
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
Voice: safe guard against invalid DB volume values #1335
base: master
Are you sure you want to change the base?
Voice: safe guard against invalid DB volume values #1335
Conversation
This shouldnt be necessary. As far as I can see, when the sql.query returns nil or anything else, its always converted to a number in |
We should fix the root cause of this instead of a bandaid patch. But if this already affects users im happy to merge to mitigate weird db values from impacting users |
I tested all three scaling functions with weird values and it seemed fine, linear is also default, which also just puts Im not fan of this fix, as it might not neutralize the problem itself. In case the db is fine, we have a database write everytime someone starts talking. |
The code that I made is pretty airtight, and all the checks have been working flawlessly for users on a server with an existing database and for users client-sided in a new database that were specifically set up to join and play. I can't find a reason why this would happen. All the checks that are in place are designed to minimize the amount of values flowing into C functions and to the database, but still have the potential to update dynamically to prevent a player from being dramatically louder or quieter between circumstances. The only probable causes in my mind are:
|
In case this should be worked on again. IMO we should just implement a default value with |
I don't think so. Similar to the shop issues we discussed, the only scaling function that could have this flaw is linear, but that is because the data is arriving to it as a string and not a number. The existing conditions assume |
maybe fixes #1334 if the database stuff doesn't