Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Processing and handle huge, multiple actions in 1 command

Comments in 'Plugin Development' started by Inta, Jul 30, 2016.

  1. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    First of all, i have 4 core with idk too, but still usable, 6GB of RAM, 20gb of SSD.
    Its a VPS with good network connection.
    I need a technique or a solution to proceed multiple actions: set skin, items, teleport, send custom packets, set variable... All in 1 command with as high TPS as possible. It's 1 player per turn in 1 second, with all the actions above. And it still drag my TPS down to < 1 just "a" moment. (2 second)
    I've tried to delay the time between 2 commands (the same command with multiple action), but it just drag my TPS down.
    My server is running at 30% CPU in normal. (Still handle multiple actions but not the same time).
    This is a minigame. I'm very appreciate with your experience of reducing lag. I want to know the secret of large servers on handling this.
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    AsyncTask
  3. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    Can't interact with Server while AsyncTask-ing.
  4. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    onCompletion give you a Server instance, use it to get whatever you want.
  5. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    However if i wanna teleport someone to somewhere, i could directly teleport them rather than go plant AsyncTask. The same thing as the set variables.
    These tasks is on the main thread so you can't just use AsyncTask for something simple like this, compare to get the huge data from the website.
  6. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    What's the meaning of using an AsyncTask if you are eventually doing things in the main thread?

Share This Page

Advertisement