fCraft.Player.GentlyKickBetaClients C# (CSharp) Method

GentlyKickBetaClients() private method

private GentlyKickBetaClients ( ) : void
return void
        private void GentlyKickBetaClients()
        {
            // This may be someone connecting with an SMP client
            int strLen = IPAddress.NetworkToHostOrder( reader.ReadInt16() );

            if ( strLen >= 2 && strLen <= 16 ) {
                string smpPlayerName = Encoding.BigEndianUnicode.GetString( reader.ReadBytes( strLen * 2 ) );

                Logger.Log( LogType.Warning,
                            "Player.LoginSequence: Player \"{0}\" tried connecting with Minecraft Beta client from {1}. " +
                            "800Craft does not support Minecraft Beta.",
                            smpPlayerName, IP );

                // send SMP KICK packet
                writer.Write( ( byte )255 );
                byte[] stringData = Encoding.BigEndianUnicode.GetBytes( NoSmpMessage );
                writer.Write( ( short )NoSmpMessage.Length );
                writer.Write( stringData );
                BytesSent += ( 1 + stringData.Length );
                writer.Flush();
            } else {
                // Not SMP client (invalid player name length)
                Logger.Log( LogType.Error,
                            "Player.LoginSequence: Unexpected opcode in the first packet from {0}: 2.", IP );
                KickNow( "Unexpected handshake message - possible protocol mismatch!", LeaveReason.ProtocolViolation );
            }
        }