3lkf Posted August 4, 2017 Share Posted August 4, 2017 Data communication can be divided into two kinds: one is between the server and the client, the other is between the main and secondary servers. The first, use net_variable form the server to the client , use rpc from the client to the server. Second, use shard_network from master server to slave server, but what is the way to send data from slave server to master server? And I found a small problem that shard_network can not send frequently modified data, such as a variable in 1 second modified 2 times, it will only be the last modified value sent in the past. If I have a variable that needs to be synchronized in multi-server real-time, how can I synchronize the value to the master server after modifying the variables in the slave server? Is there a generic function? For example, I said a word in the slave world, the master world to obtain data, but it seems to be achieved with c++, I would like to ask how to do in lua? I have been very confused, searched the forum but did not find the answer, hoping to get help. @PeterA @Ipsquiggle By google translation. Link to comment Share on other sites More sharing options...
3lkf Posted August 5, 2017 Author Share Posted August 5, 2017 Hope to answer. @V2C, @Ipsquiggle, @PeterA Link to comment Share on other sites More sharing options...
Developer V2C Posted August 8, 2017 Developer Share Posted August 8, 2017 There is no generic function for sending data from slave to master. The closest thing would be the user commands, examples in builtinusercommands.lua Link to comment Share on other sites More sharing options...
JohnWatson Posted August 8, 2017 Share Posted August 8, 2017 (edited) I've managed to have the forest and cave shards sent data to each other via the io and dofile functions. If I want data to be sent from one shard to another, I have one of them write a lua file which contains the information, then have the receiving shard read the file. I've no clue if this is efficient performance-wise, but it works. EDIT: Edited August 10, 2017 by JohnWatson Link to comment Share on other sites More sharing options...
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