Page 1 of 1

Tables change id when going through remote.call

Posted: Sun Dec 25, 2016 1:35 am
by cpeosphoros
It seems obvious in hindsight, since they probably must undergo some sort of copy/deepcopy when being passed around, but I only figured it out after trying to use them as indexes on the other side of the remote call.

I'm saying it here just as a kind of documentation.

Code: Select all

89:01:52.39: Registered job table: 0x00007f611c003ec0 with name Concreteer and priority 10
89:01:54.00: Reading workerCount for job table: 0x00007f611cb21610 with name Concreteer and priority 10
89:01:56.00: Reading workerCount for job table: 0x00007f611ea2f900 with name Concreteer and priority 10
Strings work just fine, though.

Re: Tables change id when going through remote.call

Posted: Sun Dec 25, 2016 1:41 am
by Rseding91
Each mod is run under a different lua instance and as such doesn't share anything data wise - anything passed between them is copied.

Any remote call done to yourself is a simple function call.

Re: Tables change id when going through remote.call

Posted: Sun Dec 25, 2016 2:00 am
by cpeosphoros
Yes, I pretty much figured it out.

I had scaffolded everything neatly in one single mod, passing all info through remote.call and it was working fine.

It "broke" when I separated each part into its own mod.

As I said above, it's obvious in hindsight. :D