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

Commit

Permalink
Fix main page and improve playerlist
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Sep 5, 2020
1 parent a2dcc4f commit d65ea30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
15 changes: 10 additions & 5 deletions src/main/java/Xera/Monitor/PlayerGeter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ public static String getPlayers() {
players.add(pl.getName());
}

for (int i = 0; i < players.size(); i++) {
if (i == (players.size() - 1)) {
p.append(players.get(i));
} else {
p.append(players.get(i)).append(", ");
if (players.size() < 1) {
p.append("none");
} else {
for (int i = 0; i < players.size(); i++) {
if (i == (players.size() - 1)) {
p.append(players.get(i));
} else {
p.append(players.get(i)).append(", ");
}
}
}


return p.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Xera/Monitor/WebServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void handle(HttpExchange t) {
StringBuilder contentBuilder = new StringBuilder();

try {
BufferedReader in = new BufferedReader(new FileReader("plugins/LeeesTpsMonitor/index.html"));
BufferedReader in = new BufferedReader(new FileReader("plugins/XeraMonitor/index.html"));
String str;

while ((str = in.readLine()) != null) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/Xera/Monitor/XeraMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public void onEnable() {
" <br><br>\n" +
" <img src=\"https://cdn.discordapp.com/attachments/703638060792938578/710023538840698880/server-icon.png\" width=\"64\" height=\"64\">\n" +
" <b><h1>XeraMonitor</h1></b></label>\n" +
" <h1>TPS:</h1> <h1 style=\"color:#00ff00;\">server_tps</h1>\n" +
" <h1>TPS:</h1> <h1 style=\"color:#00ff00;\">%server_tps%</h1>\n" +
" <br>\n" +
" <h1>PlayerCount:<h1> <h1 style=\"color:#00ff00;\">server_playercount</h1>\n" +
" <h1>PlayerCount:<h1> <h1 style=\"color:#00ff00;\">%server_playercount%</h1>\n" +
" <br>\n" +
" <h1>PlayerList:</h1>\n" +
" <h4 style=\"color:#00ff00;\">server_playerlist</h4>\n" +
" <h4 style=\"color:#00ff00;\">%server_playerlist%</h4>\n" +
" </div> </body>\n" +
" <style>\n" +
"body {\n" +
Expand Down

0 comments on commit d65ea30

Please sign in to comment.