Skip to content

Commit f21de89

Browse files
456devzlataovce
andcommitted
Apply suggestions from code review
Co-authored-by: Matouš Kučera <mk@kcra.me>
1 parent 2b0afa9 commit f21de89

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/velocity/dev/api/plugin-messaging.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ flowchart LR
1919

2020
:::warning
2121

22-
When listening to PluginMessageEvent, ensure sure the result is
22+
When listening to `PluginMessageEvent`, ensure the result is
2323
<Javadoc name={"com/velocitypowered/api/event/connection/PluginMessageEvent$ForwardResult#handled()"} project={"velocity"}>`ForwardResult.handled()`</Javadoc>
2424
if you do not intend the client to participate.
2525

26-
If the result is forwarded, Players can spoof the proxy to your backends.
26+
If the result is forwarded, players can impersonate the proxy to your backend servers.
2727

28-
Additionally, ensure the result is set correct after actually handling correct messages, to prevent them from being leaked to the other party.
28+
Additionally, ensure the result is set correctly after actually handling correct messages, to prevent them from being leaked to the other party.
2929

3030
This can be achieved with unconditionally setting the result between checking the identifier and checking the source, as shown in the examples.
3131

@@ -63,7 +63,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
6363

6464
@Subscribe
6565
public void onPluginMessageFromPlayer(PluginMessageEvent event) {
66-
// Check if Identifier matches first, no matter the source.
66+
// Check if the identifier matches first, no matter the source.
6767
if (!IDENTIFIER.equals(event.getIdentifier())) {
6868
return;
6969
}
@@ -75,7 +75,7 @@ public void onPluginMessageFromPlayer(PluginMessageEvent event) {
7575
// Alternatively:
7676

7777
// mark PluginMessage as forwarded, indicating that the contents
78-
// should be passed through, as if velocity is not present.
78+
// should be passed through, as if Velocity is not present.
7979
//event.setResult(PluginMessageEvent.ForwardResult.forward());
8080

8181
// only attempt parsing the data if the source is a player
@@ -173,7 +173,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
173173

174174
@Subscribe
175175
public void onPluginMessageFromBackend(PluginMessageEvent event) {
176-
// Check if Identifier matches first, no matter the source.
176+
// Check if the identifier matches first, no matter the source.
177177
// this allows setting all messages to IDENTIFIER as handled,
178178
// preventing any client-originating messages from being forwarded.
179179
if (!IDENTIFIER.equals(event.getIdentifier())) {
@@ -187,7 +187,7 @@ public void onPluginMessageFromBackend(PluginMessageEvent event) {
187187
// Alternatively:
188188

189189
// mark PluginMessage as forwarded, indicating that the contents
190-
// should be passed through, as if velocity is not present.
190+
// should be passed through, as if Velocity is not present.
191191
//
192192
// this should be used with extreme caution,
193193
// as any client can freely send whatever it wants, pretending to be the proxy

0 commit comments

Comments
 (0)