the pmmp virion for interacting with the sun proxy api
This project is connected to Poggit-CI so downloads are located Here.
This virion is meant to be used with a server using the SunProxy
//Use the class useSunProxy\SunProxyAPI\SunProxyAPI;
class Main extends \pocketmine\plugin\PluginBase {
publicfunctiononEnable() {
//Is always needed to start up Packet usage
SunProxyAPI::Register();
}
publicfunctiononCommand(\pocketmine\command\CommandSender$sender,\pocketmine\command\Command$command,string$label, array$args) : bool {
switch ($label) {
case"transfer":
if ($senderinstanceof \pocketmine\Player) {
//transfer players based on arg input
SunProxyAPI::FastTransferPlayer($sender, $args[0], (int) $args[1]);
}
}
returntrue;
}
}//Use the class useSunProxy\SunProxyAPI\SunProxyAPI;
class Main extends \pocketmine\plugin\PluginBase implements \pocketmine\event\Listener {
publicfunctiononEnable() {
//Is always needed to start up Packet usage
SunProxyAPI::Register();
$this->getServer()->getPluginManager()->registerEvents($this, $this);
}
publicfunctiononChat(\pocketmine\event\player\PlayerChatEvent$event) {
SunProxyAPI::SendProxyWideChat($event->getPlayer(), $event->getFormat() . $event->getMessage());
$event->setCancelled();
}
}//Use the class useSunProxy\SunProxyAPI\SunProxyAPI;
class Main extends \pocketmine\plugin\PluginBase implements \pocketmine\event\Listener {
publicfunctiononEnable() {
//Is always needed to start up Packet usage
SunProxyAPI::Register();
$this->getServer()->getPluginManager()->registerEvents($this, $this);
}
publicfunctiononChat(\pocketmine\event\player\PlayerChatEvent$event) {
SunProxyAPI::SendChatToServers($event->getPlayer(), $event->getFormat() . $event->getMessage(), ["ip:port","velvetpractice.live:19132"]);
$event->setCancelled();
}
}//Use the class useSunProxy\SunProxyAPI\SunProxyAPI;
class Main extends \pocketmine\plugin\PluginBase {
publicfunctiononEnable(){
$this->getServer()->getPluginManager()->registerEvents($this, $this);
}
publicfunctiononPreLogin(\pocketmine\event\player\PlayerPreLoginEvent$event) {
//Check if player isn't sending packets from the local addrif ($event->getPlayer()->getAddress() !== "0.0.0.0:19132") {
$event->setKickMessage("You must join from the lobby!");
$event->setCancelled();
} } } ___ ___ ___
/ /\ /__/\ /__/\
/ /:/_ \ \:\ \ \:\
/ /:/ /\ \ \:\ \ \:\
/ /:/ /::\ ___ \ \:\ _____\__\:\
/__/:/ /:/\:\ /__/\ \__\:\ /__/::::::::\
\ \:\/:/~/:/ \ \:\ / /:/ \ \:\~~\~~\/
\ \::/ /:/ \ \:\ /:/ \ \:\ ~~~
\__\/ /:/ \ \:\/:/ \ \:\
/__/:/ \ \::/ \ \:\
\__\/ \__\/ \__\/
MIT License
Copyright (c) 2020 Jviguy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.```
