cooldogepm / bedrockeconomy Goto Github PK
View Code? Open in Web Editor NEWAn extremely customizable Economy plugin designed for scalability and simplicity
License: MIT License
An extremely customizable Economy plugin designed for scalability and simplicity
License: MIT License
Add support for decimals so for example you can have $0.1 in your balance
PocketMine-MP 4.0.0-BETA6, using default config
Crashdumps:
Tue_Oct_26-16.07.25-CEST_2021.log
Hello, I'm trying to get player money by using your API and it's very confusing. I have $100 (balance), but in my GUI it shows that I have $0.
BedrockEconomyAPI::getInstance()->getPlayerBalance( "$username", ClosureContext::create( function (?int $balance): void { 22 => VanillaItems::WRITABLE_BOOK()->setCustomName("§r§7My Info§f\nBalance§7: §2$ §f" . $balance), }, ) );
I'm using mysql and the admin commands don't execute, only the deleteaccount one is executed
I remember EconomyAPI has multi-currency support, I hope BedrockEconomy will have it too (or it has but i don't know)
I am very sorry to see that there are no events for the commands(balance, top balance).
I would like to see events for commands as for transactions. Perhaps you need to add a get transaction type
As an alternative at the moment I use "crutches". I catch commands through the processing of kernel events.
Error:
[Server thread/CRITICAL]: Error: "Class "cooldogedev\libSQL\context\ClosureContext" not found" (EXCEPTION) in "plugins/Perks-main/src/flxiboy/Perks/provider/BedrockEconomyProvider" at line 44
Code:
use cooldogedev\BedrockEconomy\api\BedrockEconomyAPI;
use cooldogedev\libSQL\context\ClosureContext;
BedrockEconomyAPI::getInstance()->getPlayerBalance(
strtolower($player->getName()),
ClosureContext::create(
function (?int $balance): void {
var_dump($balance);
},
)
);
Is your feature request related to a problem? Please describe.
getPlayerBalance
is constantly abused for incorrect code where they check for whether the player has enough balance through getPlayerBalance
and call subtractFromPlayerBalance
without actually checking whether the latter is successful.
Describe the solution you'd like
Remove the method. It is good for nothing other than abuse.
People who want to display the balance should use an API dedicated for displaying, such as InfoAPI. getPlayerBalance
is good for nothing.
Run command /balance
Crashdumps:
Wed_Sep_8-07.06.33-UTC_2021.log
PocketMine-MP 4.0.0-BETA6
Do /pay someone
You've paid {CURRENCY_SYMBOL}1000 to {RECEIVER}!
Could you possibly add better arrangements.
for instance change 1000 = 1.000 or 1k
Would be very helpfull to have this both in the scorehud and the actual plugin
Please add German Language
Hey, i can add theese languages, ( Italy, Spain, Russian, Hungary, France, Austria)
are this a good idea??
currently the plugin has a permanent cache and it might slow down the server startup, and also waste memory (not that much because the data is lightweight).
xuid isn't usable when online mode is disabled
add some arrangements in the amount of money, for example:
so in config there are several settings for the amount of balance option, for example we can choose one of the money arrangements
Allows players to set their own language
If the user has money, when the server restarts the money will reset to 0 according to the default config
/addbalance to player and restart server, and also some translation message like /pay is missing
Can you make the command for the ui.
idk how to do this on your way.
But the menu i can do!!!
i send in requests and you make the command.
Output:
$this->EcoUI($sender);
it is okay if i use Form api?
or have i to do it self?
Comments are not generated in new config when config version is outdated
Below is the config I get when the config is outdated
---
config-version: 2.0.5
language: en-US
utility:
top-balance-accounts-limit: 10
currency:
name: USD
symbol: $
balance:
default-balance: 100
balance-cap: 100000
enable-balance-cap: false
payment:
minimum-payment: 100
maximum-payment: 1000
database:
provider: sqlite
threads: 2
mysql:
host: 127.0.0.1
username: your_username
password: password
schema: db_name
port: 3306
sqlite:
file: players.db
...
[16:57:48.900] [Server thread/CRITICAL]: UnhandledMatchError: "Unhandled match value of type string" (EXCEPTION) in "plugins/BedrockEconomy.phar/src/cooldogedev/BedrockEconomy/BedrockEconomy" at line 123
--- Stack trace ---
#0 (): cooldogedev\BedrockEconomy\BedrockEconomy->cooldogedev\BedrockEconomy{closure}(array[4])
#1 plugins/BedrockEconomy.phar/src/cooldogedev/BedrockEconomy/BedrockEconomy(122): array_map(object Closure#100285, array[7])
#2 plugins/BedrockEconomy.phar/src/cooldogedev/BedrockEconomy/BedrockEconomy(99): cooldogedev\BedrockEconomy\BedrockEconomy->initializeCommands()
#3 pmsrc/src/plugin/PluginBase(137): cooldogedev\BedrockEconomy\BedrockEconomy->onEnable()
#4 pmsrc/src/plugin/PluginManager(437): pocketmine\plugin\PluginBase->onEnableStateChange(true)
#5 pmsrc/src/Server(1385): pocketmine\plugin\PluginManager->enablePlugin(object cooldogedev\BedrockEconomy\BedrockEconomy#101592)
#6 pmsrc/src/Server(1011): pocketmine\Server->enablePlugins(object pocketmine\plugin\PluginEnableOrder#24932)
#7 pmsrc/src/PocketMine(304): pocketmine\Server->__construct(object BaseClassLoader#2, object pocketmine\utils\MainLogger#3, string[16] /home/minecraft/, string[24] /home/minecraft/plugins/)
#8 pmsrc/src/PocketMine(327): pocketmine\server()
#9 pmsrc(11): require(string[57] phar:///home/minecraft/pocketmine.phar/src/PocketMine.php)
--- End of exception information ---
Console error, but the virions are in the folder, why the error ?
It's really annoying and time consuming when I have to write down someone's full name
Instead of a long line of statements like this:
/pay BoxierChimera37 <amount>
Just:
/pay Bo <amount>
Is your feature request related to a problem? Please describe.
Rather than storing the balance in a column we store it in a label-based json format, doing so will add more flexibility to implement new features such as the following #73, #69, #46
Describe the solution you'd like
Describe alternatives you've considered
Additional context
pretty much what the title says
Currently the only available language is English, it needs to be translated to other languages if it gets released on poggit. Google translate is an option but it's obvious that it's not reliable enough for this use case
Crashdump:
Sun_Sep_5-07.18.14-UTC_2021.log
currently the plugin doesn't use the minimum and maximum payment requirements and the balance limits.
Like this:
TOP BALANCES [Current page/Max page]
1. UserName : 100
2. UserName : 100
3. UserName : 100
4. UserName : 100
5. UserName : 100
6. UserName : 100
7. UserName : 100
8. UserName : 100
9. UserName : 100
10. UserName : 100
» Your top: $senderTop
I will make if its okay for you
Is your feature request related to a problem? Please describe.
Currently, I am working on supporting some economy plugins in my plugin. After implementing Capital, I noticed something BedrockEconomy's API lacks: There are multiple reasons why a transaction gets cancelled, e.g. the player didn't have enough money or the TransactionEvent was simply cancelled. What BedrockEconomy lacks is a way to get the reason why a transaction failed.
Describe the solution you'd like
I personally like Capital's approach to that problem: When the transaction failed, an exception is thrown where the error code is specifically set to a reason.
But I know that there isn't a simple solution since BedrockEconomy uses PMMP's promise system which doesn't support parameters in their failure callbacks.
Describe the bug
When you add money to a player, the scorehud is updated for 1 millisecond to the money you have added, but after a second it disappears and returns to the money you had before.
To Reproduce
Steps to reproduce the behavior:
https://streamable.com/43poru
Expected behavior
ScoreHud will be updated correctly when adding or removing money.
Screenshots
Video up
OS and version (please complete the following information):
Additional context
X
I don't know if it is possible, but it would be great if you could add the error phrases, for example when using /pay or /pay Steve, you get those 2 phrases in English. I don't know if there are more and if it is possible to add them.
currently there's no good way to get all information of a transfer transaction, e.g. sender, receiver
Hey,
Ehm one last question, when I do this, it always comes out as 0, is there another possibility? Have already tried with $end = 0, $end = $balance, return $end doesn't work either.
BedrockEconomyAPI::getInstance()->getPlayerBalance(
strtolower($player->getName()),
ClosureContext::create(
function (?int $balance) {
return $balance;
},
)
);
return 0;
using sql to make an economy plugin is very unsuitable and will really lag your server a lot for nothing so I advise you to put the db in json or yml (preferably json) if people want to make a system of economy inter server why not make a plugin that will take care of it and suddenly will be able to attract more people because people who want to do just a server can do it without having to make db and those who want can do it just by installing a " extension" which will do it automatically
How about support adding floating text or non player character top balance
when money added to balance scorehud removes the formatting.
So everything looks fine up untill i add balance than the formatting dissapears.
implement a more simplified API for plugin developers or maybe just use singleton for the main class
Is your feature request related to a problem? Please describe.
I just updated the version (to Dev #24) and the language section has not been updated.
I don't know if that happens with the config.yml (since in this update there have been no changes in that).
There are other plugins that do update the plugins_data when you add a new version and it contains changes in resources, although I don't know how it works since I'm not a dev.
Describe the solution you'd like
X
Describe alternatives you've considered
X
Additional context
X
can you add score support to scorehud plugin?
Pls add multiworld support to the plugin it would be a pleasure to all pocketmine community i understand bc i am also a server owner/developer i know it will be hard but it would surpass economy a lot bc it didnt have multiworld but u can do it
Thank You-
Scorehud does not have to new formatting feature
Same problem continues.
Add support menu forms to make it easier for users
As the title say
Hey, can you please create BedrockmoneyScore? for my ScoreHud
here a example https://poggit.pmmp.io/p/EcoAPIScore/1.1.0
Would be cool if you could do something like that because the money doesn't show up in the ScoreHud
As the title say
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.