LuaRemota data encapsulation

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2919
Joined: Sat Jun 11, 2016 6:41 am
Contact:

LuaRemota data encapsulation

Post 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.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: LuaRemota data encapsulation

Post 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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2919
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: LuaRemota data encapsulation

Post 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.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: LuaRemota data encapsulation

Post 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:
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”