Skip to content
This repository was archived by the owner on Nov 25, 2019. It is now read-only.

Autojoin feature#57

Open
HuManKeat wants to merge 5 commits intoStratusNetwork:masterfrom
HuManKeat:new-join-feature
Open

Autojoin feature#57
HuManKeat wants to merge 5 commits intoStratusNetwork:masterfrom
HuManKeat:new-join-feature

Conversation

@HuManKeat
Copy link
Copy Markdown

update to cherrypick unneeded commits

stats.ui.monuments = Monuments Destroyed:
stats.ui.teamkills = TK:

autojoin.starting = Match is starting in {0} seconds! Left click the hat to cancel autojoin!
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You will join the match in {0} seconds. Left click the helmet to cancel!

stats.ui.teamkills = TK:

autojoin.starting = Match is starting in {0} seconds! Left click the hat to cancel autojoin!
autojoin.cancelled = You have cancelled autojoin! No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You will now observe the match. Right click the helmet if you want to join again!

protected void configure() {
new SettingBinder(publicBinder()).addBinding().toInstance(AutoJoinSetting.get());
install(new MatchModuleFixtureManifest<AutoJoinMatchModule>(){});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove extra new line

import tc.oc.pgm.match.MatchModule;
import tc.oc.pgm.match.MatchPlayer;
import tc.oc.pgm.match.MatchScope;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Extra new line.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can remove the extra new line.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✔️

joiningPlayers.add(player);
}

// Public accessor methods
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove this comment

public class AutoJoinSetting {
private static final Setting INSTANCE = new SettingBuilder()
.name("AutoJoin").alias("aj")
.summary("Toggles the AutoJoin feature")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A little more specific than that please.

.name("AutoJoin").alias("aj")
.summary("Toggles the AutoJoin feature")
.type(new BooleanType())
.defaultValue(false)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

By default, auto join is off? Then what's the point?

// If there is nothing to pick, just join immediately
jmm.requestJoin(player, JoinRequest.user());
}
} else if(hand.getType() == Button.LEAVE.material) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What about the leave button? Does it still work?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i simply refactored it and commented it out below

jmm.requestJoin(player, JoinRequest.user());
}

//} else if(hand.getType() == Button.LEAVE.material) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are you going to leave this here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

pretty sure that the button doesn't do anything, so i'll leave this here at the moment until we find some use for it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes, but add a comment explaining that.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✔️

if(this.tmm != null && !this.autoBalanced) {
this.autoBalanced = true;
this.tmm.balanceTeams();
autoJoinMatchModule.enterAllPlayers();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't you join players before balancing?

public class AutoJoinSetting {
private static final Setting INSTANCE = new SettingBuilder()
.name("AutoJoin").alias("aj")
.summary("Toggles the ability to be automatically emplaced into the match")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"Automatically join a team when a match starts"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✔️

jmm.requestJoin(player, JoinRequest.user());
}
// Removed until this has some use - currently does nothing
//} else if(hand.getType() == Button.LEAVE.material) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Keep this in, I believe it is for ranked

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants