Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Companion Mode + New Flow #716

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

artosimonyan
Copy link
Collaborator

@artosimonyan artosimonyan commented Feb 28, 2025

  • Companion mode returns to Koolo
    • Companions wait until a leader has created a game. Will NOT join if leader started the game prior to companion launch.
  • Completely revamped creating/joining games logic
  • Greatly improved online check logic and eliminated a lot of edge cases
  • Improved failure to select Character with maximum attempts and a client restart.

- Companion mode returns to Koolo
- Completely revamped creating/joining games logic
- Greatly improved online check logic and eliminated a lot of edge cases
- Improved failure to select Character with maximum attempts and a client restart.
}

// ResetCompanionGameInfoEvent is sent when the Leader finishes a game, preventing the companions from joining it
func ResetCompanionGameInfo(be BaseEvent, leader string) ResetCompanionGameInfoEvent {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just call it GameFinished or whatever? the responsibility of reseting the companion game info is based on the handler, maybe the GameFinished event can be used for other stuff too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have GameFinished event which we use for other stats. The idea here is to separate them with other events that we can use, even outside of the bot (ea discord integrations etc), specifically for companion to allow for more customization and actions.

@davidfvsilva
Copy link
Contributor

The Leader seems to be idling in Lobby after X amount of runs. It can vary. I've been testing this and have seen nothing in logs, so it must be silent errors or an edge case. It can take 1 hour, it can take 8 hours, but eventually it stops. More logs through the process could help.

@davidfvsilva
Copy link
Contributor

davidfvsilva commented Mar 4, 2025

After testing it for a few days with groups, there is an issue where the Leader stops creating games (it usually doesn't take much time, can be less than an hour, but it can take more time). You can also have cases where the companion doesn't get the join request (it will skip a run and join the following one), and where a companion can get a join request for a previous game (it will try to join an old game name). If you restart the app, then it will start working normally again for some time.

@artosimonyan
Copy link
Collaborator Author

I didn't notice any such issues @davidfvsilva.

I recommend adding some comments on your end of every single step in out of game flow and see what's wrong. I won't be adding that in the PR as it will cause a LOT of logs that we don't really need for everyone once pushed to main.

If you can find a way to reproduce it, let me know. There's literally no reason aside something local on your end or some edge case why it will just stop working randomly after a few hours.

@Antizerg
Copy link

Antizerg commented Mar 5, 2025

I also encountered the issue where the leader stops creating games, but this was not a new bug for me so hard to say if the companion feature created the issue or not. I switched to not creating lobby games to solve this in the past, so I never went deeper with it.. but I don't think this is something we can get around with in companion mode, unless we switch to friend list joining perhaps?

@artosimonyan
Copy link
Collaborator Author

So ... it's just a problem when the leader creates Lobby games? If so, just create normal ones. And by stops do you mean he does nothing (idles for 10+ minutes) or what?

I really need you to provide more information here and not vague explanations

@davidfvsilva
Copy link
Contributor

So ... it's just a problem when the leader creates Lobby games? If so, just create normal ones. And by stops do you mean he does nothing (idles for 10+ minutes) or what?

I really need you to provide more information here and not vague explanations

it will idle indefinitely in lobby like I mentioned before. Unfortunately, there isn't anything noticeable in the logs.

@Antizerg
Copy link

Antizerg commented Mar 6, 2025

So ... it's just a problem when the leader creates Lobby games? If so, just create normal ones. And by stops do you mean he does nothing (idles for 10+ minutes) or what?
I really need you to provide more information here and not vague explanations

it will idle indefinitely in lobby like I mentioned before. Unfortunately, there isn't anything noticeable in the logs.

same, it will sit in the game creation lobby indefinitely. The leader has the "Create Lobby Games" option checked on my end.

@artosimonyan
Copy link
Collaborator Author

@Antizerg @davidfvsilva, test pressing escape to get back to the character selection screen and let me know if that will make it start doing stuff again.
Preferably if you can report back before tomorrow's reset, would be wonderful.

@davidfvsilva
Copy link
Contributor

@Antizerg @davidfvsilva, test pressing escape to get back to the character selection screen and let me know if that will make it start doing stuff again. Preferably if you can report back before tomorrow's reset, would be wonderful.

you need to manually enter a game to get it running again. from a distance you can also, stop-start the bot with a discord command

@RobotGaston
Copy link

RobotGaston commented Mar 9, 2025

[companion receiving wrong game number from the leader]

thank you for this excellent feature.

there is a problem with leader-companion communication unfortunately.

it is happening occasionally NOT all the time :(

leader is running correctly but companion can receive "incorrect game name" when the next game is created by a leader, which makes companion to join previous game, and not the new game where the leader is.

in a log it looks like this:

level=INFO msg="Companion join game event received" supervisor=xxx leader=xx name=xx0 password=x
where "name=xx0" xx0 - number "0" is incorrect game number.

In reality for leader the game name is "xx1" but companion received 0 instead 1 in a games name...:(


and also I observed that sometimes companion is receiving an empty game name+password "from the leader"
usually at the first run of a freshly loaded koolo+game windows.

here what it's looks like in a log...

level=INFO msg="[Companion] Idling in character selection screen while waiting for Leader to create new game" supervisor=xxx
level=INFO msg="Companion join game event received" supervisor=xxx leader=xxxX name="" password=""

also happens randomly,
leader and companion can run 45+ games together without a problem and in 46 it can occur for no any reason at all..

something might be going on In game name+password communication in a companion's part of the program...
leader is counting up and creating new "higher number" games fine.

could this be looked into please and may be corrected?
Thank you.

upd.

1st game is mostly usually correct (but not always - empty game name+pass situation), (companion getting and using correct game number) but with time, leader start sending or companion begin receiving wrong number in a game's name...for some reason...

-maybe. clear cache before sending/receiving game name by a companion? to get in state like this a first game...

when game number is counting up, something is going off...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants