Example #1
0
        internal static Packet MakeSetPermission(Player player)
        {
            if (player == null)
            {
                throw new ArgumentNullException("player");
            }

            Packet packet = new Packet(OpCode.SetPermission);

            packet.Data[1] = player.GetOpPacketCode();
            return(packet);
        }
Example #2
0
        internal static Packet MakeHandshake(Player player, string serverName, string motd)
        {
            if (player == null)
            {
                throw new ArgumentNullException("player");
            }
            if (serverName == null)
            {
                throw new ArgumentNullException("serverName");
            }
            if (motd == null)
            {
                throw new ArgumentNullException("motd");
            }

            Packet packet = new Packet(OpCode.Handshake);

            packet.Data[1] = Config.ProtocolVersion;
            Encoding.ASCII.GetBytes(serverName.PadRight(64), 0, 64, packet.Data, 2);
            Encoding.ASCII.GetBytes(motd.PadRight(64), 0, 64, packet.Data, 66);
            packet.Data[130] = player.GetOpPacketCode();
            return(packet);
        }
Example #3
0
        internal static Packet MakeHandshake( Player player, string serverName, string motd ) {
            if( player == null ) throw new ArgumentNullException( "player" );
            if( serverName == null ) throw new ArgumentNullException( "serverName" );
            if( motd == null ) throw new ArgumentNullException( "motd" );

            Packet packet = new Packet( OpCode.Handshake );
            packet.Data[1] = Config.ProtocolVersion;
            Encoding.ASCII.GetBytes( serverName.PadRight( 64 ), 0, 64, packet.Data, 2 );
            Encoding.ASCII.GetBytes( motd.PadRight( 64 ), 0, 64, packet.Data, 66 );
            packet.Data[130] = player.GetOpPacketCode();
            return packet;
        }
Example #4
0
        internal static Packet MakeSetPermission( Player player ) {
            if( player == null ) throw new ArgumentNullException( "player" );

            Packet packet = new Packet( OpCode.SetPermission );
            packet.Data[1] = player.GetOpPacketCode();
            return packet;
        }