Code Monkey home page Code Monkey logo

bedrockeconomy's Issues

Support Decimals

Add support for decimals so for example you can have $0.1 in your balance

Need Help

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),
                },
            )
        );

Events for commands (balance, top balance)

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.

help

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);
                },
            )
        );

Please remove getPlayerBalance API

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.

Better arrangement

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

Some ideas for cooldogedev

Hey, i can add theese languages, ( Italy, Spain, Russian, Hungary, France, Austria)
are this a good idea??

implement a temporary cache

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).

[Suggests] Balance Arrangements

add some arrangements in the amount of money, for example:

  • "1000 = 1K" -> for making shorter and more efficient.
  • "1000 = 1,000" -> Add commas in each number of thousands and others.

so in config there are several settings for the amount of balance option, for example we can choose one of the money arrangements

  • "shortcut" -> making balance shortener.
  • "commas" -> add every commas in each number of thousands and others.
  • "none" -> no one choose option, default settings

/setlang

Allows players to set their own language

Balances

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

Question

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?

ConfigManager

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
...

changing command names causes a failure when loading

[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 ---

no work

Console error, but the virions are in the folder, why the error ?

Abbreviation

Allow to abbreviate the recipient's name when payment

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>

Introduce labels

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

languages

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

missing behavior

currently the plugin doesn't use the minimum and maximum payment requirements and the balance limits.

Upgrade /balance

  • Show more pages currently viewed by the user and the server's maximum number of pages.
  • Show top of users who used /topbalance

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

API failure reasons

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 alternatives you've considered

Additional context

ScoreHud does not update money

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):

  • Server OS: linux
  • PocketMine-MP version: 4.2.4
  • Version: 2.0.7
  • Plugins (2): BedrockEconomy v2.0.7, ScoreHud v7.0.0

Additional context
X

Add all error phrases to translation

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

image

Describe alternatives you've considered

Additional context

Implement more events

currently there's no good way to get all information of a transfer transaction, e.g. sender, receiver

questen

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 mysql or sqlite is not recommended

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

ScoreHud bug

when money added to balance scorehud removes the formatting.

So everything looks fine up untill i add balance than the formatting dissapears.

API proposal

implement a more simplified API for plugin developers or maybe just use singleton for the main class

Force update "resources" folder when updating the plugin

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

Scorehud

can you add score support to scorehud plugin?

MultiWorld support like ng cubecraft rtc

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 bug

Scorehud does not have to new formatting feature

Menu form

Add support menu forms to make it easier for users

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.