HUD Chat?

Discussion in 'Plugin Development' started by GaaTavares, Sep 3, 2013.

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

    GaaTavares

    Hey everyone. Is there any way to do a HUD Chat without spamming the chat? It may causes lag...
     
  2. Offline

    FurmigaHumana

    what is a HUD Chat?
     
  3. Offline

    GaaTavares

    Like mcctf.com, i dont remember the real name, but is like, a message that never quits from chat, stay on the start of the chat >.>
     
  4. Offline

    Janmm14

    To let chat messages stay shown you have to resend them every xyz seconds, no other way possible.
     
  5. Offline

    GaaTavares

    but probably will causes lag, right? bcuz on the messages that will be spammed, i will need to check the config file, i think will causes a lot of lag ._.
     
  6. Offline

    Chinwe

    You'd need to keep a list of ~5 long that would constantly remove old messages and push new messages in, and then every time you try to add a message while the list is 5 long, send a load of blank lines followed by your HUD and those 5 messages (4 olds + newest) :eek:

    Or have a BukkitTask that sends blank lines and HUD + 5 latest messages every second, using a Map that stores a counter for each message (eg 5), and everytime the timer runs decrements each value by 1, and if the counter == 0, remove from the messages map?

    Just a few ideas off the top of my head, good luck with it :rolleyes:
     
  7. Offline

    FurmigaHumana

    I think it is pretty simple, just cancel the chat event and store the message in some kind of list, and the head of this list will be the fixed message. Then just send this list instead of the actual message. You can see in the console that the chat is constantly cleaned out every 2~3 messages and it "blinks" a lot. I dont see how to not make it floody, but I dont think it would cause tons of lag, chat is async.
     
  8. Offline

    Hoolean

    GaaTavares

    Nope, the only way to do it is to send chat message after chat message.

    Additionally, you have to get into packets, otherwise messages that aren't chat messages will be ignored. (e.g. when a player gets a result from a command)
     
Thread Status:
Not open for further replies.

Share This Page