Skip to content

Commit

Permalink
Loading and saving ranks with commands. Ranks added to autosave
Browse files Browse the repository at this point in the history
Missing translations (#51)
  • Loading branch information
MarcinWieczorek committed Jan 7, 2016
1 parent 9c37557 commit 77fc2d0
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ else if(plugin.getConfigManager().getDataStorageType() == DataStorageType.SQLITE
plugin.getGroupManager().load();
Message.CHAT_RELOAD_GROUPS.send(sender);

//ranks
plugin.getRankManager().load();
Message.CHAT_RELOAD_RANKS.send(sender);

LoggerUtils.info("Post checks running");
plugin.getGuildManager().postCheck();
plugin.getRegionManager().postCheck();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public void execute(CommandSender sender, String[] args) {
Message.CHAT_ADMIN_SAVE_REGIONS.send(sender);
LoggerUtils.info("Saved regions");
break;
case "ranks":
plugin.getRankManager().save();
Message.CHAT_ADMIN_SAVE_RANKS.send(sender);
LoggerUtils.info("Saved ranks");
break;
default:
Message.CHAT_INVALIDPARAM.send(sender);
break;
Expand All @@ -69,6 +74,7 @@ public void execute(CommandSender sender, String[] args) {
plugin.getRegionManager().save();
plugin.getGuildManager().save();
plugin.getPlayerManager().save();
plugin.getRankManager().save();
Message.CHAT_ADMIN_SAVE_ALL.send(sender);
LoggerUtils.info("Saved all data");
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/co/marcin/novaguilds/enums/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public enum Message {
CHAT_ADMIN_SAVE_PLAYERS,
CHAT_ADMIN_SAVE_GUILDS,
CHAT_ADMIN_SAVE_REGIONS,
CHAT_ADMIN_SAVE_RANKS,
CHAT_ADMIN_SAVE_ALL,
CHAT_ADMIN_SAVE_AUTOSAVE,

Expand All @@ -116,6 +117,7 @@ public enum Message {
CHAT_RELOAD_REGIONS,
CHAT_RELOAD_NEWMSGFILE,
CHAT_RELOAD_GROUPS,
CHAT_RELOAD_RANKS,
CHAT_RELOAD_RELOADED,

CHAT_PVP_TEAM,
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/co/marcin/novaguilds/manager/RankManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class RankManager {
private final List<NovaRank> defaultRanks = new ArrayList<>();

public void load() {
defaultRanks.clear();

//Load default ranks
loadDefaultRanks();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public void run() {
plugin.getGuildManager().save();
plugin.getRegionManager().save();
plugin.getPlayerManager().save();
plugin.getRankManager().save();
LoggerUtils.info("Saved data.");

//send message to admins
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/lang/de-de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ chat:
players: "Spieler gespeichert."
guilds: "Gilden gespeichert."
regions: "Bereiche gespeichert."
all: "Alle Daten gespeichert. (Spieler, Bereiche, Gilden)"
ranks: "Ranks saved."
all: "Alle Daten gespeichert. (Spieler, Bereiche, Gilden, Ranks)"
autosave: "Automatisches Speichern abgeschlossen."
hologram:
notfound: "Es wurde kein Hologramm mit diesem Namen gefunden."
Expand All @@ -101,6 +102,7 @@ chat:
regions: "Bereiche geladen!"
newmsgfile: "Neue Nachrichten-Datei erstellt!"
groups: "Gruppen geladen!"
ranks: "Ranks loaded!"
reloaded: "NovaGuilds neu geladen!"

usage:
Expand Down Expand Up @@ -129,7 +131,7 @@ chat:
- "&5* &7/nga &cg &2- &3Gildenbefehle"
- "&5* &7/nga &ch &2- &3Hologrammbefehle"
- "&5* &7/nga &creload &2- &6[&5NovaGuilds&6] &3neu laden"
- "&5* &7/nga &csave &6[players/guilds/region] &2- &3Daten Speichern"
- "&5* &7/nga &csave &6[players/guilds/regions/ranks] &2- &3Daten Speichern"
region:
header: "Admin Gebiet Befehle:"
items:
Expand Down
8 changes: 5 additions & 3 deletions src/main/resources/lang/en-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ chat:
players: "Players saved."
guilds: "Guilds saved."
regions: "Regions saved."
all: "All data saved. (Players, Regions, Guilds)"
ranks: "Ranks saved."
all: "All data saved. (Players, Regions, Guilds, Ranks)"
autosave: "AutoSave completed."
hologram:
notfound: "Could not find a hologram with this name."
Expand All @@ -100,7 +101,8 @@ chat:
guilds: "Guilds loaded!"
regions: "Regions loaded!"
newmsgfile: "New messages file created!"
groups: "Groups loaded"
groups: "Groups loaded!"
ranks: "Ranks loaded!"
reloaded: "NovaGuilds reloaded!"

usage:
Expand Down Expand Up @@ -129,7 +131,7 @@ chat:
- "&5* &7/nga &cg &2- &3Guild commands"
- "&5* &7/nga &ch &2- &3Hologram commands"
- "&5* &7/nga &creload &2- &3Reload &6[&5NovaGuilds&6]"
- "&5* &7/nga &csave &6[players/guilds/regions] &2- &3Save data"
- "&5* &7/nga &csave &6[players/guilds/regions/ranks] &2- &3Save data"
region:
header: "Admin region commands:"
items:
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/lang/pl-pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ chat:
players: "Gracze zapisani."
guilds: "Gildie zapisane."
regions: "Regiony zapisane."
all: "Zapisano wszystkie dane. (Gracze, gildie, regiony)"
ranks: "Rangi zapisane."
all: "Zapisano wszystkie dane. (Gracze, gildie, regiony, rangi)"
autosave: "Zakonczono automatyczny zapis."
hologram:
notfound: "Nie udalo sie znalezc hologramu o takiej nazwie."
Expand All @@ -101,6 +102,7 @@ chat:
regions: "Regiony zaladowane"
newmsgfile: "Nowy plik wiadomosci stworzony!"
groups: "Grupy zaladowane!"
ranks: "Rangi załadowane!"
reloaded: "NovaGuilds przeladowane!"

usage:
Expand Down Expand Up @@ -129,7 +131,7 @@ chat:
- "&5* &7/nga &cg &2- &3Komendy gildii"
- "&5* &7/nga &ch &2- &3Komendy hologramow"
- "&5* &7/nga &creload &2- &3Przeladuj &6[&5NovaGuilds&6]"
- "&5* &7/nga &csave &6[players/guilds/regions] &2- &3Zapisz dane"
- "&5* &7/nga &csave &6[players/guilds/regions/ranks] &2- &3Zapisz dane"
region:
header: "Komendy Admina, regiony:"
items:
Expand Down
8 changes: 5 additions & 3 deletions src/main/resources/lang/zh-cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ chat:
players: "玩家数据已保存."
guilds: "公会数据已保存."
regions: "领地数据已保存."
all: "配置文件已保存(Players, Regions, Guilds)"
ranks: "Ranks saved."
all: "配置文件已保存(Players, Regions, Guilds, Ranks)"
autosave: "自动保存传送."
hologram:
notfound: "找不到该名称的全息图"
Expand All @@ -100,7 +101,8 @@ chat:
guilds: "公会数据已重载!"
regions: "领地数据已重载!"
newmsgfile: "成功创建新语言文件!"
groups: "权限组信息已加载"
groups: "权限组信息已加载!"
ranks: "Ranks loaded!"
reloaded: "插件重载完成!"

usage:
Expand Down Expand Up @@ -129,7 +131,7 @@ chat:
- "&5* &7/nga &cg &2- &3公会管理指令"
- "&5* &7/nga &ch &2- &3全息图指令"
- "&5* &7/nga &creload &2- &3重载 &6[&5NovaGuilds&6]"
- "&5* &7/nga &csave &6[players/guilds/regions] &2- &3保存公会插件数据"
- "&5* &7/nga &csave &6[players/guilds/regions/ranks] &2- &3保存公会插件数据"
region:
header: "[管理]领地管理指令:"
items:
Expand Down

0 comments on commit 77fc2d0

Please sign in to comment.