prevent too huge donation amounts
This commit is contained in:
parent
ea04eca452
commit
d6405550ee
@ -274,6 +274,13 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
|
|||||||
* @param string $receiverName
|
* @param string $receiverName
|
||||||
*/
|
*/
|
||||||
private function handleDonation(Player $player, $amount, $receiver = '', $receiverName = null) {
|
private function handleDonation(Player $player, $amount, $receiver = '', $receiverName = null) {
|
||||||
|
if ($amount > 1000000) {
|
||||||
|
// Prevent too huge donation amounts that would cause xmlrpc parsing errors
|
||||||
|
$message = "You can only donate 1.000.000 Planets at a time!";
|
||||||
|
$this->maniaControl->chat->sendError($message, $player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$receiverName) {
|
if (!$receiverName) {
|
||||||
$serverName = $this->maniaControl->client->getServerName();
|
$serverName = $this->maniaControl->client->getServerName();
|
||||||
$message = 'Donate ' . $amount . ' Planets to $<' . $serverName . '$>?';
|
$message = 'Donate ' . $amount . ' Planets to $<' . $serverName . '$>?';
|
||||||
|
Loading…
Reference in New Issue
Block a user