Removed unnecessary methods from IClientOutgoingPacket.
This commit is contained in:
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1113,7 +1113,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +553,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,26 +102,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1113,7 +1113,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +553,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,26 +102,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1113,7 +1113,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +553,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,26 +102,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1113,7 +1113,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +553,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,26 +102,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1113,7 +1113,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +553,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,26 +107,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1113,7 +1113,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +553,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,26 +129,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1113,7 +1113,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +553,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,26 +129,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1118,7 +1118,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -542,7 +542,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,7 +556,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,26 +129,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class ChatWorld implements IChatHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class AbnormalTimeChange extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != player.getObjectId())
|
if (member.getObjectId() != player.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (member.getObjectId() != targetPlayer.getObjectId())
|
if (member.getObjectId() != targetPlayer.getObjectId())
|
||||||
{
|
{
|
||||||
deleteObject.sendTo(member);
|
member.sendPacket(deleteObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1118,7 +1118,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (Player player : PARTICIPANT_PLAYERS)
|
for (Player player : PARTICIPANT_PLAYERS)
|
||||||
{
|
{
|
||||||
packet.sendTo(player);
|
player.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ public class EffectList
|
|||||||
{
|
{
|
||||||
if ((creature != null) && creature.isPlayer())
|
if ((creature != null) && creature.isPlayer())
|
||||||
{
|
{
|
||||||
upd.sendTo(creature.getActingPlayer());
|
creature.sendPacket(upd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CommandChannelMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PartyMatchingRoom extends MatchingRoom
|
|||||||
{
|
{
|
||||||
if (member != player)
|
if (member != player)
|
||||||
{
|
{
|
||||||
sm.sendTo(member);
|
member.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +553,10 @@ public class Siege implements Siegable
|
|||||||
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
final Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
clan.getOnlineMembers(0).forEach(message::sendTo);
|
for (Player member : clan.getOnlineMembers(0))
|
||||||
|
{
|
||||||
|
member.sendPacket(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ public class RequestPartyMatchList implements IClientIncomingPacket
|
|||||||
room.setTitle(_roomTitle);
|
room.setTitle(_roomTitle);
|
||||||
|
|
||||||
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
final PartyRoomInfo packet = new PartyRoomInfo((PartyMatchingRoom) room);
|
||||||
room.getMembers().forEach(packet::sendTo);
|
for (Player member : room.getMembers())
|
||||||
|
{
|
||||||
|
member.sendPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.commons.network.IOutgoingPacket;
|
import org.l2jmobius.commons.network.IOutgoingPacket;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,26 +129,6 @@ public interface IClientOutgoingPacket extends IOutgoingPacket
|
|||||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param masks
|
|
||||||
* @param type
|
|
||||||
* @return {@code true} if the mask contains the current update component type
|
|
||||||
*/
|
|
||||||
static boolean containsMask(int masks, IUpdateTypeComponent type)
|
|
||||||
{
|
|
||||||
return (masks & type.getMask()) == type.getMask();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends this packet to the target player, useful for lambda operations like<br>
|
|
||||||
* {@code World.getInstance().getPlayers().forEach(packet::sendTo)}
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
default void sendTo(Player player)
|
|
||||||
{
|
|
||||||
player.sendPacket(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void runImpl(Player player)
|
default void runImpl(Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ public class Broadcast
|
|||||||
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
* In order to inform other players of state modification on the Creature, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<br>
|
||||||
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T SEND Server->Client packet to this Creature (to do this use method toSelfAndKnownPlayers)</b></font>
|
||||||
* @param creature
|
* @param creature
|
||||||
* @param mov
|
* @param packet
|
||||||
* @param radiusValue
|
* @param radiusValue
|
||||||
*/
|
*/
|
||||||
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -133,7 +133,7 @@ public class Broadcast
|
|||||||
radius = 1500;
|
radius = 1500;
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +157,7 @@ public class Broadcast
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
// To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time
|
||||||
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket mov, int radiusValue)
|
public static void toSelfAndKnownPlayersInRadius(Creature creature, IClientOutgoingPacket packet, int radiusValue)
|
||||||
{
|
{
|
||||||
int radius = radiusValue;
|
int radius = radiusValue;
|
||||||
if (radius < 0)
|
if (radius < 0)
|
||||||
@@ -167,10 +167,10 @@ public class Broadcast
|
|||||||
|
|
||||||
if (creature.isPlayer())
|
if (creature.isPlayer())
|
||||||
{
|
{
|
||||||
creature.sendPacket(mov);
|
creature.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, mov::sendTo);
|
World.getInstance().forEachVisibleObjectInRange(creature, Player.class, radius, player -> player.sendPacket(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player.isNotBlocked(activeChar))
|
if (player.isNotBlocked(activeChar))
|
||||||
{
|
{
|
||||||
cs.sendTo(player);
|
player.sendPacket(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user