Page 1 of 1

LuaRemota data encapsulation

Posted: Mon Oct 08, 2018 8:13 am
by Optera
I want to give other mods the ability to look into global objects LTN uses to store requests, deliveries, etc.
LuaRemote seems to pass along global tables just fine.

Now my question is if LuaRemote copies tables or passes a reference. The later would require me to copy all tables i want to pass first so other mods can never change this data.

Re: LuaRemota data encapsulation

Posted: Mon Oct 08, 2018 3:05 pm
by eradicator
It's a copy. Everything else would cause all sorts of weird bugs. And more importantly if cross-mod table linking was possible there would be no point in using the remote interface at all.

Re: LuaRemota data encapsulation

Posted: Mon Oct 08, 2018 3:28 pm
by Optera
Thanks for verifying my test results.
I just wanted to be certain remote interface callbacks wouldn't introduce weird error states that are impossible to reproduce.

Re: LuaRemota data encapsulation

Posted: Mon Oct 08, 2018 5:38 pm
by eradicator
Optera wrote:
Mon Oct 08, 2018 3:28 pm
Thanks for verifying my test results.
And there i was wondering why you were asking on the forum instead of testing yourself.
Another mystery solved. :mrgreen: