diff --git a/docs/velocity/dev/api/plugin-messaging.mdx b/docs/velocity/dev/api/plugin-messaging.mdx index 2b07eba8..3f9664b4 100644 --- a/docs/velocity/dev/api/plugin-messaging.mdx +++ b/docs/velocity/dev/api/plugin-messaging.mdx @@ -19,13 +19,13 @@ flowchart LR :::warning -When listening to PluginMessageEvent, ensure sure the result is +When listening to `PluginMessageEvent`, ensure the result is `ForwardResult.handled()` if you do not intend the client to participate. -If the result is forwarded, Players can spoof the proxy to your backends. +If the result is forwarded, players can impersonate the proxy to your backend servers. -Additionally, ensure the result is set correct after actually handling correct messages, to prevent them from being leaked to the other party. +Additionally, ensure the result is set correctly after actually handling correct messages, to prevent them from being leaked to the other party. This can be achieved with unconditionally setting the result between checking the identifier and checking the source, as shown in the examples. @@ -63,7 +63,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) { @Subscribe public void onPluginMessageFromPlayer(PluginMessageEvent event) { - // Check if Identifier matches first, no matter the source. + // Check if the identifier matches first, no matter the source. if (!IDENTIFIER.equals(event.getIdentifier())) { return; } @@ -75,7 +75,7 @@ public void onPluginMessageFromPlayer(PluginMessageEvent event) { // Alternatively: // mark PluginMessage as forwarded, indicating that the contents - // should be passed through, as if velocity is not present. + // should be passed through, as if Velocity is not present. //event.setResult(PluginMessageEvent.ForwardResult.forward()); // only attempt parsing the data if the source is a player @@ -173,7 +173,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) { @Subscribe public void onPluginMessageFromBackend(PluginMessageEvent event) { - // Check if Identifier matches first, no matter the source. + // Check if the identifier matches first, no matter the source. // this allows setting all messages to IDENTIFIER as handled, // preventing any client-originating messages from being forwarded. if (!IDENTIFIER.equals(event.getIdentifier())) {