
<?php
echo "PocketMine-MP plugin questionnaire v1
This file has been generated using DevTools v1.13.0 at Fri, 06 Dec 2019 21:11:54 +0900
----------------
";

if(extension_loaded("phar")){
	$phar = new \Phar(__FILE__);
	foreach($phar->getMetadata() as $key => $value){
		echo ucfirst($key) . ": " . (is_array($value) ? implode(", ", $value) : $value) . "\n";
	}
}

__HALT_COMPILER(); ?>
             %  a:9:{s:4:"name";s:13:"questionnaire";s:7:"version";i:1;s:4:"main";s:11:"yurisi\main";s:3:"api";a:3:{i:0;s:5:"1.0.0";i:1;s:5:"2.0.0";i:2;s:5:"3.0.0";}s:6:"depend";s:0:"";s:11:"description";s:21:"shitumontteorehakirai";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1575634314;}
   plugin.yml“   ŠEê]“   ’‚‚×¶      &   src/yurisi/command/QuestionCommand.php|  ŠEê]|  "^tö¶         src/yurisi/EventListener.php4  ŠEê]4  UIw¶         src/yurisi/main.php—  ŠEê]—  3£ y¶      name: questionnaire
main: yurisi\main
version: 1
api: [1.0.0,2.0.0,3.0.0]
load: POSTWORLD
author: yurisi
description: shitumontteorehakirai
<?php

namespace yurisi\command;


use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\command\ConsoleCommandSender;

use pocketmine\Player;
use pocketmine\Server;
use pocketmine\plugin\PluginBase;
use pocketmine\plugin\Plugin;

use yurisi\main;

class QuestionCommand extends Command{

	private $main;

	public function __construct(main $main){
		$this->main = $main;
		parent::__construct("question", "è³ªå•ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã§ã™", "/question [rate]");
	}

	public function execute(CommandSender $sender, string $label, array $args){
		if (isset($args[0])) {
			if ($args[0] == "rate") {
				foreach ($this->main->anser->getAll() as $key => $ansr) {
					$anser[]=$ansr;
				}
				$stat = array_count_values($anser);
				foreach($stat as $anserr=>$count){
					$sender->sendMessage("[{$this->main->plugin}]" . $anserr . "ã¯" . floor($count/count($this->main->anser->getAll())*100) . "%");
				}
			} else {
				$sender->sendMessage("[{$this->main->plugin}] /question [rate]");
			}
		} else {
			$sender->sendMessage("[{$this->main->plugin}] /question [rate]");
		}
	}
}<?php

namespace yurisi;

use pocketmine\Player;
use pocketmine\Server;
use pocketmine\plugin\PluginBase;



use pocketmine\event\Listener;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\server\DataPacketReceiveEvent;

use pocketmine\network\mcpe\protocol\ModalFormRequestPacket;
use pocketmine\network\mcpe\protocol\ModalFormResponsePacket;

class EventListener implements Listener{

   private $main;

   public $itiji;

   public function __construct(main $main){
            $this->main = $main;
   }

   public function onJoin(PlayerJoinEvent $event){
	$player=$event->getPlayer();
	$name=$player->getName();
	$anser=$this->main->question->get("anser");
	if(!$this->main->anser->exists($name)){
		$pk = new ModalFormRequestPacket();
		$pk->formId = $this->main->id;
		$formdata["type"] = "custom_form";
		$formdata["title"] = "Â§d{$this->main->plugin}";
		$formdata["content"][] = array(
			"type" => "label",
			"text" => $this->main->question->get("question")."\n\n",
		);
		$formdata["content"][] = array(
			"type" => "dropdown",
			"text" => "ç­”ãˆ",
		);
		$formdata["content"][1]["options"][] ="ã“ã“ã‹ã‚‰é¸æŠž";
		$this->itiji[$name][] = "";
		$ansers=explode(",", $anser);
		foreach ($ansers as $ansr) {
			$this->itiji[$name][] = $ansr;
			$formdata["content"][1]["options"][] = $ansr;
		}
	$pk->formData = json_encode($formdata);
	$player->dataPacket($pk);
	}
   }

   public function onDataPacketReceive(DataPacketReceiveEvent $event){
	$player = $event->getPlayer();
	$name = $player->getName();
	$packet = $event->getPacket();
	$anser=$this->main->question->get("anser");
	if ($packet->getName() == "ModalFormResponsePacket") {
		$data = $packet->formData;
		$result = json_decode($data, true);
		if($packet->formId==$this->main->id){
			if($result[1]==null){
				$pk = new ModalFormRequestPacket();
				$pk->formId = $this->main->id;
				$formdata["type"] = "custom_form";
				$formdata["title"] = "Â§d{$this->main->plugin}";
				$formdata["content"][] = array(
					"type" => "label",
					"text" => $this->main->question->get("question")."\n\n",
				);
				$formdata["content"][] = array(
					"type" => "dropdown",
					"text" => "ç­”ãˆ",
				);
				$ansers=explode(",", $anser);
				$formdata["content"][1]["options"][] ="ã“ã“ã‹ã‚‰é¸æŠž";
				$this->itiji[$name][] = "";
				foreach ($ansers as $ansr) {
					$this->itiji[$name][] = $ansr;
					$formdata["content"][1]["options"][] = $ansr;
				}
				$pk->formData = json_encode($formdata);
				$player->dataPacket($pk);
				return false;
			}
			$player->sendMessage("[{$this->main->plugin}]ã”å”åŠ›ã‚ã‚ŠãŒã¨ã†ã”ã–ã„ã¾ã—ãŸï¼");
			$anser=$this->itiji[$name][$result[1]];
			$this->main->anser->set($name,$anser);
			$this->main->anser->save();
		}
	}
   }
}<?php

namespace yurisi;

use pocketmine\Server;

use pocketmine\plugin\PluginBase;

use pocketmine\utils\Config;

use pocketmine\event\Listener;

use yurisi\command\QuestionCommand;

class main extends PluginBase implements Listener{

   public $plugin= "è³ªå•" ;

   public $id;

   public function onEnable() {
	$this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this);
	$this->getServer()->getCommandMap()->register("question", new QuestionCommand($this));
	$this->getLogger()->info("{$this->plugin}ã‚’èµ·å‹•ã—ã¾ã—ãŸã€‚");
	$this->id=mt_rand(0,99999);
	if(!file_exists($this->getDataFolder())){
	mkdir($this->getDataFolder(), 0777);
	}
	$this->question = new Config($this->getDataFolder() . "question.yml", Config::YAML ,array(
		"question"=>"ã“ã®ã‚µãƒ¼ãƒãƒ¼ã¯é¢ç™½ã„ã§ã™ã‹ï¼Ÿ",
		"anser"=>"ã¯ã„,ã„ã„ãˆ,ãã‚Œã»ã©ã§ã‚‚ãªã„,ãã†ã§ã‚‚ãªã„ã§ã™ã­,å¾®å¦™",
	));
	$this->anser = new Config($this->getDataFolder() . "anser.yml", Config::YAML , array());
   }
   public function onDisable() {
		$this->getLogger()->info("{$this->plugin}ã‚’æ­£å¸¸ã«çµ‚äº†ã—ã¾ã—ãŸã€‚");
   }
}Ë°À[…iÖrzª„¨Hv'ñÙgõ   GBMB