added message to billdata
This commit is contained in:
parent
65802d38f5
commit
ea33ebc47b
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user