Skip to content

Several Bugfixes in EcoCommands#212

Merged
Bishbash777 merged 6 commits intoTorchAPI:masterfrom
LordTylus:master
Dec 31, 2023
Merged

Several Bugfixes in EcoCommands#212
Bishbash777 merged 6 commits intoTorchAPI:masterfrom
LordTylus:master

Conversation

@LordTylus
Copy link
Copy Markdown
Contributor

  • Player cannot pay themselves anymore. This caused client and server to go out of sync, and cause crashes. Also it created money out of thin air.
  • All Numbers are now formatted #,##0
  • Fixed KeyAlreadyAddedException in Econ Top. 2 Players with same SteamID but different SerialID could break it. Assumption that it has something to do with perma death. The server I saw it on had 2 identities for that person too. One alive one dead.
  • !econ check can now also check for offline players.
  • !econ pay shows the correct playername in noticiation now instead of the MyPlayer toString()
  • !econ give/set/take/reset now inform that the player might be offline.

The last four commands should also work with offline players. But this optimization is not "important" enough. So I didn't bother.

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.
@LordTylus
Copy link
Copy Markdown
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.

@Bishbash777 Bishbash777 merged commit e770de1 into TorchAPI:master Dec 31, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants