Updating a signs content utilizing craftbukkit and packets

Discussion in 'Plugin Development' started by Father Of Time, May 10, 2012.

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

    Father Of Time

    Out of curiosity, has anyone ever tried to force the client to display the sign edit GUI utilizing packets?

    Code:
            a(130, true, true, Packet130UpdateSign.class);
    
    Which is located in the following class within the craftbukkit client source:

    https://github.com/Bukkit/CraftBukkit/blob/master/src/main/java/net/minecraft/server/Packet.java

    I've done almost no research on this packet and how it's utilized; I simply check the packet class to see if any packets specifically had the word "sign" in their name, which apparently there is.

    So, does anyone in the community have experience using this packet, and if so what is the primary use of this packet (when used legitimately by the server/client).

    Thank you in advance to all who offer additional information to this discussion, have a great day!
     
  2. Well, as it seems it contains the lines of the sign and a x, y and z value. I would guess it'll be send to the client for example after the SignChangeEvent.
     
    Father Of Time likes this.
  3. Father Of Time likes this.
  4. Offline

    Father Of Time

    Thanks for your contributions guys. Sadly from what V10lator posted it appears that it only sends the update information itself and does not trigger the sending of the sign GUI:

    The bold section leads me to believe that this packet is only sent after the sign has been placed and the GUI has been sent to the player, not before... Oh well, was worth looking into.

    Thanks for the contributions!
     
  5. Just a guess:
    Since the client already knows the content to display, because of the packet that we're talking about keeps informing the client if a sign changes, it doesn't need to send any packets when displaying the sign edit screen. Whereas, for example, when you open a chest, the client doesn't know the exact contents so it's forced to make some kind of update to get those.
     
  6. Offline

    Father Of Time

    Exactly, There is no reason for the client to ever notify the server of the GUI being displayed to the player because the GUI display and the input is all conducted on the client side; it's not until the content of the sign is set that the server needs to be made aware of the changes so that it can notify other clients.

    A player opening a sign GUI doesn't affect other players, hence the action doesn't send a packet to the server; however, a player changing the content of a sign does affect other players, so it must notify the server of the changes.

    I think your logic is spot on, unfortunately... ;)
     
  7. unfortunately yes :D
    BTW: I have good news for you when you get home/on teamspeak ;)
     
  8. Offline

    Father Of Time

    *claps happily* I always a fan of good news! :D

    Talk to you soon Kumpel (one half hour to go!)
     
Thread Status:
Not open for further replies.

Share This Page