Jump to content
  • Advertisement
Sign in to follow this  
sordid

Sending script-based data between C & S

This topic is 4782 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'll try to explain this the best I can.. I'm wrestling with trying to figure out how to effectively send data between client and server, when that data is contained within script (Lua, in this case). As an example, I have an Entity object within C++ that is the chief object thrown to the spatial partioner, and holds basic information such as position, rotation, related matrices, and mesh data. *All* actual actor logic is contained within scripts that, for all intensive purposes, "extend" this C++ base class. I accomplish this with just associating a table containing the extended object with the base C++ object. At any rate, this Lua table contains extra data that is not known to the C++ object. Some of this data needs to be sent to the client, or vice versa. The only method I can think of is to have a table within the lua extension of the entity that contains the data to send to the client. This table must then be serialized and then sent. When it's received by the client, the data is reconstructed into a Lua table and given to the lua entity's OnUpdateFromServer() function (just as an example). Essentially, the same process would be involved with filling a UI control with server-defined data (think EVE-Online with its UI). I was looking through the Far Cry SDK since it's the only other source (as partial as it is) that has all logic done within a script, and just so happened to be the same language. However, I cannot find anything in there regarding entity data transfer to a client, which must be for reasons of security and the open source nature of the SDK. However, any pointers on how I would go about accomplishing this transfer of Lua-specific data between client and server would be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!