From c63fc7475c453d3782800c685dcf09726896f693 Mon Sep 17 00:00:00 2001 From: MedicOP Date: Tue, 15 Jan 2019 02:33:25 +0100 Subject: [PATCH] Find command target in world instead of channel (#328) --- src/client/command/commands/gm2/ApCommand.java | 4 ++-- .../command/commands/gm2/ClearSavedLocationsCommand.java | 4 ++-- src/client/command/commands/gm2/JailCommand.java | 4 ++-- src/client/command/commands/gm2/JobCommand.java | 4 ++-- src/client/command/commands/gm2/SpCommand.java | 4 ++-- src/client/command/commands/gm2/UnJailCommand.java | 4 ++-- src/client/command/commands/gm3/FameCommand.java | 4 ++-- src/client/command/commands/gm3/GiveMesosCommand.java | 4 ++-- src/client/command/commands/gm3/GiveNxCommand.java | 4 ++-- src/client/command/commands/gm3/GiveVpCommand.java | 4 ++-- src/client/command/commands/gm3/HealPersonCommand.java | 4 ++-- src/client/command/commands/gm3/HurtCommand.java | 4 ++-- src/client/command/commands/gm3/KillCommand.java | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/client/command/commands/gm2/ApCommand.java b/src/client/command/commands/gm2/ApCommand.java index b6163e3a29..aaecf00dff 100644 --- a/src/client/command/commands/gm2/ApCommand.java +++ b/src/client/command/commands/gm2/ApCommand.java @@ -48,7 +48,7 @@ public class ApCommand extends Command { player.changeRemainingAp(newAp, false); } else { - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { int newAp = Integer.parseInt(params[1]); if (newAp < 0) newAp = 0; @@ -56,7 +56,7 @@ public class ApCommand extends Command { victim.changeRemainingAp(newAp, false); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } } diff --git a/src/client/command/commands/gm2/ClearSavedLocationsCommand.java b/src/client/command/commands/gm2/ClearSavedLocationsCommand.java index d049b19382..8f069ea686 100644 --- a/src/client/command/commands/gm2/ClearSavedLocationsCommand.java +++ b/src/client/command/commands/gm2/ClearSavedLocationsCommand.java @@ -38,9 +38,9 @@ public class ClearSavedLocationsCommand extends Command { MapleCharacter player = c.getPlayer(), victim; if (params.length > 0) { - victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim == null) { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); return; } } else { diff --git a/src/client/command/commands/gm2/JailCommand.java b/src/client/command/commands/gm2/JailCommand.java index ceb5c6063f..afea582f87 100644 --- a/src/client/command/commands/gm2/JailCommand.java +++ b/src/client/command/commands/gm2/JailCommand.java @@ -51,7 +51,7 @@ public class JailCommand extends Command { } } - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { victim.addJailExpirationTime(minutesJailed * 60 * 1000); @@ -68,7 +68,7 @@ public class JailCommand extends Command { } } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } } diff --git a/src/client/command/commands/gm2/JobCommand.java b/src/client/command/commands/gm2/JobCommand.java index cf679b2c2e..a66f91d99c 100644 --- a/src/client/command/commands/gm2/JobCommand.java +++ b/src/client/command/commands/gm2/JobCommand.java @@ -46,7 +46,7 @@ public class JobCommand extends Command { player.changeJob(MapleJob.getById(jobid)); player.equipChanged(); } else if (params.length == 2) { - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { int jobid = Integer.parseInt(params[1]); @@ -58,7 +58,7 @@ public class JobCommand extends Command { victim.changeJob(MapleJob.getById(jobid)); player.equipChanged(); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } else { player.message("Syntax: !job "); diff --git a/src/client/command/commands/gm2/SpCommand.java b/src/client/command/commands/gm2/SpCommand.java index 3804f636b9..5b217b62c4 100644 --- a/src/client/command/commands/gm2/SpCommand.java +++ b/src/client/command/commands/gm2/SpCommand.java @@ -48,7 +48,7 @@ public class SpCommand extends Command { player.updateRemainingSp(newSp); } else { - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { int newSp = Integer.parseInt(params[1]); if (newSp < 0) newSp = 0; @@ -58,7 +58,7 @@ public class SpCommand extends Command { player.dropMessage(5, "SP given."); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } } diff --git a/src/client/command/commands/gm2/UnJailCommand.java b/src/client/command/commands/gm2/UnJailCommand.java index f5fb8b4da8..b8381bca18 100644 --- a/src/client/command/commands/gm2/UnJailCommand.java +++ b/src/client/command/commands/gm2/UnJailCommand.java @@ -40,7 +40,7 @@ public class UnJailCommand extends Command { return; } - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { if (victim.getJailExpirationTimeLeft() <= 0) { player.message("This player is already free."); @@ -50,7 +50,7 @@ public class UnJailCommand extends Command { victim.message("By lack of concrete proof you are now unjailed. Enjoy freedom!"); player.message(victim.getName() + " was unjailed."); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } } diff --git a/src/client/command/commands/gm3/FameCommand.java b/src/client/command/commands/gm3/FameCommand.java index 9e1b8e6165..78e1738c77 100644 --- a/src/client/command/commands/gm3/FameCommand.java +++ b/src/client/command/commands/gm3/FameCommand.java @@ -41,13 +41,13 @@ public class FameCommand extends Command { return; } - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { victim.setFame(Integer.parseInt(params[1])); victim.updateSingleStat(MapleStat.FAME, victim.getFame()); player.message("FAME given."); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } } diff --git a/src/client/command/commands/gm3/GiveMesosCommand.java b/src/client/command/commands/gm3/GiveMesosCommand.java index 09f58a4cd5..10d6fe63a9 100644 --- a/src/client/command/commands/gm3/GiveMesosCommand.java +++ b/src/client/command/commands/gm3/GiveMesosCommand.java @@ -66,12 +66,12 @@ public class GiveMesosCommand extends Command { } } - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(recv_); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv_); if (victim != null) { victim.gainMeso((int) mesos_, true); player.message("MESO given."); } else { - player.message("Player '" + recv_ + "' could not be found on this channel."); + player.message("Player '" + recv_ + "' could not be found."); } } } diff --git a/src/client/command/commands/gm3/GiveNxCommand.java b/src/client/command/commands/gm3/GiveNxCommand.java index 04289bec41..f3d4dd12c0 100644 --- a/src/client/command/commands/gm3/GiveNxCommand.java +++ b/src/client/command/commands/gm3/GiveNxCommand.java @@ -50,12 +50,12 @@ public class GiveNxCommand extends Command { value = Integer.parseInt(params[0]); } - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(recv); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv); if (victim != null) { victim.getCashShop().gainCash(1, value); player.message("NX given."); } else { - player.message("Player '" + recv + "' could not be found on this channel."); + player.message("Player '" + recv + "' could not be found."); } } } diff --git a/src/client/command/commands/gm3/GiveVpCommand.java b/src/client/command/commands/gm3/GiveVpCommand.java index 798ac91ad9..20135a57f2 100644 --- a/src/client/command/commands/gm3/GiveVpCommand.java +++ b/src/client/command/commands/gm3/GiveVpCommand.java @@ -40,12 +40,12 @@ public class GiveVpCommand extends Command { return; } - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { victim.getClient().addVotePoints(Integer.parseInt(params[1])); player.message("VP given."); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } } diff --git a/src/client/command/commands/gm3/HealPersonCommand.java b/src/client/command/commands/gm3/HealPersonCommand.java index 7621cb2815..73a6a05c0d 100644 --- a/src/client/command/commands/gm3/HealPersonCommand.java +++ b/src/client/command/commands/gm3/HealPersonCommand.java @@ -36,11 +36,11 @@ public class HealPersonCommand extends Command { @Override public void execute(MapleClient c, String[] params) { MapleCharacter player = c.getPlayer(); - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { victim.healHpMp(); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } } diff --git a/src/client/command/commands/gm3/HurtCommand.java b/src/client/command/commands/gm3/HurtCommand.java index 82cf06ac92..1324dbcc3a 100644 --- a/src/client/command/commands/gm3/HurtCommand.java +++ b/src/client/command/commands/gm3/HurtCommand.java @@ -35,11 +35,11 @@ public class HurtCommand extends Command { @Override public void execute(MapleClient c, String[] params) { MapleCharacter player = c.getPlayer(); - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { victim.updateHp(1); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } } diff --git a/src/client/command/commands/gm3/KillCommand.java b/src/client/command/commands/gm3/KillCommand.java index 910fd9f53a..041826ce69 100644 --- a/src/client/command/commands/gm3/KillCommand.java +++ b/src/client/command/commands/gm3/KillCommand.java @@ -42,12 +42,12 @@ public class KillCommand extends Command { return; } - MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); + MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); if (victim != null) { victim.updateHpMp(0); Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, player.getName() + " used !kill on " + victim.getName())); } else { - player.message("Player '" + params[0] + "' could not be found on this channel."); + player.message("Player '" + params[0] + "' could not be found."); } } }