Pivity

Better way to request things from the server

Last read Never
#1

Hello, I'm looking for a better way of requesting info from the server. I tried with a just net message to the server and the server receive function just sent it back, but it disregarded the message in favor of a new one. So I switched to the client an update to the server when it needs to, and a timer on the server constantly sends a settings variable to the client to update the client. I feel it's not that optimized and not that quick. Is there any other way to do this?

#2

The reason it disregarded the net message is likely due to the fact that a net message was started (with net.Start) and not actually processed (either sent to the server, or sent to the intended recipients)

If you want to sync values on the server and client is send the value from the server to the client initially when they load in, and then again every time the value changes (assuming the value doesn't change very often)

If it is something that changes very often, for example a timer on the server that you'd like to sync with a client. Your best bet, for that example, would be to send the length of the timer from the server to the client when the timer starts, so you can calculate the elapsed time separately on the client rather then sending a net message every second or so to update the clientside timer value. Hopefully similar logic can apply in terms of predicting the value clientside rather than spamming net messages.

Agree x 2Informative x 1
Users viewing this thread
Nobody