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

Commit

Permalink
Added message for key command if key is disabled + Now sends use in-g…
Browse files Browse the repository at this point in the history
…ame message from language files
  • Loading branch information
DaPigGuy committed Apr 21, 2017
1 parent 54211e9 commit 4d5bd61
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 14 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PiggyAuth
main: PiggyAuth\Main
version: 3.0.0.15
version: 3.0.0.16
api: [2.0.0, 3.0.0-ALPHA1, 3.0.0-ALPHA2, 3.0.0-ALPHA3, 3.0.0-ALPHA4, 3.0.0-APLHA5]
load: POSTWORLD
author: MCPEPIG
Expand Down
3 changes: 3 additions & 0 deletions resources/languages/lang_chs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ your-pin: "&a您的交换码: {pin}"

#Key
key-expired: "&c您的密钥已过期."
key-disabled: "&cKeys aren't enabled on this server." #Needs translation

#Language
invalid-language: "&c不存在的语言.\n可用的语言: {languages}"
Expand All @@ -109,3 +110,5 @@ over-api-rate-limit: "&c你已经超过API率的极限了(60 请求1小时)"
#General
dont-say-password: "&c请别分享您的密码."
account-blocked: "&c此账户已受阻."
use-in-game: "&cYou must use the command in-game." #Needs translation
use-on-console: "&cYou must use the command on console." #Needs translation
5 changes: 4 additions & 1 deletion resources/languages/lang_cze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ your-pin: "&aTvů pin je {pin}."

#Key
key-expired: "&cTvůj klíč expiroval."
key-disabled: "&cKeys aren't enabled on this server." #Needs translation

#Language
invalid-language: "&cJazyk není dostupný.\nDostupné jazyky: {languages}"
Expand All @@ -108,4 +109,6 @@ over-api-rate-limit: "&cProšli jste api limit (60 žádostí za hodinu)."

#General
dont-say-password: "&cNesděluj své heslo!"
account-blocked: "&cÚčet je zablokovaný!"
account-blocked: "&cÚčet je zablokovaný!"
use-in-game: "&cYou must use the command in-game." #Needs translation
use-on-console: "&cYou must use the command on console." #Needs translation
5 changes: 4 additions & 1 deletion resources/languages/lang_eng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ your-pin: "&aYour pin: {pin}"

#Key
key-expired: "&cYour key is expired."
key-disabled: "&cKeys aren't enabled on this server."

#Language
invalid-language: "&cLanguage not available.\nAvailable languages: {languages}"
Expand All @@ -108,4 +109,6 @@ over-api-rate-limit: "&cYou have passed the api rate limit (60 requests an hour)

#General
dont-say-password: "&cDo not say your password."
account-blocked: "&cAccount is blocked."
account-blocked: "&cAccount is blocked."
use-in-game: "&cYou must use the command in-game."
use-on-console: "&cYou must use the command on console."
3 changes: 3 additions & 0 deletions resources/languages/lang_ger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ your-pin: "&aDeine PIN: {pin}"

#Key
key-expired: "&cDein Key ist abgelaufen."
key-disabled: "&cKeys aren't enabled on this server." #Needs translation

#Language
invalid-language: "&cSprache nicht verfügbar.\nVerfügbare Sprachen: {languages}"
Expand All @@ -109,3 +110,5 @@ over-api-rate-limit: "&cDu hast die API-Ratenbegrenzung überschritten (60 Anfor
#General
dont-say-password: "&cSchreib dein Kennwort nicht in den Chat!"
account-blocked: "&cDie Kennung ist gesperrt."
use-in-game: "&cYou must use the command in-game." #Needs translation
use-on-console: "&cYou must use the command on console." #Needs translation
3 changes: 3 additions & 0 deletions resources/languages/lang_por.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ your-pin: "&aO teu PIN: {pin}"

#Key
key-expired: "&cA tua chave passou do prazo de validade!"
key-disabled: "&cKeys aren't enabled on this server." #Needs translation

#Language
invalid-language: "&cIdioma não dísponível.\nIdiomas dísponíveis: {languages}"
Expand All @@ -109,3 +110,5 @@ over-api-rate-limit: "&cAntingiste o limite de pedidos da API (60 pedidos/hora).
#General
dont-say-password: "&cNunca digas a tua palavra-passe a ninguém!"
account-blocked: "&cA tua conta está bloqueada."
use-in-game: "&cYou must use the command in-game." #Needs translation
use-on-console: "&cYou must use the command on console." #Needs translation
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/ChangeEmailCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
if (!isset($args[0])) {
Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/ChangePasswordCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
if (!isset($args[1])) {
Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/ForgotPasswordCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
if (!isset($args[1])) {
Expand Down
8 changes: 6 additions & 2 deletions src/PiggyAuth/Commands/KeyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if ($sender instanceof Player) {
$sender->sendMessage("§cThis is for the console only.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-on-console"));
return false;
}
if (!isset($args[0])) {
$sender->sendMessage("/key <password>");
return false;
}
$sender->sendMessage($this->plugin->getKey($args[0]) == false ? "Incorrect password." : $this->plugin->getKey($args[0]));
if(!$this->plugin->getConfig()->getNested("key.enabled")) {
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "key-disabled"));
return false;
}
$sender->sendMessage($this->plugin->getKey($args[0]) == false ? $this->plugin->languagemanager->getMessage($sender, "incorrect-password-other") : $this->plugin->getKey($args[0]));
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/LoginCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
if (!isset($args[0])) {
Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/LogoutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
$this->plugin->logout($sender, false);
Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/PinCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
$sender->sendMessage(str_replace("{pin}", $this->plugin->sessionmanager->getSession($sender)->getPin(), $this->plugin->languagemanager->getMessage($sender, "your-pin")));
Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/RegisterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
if (!isset($args[0]) || !isset($args[1])) {
Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/SendPinCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
$result = $this->plugin->emailmanager->sendEmail($this->plugin->sessionmanager->getSender($sender)->getEmail(), $this->plugin->languagemanager->getMessage($sender, "email-subject-sendpin"), str_replace("{pin}", $this->plugin->sessionmanager->getSender($sender)->getPin(), $this->plugin->languagemanager->getMessage($sender, "email-sendpin")), $sender);
Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/Commands/SetLanguageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute(CommandSender $sender, $currentAlias, array $args)
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage("§cYou must use the command in-game.");
$sender->sendMessage($this->plugin->languagemanager->getMessage($sender, "use-in-game"));
return false;
}
if (!isset($args[0])) {
Expand Down
9 changes: 9 additions & 0 deletions src/PiggyAuth/Databases/IndividualFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@
use pocketmine\utils\Config;


/**
* Class IndividualFiles
* @package PiggyAuth\Databases
*/
class IndividualFiles implements Database
{
private $plugin;
private $extension;


/**
* IndividualFiles constructor.
* @param Main $plugin
* @param $extension
*/
public function __construct(Main $plugin, $extension)
{
$this->plugin = $plugin;
Expand Down

1 comment on commit 4d5bd61

@DaPigGuy
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Thunder33345 @SleepSpace9 @miguel456 @lolmanz0 New translations required

Please sign in to comment.