Several Bugfixes in EcoCommands#212
Merged
Bishbash777 merged 6 commits intoTorchAPI:masterfrom Dec 31, 2023
Merged
Conversation
It apparently is possible to have 2 Players with Same Steam ID but different Serial ID. Cause unknown. For both of them the same Identity ID is looked up because that ignores the Serial ID. And therefore I can just replace the value. Could auso check with if(!containsKey) but since the result will be identical I didn't bother.
Players were able to duplicate money by paying themselves. If Player A has 10,000 credits And Pays Player A 1,000 credits He ended up with 11,000 credits. But there was a warning on server side that the client was out of sync. And if you do anything else, like for example !econ set !econ take or !econ reset it crashed said client.
I dont exactly know why that limitation of online only was in place. set, take, give, check should work for offlines too. Since the others are not important enough (for me at least) I am not doing that with this commit.
…fline These kind of commands should work with IMyIdentity instead of IMyPlayer especially since the "*" parameter would work for ALL Players (not NPCs) but since I have no intention to fix it at this point in time. The better message will have to do.
Contributor
Author
|
@Bishbash777 I highly recommend reviewing the commits individually. I didn't want to merge conflict myself by creating several PRs for the fixes. |
dorimanx
pushed a commit
to dorimanx/Essentials
that referenced
this pull request
Nov 7, 2024
* Fix: It possible KeyAlreadyExistException workarounded It apparently is possible to have 2 Players with Same Steam ID but different Serial ID. Cause unknown. For both of them the same Identity ID is looked up because that ignores the Serial ID. And therefore I can just replace the value. Could auso check with if(!containsKey) but since the result will be identical I didn't bother. * Fix: Credits are Number-Formatted in all eco commands * Fix: Players can nolonger pay themselves Players were able to duplicate money by paying themselves. If Player A has 10,000 credits And Pays Player A 1,000 credits He ended up with 11,000 credits. But there was a warning on server side that the client was out of sync. And if you do anything else, like for example !econ set !econ take or !econ reset it crashed said client. * Fix: Added missing .DisplayName when Paying player * Feat: !econ check can now also check offline players I dont exactly know why that limitation of online only was in place. set, take, give, check should work for offlines too. Since the others are not important enough (for me at least) I am not doing that with this commit. * Fix: Responses now inform about the possability that the player is offline These kind of commands should work with IMyIdentity instead of IMyPlayer especially since the "*" parameter would work for ALL Players (not NPCs) but since I have no intention to fix it at this point in time. The better message will have to do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last four commands should also work with offline players. But this optimization is not "important" enough. So I didn't bother.