AGuyNamedJens / FactorioChatBot

Two-Directional chat bot connecting Discord and Factorio chats together, written in nodejs.
MIT License
13 stars 9 forks source link

Leave messages are not always parsed / posted #9

Closed Mattie112 closed 2 years ago

Mattie112 commented 2 years ago

It looks like leave messages are not always handled. Didn't have time to look into this yet. I'm thinking of adding a PR that adds debug mode, just logs all received and send messages to stdout so you can see what the bot is doing. But I thought let's at least document this. Probably won't have time before tomorrow evening to do this :)

29499.783 Info AppManagerStates.cpp:1941: Saving finished
29973.149 Info ServerMultiplayerManager.cpp:1064: Disconnect notification for peer (2)
29973.149 Info ServerMultiplayerManager.cpp:946: updateTick(1252403) received stateChanged peerID(2) oldState(InGame) newState(DisconnectScheduled)
2022-01-26 18:06:44 [LEAVE] kkndvulcanic left the game
29973.150 Info ServerSynchronizer.cpp:627: nextHeartbeatSequenceNumber(1798073) removing peer(2).
[..]
31383.782 Info ServerMultiplayerManager.cpp:946: updateTick(1252453) received stateChanged peerID(5) oldState(WaitingForCommandToStartSendingTickClosures) newState(InGame)
2022-01-26 18:30:15 [JOIN] Mattie joined the game
[..]
33311.899 Info AppManagerStates.cpp:1941: Saving finished
33409.532 Info ServerMultiplayerManager.cpp:1064: Disconnect notification for peer (5)
33409.532 Info ServerMultiplayerManager.cpp:946: updateTick(1373859) received stateChanged peerID(5) oldState(InGame) newState(DisconnectScheduled)
2022-01-26 19:04:01 [LEAVE] Mattie left the game
33409.533 Info ServerSynchronizer.cpp:627: nextHeartbeatSequenceNumber(2004252) removing peer(5).

image

AGuyNamedJens commented 2 years ago

Interesting.. So it's not always handling them? That's weird..

AGuyNamedJens commented 2 years ago

Looks like that issue was on Discord's end yesterday due to the outage. Considering the fact it actually sent [LEAVE] to the server would mean with the API outage Discord had yesterday, the message simply failed to send.

However, when a player gets kicked/banned for reasons such as AFK, these don't log at all due to a limitation in factorio. The rewrite will have an option and a guide on adding the custom feature.

Mattie112 commented 2 years ago

Allright I will keep an eye on this :)

Mattie112 commented 2 years ago

Can you re-open this issue? I do continue to have this issue. I am going to add some debug logging to the bot so I can at least see what is it doing. Is it getting the LEAVE and it is posting it to Discord or not?

Mattie112 commented 2 years ago

Do you preferer a PR for master or for rewrite? Think it would be best to know this before I add the code :)