Skip to content

Commit

Permalink
Clean up master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
NickG365 committed Jul 17, 2013
1 parent 04c4d6f commit 864b89f
Showing 1 changed file with 2 additions and 98 deletions.
100 changes: 2 additions & 98 deletions src/net/gameon365/mc/plugins/bungee/globaljoins/GlobalJoins.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,124 +8,28 @@
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;

//import java.util.concurrent.TimeUnit;

public class GlobalJoins extends ConfigurablePlugin implements Listener {
protected String loginString;
protected String logoutString;
// protected Boolean delayedCheck;
// protected Integer delayedSeconds;

@Override
public void onEnable()
{
this.loginString = this.getConfig().getString( "strings.login", "&e%s joined the network." );
this.logoutString = this.getConfig().getString( "strings.logout", "&e%s left the network." );
// this.delayedCheck = this.getConfig().getBoolean( "delayedCheck.enabled", false );
// this.delayedSeconds = this.getConfig().getInt( "delayedCheck.seconds", 3 );
//
// if( this.delayedCheck )
// {
// this.getProxy().getLogger().info( "You have delayedCheck enabled. Please note, this is an experimental feature and may reduce performance and/or stability." );
// }
// else if( this.delayedCheck && ( this.delayedSeconds == 0 ) )
// {
// this.getProxy().getLogger().warning( "You have delayedCheck enabled, but set the delay to 0 seconds. This will likely act the same as having delayedCheck disabled, though performance and/or stability may be decreased." );
// }
// else if( this.delayedCheck && ( this.delayedSeconds < 0 ) )
// {
// this.getProxy().getLogger().severe( "You have delayedCheck enabled, but set the delay to a negative value, which is not acceptable for this option. Please set the delay to a positive number of seconds. Because of this, delayedCheck has been disabled for now.");
// this.delayedCheck = false;
// }

this.getProxy().getPluginManager().registerListener( this, this );
}

@EventHandler
public void onPostLoginEvent( PostLoginEvent e )
{
// if( ! this.delayedCheck )
// {
this.getProxy().broadcast( ChatColor.translateAlternateColorCodes( '&', String.format( this.loginString, e.getPlayer().getName() ) ) );
// }
// else
// {
// this.getProxy().getScheduler().schedule( this, new onPostLoginEventTask( e ), this.delayedSeconds, TimeUnit.SECONDS );
// }
this.getProxy().broadcast( ChatColor.translateAlternateColorCodes( '&', String.format( this.loginString, e.getPlayer().getName() ) ) );
}

// public class onPostLoginEventTask extends GlobalJoins implements Runnable
// {
// protected PostLoginEvent e;
// protected Boolean getPlayerResult;
//
// public onPostLoginEventTask( PostLoginEvent e )
// {
// this.e = e;
//
// }
//
// @Override
// public void run()
// {
// try
// {
// this.e.getPlayer();
// this.getPlayerResult = true;
// }
// catch( NullPointerException ex )
// {
// this.getPlayerResult = false;
// }
//
// if( this.getPlayerResult )
// {
// this.getProxy().broadcast( ChatColor.translateAlternateColorCodes( '&', String.format( this.loginString, e.getPlayer().getName() ) ) );
// }
// }
// }

@EventHandler
public void onPlayerDisconnectEvent( PlayerDisconnectEvent e )
{
// if( ! this.delayedCheck )
// {
this.getProxy().broadcast( ChatColor.translateAlternateColorCodes( '&', String.format( this.logoutString, e.getPlayer().getName() ) ) );
// }
// else
// {
// this.getProxy().getScheduler().schedule( this, new onPlayerDisconnectEvent( e ), this.delayedSeconds, TimeUnit.SECONDS );
// }
this.getProxy().broadcast( ChatColor.translateAlternateColorCodes( '&', String.format( this.logoutString, e.getPlayer().getName() ) ) );
}

// public class onPlayerDisconnectEvent extends GlobalJoins implements Runnable
// {
// protected PlayerDisconnectEvent e;
// protected Boolean getPlayerResult;
//
// public onPlayerDisconnectEvent( PlayerDisconnectEvent e )
// {
// this.e = e;
//
// }
//
// @Override
// public void run()
// {
// try
// {
// this.e.getPlayer();
// this.getPlayerResult = true;
// }
// catch( NullPointerException ex )
// {
// this.getPlayerResult = false;
// }
//
// if( this.getPlayerResult )
// {
// this.getProxy().broadcast( ChatColor.translateAlternateColorCodes( '&', String.format( this.logoutString, e.getPlayer().getName() ) ) );
// }
// }
// }
}

0 comments on commit 864b89f

Please sign in to comment.