world switcher: fix race with fetching worlds while pinging
This commit is contained in:
@@ -741,7 +741,7 @@ public class WorldHopperPlugin extends Plugin
|
|||||||
for (World world : worldResult.getWorlds())
|
for (World world : worldResult.getWorlds())
|
||||||
{
|
{
|
||||||
int ping = Ping.ping(world);
|
int ping = Ping.ping(world);
|
||||||
SwingUtilities.invokeLater(() -> panel.updatePing(world, ping));
|
SwingUtilities.invokeLater(() -> panel.updatePing(world.getId(), ping));
|
||||||
}
|
}
|
||||||
|
|
||||||
stopwatch.stop();
|
stopwatch.stop();
|
||||||
|
|||||||
@@ -113,11 +113,11 @@ class WorldSwitcherPanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updatePing(World world, int ping)
|
void updatePing(int world, int ping)
|
||||||
{
|
{
|
||||||
for (WorldTableRow worldTableRow : rows)
|
for (WorldTableRow worldTableRow : rows)
|
||||||
{
|
{
|
||||||
if (worldTableRow.getWorld() == world)
|
if (worldTableRow.getWorld().getId() == world)
|
||||||
{
|
{
|
||||||
worldTableRow.setPing(ping);
|
worldTableRow.setPing(ping);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user