mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-30 22:24:18 +01:00
Clean some formatting etc
This commit is contained in:
parent
5ecbd4b2bc
commit
a20e8951f6
@ -26,7 +26,7 @@ import net.md_5.bungee.packet.DefinedPacket;
|
|||||||
import net.md_5.bungee.plugin.JavaPluginManager;
|
import net.md_5.bungee.plugin.JavaPluginManager;
|
||||||
import net.md_5.bungee.tablist.GlobalPingTabList;
|
import net.md_5.bungee.tablist.GlobalPingTabList;
|
||||||
import net.md_5.bungee.tablist.GlobalTabList;
|
import net.md_5.bungee.tablist.GlobalTabList;
|
||||||
import net.md_5.bungee.tablist.ServerUnqiueTabList;
|
import net.md_5.bungee.tablist.ServerUniqueTabList;
|
||||||
import net.md_5.bungee.tablist.TabListHandler;
|
import net.md_5.bungee.tablist.TabListHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -165,14 +165,15 @@ public class BungeeCord
|
|||||||
|
|
||||||
switch (config.tabList)
|
switch (config.tabList)
|
||||||
{
|
{
|
||||||
default: case 1:
|
default:
|
||||||
|
case 1:
|
||||||
tabListHandler = new GlobalPingTabList();
|
tabListHandler = new GlobalPingTabList();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
tabListHandler = new GlobalTabList();
|
tabListHandler = new GlobalTabList();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
tabListHandler = new ServerUnqiueTabList();
|
tabListHandler = new ServerUniqueTabList();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,9 +72,9 @@ public class Configuration
|
|||||||
public int maxPlayers = 1;
|
public int maxPlayers = 1;
|
||||||
/**
|
/**
|
||||||
* Tab list 1: For a tab list that is global over all server (using their
|
* Tab list 1: For a tab list that is global over all server (using their
|
||||||
* minecraft name) and updating their ping frequently 2: Same as 1 but does
|
* Minecraft name) and updating their ping frequently 2: Same as 1 but does
|
||||||
* not update their ping frequently, just once. 3: Makes the individual
|
* not update their ping frequently, just once, 3: Makes the individual
|
||||||
* servers handle the tab list (server unique)
|
* servers handle the tab list (server unique).
|
||||||
*/
|
*/
|
||||||
public int tabList = 1;
|
public int tabList = 1;
|
||||||
/**
|
/**
|
||||||
|
@ -12,8 +12,7 @@ public class GlobalPingTabList extends GlobalTabList
|
|||||||
{
|
{
|
||||||
|
|
||||||
public static final int PING_THRESHOLD = 20;
|
public static final int PING_THRESHOLD = 20;
|
||||||
private Map<UserConnection, Integer> lastPings =
|
private Map<UserConnection, Integer> lastPings = Collections.synchronizedMap(new WeakHashMap<UserConnection, Integer>());
|
||||||
Collections.synchronizedMap(new WeakHashMap<UserConnection, Integer>());
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPingChange(final UserConnection con, final int ping)
|
public void onPingChange(final UserConnection con, final int ping)
|
||||||
|
@ -16,9 +16,9 @@ public class GlobalTabList implements TabListHandler
|
|||||||
@Override
|
@Override
|
||||||
public void onJoin(UserConnection con)
|
public void onJoin(UserConnection con)
|
||||||
{
|
{
|
||||||
for (UserConnection con2 : BungeeCord.instance.connections.values())
|
for (UserConnection c : BungeeCord.instance.connections.values())
|
||||||
{
|
{
|
||||||
con.packetQueue.add(new PacketC9PlayerListItem(con2.username, true, con2.getPing()));
|
con.packetQueue.add(new PacketC9PlayerListItem(c.username, true, c.getPing()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,11 +9,10 @@ import java.util.WeakHashMap;
|
|||||||
import net.md_5.bungee.UserConnection;
|
import net.md_5.bungee.UserConnection;
|
||||||
import net.md_5.bungee.packet.PacketC9PlayerListItem;
|
import net.md_5.bungee.packet.PacketC9PlayerListItem;
|
||||||
|
|
||||||
public class ServerUnqiueTabList implements TabListHandler
|
public class ServerUniqueTabList implements TabListHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
private Map<UserConnection, Set<String>> sentUsernames =
|
private Map<UserConnection, Set<String>> sentUsernames = Collections.synchronizedMap(new WeakHashMap<UserConnection, Set<String>>());
|
||||||
Collections.synchronizedMap(new WeakHashMap<UserConnection, Set<String>>());
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onJoin(UserConnection con)
|
public void onJoin(UserConnection con)
|
Loading…
Reference in New Issue
Block a user