n0body Posted November 30, 2015 Share Posted November 30, 2015 I know that element datas generate a lot of network traffic, but i need to sync (many) things with the clients. Lets say that i have 20 element datas (that's not the actual number, just an example) setElementData ( player, "data1", ... ); setElementData ( player, "data2", ... ); setElementData ( player, "data3", ... ); setElementData ( player, "data4", ... ); ... This can cause issues, but what if i do something like this: table = { ["data1"] = "x", ["data2"] = "y"; -- etc } setElementData ( player, "data", toJSON ( table ) ); Is this possible ? Is it effective ? If yes there's a limit regarding the string lenght ? Hope that someone can answer my questions Link to comment
Moderators IIYAMA Posted November 30, 2015 Moderators Share Posted November 30, 2015 It depends what kind of things you store in it. Elementdata is for sync data with all clients, which you only want to use for letting all player know that one specific player has 60 fps. When it comes to how much "items" a player caries, elementdata would totally ruining your server. You don't want/need to let other players know that information. Waste of your bandwidth if you ask me. Your question: many elementdata vs one big Every time you update the key "data", all players in your server have to re-download the elementdata. Is a big elementdata efficient? No, it is exactly the opposite. But there is one exception, if the elementdata has to be downloaded only ones, it might be more efficient. Link to comment
n0body Posted November 30, 2015 Author Share Posted November 30, 2015 It depends what kind of things you store in it. Elementdata is for sync data with all clients, which you only want to use for letting all player know that one specific player has 60 fps. When it comes to how much "items" a player caries, elementdata would totally ruining your server. You don't want/need to let other players know that information. Waste of your bandwidth if you ask me.Your question: many elementdata vs one big Every time you update the key "data", all players in your server have to re-download the elementdata. Is a big elementdata efficient? No, it is exactly the opposite. But there is one exception, if the elementdata has to be downloaded only ones, it might be more efficient. My plan was update the element data sometimes, i'll try to use events to reduce the amount of element datas, thanks for the information 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