A library for adding economic concepts.

Overview

Summary

This plugin adds the concept of money to the server.

Wallet data held by the player is stored in .json format and I/O asynchronously.

As for the Option setting, you can change the asynchronous setting to your liking. Basically, there is no need to change the default settings.

PHP

  • use binary version 8.0.10
  • use PocketMine-MP version API4-beta11+dev2067

Wallet

get player's Wallet.

use pocketmine\player\Player;
use oiran\walletlib\api\WalletLib;
use oiran\walletlib\dto\WalletDTO;

/** @var $player Player */
$xuid = $player->getXuid();
$wallet = WalletLib::findWallet($xuid);

check Wallet Money amount.

$moneyAmount = $wallet->getMoney()->getAmount();

earn or spend Money.

use oiran\walletlib\model\Money;

$wallet->earn(200);
$wallet->spend(100);

pay Money to other Wallet.

$to = WalletLib::findWallet("to player xuid");
$from = WalletLib::findWallet("from player xuid");

$from->payTo($to, 300);
You might also like...
This AddOn allows you to search for module names when adding a block
This AddOn allows you to search for module names when adding a block

Modulsuche und Modulvorschau für REDAXO 5 Dieses AddOn ermöglicht die Suche nach Modulnamen, wenn man einen Block hinzufügt. Dies kann sehr hilfreich

An extension for PHPStan for adding analysis for PHP Language Extensions.

PHPStan PHP Language Extensions (currently in BETA) This is an extension for PHPStan for adding analysis for PHP Language Extensions. Language feature

:date: The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects

sabre/vobject The VObject library allows you to easily parse and manipulate iCalendar and vCard objects using PHP. The goal of the VObject library is

Small convention based CQRS library for PHP

LiteCQRS for PHP Small naming-convention based CQRS library for PHP (loosely based on LiteCQRS for C#) that relies on the MessageBus, Command, EventSo

Experimental library for forking PHP

Spork: PHP on a Fork ?php $manager = new Spork\ProcessManager(); $manager-fork(function() { // do something in another process! return 'Hel

Collection pipeline library for PHP

Knapsack Collection pipeline library for PHP Knapsack is a collection library for PHP = 5.6 that implements most of the sequence operations proposed

Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

A PHP library to play with the Raspberry PI's GPIO pins
A PHP library to play with the Raspberry PI's GPIO pins

php-gpio php-gpio is a simple PHP library to play with the Raspberry PI's GPIO pins. It provides simple tools such as reading & writing to pins. [UPDA

Comments
  • レースコンディションの脆弱性について

    レースコンディションの脆弱性について

    プレイヤーの退出またはサーバのシャットダウンをトリガーにして、SaveWalletThreadでプレイヤーに紐づけられたファイルに書き込みを行いますが、同一のプレイヤーに対するSaveWalletThreadの同時発行数が制限されていないため、なんらかの理由で遅延した場合レースコンディションを引き起こします。

    opened by WhiteGrouse 2
Releases(1.0.1)
Owner
null
Silverstripe-searchable - Adds to the default Silverstripe search by adding a custom results controller and allowing properly adding custom data objects and custom fields for searching

SilverStripe Searchable Module UPDATE - Full Text Search This module now uses Full Text Support for MySQL/MariaDB databases in version 3.* Adds more c

ilateral 13 Apr 14, 2022
Clean Code concepts adapted for PHP

Clean Code PHP Table of Contents Introduction Variables Use meaningful and pronounceable variable names Use the same vocabulary for the same type of v

Piotr Plenik 11.3k Jan 7, 2023
Demonstration of OOP concepts and usage of Abstract class & Interfaces

Learn OOP Demonstration of OOP concepts and usage of Abstract class & Interfaces Usage clone this repo run composer install run php index.php Code str

M N Islam Shihan 3 Sep 14, 2021
Clean Code concepts adapted for PHP - A guide for producing readable, reusable, and refactorable PHP software

Clean Code concepts adapted for PHP - A guide for producing readable, reusable, and refactorable PHP software

Fabio Soares 172 Dec 25, 2022
Clean Code concepts adapted for PHP

PHP Temiz Kod İçindekiler Giriş Değişkenler Anlamlı ve telaffuz edilebilir değişken isimleri kullanın Aynı türden değişkenler için aynı kelimeleri kul

Anıl Özmen 122 Dec 25, 2022
Envbar allows you to differentiate between environments by adding a custom colored bar above the top navigation.

Envbar Envbar allows you to differentiate between environments by adding a custom colored bar above the top navigation. This should help backend users

Magenizr 6 Oct 7, 2022
A package for adding more type safety to your PHP projects.

Table of Contents Overview Installation Usage Simple Checks Advanced Checks Custom Checks Skipping Checks Testing Security Contribution Credits Change

Ash Allen 14 Aug 31, 2022
The Cache component provides an extended PSR-6 implementation for adding cache to your applications.

Symfony PSR-6 implementation for caching The Cache component provides an extended PSR-6 implementation for adding cache to your applications. It is de

Symfony 3.8k Jan 3, 2023
Adding Firebase PHP to your project using Composer

Firebase PHP Client ❤️ Sponsor Based on the Firebase REST API. Available on Packagist. Adding Firebase PHP to your project using Composer For PHP 7 or

Tamas Kalman 786 Dec 31, 2022
Adds support for quickly adding a "snow day" banner at the top of a website.

❄️ Snow Day Plugin ?? Requires OctoberCMS 2.0 ✨ What does this plugin do? Provides the ability to quickly add a cross-site banner using a component. ❓

Albright Labs 4 Nov 7, 2022