Packet Help

Discussion in 'Spigot Plugin Development' started by ckamps2020, May 16, 2016.

  1. Hey there!

    So I'm working on a very secret project, and to execute one of the functions we need, we need to send a custom packet to the client. I'm not too sure how to go about this, and if you could possibly give me help in figuring this out that would be great!
     
  2. You could use wire packets, and ProtocolLib.
    This is the example that I use to play out the MC|BOpen packet, which opens a written book in hand

    Code (Text):
    byte hand = 0; //0: Main hand, 1: Off hand
    byte[] packet = {
    8, 'M', 'C', '|', 'B', 'O', 'p', 'e', 'n', //Length prefix, then channel name
    hand
    };
    ProtocolLibrary.getProtocolManager().sendWirePacket(player, 0x18, packet) // 0x18 id for packet with custom payload
     
    • Friendly Friendly x 1
  3. Thank you I'll try this out!
     
  4. For a bit more documentation on this check out http://wiki.vg/Protocol#Plugin_Message_.28clientbound.29 . Note that you cannot change how the client is handling things unless you are also writing a mod that the client has to be using on the other end. I know you said you are keeping things secret but the more info you give the more help we can be :)
     
    #4 MrBlobman, May 16, 2016
    Last edited: May 16, 2016
    • Useful Useful x 1
  5. Basically, we are attempting to send a packet to a user who joins, and if they are using a certain hacked client, the panic mode will be enabled every second via a runnable. Sadly though, I am starting to see this is probably not going to be possible
     
  6. Yeah if I were writing a hacked client there is no way I would allow an external source such as a server start twisting knobs. Hacked clients do their best to give the client (and therefor the user) as much power as they can squeeze out of what the server allows them to control.

    The best you could do is try your best to trick the user into enabling this on their own and even then there are quite a few people that are doing work in this area already with the major technique being spawning a client side entity somewhere where only a hacked client is likely to attempt to hit it via kill aura or something similar. So far there really isn't a simple solution to dealing with hacked clients but I do encourage you to keep looking into things like this!
     

  7. Thanks for advice! I'm currently researching this, and one of the three of us knows how to write them, but he is asleep currently and I wanted to test a few methods. I have looked through the source of many clients, and some are easy to block via the plugin messaging channel, but others are a bit harder.

    We have a team of three of us working to solve this, as we think that not only will this help us, but the whole community. Why its kinda secret is we don't want to name the clients we are testing, so they don't change their methods or how they call certain things.

    As for how we would stop the hacks, there is a method in pretty much every hacked client that is something on the lines of "panic mode"

    Creating a runnable and forcing the user to simple trigger this "panic mode" would not force him off with the client on, but simply disable all hacking options, as the second the user would enable them, the server would force the player to disable them. We have found that a few other smaller hacked clients are easy to block, since they interact with the server, but there is two main ones that we have not figured a way to block.
     
  8. Ooooo sounds very interesting! I hope everything works out for you guys! :)
     
    • Like Like x 1