Listening to client data

Discussion in 'General Help' started by RcExtract, Jul 31, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    RcExtract

    How does nms listen and read data from Minecraft server? (Just wondering) Both Minecraft pe and pc are not open source, but why fans can build a server that listens to Minecraft pe client, but cannot build a server that listens to a Minecraft pc client? Thanks.
     
  2. Offline

    Zombie_Striker

  3. Offline

    RcExtract

    There is an official Minecraft pc server client, and it is not open source, so we cannot exactly know how the server receive data from the unopen source Minecraft pc client. But Minecraft pe client is unopen source too, then how programmers build their unofficial pe server client and receive data? Therefore, I believe either mojang has posted something related, or the resources is leaked.
     
  4. @RcExtract
    For the PC java edition, it's pretty easy. Modders just use a decompiler to see the source code (this is actually what BuildTools does to patch the NMS code). There's even a nearly complete protocol documentation, so if you're making a server or client, you might not even need to look at the decompiled code.

    Pocket Edition is a bit harder. I'm not too familiar with how reverse-engineering app code works. But I'd assume they use the android edition (since that is written in Java?). They also have a PE protocol documentation, but it's not as nice as the PC one.
     
  5. Offline

    RcExtract

    After decompiling the nms jar the classes are named aaa, aab, aac, etc. and I have no idea what they are. Also the methods and fields are all named with two alphabets and I don't know their meaning. But thanks for the documentation.

    So the data are stored into a packet and the packet is sent to the client right?
     
  6. Online

    timtower Administrator Administrator Moderator

    @RcExtract Yes, that is indeed what is happening.
     
  7. Offline

    RcExtract

    But the packet object cannot be sent to the client. How is it serialized into string?
     
  8. Online

    timtower Administrator Administrator Moderator

    Who says that it is being serialized to a string?
    Why wouldn't the client be able to send the packet?
     
  9. @RcExtract
    Mojang's sources are obfuscated. They are half-heartedly trying to prevent people from doing this. Spigot has a set of mappings that they use to rename the classes and some of the methods to more meaningful names.

    The packets aren't serialized to Strings, they're just sent as bytes over the network. Mojang use the netty framework for this, but it isn't really needed (at least if you're writing a client, I'm not sure what the standard nio api for servers looks like).
     
Thread Status:
Not open for further replies.

Share This Page