TorchAPI / Essentials

A Torch plugin that adds must-have utilities and administration tools to Space Engineers dedicated servers.
23 stars 31 forks source link

Econ Module can work with offlines now #213

Closed LordTylus closed 6 months ago

LordTylus commented 7 months ago

The economy Module now works primarily with Identities instead of players, and is therefore able to work with online players, offline players and NPCs where the previous method could only work with online players.

The API is pretty much the same, though each method has 2 new optional parameters for filter to online players and excluding NPCs

excluding NPCs is default true (just like before) only showing Online is default false (WARNING UNLIKE BEFORE)

So its probably good to announce this change to prevent people from doing bullshit, when they accidentally do stuff to everyone. If they want to do stuff to only onlines, they have to apply the respective parameter.

image image

Also if you take X credits from all players it will properly handle that now image before, it just didn't do anything.

I did add a new change to the Pay method. This purposely still has the online/offline check in, because I think its important, that players do transactions that both see, to prevent arguments over "you havent paid yet"

There i check if the paid amount is available first before paying. But sadly I cannot test that on my own as I need a second player for that.

Ignore the Commits from December those are already merged, I just forgot to drop these commits when syncing my fork.