@@ -20,26 +20,28 @@ public VelocityHandshakeHandler(TCPShieldPlugin plugin) {
20
20
this .plugin = plugin ;
21
21
}
22
22
23
- @ Subscribe (order = PostOrder .FIRST )
24
- public void onPreLogin (PreLoginEvent e ) {
25
- InboundConnection connection = e .getConnection ();
26
- handleEvent (connection );
27
- }
23
+ // Turns out this event sometimes passes erroneous hostnames
24
+ // which have the null bytes terminated as FML data which causes
25
+ // issues with the verification process.
26
+ // @Subscribe(order = PostOrder.FIRST)
27
+ // public void onPreLogin(PreLoginEvent e) {
28
+ // InboundConnection connection = e.getConnection();
29
+ // handleEvent(connection, "onPreLogin");
30
+ // }
28
31
29
32
@ Subscribe (order = PostOrder .FIRST )
30
33
public void onHandshake (ConnectionHandshakeEvent e ) {
31
34
InboundConnection connection = e .getConnection ();
32
- handleEvent (connection );
35
+ handleEvent (connection , "onHandshake" );
33
36
}
34
37
35
38
@ Subscribe (order = PostOrder .FIRST )
36
39
public void onProxyPing (ProxyPingEvent e ) {
37
40
InboundConnection connection = e .getConnection ();
38
- handleEvent (connection );
41
+ handleEvent (connection , "onProxyPing" );
39
42
}
40
43
41
-
42
- private void handleEvent (InboundConnection connection ) {
44
+ private void handleEvent (InboundConnection connection , String debugSource ) {
43
45
VelocityPlayer player = new VelocityPlayer (connection );
44
46
if (player .isLegacy ()) {
45
47
player .disconnect ();
@@ -48,7 +50,7 @@ private void handleEvent(InboundConnection connection) {
48
50
49
51
VelocityPacket packet = new VelocityPacket (connection );
50
52
51
- this .plugin .getDebugger ().warn ("Velocity: Raw player hostname: " + packet .getPayloadString ());
53
+ this .plugin .getDebugger ().warn ("Velocity: " + debugSource + " Raw player hostname: " + packet .getPayloadString ());
52
54
53
55
try {
54
56
plugin .getPacketHandler ().handleHandshake (packet , player );
0 commit comments