Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Beta3 Released.
Browse files Browse the repository at this point in the history
  • Loading branch information
JaxkDev committed Jun 30, 2019
1 parent b98f1e9 commit e48e54a
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ the only difference is forcestart does not check the arena status whereas ^^^ on
You can leave a game by using the command `/koth leave` or quiting the game.

### Winning a game
**NOTICE: THIS IS PLANNED TO CHANGE IN BETA4/5**
**NOTICE: There is plans for different types of ways of winning a game, targeted for beta 4/5**

The game runs on a timer, during which anyone can move, attack and kill the king.
However when the timer runs out the last standing king, or the previous king will be crowned.
Expand Down Expand Up @@ -108,6 +108,7 @@ For more info see the help file found in the same directory.
## Extensions:
- <https://github.com/jackthehack21/koth-extensions>
To install extensions place the phar from the releases section into the plugins directory of your server and reboot server.
Any issues should be reported in that repository if the extension crashes.

## Known Bugs:
- Floating Text Particles will appear in every world but at same position, disable floating_text_particles if this is a issue for your server setup.
Expand Down
10 changes: 9 additions & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ version: 1.0.0-Beta3
api:
- 3.7.0
main: Jackthehack21\KOTH\Main
website: "https://github.com/Jackthehack21/KOTH"
description: "King of The Hill, A mini-game plugin by Jackthehack21"

extensions: [sqlite3]

Expand Down Expand Up @@ -48,6 +50,12 @@ permissions:
description: "Allows player to join a game."
default: true
koth.leave:
description: "Allows players to chicken out of a game."
description: "Allows player to chicken out of a game."
default: true
koth.start:
description: "Allows player to start a arena."
default: true
koth.forcestart:
description: "Allows player to force start a arena."
default: op
...
2 changes: 1 addition & 1 deletion resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 1

provider: "sqlite3"

debug: true
debug: false

show_updates: true
check_updates: true
Expand Down
4 changes: 3 additions & 1 deletion src/Jackthehack21/KOTH/CommandHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ public function handleCommand(CommandSender $sender, Command $cmd, /** @noinspec
if($sender->hasPermission("koth.info")) $sender->sendMessage(C::GOLD."/koth info (arena name) ".C::RESET."- Get more info on one arena.");
if($sender->hasPermission("koth.join")) $sender->sendMessage(C::GOLD."/koth join (arena name)".C::RESET." - Join a game.");
if($sender->hasPermission("koth.leave")) $sender->sendMessage(C::GOLD."/koth leave ".C::RESET."- Leave a game you'r currently in.");
if($sender->hasPermission("koth.start")) $sender->sendMessage(C::GOLD."/koth start (arena name - optional) ".C::RESET."- Starts a arena if game requirements are met.");
if($sender->hasPermission("koth.forcestart")) $sender->sendMessage(C::GOLD."/koth forcestart (arena name - optional) ".C::RESET."- Forces a arena/game to start the countdown to begin.");
if($sender->hasPermission("koth.new")) $sender->sendMessage(C::GOLD."/koth new (arena name - no spaces) (min players) (max players) (gametime in seconds)".C::RESET." - Start the setup process of making a new arena.");
if($sender->hasPermission("koth.rem")) $sender->sendMessage(C::GOLD."/koth rem (arena name)".C::RESET." - Remove a area that has been setup.");
if($sender->hasPermission("koth.setspawns")) $sender->sendMessage(C::GOLD."/koth setspawn (arena name) ".C::RESET."- Set a spawn point for a arena.");
if($sender->hasPermission("koth.setpos")) $sender->sendMessage(C::GOLD."/koth setpos1 (arena name) or /koth setpos2 (arena name> ".C::RESET."- Set king area corner to corner.");
if($sender->hasPermission("koth.addrewards")) $sender->sendMessage(C::GOLD."/koth addreward (arena name) (command eg. /give {PLAYER} 20 1)");
if($sender->hasPermission("koth.addrewards")) $sender->sendMessage(C::GOLD."/koth addreward (arena name) (command eg. /give {PLAYER} 20 1)".C::RESET." - Add a command to execute when winner is announced");
return true;
case 'credits':
$sender->sendMessage(C::YELLOW."[".C::AQUA."KOTH ".C::RED."-".C::GREEN." CREDITS".C::YELLOW."]");
Expand Down
20 changes: 14 additions & 6 deletions src/Jackthehack21/KOTH/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Main extends PluginBase implements Listener
public const CONFIG_VER = 1;
public const MESSAGE_VER = 0;

private $arenas;
private $arenas = [];
private $CommandHandler;
private $EventHandler;
private $configC;
Expand Down Expand Up @@ -135,10 +135,16 @@ private function initResources(): void
$this->saveConfig();
}

if($this->config["download_updates"] === true){
$this->getLogger()->warning("Important disclaimer, by using the download_updates option you accept full responsibility of any damage done by the feature. Disable the option if you are un-happy with this or do not need it (Note, it has been tested and works on a plain pocketmine-mp v3.7.0-v3.8.5 server)");
//Just in case it somehow goes wrong.
}

foreach(array("eng","spa","fra") as $language){
@unlink($this->getDataFolder()."help_".$language.".txt");
$this->saveResource("help_" . $language . ".txt");
}

}

/**
Expand Down Expand Up @@ -245,9 +251,10 @@ private function loadArenas(): void

public function onDisable()
{
$this->updateAllArenas();
$this->saveConfig();
$this->db->close();
//small checks here to stop throwing more errors if crashing on load/enable etc.
if(!is_null($this->db)) $this->updateAllArenas();
if(!is_null($this->config)) $this->saveConfig();
if(!is_null($this->db)) $this->db->close();
}

public function onEnable(): void
Expand Down Expand Up @@ -299,7 +306,7 @@ public function updateAllArenas(array $data = null): void
"world" => $arena->world
];
}
$this->db->setAllData($save);
if(!is_null($this->db)) $this->db->setAllData($save);
}

/**
Expand All @@ -308,9 +315,10 @@ public function updateAllArenas(array $data = null): void
public function saveConfig(array $data = null): void
{
if ($data !== null) {
$this->configC->setAll($data);
if(!is_null($this->configC)) $this->configC->setAll($data);
return;
}
if(is_null($this->configC) or is_null($this->config)) return;
$this->configC->setAll($this->config);
$this->configC->save();
}
Expand Down
10 changes: 5 additions & 5 deletions updates.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "1.0.0-Beta2",
"time": 1555660800,
"link": "https://github.com/Jackthehack21/KOTH/releases/tag/1.0.0-Beta2",
"download_link": "https://poggit.pmmp.io/r/56397/KOTH.phar",
"patch_notes": "- Arena rewards ! (much awaited)\n- NameTag (for king)\n- FloatingText to display king (in middle of kings area)\n- Config file (adds some configurable options in there.)\n- UpdateNotifier by JackMD ready (but not enabled)\n- Removed both forced min/max players. (still need min and max players though)\n- Added the following commands and their relevant permission nodes)\n - /koth addreward <arena name> <command>\n - /koth leave\n - /koth info <arena name>\n\n## Breaking changes:\n- Arenas data version bumped, automatically updated.\n\n## Bugs fixed:\n- Bug with saving arena's (causing arena's to be lost on reboot.)\n- King is recognised in area no matter how you set it up now.\n- No more crashing when dying.\n- TP to the correct position after dying.\n- Hidden Bug. (if you don't know what it was, good)\n- Several bugs."
"version": "1.0.0-Beta3",
"time": 1561900000,
"link": "https://github.com/Jackthehack21/KOTH/releases/tag/1.0.0-Beta3",
"download_link": "https://poggit.pmmp.io/r/61202/KOTH.phar",
"patch_notes": "- Brand new extensions now available.\n- Database options (default Sqlite3, only two options as of now [sqlite3, yaml])\n- Massive changes in message formats, almost all messages can be changed in messages.yml\n- options in config.yml to:\n - Broadcast events server wide\n - Option to auto-start arena or wait for /koth start\n - Countdown options are now configurable\n - The following are now optional:\n - block_commands (NEW !)\n - prevent_place\n - prevent_break\n - prevent_gamemode_change\n - keep_inventory\n- Massive changes to the update feature:\n - Check for updates on server start (you can change URL for those who take it to the next level *wink*)\n - Download updates and install updates automatically no need to do anything except restart server !\n *Notice: This option is disabled by default by enabling it you accept the risk that the plugin may become corrupt or worse. (but good news is its been tested ALOT, and not once has anything caused lasting damage)*\n- For those over the seas, the help files got translated to a few modern foreign languages (more to come)\n- You can now re-set position 1 and 2 of the hill if you need to move the arena (spawn points aren't removable yet)\n\n**For developers:**\n- Notice: The GameTimer task seconds played has been switched to seconds left to cater for events and extending game play.\n- The plugin got some housecleaning now almost everything has type hints for your ease and Koth events are now in use.\n- The following events are used, please check the source for their individual vars:\n - KothEvent (base, all events extend)\n - ArenaCreateEvent\n - ArenaDeleteEvent\n - ArenaEndEvent\n - ArenaPreStartEvent\n - ArenaStartEvent\n - ArenaRemovePlayerEvent\n - ArenaAddPlayerEvent"
}

0 comments on commit e48e54a

Please sign in to comment.