Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: get client action from bytes

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default get client action from bytes

    Hi.

    I have a "minecraft" server in my pc. and i am writing a tunnel to block some actions from the players.

    so, the client's connect to my program, and i foward all bytes received, to the server, and the same when the server send something to the client.

    while ((bytesRead = In.read(byteBuffer)) != -1) {
                    if (Debug.dmode && isClient ) {
                        //System.out.println("byte %d" + totalBytesMoved);
                        //System.out.println(stringToHex(new String(byteBuffer)));
                        //System.out.println(byteBuffer[0]);
                    }
     
                    Out.write(byteBuffer, 0, bytesRead);
                    Out.flush();
     }

    It works, i can play the game with the tunnel working, and print only the bytes that the client send to the server.

    The problem is, i want to block an specific action, (destroying block from a certain area - if you know the game), and i cant understand the actions from the bytes.. i tried so many times to see the bytes, but look like its not the same to same action, because maybe the content, like position of the player, are in 2 or more bytes.

    anybody have any idea of how to do it?

    Thx for all.
    sorry for the english


  2. #2
    Junior Member
    Join Date
    Feb 2011
    Posts
    19
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default Re: get client action from bytes

    You have to write as many bytes as possible and start analysing it.
    Try to find some simple bytes sequences occurring when you "destroy the blocks" or whatever you do Maybe you will find your sequence.
    It could take long hours and may be problematic if you don't know how (used RMI, ICE or plain sockets) the author wrote the program.

Similar Threads

  1. Java Sockets, Bytes / Objects
    By AdamD in forum Java Networking
    Replies: 1
    Last Post: January 31st, 2011, 03:25 PM
  2. reading stream of bytes from serial port
    By KrisTheSavage in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: January 3rd, 2011, 11:02 AM
  3. Reading an int from bytes(binary file) - HELP
    By yogiyogi in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 14th, 2010, 02:03 PM
  4. convert vector to array of bytes
    By chopficaro in forum Java Theory & Questions
    Replies: 1
    Last Post: May 3rd, 2010, 11:00 AM
  5. How to Get the size of a file in bytes
    By JavaPF in forum File Input/Output Tutorials
    Replies: 1
    Last Post: June 8th, 2009, 10:19 AM