<?php

namespace App\Services\PwApi\Ban;

class BanService extends \App\Services\PwApi\Core\PwApiService
{
    public function forbidAcc($role, $time, $reason)
    {
        $pack = pack('N*', -1, 0, $role, $time).$this->gamed->packString($reason);

        return $this->gamed->SendToDelivery($this->gamed->createHeader($this->data['code']['forbidAcc'], $pack));
    }

    public function forbidRole($role, $time, $reason)
    {
        $pack = pack('N*', -1, 0, $role, $time).$this->gamed->packString($reason);

        return $this->gamed->SendToDelivery($this->gamed->createHeader($this->data['code']['forbidRole'], $pack));
    }

    public function muteAcc($role, $time, $reason)
    {
        $pack = pack('N*', -1, 0, $role, $time).$this->gamed->packString($reason);

        return $this->gamed->SendToDelivery($this->gamed->createHeader($this->data['code']['muteAcc'], $pack));
    }

    public function muteRole($role, $time, $reason)
    {
        $pack = pack('N*', -1, 0, $role, $time).$this->gamed->packString($reason);

        return $this->gamed->SendToDelivery($this->gamed->createHeader($this->data['code']['muteRole'], $pack));
    }
}
