ItemInstance detailed log NPE fixes.

This commit is contained in:
MobiusDev 2017-11-04 10:57:14 +00:00
parent bc399fc171
commit 46e0fa7419
4 changed files with 248 additions and 200 deletions

View File

@ -326,24 +326,30 @@ public final class L2ItemInstance extends L2Object
if (Config.LOG_ITEMS) if (Config.LOG_ITEMS)
{ {
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID)))) if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID))))
{
if ((creator != null) && (reference != null))
{ {
if (getEnchantLevel() > 0) if (getEnchantLevel() > 0)
{ {
_logItems.info("SETOWNER:" + process + ", item " + getObjectId() + ":+" + getEnchantLevel() + " " + getItem().getName() + "(" + _count + "), " + creator + ", " + reference); _logItems.info("SETOWNER:" + String.valueOf(process) // in case of null
+ ", item " + getObjectId() //
+ ":+" + getEnchantLevel() //
+ " " + getItem().getName() //
+ "(" + _count + "), " //
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
else else
{ {
_logItems.info("SETOWNER:" + process + ", item " + getObjectId() + ":" + getItem().getName() + "(" + _count + "), " + creator + ", " + reference); _logItems.info("SETOWNER:" + String.valueOf(process) // in case of null
} + ", item " + getObjectId() //
+ ":" + getItem().getName() //
+ "(" + _count + "), " //
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
} }
} }
if (creator != null) if ((creator != null) && creator.isGM())
{
if (creator.isGM())
{ {
String referenceName = "no-reference"; String referenceName = "no-reference";
if (reference instanceof L2Object) if (reference instanceof L2Object)
@ -361,7 +367,6 @@ public final class L2ItemInstance extends L2Object
} }
} }
} }
}
/** /**
* Sets the ownerID of the item * Sets the ownerID of the item
@ -495,24 +500,32 @@ public final class L2ItemInstance extends L2Object
if (Config.LOG_ITEMS && (process != null)) if (Config.LOG_ITEMS && (process != null))
{ {
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID)))) if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID))))
{
if ((creator != null) && (reference != null))
{ {
if (getEnchantLevel() > 0) if (getEnchantLevel() > 0)
{ {
_logItems.info("CHANGE:" + process + ", item " + getObjectId() + ":+" + getEnchantLevel() + " " + getItem().getName() + "(" + _count + "), PrevCount(" + old + "), " + creator + ", " + reference); _logItems.info("CHANGE:" + String.valueOf(process) // in case of null
+ ", item " + getObjectId() //
+ ":+" + getEnchantLevel() //
+ " " + getItem().getName() //
+ "(" + _count + "), PrevCount(" //
+ String.valueOf(old) + "), " // in case of null
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
else else
{ {
_logItems.info("CHANGE:" + process + ", item " + getObjectId() + ":" + getItem().getName() + "(" + _count + "), PrevCount(" + old + "), " + creator + ", " + reference); _logItems.info("CHANGE:" + String.valueOf(process) // in case of null
} + ", item " + getObjectId() //
+ ":" + getItem().getName() //
+ "(" + _count + "), PrevCount(" //
+ String.valueOf(old) + "), " // in case of null
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
} }
} }
if (creator != null) if ((creator != null) && creator.isGM())
{
if (creator.isGM())
{ {
String referenceName = "no-reference"; String referenceName = "no-reference";
if (reference instanceof L2Object) if (reference instanceof L2Object)
@ -530,7 +543,6 @@ public final class L2ItemInstance extends L2Object
} }
} }
} }
}
// No logging (function designed for shots only) // No logging (function designed for shots only)
public void changeCountWithoutTrace(int count, L2PcInstance creator, Object reference) public void changeCountWithoutTrace(int count, L2PcInstance creator, Object reference)

View File

@ -330,24 +330,30 @@ public final class L2ItemInstance extends L2Object
if (Config.LOG_ITEMS) if (Config.LOG_ITEMS)
{ {
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID)))) if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID))))
{
if ((creator != null) && (reference != null))
{ {
if (getEnchantLevel() > 0) if (getEnchantLevel() > 0)
{ {
_logItems.info("SETOWNER:" + process + ", item " + getObjectId() + ":+" + getEnchantLevel() + " " + getItem().getName() + "(" + _count + "), " + creator + ", " + reference); _logItems.info("SETOWNER:" + String.valueOf(process) // in case of null
+ ", item " + getObjectId() //
+ ":+" + getEnchantLevel() //
+ " " + getItem().getName() //
+ "(" + _count + "), " //
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
else else
{ {
_logItems.info("SETOWNER:" + process + ", item " + getObjectId() + ":" + getItem().getName() + "(" + _count + "), " + creator + ", " + reference); _logItems.info("SETOWNER:" + String.valueOf(process) // in case of null
} + ", item " + getObjectId() //
+ ":" + getItem().getName() //
+ "(" + _count + "), " //
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
} }
} }
if (creator != null) if ((creator != null) && creator.isGM())
{
if (creator.isGM())
{ {
String referenceName = "no-reference"; String referenceName = "no-reference";
if (reference instanceof L2Object) if (reference instanceof L2Object)
@ -365,7 +371,6 @@ public final class L2ItemInstance extends L2Object
} }
} }
} }
}
/** /**
* Sets the ownerID of the item * Sets the ownerID of the item
@ -499,24 +504,32 @@ public final class L2ItemInstance extends L2Object
if (Config.LOG_ITEMS && (process != null)) if (Config.LOG_ITEMS && (process != null))
{ {
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID)))) if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID))))
{
if ((creator != null) && (reference != null))
{ {
if (getEnchantLevel() > 0) if (getEnchantLevel() > 0)
{ {
_logItems.info("CHANGE:" + process + ", item " + getObjectId() + ":+" + getEnchantLevel() + " " + getItem().getName() + "(" + _count + "), PrevCount(" + old + "), " + creator + ", " + reference); _logItems.info("CHANGE:" + String.valueOf(process) // in case of null
+ ", item " + getObjectId() //
+ ":+" + getEnchantLevel() //
+ " " + getItem().getName() //
+ "(" + _count + "), PrevCount(" //
+ String.valueOf(old) + "), " // in case of null
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
else else
{ {
_logItems.info("CHANGE:" + process + ", item " + getObjectId() + ":" + getItem().getName() + "(" + _count + "), PrevCount(" + old + "), " + creator + ", " + reference); _logItems.info("CHANGE:" + String.valueOf(process) // in case of null
} + ", item " + getObjectId() //
+ ":" + getItem().getName() //
+ "(" + _count + "), PrevCount(" //
+ String.valueOf(old) + "), " // in case of null
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
} }
} }
if (creator != null) if ((creator != null) && creator.isGM())
{
if (creator.isGM())
{ {
String referenceName = "no-reference"; String referenceName = "no-reference";
if (reference instanceof L2Object) if (reference instanceof L2Object)
@ -534,7 +547,6 @@ public final class L2ItemInstance extends L2Object
} }
} }
} }
}
// No logging (function designed for shots only) // No logging (function designed for shots only)
public void changeCountWithoutTrace(int count, L2PcInstance creator, Object reference) public void changeCountWithoutTrace(int count, L2PcInstance creator, Object reference)

View File

@ -330,24 +330,30 @@ public final class L2ItemInstance extends L2Object
if (Config.LOG_ITEMS) if (Config.LOG_ITEMS)
{ {
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID)))) if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID))))
{
if ((creator != null) && (reference != null))
{ {
if (getEnchantLevel() > 0) if (getEnchantLevel() > 0)
{ {
_logItems.info("SETOWNER:" + process + ", item " + getObjectId() + ":+" + getEnchantLevel() + " " + getItem().getName() + "(" + _count + "), " + creator + ", " + reference); _logItems.info("SETOWNER:" + String.valueOf(process) // in case of null
+ ", item " + getObjectId() //
+ ":+" + getEnchantLevel() //
+ " " + getItem().getName() //
+ "(" + _count + "), " //
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
else else
{ {
_logItems.info("SETOWNER:" + process + ", item " + getObjectId() + ":" + getItem().getName() + "(" + _count + "), " + creator + ", " + reference); _logItems.info("SETOWNER:" + String.valueOf(process) // in case of null
} + ", item " + getObjectId() //
+ ":" + getItem().getName() //
+ "(" + _count + "), " //
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
} }
} }
if (creator != null) if ((creator != null) && creator.isGM())
{
if (creator.isGM())
{ {
String referenceName = "no-reference"; String referenceName = "no-reference";
if (reference instanceof L2Object) if (reference instanceof L2Object)
@ -365,7 +371,6 @@ public final class L2ItemInstance extends L2Object
} }
} }
} }
}
/** /**
* Sets the ownerID of the item * Sets the ownerID of the item
@ -499,24 +504,32 @@ public final class L2ItemInstance extends L2Object
if (Config.LOG_ITEMS && (process != null)) if (Config.LOG_ITEMS && (process != null))
{ {
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID)))) if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID))))
{
if ((creator != null) && (reference != null))
{ {
if (getEnchantLevel() > 0) if (getEnchantLevel() > 0)
{ {
_logItems.info("CHANGE:" + process + ", item " + getObjectId() + ":+" + getEnchantLevel() + " " + getItem().getName() + "(" + _count + "), PrevCount(" + old + "), " + creator + ", " + reference); _logItems.info("CHANGE:" + String.valueOf(process) // in case of null
+ ", item " + getObjectId() //
+ ":+" + getEnchantLevel() //
+ " " + getItem().getName() //
+ "(" + _count + "), PrevCount(" //
+ String.valueOf(old) + "), " // in case of null
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
else else
{ {
_logItems.info("CHANGE:" + process + ", item " + getObjectId() + ":" + getItem().getName() + "(" + _count + "), PrevCount(" + old + "), " + creator + ", " + reference); _logItems.info("CHANGE:" + String.valueOf(process) // in case of null
} + ", item " + getObjectId() //
+ ":" + getItem().getName() //
+ "(" + _count + "), PrevCount(" //
+ String.valueOf(old) + "), " // in case of null
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
} }
} }
if (creator != null) if ((creator != null) && creator.isGM())
{
if (creator.isGM())
{ {
String referenceName = "no-reference"; String referenceName = "no-reference";
if (reference instanceof L2Object) if (reference instanceof L2Object)
@ -534,7 +547,6 @@ public final class L2ItemInstance extends L2Object
} }
} }
} }
}
// No logging (function designed for shots only) // No logging (function designed for shots only)
public void changeCountWithoutTrace(int count, L2PcInstance creator, Object reference) public void changeCountWithoutTrace(int count, L2PcInstance creator, Object reference)

View File

@ -330,24 +330,30 @@ public final class L2ItemInstance extends L2Object
if (Config.LOG_ITEMS) if (Config.LOG_ITEMS)
{ {
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID)))) if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID))))
{
if ((creator != null) && (reference != null))
{ {
if (getEnchantLevel() > 0) if (getEnchantLevel() > 0)
{ {
_logItems.info("SETOWNER:" + process + ", item " + getObjectId() + ":+" + getEnchantLevel() + " " + getItem().getName() + "(" + _count + "), " + creator + ", " + reference); _logItems.info("SETOWNER:" + String.valueOf(process) // in case of null
+ ", item " + getObjectId() //
+ ":+" + getEnchantLevel() //
+ " " + getItem().getName() //
+ "(" + _count + "), " //
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
else else
{ {
_logItems.info("SETOWNER:" + process + ", item " + getObjectId() + ":" + getItem().getName() + "(" + _count + "), " + creator + ", " + reference); _logItems.info("SETOWNER:" + String.valueOf(process) // in case of null
} + ", item " + getObjectId() //
+ ":" + getItem().getName() //
+ "(" + _count + "), " //
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
} }
} }
if (creator != null) if ((creator != null) && creator.isGM())
{
if (creator.isGM())
{ {
String referenceName = "no-reference"; String referenceName = "no-reference";
if (reference instanceof L2Object) if (reference instanceof L2Object)
@ -365,7 +371,6 @@ public final class L2ItemInstance extends L2Object
} }
} }
} }
}
/** /**
* Sets the ownerID of the item * Sets the ownerID of the item
@ -499,24 +504,32 @@ public final class L2ItemInstance extends L2Object
if (Config.LOG_ITEMS && (process != null)) if (Config.LOG_ITEMS && (process != null))
{ {
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID)))) if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID))))
{
if ((creator != null) && (reference != null))
{ {
if (getEnchantLevel() > 0) if (getEnchantLevel() > 0)
{ {
_logItems.info("CHANGE:" + process + ", item " + getObjectId() + ":+" + getEnchantLevel() + " " + getItem().getName() + "(" + _count + "), PrevCount(" + old + "), " + creator + ", " + reference); _logItems.info("CHANGE:" + String.valueOf(process) // in case of null
+ ", item " + getObjectId() //
+ ":+" + getEnchantLevel() //
+ " " + getItem().getName() //
+ "(" + _count + "), PrevCount(" //
+ String.valueOf(old) + "), " // in case of null
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
else else
{ {
_logItems.info("CHANGE:" + process + ", item " + getObjectId() + ":" + getItem().getName() + "(" + _count + "), PrevCount(" + old + "), " + creator + ", " + reference); _logItems.info("CHANGE:" + String.valueOf(process) // in case of null
} + ", item " + getObjectId() //
+ ":" + getItem().getName() //
+ "(" + _count + "), PrevCount(" //
+ String.valueOf(old) + "), " // in case of null
+ String.valueOf(creator) + ", " // in case of null
+ String.valueOf(reference)); // in case of null
} }
} }
} }
if (creator != null) if ((creator != null) && creator.isGM())
{
if (creator.isGM())
{ {
String referenceName = "no-reference"; String referenceName = "no-reference";
if (reference instanceof L2Object) if (reference instanceof L2Object)
@ -534,7 +547,6 @@ public final class L2ItemInstance extends L2Object
} }
} }
} }
}
// No logging (function designed for shots only) // No logging (function designed for shots only)
public void changeCountWithoutTrace(int count, L2PcInstance creator, Object reference) public void changeCountWithoutTrace(int count, L2PcInstance creator, Object reference)