blackgrain 0 Posted April 9, 2008 Hello!! I have a doubt about publicVariable command... well.. the real doubt not is about publicVariable ... is about his use. Well.. i go try explain myself... sorry for my bad english! If I use a "global variable" (for example _variable_in_server) but I only need this variable (_variable_in_server) to read/modify in scripts running on server machine... really need call to: publicVariable "_variable_in_server"; ...any time I modify his value? If really.. the value of _variable_in_server ONLY is needed in scripts running on server machine... I don´t need to public his value around the net... I'm right???.. or always I must to public tihs value with publicVarible despite use the value ONLY in the server machine... Thank!! Share this post Link to post Share on other sites
baddo 0 Posted April 9, 2008 You are right, you have no reason to publicVariable something if it is only ever needed on the one machine. You will need to make sure that the scripts/functions which are only needed to run on server, are only run on server. Use isServer command. From thereon you make sure that the global variables which are used only by the scripts/functions run on the server are only present at the server. We can even see a programming security concept here: if you keep as much in the hands of the server as possible, in local variables, then you are potentially fighting off people who try to cheat. I'm saying local because public data is more exposed and more easily changed by definition. So, to add further, my advice would be to minimize the number of global variables. It should be obvious, but I think it is often neglected. Share this post Link to post Share on other sites
blackgrain 0 Posted April 9, 2008 Thanks Baddo!!! The security is one reason... and another important one is reduce traffic over net Thanks!! Share this post Link to post Share on other sites