parent
7108bd4deb
commit
a9ad4889f7
@ -247,11 +247,4 @@ public abstract class ProxyServer
|
|||||||
* @return the server's {@link AsyncHttpClient} instance
|
* @return the server's {@link AsyncHttpClient} instance
|
||||||
*/
|
*/
|
||||||
public abstract AsyncHttpClient getHttpClient();
|
public abstract AsyncHttpClient getHttpClient();
|
||||||
|
|
||||||
/**
|
|
||||||
* Send a message to all connected players.
|
|
||||||
*
|
|
||||||
* @param message the message to send
|
|
||||||
*/
|
|
||||||
public abstract void broadcast(String message);
|
|
||||||
}
|
}
|
||||||
|
@ -403,13 +403,4 @@ public class BungeeCord extends ProxyServer
|
|||||||
{
|
{
|
||||||
return ConsoleCommandSender.getInstance();
|
return ConsoleCommandSender.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void broadcast(String message)
|
|
||||||
{
|
|
||||||
for ( ProxiedPlayer player : getPlayers() )
|
|
||||||
{
|
|
||||||
player.sendMessage( message );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ import io.netty.channel.ChannelInitializer;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.socket.nio.NioSocketChannel;
|
import io.netty.channel.socket.nio.NioSocketChannel;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.text.MessageFormat;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -86,9 +85,6 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
{
|
{
|
||||||
addGroups( s );
|
addGroups( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Here?
|
|
||||||
bungee.broadcast( MessageFormat.format( BungeeCord.getInstance().config.getJoinMessage(), getDisplayName() ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendPacket(DefinedPacket p)
|
public void sendPacket(DefinedPacket p)
|
||||||
@ -192,8 +188,6 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
{
|
{
|
||||||
server.disconnect( "Quitting" );
|
server.disconnect( "Quitting" );
|
||||||
}
|
}
|
||||||
|
|
||||||
bungee.broadcast( MessageFormat.format( BungeeCord.getInstance().config.getPartMessage(), getDisplayName() ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,20 +195,14 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
public void chat(String message)
|
public void chat(String message)
|
||||||
{
|
{
|
||||||
Preconditions.checkState( server != null, "Not connected to server" );
|
Preconditions.checkState( server != null, "Not connected to server" );
|
||||||
if ( message != null && !message.isEmpty() )
|
|
||||||
{
|
|
||||||
server.getCh().write( new Packet3Chat( message ) );
|
server.getCh().write( new Packet3Chat( message ) );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendMessage(String message)
|
public void sendMessage(String message)
|
||||||
{
|
|
||||||
if ( message != null && !message.isEmpty() )
|
|
||||||
{
|
{
|
||||||
ch.write( new Packet3Chat( message ) );
|
ch.write( new Packet3Chat( message ) );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendMessages(String... messages)
|
public void sendMessages(String... messages)
|
||||||
|
@ -5,7 +5,6 @@ import java.util.Collection;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.config.ConfigurationAdapter;
|
import net.md_5.bungee.api.config.ConfigurationAdapter;
|
||||||
import net.md_5.bungee.api.config.ListenerInfo;
|
import net.md_5.bungee.api.config.ListenerInfo;
|
||||||
@ -50,8 +49,6 @@ public class Configuration
|
|||||||
*/
|
*/
|
||||||
private boolean onlineMode = true;
|
private boolean onlineMode = true;
|
||||||
private int playerLimit = -1;
|
private int playerLimit = -1;
|
||||||
private String joinMessage = "&b{0} has joined the network";
|
|
||||||
private String partMessage = "&b{0} has left the network";
|
|
||||||
|
|
||||||
public void load()
|
public void load()
|
||||||
{
|
{
|
||||||
@ -63,10 +60,7 @@ public class Configuration
|
|||||||
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
|
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
|
||||||
playerLimit = adapter.getInt( "player_limit", playerLimit );
|
playerLimit = adapter.getInt( "player_limit", playerLimit );
|
||||||
|
|
||||||
joinMessage = ChatColor.translateAlternateColorCodes( '&', adapter.getString( "messages.join", joinMessage ) );
|
DefaultTabList tab = DefaultTabList.valueOf( adapter.getString( "tab_list", "GLOBAL_PING" ) );
|
||||||
partMessage = ChatColor.translateAlternateColorCodes( '&', adapter.getString( "messages.part", partMessage ) );
|
|
||||||
|
|
||||||
DefaultTabList tab = DefaultTabList.valueOf( adapter.getString( "tab_list", "GLOBAL_PING" ).toUpperCase() );
|
|
||||||
if ( tab == null )
|
if ( tab == null )
|
||||||
{
|
{
|
||||||
tab = DefaultTabList.GLOBAL_PING;
|
tab = DefaultTabList.GLOBAL_PING;
|
||||||
|
Loading…
Reference in New Issue
Block a user