/**
  * @param PluginBase $owner - plugin that owns this session
  */
 public function __construct(PluginBase $owner, $privacy = null, $exPerms = null, $notice = null)
 {
     parent::__construct($owner);
     // We do it here so to prevent the registration of listeners
     $this->conlog = null;
     $this->privacy = $privacy;
     $this->exPerms = $exPerms;
     $this->notice = is_null($notice) || is_array($notice) ? $notice : [$notice];
 }
 /**
  * @param PluginBase $owner - plugin that owns this session
  * @param bool $hard - hard freeze option
  */
 public function __construct(PluginBase $owner, $hard = true)
 {
     $bag = $owner->getServer()->getPluginManager()->getPlugin("GrabBag");
     if ($bag && $bag->isEnabled() && MPMU::apiCheck($bag->getDescription()->getVersion(), "2.3") && $bag->api->getFeature("shield")) {
         $this->api = $bag->api;
         return;
     }
     parent::__construct($owner);
     $this->api = null;
 }
 /**
  * @param PluginBase $owner - plugin that owns this session
  * @param bool $hard - hard freeze option
  */
 public function __construct(PluginBase $owner, $hard = true)
 {
     $bag = $owner->getServer()->getPluginManager()->getPlugin("GrabBag");
     if ($bag && $bag->isEnabled() && MPMU::apiCheck($bag->getDescription()->getVersion(), "2.3") && $bag->api->getFeature("freeze-thaw")) {
         $this->api = $bag->api;
         return;
     }
     parent::__construct($owner);
     // We do it here so to prevent the registration of listeners
     $this->api = null;
     $this->hard = $hard;
 }
Example #4
0
 /**
  * Handle player quit events.  Restore player's inventory before resetting
  * state.
  *
  * @param PlayerQuitEvent $ev - Quit event
  */
 public function onPlayerQuit(PlayerQuitEvent $ev)
 {
     echo __METHOD__ . "," . __LINE__ . "\n";
     //##DEBUG
     $n = MPMU::iName($ev->getPlayer());
     $xx = $this->getState(self::tag, $ev->getPlayer(), null);
     if ($xx !== null) {
         $this->restoreInv($ev->getPlayer());
     }
     parent::onPlayerQuit($ev);
     echo __METHOD__ . "," . __LINE__ . "\n";
     //##DEBUG
 }
Example #5
0
 /**
  * @param PluginBase $owner - plugin that owns this session
  */
 public function __construct(PluginBase $owner)
 {
     $bag = $owner->getServer()->getPluginManager()->getPlugin("GrabBag");
     $this->apis = [null, null];
     if ($bag && $bag->isEnabled() && MPMU::apiCheck($bag->getDescription()->getVersion(), "2.3")) {
         if ($bag->api->getFeature("chat-utils")) {
             $this->apis[0] = $bag->api;
         }
         if ($bag->api->getFeature("mute-unmute")) {
             $this->apis[1] = $bag->api;
         }
         return;
     }
     parent::__construct($owner);
     $this->chat = true;
 }