Skip to content

Commit 6915e81

Browse files
committed
Added permissions for diagnostics and updated README.
1 parent b080d33 commit 6915e81

File tree

4 files changed

+215
-3
lines changed

4 files changed

+215
-3
lines changed

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@ Aliases: /lag, /latency
1111

1212
Permission: `ping.ping` (default `true`).
1313

14-
Translated in French (see configuration file).
15-
1614
![Preview](https://raw.carrade.eu/s/1463868237.png)
15+
16+
## Diagnostics
17+
18+
If the latency or server load is high, the command displays a diagnostic to help the player understand
19+
its performances problems.
20+
21+
Permission: `ping.diagnostic` (default `true`).
22+
23+
![Diagnostics preview](https://i.zcraft.fr/3523981572177619.png)
24+
25+
## Monitoring
26+
27+
By using `/toggleping` (or clicking on “keep displayed” in the `/ping` output), the ping can be kept
28+
displayed above the inventory, on the action bar. That can be useful to monitor your connection, if
29+
it is bad, or the server performances.
30+
31+
Permission: `ping.toggleping` (default `true`).
32+
33+
![Continuous ping](https://i.zcraft.fr/3928871572177775.png)
34+
35+
## Translations
36+
37+
Translated in French (see configuration file). Use the [provided POT file](src/main/resources/i18n/useful-ping.pot)
38+
if you want to translate it in your language (and send me the translation, if you want it to be available for
39+
others too).

src/main/java/fr/zcraft/Ping/commands/PingCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ else if (label.toLowerCase().endsWith("ping"))
156156
final boolean highLatency = latency > 150;
157157
final boolean lowTPS = tps != null && tps[0] < 16.5;
158158

159-
if (highLatency || lowTPS)
159+
if ((highLatency || lowTPS) && sender.hasPermission("ping.diagnostic"))
160160
{
161161
sender.sendMessage("");
162162

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PACKAGE VERSION\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2019-10-27 13:10+0100\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=CHARSET\n"
18+
"Content-Transfer-Encoding: 8bit\n"
19+
20+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:69
21+
msgid "{ce}Player {0} not found."
22+
msgstr ""
23+
24+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:80
25+
msgid "{green}Pong!"
26+
msgstr ""
27+
28+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:85
29+
#: src/main/java/fr/zcraft/Ping/commands/TogglePingCommand.java:51
30+
msgid "{ce}You cannot execute this command from the console."
31+
msgstr ""
32+
33+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:101
34+
msgid "{green}{bold}{0}'s ping"
35+
msgstr ""
36+
37+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:107
38+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:116
39+
msgid "{green}{bold}Pong!"
40+
msgstr ""
41+
42+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:109
43+
msgid "(keep displayed)"
44+
msgstr ""
45+
46+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:111
47+
msgid "Click here to display your ping continuously"
48+
msgstr ""
49+
50+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:122
51+
#: src/main/java/fr/zcraft/Ping/ContinuousPingSender.java:107
52+
msgid "Latency: "
53+
msgstr ""
54+
55+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:126
56+
msgid "Latency"
57+
msgstr ""
58+
59+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:129
60+
msgid "The time needed to transfer data from you to the server."
61+
msgstr ""
62+
63+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:130
64+
#, java-format
65+
msgid "The time needed to transfer data from {0} to the server."
66+
msgstr ""
67+
68+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:132
69+
msgid "The lower the better."
70+
msgstr ""
71+
72+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:135
73+
msgid "{gray}(unable to retrieve latency)"
74+
msgstr ""
75+
76+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:141
77+
msgid "Server load: "
78+
msgstr ""
79+
80+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:145
81+
msgid "Ticks per second"
82+
msgstr ""
83+
84+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:146
85+
msgid ""
86+
"The number of cycles the server executes per second. The best is 20; under "
87+
"15, the server is experiencing difficulties."
88+
msgstr ""
89+
90+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:147
91+
msgid ""
92+
"The three values are the average number of TPS during the last 1, 5 and 15 "
93+
"minutes."
94+
msgstr ""
95+
96+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:148
97+
msgid "The closest to 20 the better."
98+
msgstr ""
99+
100+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:151
101+
msgid "{gray}(unable to retrieve server load)"
102+
msgstr ""
103+
104+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:167
105+
msgid "Both your latency and the server load are high."
106+
msgstr ""
107+
108+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:167
109+
msgid ""
110+
"If you are experiencing poor performances, it may come from your internet "
111+
"connection, the server, or both."
112+
msgstr ""
113+
114+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:171
115+
msgid "Your latency is high."
116+
msgstr ""
117+
118+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:171
119+
msgid ""
120+
"If you are experiencing poor performances, it probably comes from your "
121+
"internet connection."
122+
msgstr ""
123+
124+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:175
125+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:190
126+
msgid "The server load is high."
127+
msgstr ""
128+
129+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:175
130+
msgid ""
131+
"If you are experiencing poor performances, it probably comes from the server."
132+
msgstr ""
133+
134+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:182
135+
#, java-format
136+
msgid "Both {0}'s latency and the server load are high."
137+
msgstr ""
138+
139+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:182
140+
msgid ""
141+
"If they are experiencing poor performances, it may come from their internet "
142+
"connection, the server, or both."
143+
msgstr ""
144+
145+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:186
146+
#, java-format
147+
msgid "{0}'s latency is high."
148+
msgstr ""
149+
150+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:186
151+
msgid ""
152+
"If they are experiencing poor performances, it probably comes from their "
153+
"internet connection."
154+
msgstr ""
155+
156+
#: src/main/java/fr/zcraft/Ping/commands/PingCommand.java:190
157+
#, java-format
158+
msgid ""
159+
"If {0} is experiencing poor performances, it probably comes from the server."
160+
msgstr ""
161+
162+
#: src/main/java/fr/zcraft/Ping/commands/TogglePingCommand.java:57
163+
msgid "{cs}The ping will be kept in your action bar."
164+
msgstr ""
165+
166+
#: src/main/java/fr/zcraft/Ping/commands/TogglePingCommand.java:59
167+
msgid "{cst}Run {cc}/toggleping{cst} or click here to remove."
168+
msgstr ""
169+
170+
#: src/main/java/fr/zcraft/Ping/commands/TogglePingCommand.java:60
171+
msgid "Click here to run {cc}/toggleping"
172+
msgstr ""
173+
174+
#: src/main/java/fr/zcraft/Ping/commands/TogglePingCommand.java:66
175+
msgid "{cs}The ping will no longer be kept."
176+
msgstr ""
177+
178+
#: src/main/java/fr/zcraft/Ping/ContinuousPingSender.java:97
179+
#: src/main/java/fr/zcraft/Ping/ContinuousPingSender.java:108
180+
#: src/main/java/fr/zcraft/Ping/ContinuousPingSender.java:134
181+
msgid "{gray}(unknown)"
182+
msgstr ""
183+
184+
#: src/main/java/fr/zcraft/Ping/ContinuousPingSender.java:112
185+
msgid "Load: "
186+
msgstr ""

src/main/resources/plugin.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ permissions:
2222
ping.toggleping:
2323
description: Allows the usage of the /toggleping command.
2424
default: true
25+
ping.diagnostic:
26+
description: Allows to see diagnostics in the /ping command if the latency or server load seems to be high.
27+
default: true

0 commit comments

Comments
 (0)