Efficient Spawn Menu / Client Server Communication
5 replies, posted
I'm trying to find information to load my spawn menu from a file and - also to help with removing the labor of setting up each spawn icon and doing a bit of math and letting it auto lay the icons out... I'm not proficient enough yet to know the term I want to search for on the wiki..
I'm also lost as to how I'd pass information from client to server.. I've made money for buying props but how do I pull the price and prop model from my Dpanel and send that to the server to spawn the prop and subtract the money.
When i'm dealing with laying out something that i dont want to make indevidual panels for each value i store each value in a table with it's own table with the values im interested in for example,
exampletable.value1 = {value = "value you want",description = "item description"}
then you could just loop through the table and get your value like this:
for k, v in pairs(exampletable) do
print(v.value)
end
Thank you! I've been playing around with net library and it just seems spammy to constantly send and update. I've not set it on a timer but on a hook when the data would be updated but that could be multiple times every second.. on a large scale would this get laggy? Should I worry about limiting these request?
It really depends on the size of your message, sending a 8 bit int is not going to have the same load on the server as sending complicated tables. What kind of data do you intend to update a lotÉ
Is it possible to send one net message and parse it out? I've done such in other programs. I do not need to send a ton of data front client to server just prop model, cost, and health to the server to spawn.
Instead of networking the model, cost, etc. Just keep a global table of items and only network the items ids from client to server.
Sorry, you need to Log In to post a reply to this thread.