![]() |
Using clientr, client, serverr, server vars wisely.
All of these vars need to be sent to the player on update serverside. This can create lag. Also, client and server vars being updated constantly clientside can create a lot of output to the server.
Alt+4 shows input/output bytes for the player. A few of the old reused damage functions on Classic have been updating constantly clientside, and there were a lot of variables being sent to the player from the serverside of the damage system. Variables that the player didn't need to have immediate access to. If the player doesn't need immediate access to a variable clientside, just set the variable as a player.var serverside. The variable will save in the flags when you set a player.var as a non-prefixed var. Hope people take some wisdom from this. Still need to work it out of the drunk movement system, but need to approach how. |
Non-prefixed variables in the flags are not able to be read clientside, are they?
|
Quote:
|
Quote:
|
Also, if you need data to be visible from one player's clientside to the rest, attr vars are the only way to do that. However, you can minimize the number of attr vars you have to modify by using bitflags (unless you need to send a string)
...Yea, now my damage system is doing a lot better. |
Quote:
|
Quote:
|
Quote:
You implied that server. varsare sent to the client, which is just wrong; they are only seen serverside. serverr. strings are sent to the clients, but as read-only. Your post also implied that server vars can be written to clientside, which is just plain wrong. |
Quote:
|
Quote:
|
Quote:
|
Hey give me some credit here for helping you figure all this out ;)
|
Quote:
You can also use client.vars to reduce lag instead of having to use triggeractions. |
Quote:
|
Quote:
|
Script security is rather important.
I'd hold that as a higher priority than a bit less lag. |
Quote:
|
I'd make movement clientside with checks done serverside every few ticks.
If I was making a physics engine that kept track of several thousand items and was very important to the server, i'd have all the players do it locally, then do a spot-check every few seconds to make sure everyone's list is accurate. The server would check each player's list against every other and take the most common one, then send that to everyone as an update. Thus, everyone has the same list every few seconds and the server wouldn't have to do any work actually calculating any of the physics. Also, a majority of the server would have to be hacking in order for it to affect the rest of the server. |
Quote:
|
Quote:
|
Quote:
|
All times are GMT +2. The time now is 12:11 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.