mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 11:15:47 +01:00
knohacks - thanks @ammaraskar
This commit is contained in:
parent
1296783d9b
commit
788b96dc0a
@ -19,6 +19,12 @@
|
||||
<description>Proxy component of the Elastic Portal Suite</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.2.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-codec</artifactId>
|
||||
|
@ -5,6 +5,7 @@ import net.md_5.bungee.log.BungeeLogger;
|
||||
import net.md_5.bungee.reconnect.SQLReconnectHandler;
|
||||
import net.md_5.bungee.scheduler.BungeeScheduler;
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import com.google.gson.Gson;
|
||||
import com.ning.http.client.AsyncHttpClient;
|
||||
import com.ning.http.client.AsyncHttpClientConfig;
|
||||
import com.ning.http.client.providers.netty.NettyAsyncHttpProvider;
|
||||
@ -130,6 +131,7 @@ public class BungeeCord extends ProxyServer
|
||||
private ConsoleReader consoleReader;
|
||||
@Getter
|
||||
private final Logger logger;
|
||||
public final Gson gson = new Gson();
|
||||
|
||||
|
||||
{
|
||||
@ -488,7 +490,8 @@ public class BungeeCord extends ProxyServer
|
||||
{
|
||||
getConsole().sendMessage( message );
|
||||
// TODO: Here too
|
||||
broadcast( new Packet3Chat( "{\"text\":\"" + message + "\"}" ));
|
||||
String encoded = BungeeCord.getInstance().gson.toJson( message );
|
||||
broadcast( new Packet3Chat( "{\"text\":" + encoded + "}" ) );
|
||||
}
|
||||
|
||||
public void addConnection(UserConnection con)
|
||||
|
@ -266,7 +266,8 @@ public final class UserConnection implements ProxiedPlayer
|
||||
public void sendMessage(String message)
|
||||
{
|
||||
// TODO: Fix this
|
||||
unsafe().sendPacket( new Packet3Chat( "{\"text\":\"" + message + "\"}" ) );
|
||||
String encoded = BungeeCord.getInstance().gson.toJson( message );
|
||||
unsafe().sendPacket( new Packet3Chat( "{\"text\":" + encoded + "}" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,7 +41,6 @@ public class CommandAlert extends Command
|
||||
String message = builder.substring( 0, builder.length() - 1 );
|
||||
|
||||
ProxyServer.getInstance().broadcast( message );
|
||||
ProxyServer.getInstance().getConsole().sendMessage( message );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user