Auto Trash


Allows saving of different logistic request setups Enable autotrash only in certain logistic networks Load your spidertron with different setups with a single click Load one or more preset after respawning Trash unrequested items

Content
3 years ago
0.13 - 1.1
37.9K
Logistic network

b Main network lost on leaving/rejoining multiplayer?

4 years ago
(updated 4 years ago)

With "Autotrash only in main network" enabled, and my main network set, I stand inside that main network and disconnect from multiplayer.

Upon reconnecting to the same multiplayer game, everything looks fine until I move. As soon as I move, AutoTrash disables itself. It doesn't matter how many times I re-check the box; as soon as I move, AutoTrash will become disabled. The main network button is still in the "Unset main network" state. Remember, I disconnected while inside the main network, so I've respawned inside the main network upon reconnecting.

What fixes this is clicking "Unset main network" followed immediately by "Set current as main network". AutoTrash then works as expected until my next disconnect/reconnect.

4 years ago

I can't reproduce it.
Hosted a game on my steam version. Joined with the normal version, built a couple of roboports, set the main network. Moved around after rejoining nothing.
Disconnected and had the other player remove all roboports from the network except one (different ones, so sometimes the rejoining player would end up outside the network). Even then after rejoining and moving around it behaved as expected.
Not really sure what could go wrong in your case. The stored main network only gets changed when a roboport is mined/destroyed and that roboport happens to be the one used to store your network.

Can you upload the factorio-current.log somewhere or even upload a save from the server and tell me your ingame name so i can take a look at the data Autotrash stores? (Or if it's a public server tell me and i'll take a look there)

4 years ago
(updated 4 years ago)

I'll just give both, because I don't think the log has anything useful. There are only four occurrences of "trash" (case-insensitive) in the file, and all are during the startup/loading process. Note: IP addresses were partially redacted before upload.

The save file is from after the last player (me; name in-game is also "dgw") disconnected and the server went into pause mode. I'm prepared to try saving immediately after I join if things look normal in this one (meaning the bug, whatever it is, triggers on reconnect, not on disconnect). My guess is that there's some kind of conflict with another mod.

Log: https://mega.nz/#!vV1E2ICa!9y2BK_QrxwFKKunZWyht2CXQ6C4vhLKtf8tvGuyD9H0
Save: https://mega.nz/#!XM02kaBQ!Kbh9dHGUenXlTmnx7gIbZEeknMiGUhEOSePiEWXBxf4

4 years ago

Ok, that save helped. Turns out it wasn't a multiplayer bug, but somehow the saved roboport became invalid
The new version will check for that when the player moves, print a message in the console to set the network again and pause trashing. I can't really recover from loosing the reference to the roboport, cause once it is invalid there's no way of getting the network it belonged to.

In your case you should get the message once after moving and then hopefully never again after you set the network.
Let me know if it works after a few disonnects/reconnects from your side. If it doesn't, i'll have to take a closer look at the other mods, but going by the names none of it seems to do anything with roboports.

4 years ago

Obviously if the saved reference becomes invalid, there's nothing AutoTrash could do to fix it. But the reference shouldn't become invalid in the first place. It's strange.

On the plus side, the new messaging and UX you added makes the problem easier to deal with. Saves a click not having to first unset the invalid saved network. :)

And I've tried the same map in single-player, with AutoTrash 4.1.10 (the new version). This issue also happens there, so it doesn't seem related to multiplayer at all.

I spent some time doing this:

  • Disable one mod
  • Restart Factorio
  • Load game
  • Move so the "invalid network" alert triggers
  • Set main network again in AutoTrash
  • Move to confirm it un-pauses
  • Save & quit map
  • Load map
  • Move to see if "invalid network" alert triggers

It was a tedious cycle, and after doing it with about a dozen mods I decided to just disable everything except AutoTrash. Performing the same "trigger, fix, save, load, trigger" sequence surprised me when the same issue happened without any other mods loaded. I'm not sure what's going on any more.

4 years ago

Oh boy, i found it.
I used a (what i thought) clever way to find the nearest logistic network to the player when he clicked "set main network". Which worked fine as long as the player didn't have a roboport in his armor. :D If he did then the character itself gets saved as the main network and that somehow turned out to be total garbage in the end.
(And of course in my test multiplayer game i didn't wear one, that's why i couldn't reproduce it and my fix seemed to work)

It is fixed now. But now i'm not sure whether i never had a roboport equipped when developing the mod and you just happened to be the first one to use the main network + only trash in the main network feature OR the way the API worked changed in one of the latest updates. I'll try it with an older Factorio version next week to make sure it's not an undocumented change in the api.

4 years ago

Hahahaha that's amazing. I never would have thought my own personal roboport was involved!

New response