Player sendInfo now sends relations when asked.

This commit is contained in:
MobiusDev
2017-10-02 21:57:27 +00:00
parent f103c50fb3
commit 1e2f1c550a
4 changed files with 100 additions and 128 deletions

View File

@@ -12108,45 +12108,38 @@ public final class L2PcInstance extends L2Playable
} }
final int relation1 = getRelation(activeChar); final int relation1 = getRelation(activeChar);
final int relation2 = activeChar.getRelation(this); final RelationChanged rc1 = new RelationChanged();
Integer oldrelation = getKnownRelations().get(activeChar.getObjectId()); rc1.addRelation(this, relation1, isAutoAttackable(activeChar));
if ((oldrelation != null) && (oldrelation != relation1))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation1, isAutoAttackable(activeChar));
if (hasSummon()) if (hasSummon())
{ {
final L2Summon pet = getPet(); final L2Summon pet = getPet();
if (pet != null) if (pet != null)
{ {
rc.addRelation(pet, relation1, isAutoAttackable(activeChar)); rc1.addRelation(pet, relation1, isAutoAttackable(activeChar));
} }
if (hasServitors()) if (hasServitors())
{ {
getServitors().values().forEach(s -> rc.addRelation(s, relation1, isAutoAttackable(activeChar))); getServitors().values().forEach(s -> rc1.addRelation(s, relation1, isAutoAttackable(activeChar)));
} }
} }
activeChar.sendPacket(rc); activeChar.sendPacket(rc1);
}
oldrelation = activeChar.getKnownRelations().get(getObjectId()); final int relation2 = activeChar.getRelation(this);
if ((oldrelation != null) && (oldrelation != relation2) && activeChar.isVisibleFor(this)) final RelationChanged rc2 = new RelationChanged();
{ rc2.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));
final RelationChanged rc = new RelationChanged();
rc.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));
if (activeChar.hasSummon()) if (activeChar.hasSummon())
{ {
final L2Summon pet = getPet(); final L2Summon pet = getPet();
if (pet != null) if (pet != null)
{ {
rc.addRelation(pet, relation2, activeChar.isAutoAttackable(this)); rc2.addRelation(pet, relation2, activeChar.isAutoAttackable(this));
} }
if (hasServitors()) if (hasServitors())
{ {
getServitors().values().forEach(s -> rc.addRelation(s, relation2, activeChar.isAutoAttackable(this))); getServitors().values().forEach(s -> rc2.addRelation(s, relation2, activeChar.isAutoAttackable(this)));
} }
} }
sendPacket(rc); sendPacket(rc2);
}
switch (getPrivateStoreType()) switch (getPrivateStoreType())
{ {

View File

@@ -12108,45 +12108,38 @@ public final class L2PcInstance extends L2Playable
} }
final int relation1 = getRelation(activeChar); final int relation1 = getRelation(activeChar);
final int relation2 = activeChar.getRelation(this); final RelationChanged rc1 = new RelationChanged();
Integer oldrelation = getKnownRelations().get(activeChar.getObjectId()); rc1.addRelation(this, relation1, isAutoAttackable(activeChar));
if ((oldrelation != null) && (oldrelation != relation1))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation1, isAutoAttackable(activeChar));
if (hasSummon()) if (hasSummon())
{ {
final L2Summon pet = getPet(); final L2Summon pet = getPet();
if (pet != null) if (pet != null)
{ {
rc.addRelation(pet, relation1, isAutoAttackable(activeChar)); rc1.addRelation(pet, relation1, isAutoAttackable(activeChar));
} }
if (hasServitors()) if (hasServitors())
{ {
getServitors().values().forEach(s -> rc.addRelation(s, relation1, isAutoAttackable(activeChar))); getServitors().values().forEach(s -> rc1.addRelation(s, relation1, isAutoAttackable(activeChar)));
} }
} }
activeChar.sendPacket(rc); activeChar.sendPacket(rc1);
}
oldrelation = activeChar.getKnownRelations().get(getObjectId()); final int relation2 = activeChar.getRelation(this);
if ((oldrelation != null) && (oldrelation != relation2) && activeChar.isVisibleFor(this)) final RelationChanged rc2 = new RelationChanged();
{ rc2.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));
final RelationChanged rc = new RelationChanged();
rc.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));
if (activeChar.hasSummon()) if (activeChar.hasSummon())
{ {
final L2Summon pet = getPet(); final L2Summon pet = getPet();
if (pet != null) if (pet != null)
{ {
rc.addRelation(pet, relation2, activeChar.isAutoAttackable(this)); rc2.addRelation(pet, relation2, activeChar.isAutoAttackable(this));
} }
if (hasServitors()) if (hasServitors())
{ {
getServitors().values().forEach(s -> rc.addRelation(s, relation2, activeChar.isAutoAttackable(this))); getServitors().values().forEach(s -> rc2.addRelation(s, relation2, activeChar.isAutoAttackable(this)));
} }
} }
sendPacket(rc); sendPacket(rc2);
}
switch (getPrivateStoreType()) switch (getPrivateStoreType())
{ {

View File

@@ -12119,45 +12119,38 @@ public final class L2PcInstance extends L2Playable
} }
final int relation1 = getRelation(activeChar); final int relation1 = getRelation(activeChar);
final int relation2 = activeChar.getRelation(this); final RelationChanged rc1 = new RelationChanged();
Integer oldrelation = getKnownRelations().get(activeChar.getObjectId()); rc1.addRelation(this, relation1, isAutoAttackable(activeChar));
if ((oldrelation != null) && (oldrelation != relation1))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation1, isAutoAttackable(activeChar));
if (hasSummon()) if (hasSummon())
{ {
final L2Summon pet = getPet(); final L2Summon pet = getPet();
if (pet != null) if (pet != null)
{ {
rc.addRelation(pet, relation1, isAutoAttackable(activeChar)); rc1.addRelation(pet, relation1, isAutoAttackable(activeChar));
} }
if (hasServitors()) if (hasServitors())
{ {
getServitors().values().forEach(s -> rc.addRelation(s, relation1, isAutoAttackable(activeChar))); getServitors().values().forEach(s -> rc1.addRelation(s, relation1, isAutoAttackable(activeChar)));
} }
} }
activeChar.sendPacket(rc); activeChar.sendPacket(rc1);
}
oldrelation = activeChar.getKnownRelations().get(getObjectId()); final int relation2 = activeChar.getRelation(this);
if ((oldrelation != null) && (oldrelation != relation2) && activeChar.isVisibleFor(this)) final RelationChanged rc2 = new RelationChanged();
{ rc2.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));
final RelationChanged rc = new RelationChanged();
rc.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));
if (activeChar.hasSummon()) if (activeChar.hasSummon())
{ {
final L2Summon pet = getPet(); final L2Summon pet = getPet();
if (pet != null) if (pet != null)
{ {
rc.addRelation(pet, relation2, activeChar.isAutoAttackable(this)); rc2.addRelation(pet, relation2, activeChar.isAutoAttackable(this));
} }
if (hasServitors()) if (hasServitors())
{ {
getServitors().values().forEach(s -> rc.addRelation(s, relation2, activeChar.isAutoAttackable(this))); getServitors().values().forEach(s -> rc2.addRelation(s, relation2, activeChar.isAutoAttackable(this)));
} }
} }
sendPacket(rc); sendPacket(rc2);
}
switch (getPrivateStoreType()) switch (getPrivateStoreType())
{ {

View File

@@ -12081,45 +12081,38 @@ public final class L2PcInstance extends L2Playable
} }
final int relation1 = getRelation(activeChar); final int relation1 = getRelation(activeChar);
final int relation2 = activeChar.getRelation(this); final RelationChanged rc1 = new RelationChanged();
Integer oldrelation = getKnownRelations().get(activeChar.getObjectId()); rc1.addRelation(this, relation1, isAutoAttackable(activeChar));
if ((oldrelation != null) && (oldrelation != relation1))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation1, isAutoAttackable(activeChar));
if (hasSummon()) if (hasSummon())
{ {
final L2Summon pet = getPet(); final L2Summon pet = getPet();
if (pet != null) if (pet != null)
{ {
rc.addRelation(pet, relation1, isAutoAttackable(activeChar)); rc1.addRelation(pet, relation1, isAutoAttackable(activeChar));
} }
if (hasServitors()) if (hasServitors())
{ {
getServitors().values().forEach(s -> rc.addRelation(s, relation1, isAutoAttackable(activeChar))); getServitors().values().forEach(s -> rc1.addRelation(s, relation1, isAutoAttackable(activeChar)));
} }
} }
activeChar.sendPacket(rc); activeChar.sendPacket(rc1);
}
oldrelation = activeChar.getKnownRelations().get(getObjectId()); final int relation2 = activeChar.getRelation(this);
if ((oldrelation != null) && (oldrelation != relation2) && activeChar.isVisibleFor(this)) final RelationChanged rc2 = new RelationChanged();
{ rc2.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));
final RelationChanged rc = new RelationChanged();
rc.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));
if (activeChar.hasSummon()) if (activeChar.hasSummon())
{ {
final L2Summon pet = getPet(); final L2Summon pet = getPet();
if (pet != null) if (pet != null)
{ {
rc.addRelation(pet, relation2, activeChar.isAutoAttackable(this)); rc2.addRelation(pet, relation2, activeChar.isAutoAttackable(this));
} }
if (hasServitors()) if (hasServitors())
{ {
getServitors().values().forEach(s -> rc.addRelation(s, relation2, activeChar.isAutoAttackable(this))); getServitors().values().forEach(s -> rc2.addRelation(s, relation2, activeChar.isAutoAttackable(this)));
} }
} }
sendPacket(rc); sendPacket(rc2);
}
switch (getPrivateStoreType()) switch (getPrivateStoreType())
{ {