Cleanup TODO comments

This commit is contained in:
TechnicallyCoded 2023-10-09 10:34:11 +02:00
parent c440f4b4d8
commit a01196f345
No known key found for this signature in database
GPG Key ID: 258C4DBC0BF4AF73
4 changed files with 9 additions and 9 deletions

View File

@ -49,7 +49,7 @@ public class PtpAcceptCommand implements CommandExecutor {
} }
if (mcMMO.p.getGeneralConfig().getPTPCommandWorldPermissions()) { if (mcMMO.p.getGeneralConfig().getPTPCommandWorldPermissions()) {
// TODO TECH CHECK - running operations on teleporting player and target player without the proper thread // TODO FOLIA - target is not on the same thread as sender/player - unsafe
World targetWorld = target.getWorld(); World targetWorld = target.getWorld();
World playerWorld = player.getWorld(); World playerWorld = player.getWorld();
@ -65,7 +65,7 @@ public class PtpAcceptCommand implements CommandExecutor {
} }
} }
// TODO TECH CHECK - running operations on teleporting player and target player without the proper thread // TODO FOLIA - target is not on the same thread as sender/player - unsafe
PtpCommand.handleTeleportWarmup(target, player); PtpCommand.handleTeleportWarmup(target, player);
return true; return true;
} }

View File

@ -228,8 +228,8 @@ public class PtpCommand implements TabExecutor {
return true; return true;
} }
// TODO TECH CHECK - running operations on teleporting player and target player without the proper thread
protected static void handleTeleportWarmup(Player teleportingPlayer, Player targetPlayer) { protected static void handleTeleportWarmup(Player teleportingPlayer, Player targetPlayer) {
// TODO FOLIA - target is not on the same thread as sender/player - unsafe
if(UserManager.getPlayer(targetPlayer) == null) if(UserManager.getPlayer(targetPlayer) == null)
{ {
targetPlayer.sendMessage(LocaleLoader.getString("Profile.PendingLoad")); targetPlayer.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
@ -251,11 +251,11 @@ public class PtpCommand implements TabExecutor {
if (warmup > 0) { if (warmup > 0) {
teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup)); teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup));
// TODO TECH CHECK - running operations on teleporting player and target player without the proper thread // TODO FOLIA - target is not on the same thread as sender/player - unsafe
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(teleportingPlayer, new TeleportationWarmup(mcMMOPlayer, mcMMOTarget), 20 * warmup); mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(teleportingPlayer, new TeleportationWarmup(mcMMOPlayer, mcMMOTarget), 20 * warmup);
} }
else { else {
// TODO TECH CHECK - running operations on teleporting player and target player without the proper thread // TODO FOLIA - target is not on the same thread as sender/player - unsafe
EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer); EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer);
} }
} }

View File

@ -37,7 +37,8 @@ public class PlayerProfileLoadingTask extends CancellableRunnable {
} }
// Quit if they logged out // Quit if they logged out
if (!player.isOnline()) { // TODO TECH CHECK - is thread safe? We are running this async // TODO FOLIA - player may not be accessed from the right thread - unsafe
if (!player.isOnline()) {
LogUtils.debug(mcMMO.p.getLogger(), "Aborting profile loading recovery for " + player.getName() + " - player logged out"); LogUtils.debug(mcMMO.p.getLogger(), "Aborting profile loading recovery for " + player.getName() + " - player logged out");
return; return;
} }

View File

@ -354,14 +354,13 @@ public final class EventUtils {
return !damageEvent.isCancelled() && !fakeBlockBreakEvent.isCancelled(); return !damageEvent.isCancelled() && !fakeBlockBreakEvent.isCancelled();
} }
// TODO TECH CHECK - running operations on teleporting player and target player without the proper thread
public static void handlePartyTeleportEvent(Player teleportingPlayer, Player targetPlayer) { public static void handlePartyTeleportEvent(Player teleportingPlayer, Player targetPlayer) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer);
if(mcMMOPlayer == null) if(mcMMOPlayer == null)
return; return;
// TODO TECH CHECK - running operations on teleporting player and target player without the proper thread // TODO FOLIA - target is not on the same thread as sender/player - unsafe
McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(teleportingPlayer, targetPlayer, mcMMOPlayer.getParty().getName()); McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(teleportingPlayer, targetPlayer, mcMMOPlayer.getParty().getName());
mcMMO.p.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
@ -369,7 +368,7 @@ public final class EventUtils {
return; return;
} }
// TODO TECH CHECK - getting location of target from another thread // TODO FOLIA - target is not on the same thread as sender/player - unsafe
mcMMO.p.getFoliaLib().getImpl().teleportAsync(teleportingPlayer, targetPlayer.getLocation()); mcMMO.p.getFoliaLib().getImpl().teleportAsync(teleportingPlayer, targetPlayer.getLocation());
teleportingPlayer.sendMessage(LocaleLoader.getString("Party.Teleport.Player", targetPlayer.getName())); teleportingPlayer.sendMessage(LocaleLoader.getString("Party.Teleport.Player", targetPlayer.getName()));