Skip to content

Sample/group up flow#31

Open
edge-marge wants to merge 6 commits into
devfrom
sample/group-up-flow
Open

Sample/group up flow#31
edge-marge wants to merge 6 commits into
devfrom
sample/group-up-flow

Conversation

@edge-marge

Copy link
Copy Markdown
Contributor

No description provided.

@orcist orcist left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Leaving a few refactoring suggestions and some requests for changing the sample flow, let me know when ready for another review! Well done on the first submission. 💪

Comment on lines +31 to +32
public bool DeleteTicketOnPause = false;
public bool DeleteTicketOnQuit = true;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
public bool DeleteTicketOnPause = false;
public bool DeleteTicketOnQuit = true;
public bool DeleteGroupOnPause = false;
public bool DeleteGroupOnQuit = true;

[Header("Logging")]
public bool LogTicketUpdates = true;
public bool LogAssignmentUpdates = true;
public bool LogPollingUpdates = false;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
public bool LogPollingUpdates = false;
public bool LogGroupUpdates = true;

probably some leftover from earlier versions?

&& message.Contains("created")
)
{
StatusDisplay.text = $"Group created, awaiting teammates.\nID: {group.Current.GroupID}";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
StatusDisplay.text = $"Group created, awaiting teammates.\nID: {group.Current.GroupID}";
StatusDisplay.text = $"Group created, awaiting members.\nID: {group.Current.GroupID}";

&& message.Contains("joined")
)
{
StatusDisplay.text = "Group joined, awaiting other ready teammates.";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
StatusDisplay.text = "Group joined, awaiting other ready teammates.";
StatusDisplay.text = "Group joined, waiting for group owner to set ready.";


if (
action == ObservableActionType.Update
&& message.Contains("created")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we disable the join input and button as well? When in a group, players are expected to either continue to matchmaking or leave the group before joining another group.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Actually, maybe you can merge this and the group join blocks together and include even the UI related code from StartMatchmaking. After all the changes I suggested, the only difference between create and join is the the displayed text and the log, could put that bit in an if statement...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the buttons/input field actually get disabled in StartMatchmaking; the SetActive() calls are to switch between which buttons are displayed depending on if you're using the owner or member flow (so: no need to switch Create Group to Delete Group if you're not an owner)

JoinGroupButton.gameObject.SetActive(false);
IdInputField.gameObject.SetActive(false);

LeaveGroupButton.gameObject.SetActive(true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

probably need to disable delete group button too, no?

SetReadyButton.gameObject.SetActive(true);
SetReadyButton.interactable = true;

DeleteGroupButton.gameObject.SetActive(true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

probably need to disable leave group button also, no?

Comment on lines +381 to +397
public void StartMatchmaking(Dictionary<string, float> pings, bool isReady)
{
CreateGroupButton.interactable = false;
JoinGroupButton.interactable = false;
IdInputField.interactable = false;

MatchmakingClient.CreateGroup(new MyGroupUpRequestDTO(pings, isReady));
}

public void StartMatchmaking(Dictionary<string, float> pings, bool isReady, string groupID)
{
CreateGroupButton.interactable = false;
JoinGroupButton.interactable = false;
IdInputField.interactable = false;

MatchmakingClient.JoinGroup(new MyGroupUpRequestDTO(pings, isReady), groupID);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
public void StartMatchmaking(Dictionary<string, float> pings, bool isReady)
{
CreateGroupButton.interactable = false;
JoinGroupButton.interactable = false;
IdInputField.interactable = false;
MatchmakingClient.CreateGroup(new MyGroupUpRequestDTO(pings, isReady));
}
public void StartMatchmaking(Dictionary<string, float> pings, bool isReady, string groupID)
{
CreateGroupButton.interactable = false;
JoinGroupButton.interactable = false;
IdInputField.interactable = false;
MatchmakingClient.JoinGroup(new MyGroupUpRequestDTO(pings, isReady), groupID);
}
public void StartMatchmaking(Dictionary<string, float> pings, bool isReady, string groupID = null)
{
if (groupID is null) {
MatchmakingClient.CreateGroup(new MyGroupUpRequestDTO(pings, isReady));
} else {
MatchmakingClient.JoinGroup(new MyGroupUpRequestDTO(pings, isReady), groupID);
}
}

removes some code duplication, assuming the UI related code will move to the observable callback

Comment on lines +399 to +403
public void BecomeReady()
{
SetReadyButton.interactable = false;
MatchmakingClient.SetReady(true);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can also un-ready yourself, could we add support for that? Basically just flip the boolean to the opposite value without disabling the button. Maybe we could change the button text to indicate whether you're ready or not (e.g. "waiting" when the player is ready, and "set ready" when the player is not ready).

@orcist orcist changed the base branch from main to dev June 15, 2026 18:23
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.

2 participants