added bill payed cb
This commit is contained in:
parent
fbdf92cd25
commit
923dfcf128
@ -24,6 +24,7 @@ class BillManager implements CallbackListener {
|
|||||||
const PAYED_FROM_SERVER = 3;
|
const PAYED_FROM_SERVER = 3;
|
||||||
const PLAYER_REFUSED_DONATION = 4;
|
const PLAYER_REFUSED_DONATION = 4;
|
||||||
const ERROR_WHILE_TRANSACTION = 5;
|
const ERROR_WHILE_TRANSACTION = 5;
|
||||||
|
const CB_BILL_PAYED = 'Billmanager.BillPayed';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Private properties
|
* Private properties
|
||||||
@ -93,11 +94,17 @@ class BillManager implements CallbackListener {
|
|||||||
case Bill::STATE_PAYED:
|
case Bill::STATE_PAYED:
|
||||||
if ($billData->pay) {
|
if ($billData->pay) {
|
||||||
call_user_func($billData->function, $billData, self::PAYED_FROM_SERVER);
|
call_user_func($billData->function, $billData, self::PAYED_FROM_SERVER);
|
||||||
|
//Trigger a Callback for external Plugins
|
||||||
|
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_BILL_PAYED, self::PAYED_FROM_SERVER, $billData);
|
||||||
} else {
|
} else {
|
||||||
if ($billData->receiverLogin) {
|
if ($billData->receiverLogin) {
|
||||||
call_user_func($billData->function, $billData, self::DONATED_TO_RECEIVER);
|
call_user_func($billData->function, $billData, self::DONATED_TO_RECEIVER);
|
||||||
|
//Trigger a Callback for external Plugins
|
||||||
|
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_BILL_PAYED, self::DONATED_TO_RECEIVER, $billData);
|
||||||
} else {
|
} else {
|
||||||
call_user_func($billData->function, $billData, self::DONATED_TO_SERVER);
|
call_user_func($billData->function, $billData, self::DONATED_TO_SERVER);
|
||||||
|
//Trigger a Callback for external Plugins
|
||||||
|
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_BILL_PAYED, self::DONATED_TO_SERVER, $billData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($this->openBills[$billId]);
|
unset($this->openBills[$billId]);
|
||||||
|
Loading…
Reference in New Issue
Block a user