DataBlocks on client
by Guy Allard · in Torque 3D Beginner · 01/28/2010 (11:18 pm) · 4 replies
So, it would be really useful from within a GUI to be able to look at a datablock and pull some of the values from it to display in the Gui. Things like maxDamage, shapeFile etc.
However, the datablocks that exist on the client cannot be referenced by name like they can on the server (e.g. armor.maxDamage). I've seen this discussed a few times, and the reason that the name is not networked has something to do with security, but I can't see what the security problems might be.
The datablock on the client only contains information, there's no logic there to be messed with by a client as the logic is dealt with separately on the server. I know that a small engine change will allow datablocks to be accessed on the client in the same way as on the server, but what are the potential security holes that are created by doing this?
However, the datablocks that exist on the client cannot be referenced by name like they can on the server (e.g. armor.maxDamage). I've seen this discussed a few times, and the reason that the name is not networked has something to do with security, but I can't see what the security problems might be.
The datablock on the client only contains information, there's no logic there to be messed with by a client as the logic is dealt with separately on the server. I know that a small engine change will allow datablocks to be accessed on the client in the same way as on the server, but what are the potential security holes that are created by doing this?
About the author
Recent Threads
#3
12/16/2012 (12:50 am)
I went down a slightly different route in the end and derived a separate datablock based 'DescriptionData' class that I used to hold only descriptive information about objects that was intended to be used in client GUI's etc. I then added an extra field to the objects datablock that let me assign the DescriptionData to them.
#4
The hard way would probably be to set up server commands to retrieve specific values (serverCmdgetArmorMaxDmd()) and use that - a headache to be sure. You've hit on a nice solution there.
The security issue with allowing access to datablocks by name on the client (as far as I can see) is that it would make it easier to tell the server what the values in the datablock should be. That shouldn't work because datablocks are supposed to be immutable, but I never really looked to see if that was actually true (i.e. no setter functions exposed in the source).
12/17/2012 (7:03 am)
Nice.The hard way would probably be to set up server commands to retrieve specific values (serverCmdgetArmorMaxDmd()) and use that - a headache to be sure. You've hit on a nice solution there.
The security issue with allowing access to datablocks by name on the client (as far as I can see) is that it would make it easier to tell the server what the values in the datablock should be. That shouldn't work because datablocks are supposed to be immutable, but I never really looked to see if that was actually true (i.e. no setter functions exposed in the source).
Ahsan Muzaheed
Default Studio Name
guy,
did u do that?
it will save lots of commandToclient() for my charcter selection menu.
+
Brandwidth