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

Autojoin feature #57

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Autojoin feature #57

wants to merge 5 commits into from

Conversation

PotatoStealer
Copy link

update to cherrypick unneeded commits

@@ -352,3 +352,5 @@ stats.ui.cores = Cores Leaked:
stats.ui.monuments = Monuments Destroyed:
stats.ui.teamkills = TK:

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

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!

@@ -352,3 +352,5 @@ stats.ui.cores = Cores Leaked:
stats.ui.monuments = Monuments Destroyed:
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!

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>(){});

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;

Choose a reason for hiding this comment

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

Extra new line.

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
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

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")

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)

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) {

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
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) {

Choose a reason for hiding this comment

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

?

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
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.

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
Author

Choose a reason for hiding this comment

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

✔️

if(remaining.getSeconds() >= 1 && remaining.getSeconds() <= 3) {
// Auto-balance runs at match start as well, but try to run it a few seconds in advance
if(this.tmm != null && !this.autoBalanced) {
this.autoBalanced = true;
this.tmm.balanceTeams();
autoJoinMatchModule.enterAllPlayers();

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")

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
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) {

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