troelsbjerre / Bottleneck

Factorio mod that tell you which assemblers are starved of ingredients
Other
29 stars 21 forks source link

Add a blacklist_name remote interface #81

Open Quezler opened 4 years ago

Quezler commented 4 years ago

hi,

this pull allows mods to blacklist their entity(s) from bottleneck, here's an example of a working control.lua:

local function bottleneck()
    if remote.interfaces["Bottleneck"] and remote.interfaces["Bottleneck"]["blacklist_name"] then
        remote.call("Bottleneck", "blacklist_name", "liquify2-liquifier")
    end
end

script.on_init(bottleneck);
script.on_load(bottleneck);

(i would really love it if you could merge this or provide the required functionality somehow ❤️)

Quezler commented 4 years ago

apparently this somehow causes a desync when trying to run a multiplayer server with it 😶

troelsbjerre commented 4 years ago

It seems like a good interface to have. I hope to find some time to look at it soon.

Nexela commented 4 years ago

BLACKLIST_NAMES will need to be moved to global.blacklisted (a simple find and replace should work as well as having a default creator in on_init and an update in on config changed Something simple like

global.blacklisted = global.blacklisted or {}

I haven't looked at the whole code lately but that should get it started

On Thu, Jul 23, 2020, 1:25 PM Troels Bjerre Lund notifications@github.com wrote:

It seems like a good interface to have. I hope to find some time to look at it soon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/troelsbjerre/Bottleneck/pull/81#issuecomment-663132715, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKTFYAFQT2573SETPAVJ5LR5BW7RANCNFSM4PE65UQA .

Nexela commented 4 years ago

Additionally I would remove the calls to rebuild the overlays and let it be handled in the normal course of the script.

On Thu, Jul 23, 2020, 1:57 PM Nexela nexela@gmail.com wrote:

BLACKLIST_NAMES will need to be moved to global.blacklisted (a simple find and replace should work as well as having a default creator in on_init and an update in on config changed Something simple like

global.blacklisted = global.blacklisted or {}

I haven't looked at the whole code lately but that should get it started

On Thu, Jul 23, 2020, 1:25 PM Troels Bjerre Lund notifications@github.com wrote:

It seems like a good interface to have. I hope to find some time to look at it soon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/troelsbjerre/Bottleneck/pull/81#issuecomment-663132715, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKTFYAFQT2573SETPAVJ5LR5BW7RANCNFSM4PE65UQA .