Geo Posted April 30, 2020 Share Posted April 30, 2020 Hello guys, I'm writing a gamemode and I'm using a lot of setElementData in order to work with the functionality of the items in my script. The synchronization between server and client is disabled, all the element data is handled server side. I was wondering, is this a bad practice? Since I've read using synchronization takes a toll on server performance, I was wondering how much of a toll would be without synchronization. Link to comment
Moderators IIYAMA Posted April 30, 2020 Moderators Share Posted April 30, 2020 (edited) 10 minutes ago, Geo said: I was wondering how much of a toll would be without synchronization. If synchronization is enabled, the server as well as all players have that performance penalty. If disabled, it is just the server (and exclusive network packets management). 10 minutes ago, Geo said: I was wondering, is this a bad practice? It is not bad practice, but if you could use Lua instead, it would be even better since it is a lot faster (and doesn't trigger the event system) Edited April 30, 2020 by IIYAMA Link to comment
Geo Posted April 30, 2020 Author Share Posted April 30, 2020 (edited) Just now, IIYAMA said: If synchronization is enabled, the server as well as all players have that performance penalty. If disabled, it is just the server (and exclusive network packets management). It is not bad practice, but if you could use Lua instead, it would be even better since it is a lot faster (and doesn't trigger the event system) What would be an example of doing this in Lua? What I'm doing is setting data to an created object element in order to act accordingly when that object is used by players Edited April 30, 2020 by Geo Link to comment
Moderators IIYAMA Posted April 30, 2020 Moderators Share Posted April 30, 2020 (edited) 27 minutes ago, Geo said: What would be an example of doing this in Lua? The very basic. local example = {} function saveExample (object, player) example[object] = player return true end function loadExample (object) return example[object] end Edited April 30, 2020 by IIYAMA 1 Link to comment
Geo Posted April 30, 2020 Author Share Posted April 30, 2020 Just now, IIYAMA said: The very basic. local example = {} function saveExample (object) example[object] = player return true end function loadExample (object) return example[object] end I understand. Thanks! 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now