@@ -19,13 +19,13 @@ flowchart LR
19
19
20
20
:::warning
21
21
22
- When listening to PluginMessageEvent, ensure sure the result is
22
+ When listening to ` PluginMessageEvent ` , ensure the result is
23
23
<Javadoc name = { " com/velocitypowered/api/event/connection/PluginMessageEvent$ForwardResult#handled()" } project = { " velocity" } >` ForwardResult.handled() ` </Javadoc >
24
24
if you do not intend the client to participate.
25
25
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 .
27
27
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.
29
29
30
30
This can be achieved with unconditionally setting the result between checking the identifier and checking the source, as shown in the examples.
31
31
@@ -63,7 +63,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
63
63
64
64
@Subscribe
65
65
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.
67
67
if (! IDENTIFIER . equals(event. getIdentifier())) {
68
68
return ;
69
69
}
@@ -75,7 +75,7 @@ public void onPluginMessageFromPlayer(PluginMessageEvent event) {
75
75
// Alternatively:
76
76
77
77
// 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.
79
79
// event.setResult(PluginMessageEvent.ForwardResult.forward());
80
80
81
81
// only attempt parsing the data if the source is a player
@@ -173,7 +173,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
173
173
174
174
@Subscribe
175
175
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.
177
177
// this allows setting all messages to IDENTIFIER as handled,
178
178
// preventing any client-originating messages from being forwarded.
179
179
if (! IDENTIFIER . equals(event. getIdentifier())) {
@@ -187,7 +187,7 @@ public void onPluginMessageFromBackend(PluginMessageEvent event) {
187
187
// Alternatively:
188
188
189
189
// 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.
191
191
//
192
192
// this should be used with extreme caution,
193
193
// as any client can freely send whatever it wants, pretending to be the proxy
0 commit comments