is there a way to send predefined actions to the client?

Discussion in 'Spigot Plugin Development' started by iUseRod, Sep 6, 2021.

  1. is there a way to send predefined actions & reactions (more like a final variable in java) to the client? for example i want to send when a player launchs a projectile, instead of sending a packet of the event to the server, it'll act as the server has sent it before, which'll put way less load on the server and the client, and it'll dramatically improve the performance.

    if you still didn't get it, i made this graph:
    [​IMG]

    (sorry for the fucked explanation, if you don't understand something ask me)
     
    • Funny Funny x 2
  2. You mean that the response from the server to a packet sent by the client will be "cached" and then let the client reply to itself by checking it's cache?
    I guess that in theory there would be a way to do this, but not without modifying the client code. The performance gain you'll get from this is probably negligible. Also, at this point, why not just play singleplayer or run a localhost server?
     
  3. yeh that's what i meant, also the performance will be gained won't be negligible as you said, why not play in singleplayer, so you'll get almost the same performance of the singleplayer...
     
  4. well, the server wouldn't have to reply to the player that ran the action but it will still have to do the same calculations it did before, send the packets to all other players since obviously, you want them to see the projectile as well and fire all the necessary events, etc. So effectively you're just not responding to the client after the packet has been received (which I would not call an improvement at all), this would be a stupid amount of effort for basically no improvement, it would be insecure and overall just not worth doing it.

    In theory, it could work, with one player on the server. And if there's just one player on the server, why not play singleplayer?

    Also if you didn't know yet, Minecraft singleplayer runs on an integrated server, so there's still the communication happening, just with the integrated server.
     
    #4 Sxlver_, Sep 6, 2021
    Last edited: Sep 6, 2021
    • Like Like x 1