From ea33ebc47b73bd0c48b1a1c2482e4bf811bf2bb4 Mon Sep 17 00:00:00 2001 From: kremsy Date: Wed, 3 Jun 2015 22:49:08 +0200 Subject: [PATCH] added message to billdata --- core/Bills/BillData.php | 15 +++++++++------ core/Bills/BillManager.php | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/Bills/BillData.php b/core/Bills/BillData.php index 2438335f..3e3d145c 100644 --- a/core/Bills/BillData.php +++ b/core/Bills/BillData.php @@ -15,12 +15,13 @@ class BillData { /* * Public properties */ - public $function = null; - public $pay = false; - public $player = null; + public $function = null; + public $pay = false; + public $player = null; public $receiverLogin = null; - public $amount = 0; - public $creationTime = -1; + public $amount = 0; + public $creationTime = -1; + public $message = ""; /** * Construct new Bill Data Model @@ -30,13 +31,15 @@ class BillData { * @param int $amount * @param bool $pay * @param string $receiverLogin + * @param string $message */ - public function __construct(callable $function, $player, $amount, $pay = false, $receiverLogin = null) { + public function __construct(callable $function, $player, $amount, $pay = false, $receiverLogin = null, $message = '') { $this->function = $function; $this->player = $player; $this->amount = $amount; $this->pay = $pay; $this->receiverLogin = $receiverLogin; + $this->message = $message; $this->creationTime = time(); } } diff --git a/core/Bills/BillManager.php b/core/Bills/BillManager.php index cd182bb7..67d8778b 100644 --- a/core/Bills/BillManager.php +++ b/core/Bills/BillManager.php @@ -58,7 +58,7 @@ class BillManager implements CallbackListener { */ public function sendBill(callable $function, Player $player, $amount, $message, $receiver = '') { $billId = $this->maniaControl->getClient()->sendBill($player->login, $amount, $message, $receiver); - $this->openBills[$billId] = new BillData($function, $player, $amount, false, $receiver); + $this->openBills[$billId] = new BillData($function, $player, $amount, false, $receiver, $message); return true; } @@ -73,7 +73,7 @@ class BillManager implements CallbackListener { */ public function sendPlanets(callable $function, $receiverLogin, $amount, $message) { $billId = $this->maniaControl->getClient()->pay($receiverLogin, $amount, $message); - $this->openBills[$billId] = new BillData($function, $receiverLogin, $amount, true, $receiverLogin); + $this->openBills[$billId] = new BillData($function, $receiverLogin, $amount, true, $receiverLogin, $message); return true; }