Log items even with null values.

This commit is contained in:
MobiusDev
2017-10-25 21:50:08 +00:00
parent e9664d56fc
commit 15852c5555
4 changed files with 304 additions and 352 deletions

View File

@@ -250,35 +250,30 @@ public class ItemTable
if (Config.LOG_ITEMS && !process.equals("Reset"))
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
if ((actor != null) && (reference != null)) // NPE check
{
if (item.getEnchantLevel() > 0)
{
LOGGER_ITEMS.info("CREATE:" + process //
LOGGER_ITEMS.info("CREATE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":+" + item.getEnchantLevel() //
+ " " + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), " + actor //
+ ", " + reference);
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
else
{
LOGGER_ITEMS.info("CREATE:" + process //
LOGGER_ITEMS.info("CREATE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":" + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), " + actor //
+ ", " + reference);
}
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
}
}
if (actor != null)
{
if (actor.isGM())
if ((actor != null) && actor.isGM())
{
String referenceName = "no-reference";
if (reference instanceof L2Object)
@@ -293,7 +288,7 @@ public class ItemTable
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]" //
, process //
, String.valueOf(process) // in case of null
+ "(id: " + itemId //
+ " count: " + count //
+ " name: " + item.getItemName() //
@@ -302,7 +297,6 @@ public class ItemTable
, "L2Object referencing this action is: " + referenceName);
}
}
}
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnItemCreate(process, item, actor, reference), item.getItem());
@@ -343,37 +337,32 @@ public class ItemTable
if (Config.LOG_ITEMS)
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
if ((actor != null) && (reference != null)) // NPE check
{
if (item.getEnchantLevel() > 0)
{
LOGGER_ITEMS.info("DELETE:" + process //
LOGGER_ITEMS.info("DELETE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":+" + item.getEnchantLevel() //
+ " " + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), PrevCount(" + old //
+ "), " + actor //
+ ", " + reference);
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
else
{
LOGGER_ITEMS.info("DELETE:" + process //
LOGGER_ITEMS.info("DELETE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":" + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), PrevCount(" + old //
+ "), " + actor //
+ ", " + reference);
}
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
}
}
if (actor != null)
{
if (actor.isGM())
if ((actor != null) && actor.isGM())
{
String referenceName = "no-reference";
if (reference instanceof L2Object)
@@ -388,7 +377,7 @@ public class ItemTable
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]" //
, process //
, String.valueOf(process) // in case of null
+ "(id: " + item.getId() //
+ " count: " + item.getCount() //
+ " itemObjId: " //
@@ -397,7 +386,6 @@ public class ItemTable
, "L2Object referencing this action is: " + referenceName);
}
}
}
// if it's a pet control item, delete the pet as well
if (item.getItem().isPetItem())

View File

@@ -250,35 +250,30 @@ public class ItemTable
if (Config.LOG_ITEMS && !process.equals("Reset"))
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
if ((actor != null) && (reference != null)) // NPE check
{
if (item.getEnchantLevel() > 0)
{
LOGGER_ITEMS.info("CREATE:" + process //
LOGGER_ITEMS.info("CREATE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":+" + item.getEnchantLevel() //
+ " " + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), " + actor //
+ ", " + reference);
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
else
{
LOGGER_ITEMS.info("CREATE:" + process //
LOGGER_ITEMS.info("CREATE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":" + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), " + actor //
+ ", " + reference);
}
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
}
}
if (actor != null)
{
if (actor.isGM())
if ((actor != null) && actor.isGM())
{
String referenceName = "no-reference";
if (reference instanceof L2Object)
@@ -293,7 +288,7 @@ public class ItemTable
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]" //
, process //
, String.valueOf(process) // in case of null
+ "(id: " + itemId //
+ " count: " + count //
+ " name: " + item.getItemName() //
@@ -302,7 +297,6 @@ public class ItemTable
, "L2Object referencing this action is: " + referenceName);
}
}
}
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnItemCreate(process, item, actor, reference), item.getItem());
@@ -343,37 +337,32 @@ public class ItemTable
if (Config.LOG_ITEMS)
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
if ((actor != null) && (reference != null)) // NPE check
{
if (item.getEnchantLevel() > 0)
{
LOGGER_ITEMS.info("DELETE:" + process //
LOGGER_ITEMS.info("DELETE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":+" + item.getEnchantLevel() //
+ " " + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), PrevCount(" + old //
+ "), " + actor //
+ ", " + reference);
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
else
{
LOGGER_ITEMS.info("DELETE:" + process //
LOGGER_ITEMS.info("DELETE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":" + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), PrevCount(" + old //
+ "), " + actor //
+ ", " + reference);
}
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
}
}
if (actor != null)
{
if (actor.isGM())
if ((actor != null) && actor.isGM())
{
String referenceName = "no-reference";
if (reference instanceof L2Object)
@@ -388,7 +377,7 @@ public class ItemTable
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]" //
, process //
, String.valueOf(process) // in case of null
+ "(id: " + item.getId() //
+ " count: " + item.getCount() //
+ " itemObjId: " //
@@ -397,7 +386,6 @@ public class ItemTable
, "L2Object referencing this action is: " + referenceName);
}
}
}
// if it's a pet control item, delete the pet as well
if (item.getItem().isPetItem())

View File

@@ -250,35 +250,30 @@ public class ItemTable
if (Config.LOG_ITEMS && !process.equals("Reset"))
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
if ((actor != null) && (reference != null)) // NPE check
{
if (item.getEnchantLevel() > 0)
{
LOGGER_ITEMS.info("CREATE:" + process //
LOGGER_ITEMS.info("CREATE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":+" + item.getEnchantLevel() //
+ " " + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), " + actor //
+ ", " + reference);
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
else
{
LOGGER_ITEMS.info("CREATE:" + process //
LOGGER_ITEMS.info("CREATE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":" + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), " + actor //
+ ", " + reference);
}
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
}
}
if (actor != null)
{
if (actor.isGM())
if ((actor != null) && actor.isGM())
{
String referenceName = "no-reference";
if (reference instanceof L2Object)
@@ -293,7 +288,7 @@ public class ItemTable
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]" //
, process //
, String.valueOf(process) // in case of null
+ "(id: " + itemId //
+ " count: " + count //
+ " name: " + item.getItemName() //
@@ -302,7 +297,6 @@ public class ItemTable
, "L2Object referencing this action is: " + referenceName);
}
}
}
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnItemCreate(process, item, actor, reference), item.getItem());
@@ -343,37 +337,32 @@ public class ItemTable
if (Config.LOG_ITEMS)
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
if ((actor != null) && (reference != null)) // NPE check
{
if (item.getEnchantLevel() > 0)
{
LOGGER_ITEMS.info("DELETE:" + process //
LOGGER_ITEMS.info("DELETE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":+" + item.getEnchantLevel() //
+ " " + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), PrevCount(" + old //
+ "), " + actor //
+ ", " + reference);
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
else
{
LOGGER_ITEMS.info("DELETE:" + process //
LOGGER_ITEMS.info("DELETE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":" + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), PrevCount(" + old //
+ "), " + actor //
+ ", " + reference);
}
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
}
}
if (actor != null)
{
if (actor.isGM())
if ((actor != null) && actor.isGM())
{
String referenceName = "no-reference";
if (reference instanceof L2Object)
@@ -388,7 +377,7 @@ public class ItemTable
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]" //
, process //
, String.valueOf(process) // in case of null
+ "(id: " + item.getId() //
+ " count: " + item.getCount() //
+ " itemObjId: " //
@@ -397,7 +386,6 @@ public class ItemTable
, "L2Object referencing this action is: " + referenceName);
}
}
}
// if it's a pet control item, delete the pet as well
if (item.getItem().isPetItem())

View File

@@ -250,35 +250,30 @@ public class ItemTable
if (Config.LOG_ITEMS && !process.equals("Reset"))
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
if ((actor != null) && (reference != null)) // NPE check
{
if (item.getEnchantLevel() > 0)
{
LOGGER_ITEMS.info("CREATE:" + process //
LOGGER_ITEMS.info("CREATE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":+" + item.getEnchantLevel() //
+ " " + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), " + actor //
+ ", " + reference);
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
else
{
LOGGER_ITEMS.info("CREATE:" + process //
LOGGER_ITEMS.info("CREATE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":" + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), " + actor //
+ ", " + reference);
}
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
}
}
if (actor != null)
{
if (actor.isGM())
if ((actor != null) && actor.isGM())
{
String referenceName = "no-reference";
if (reference instanceof L2Object)
@@ -293,7 +288,7 @@ public class ItemTable
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]" //
, process //
, String.valueOf(process) // in case of null
+ "(id: " + itemId //
+ " count: " + count //
+ " name: " + item.getItemName() //
@@ -302,7 +297,6 @@ public class ItemTable
, "L2Object referencing this action is: " + referenceName);
}
}
}
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnItemCreate(process, item, actor, reference), item.getItem());
@@ -343,37 +337,32 @@ public class ItemTable
if (Config.LOG_ITEMS)
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
if ((actor != null) && (reference != null)) // NPE check
{
if (item.getEnchantLevel() > 0)
{
LOGGER_ITEMS.info("DELETE:" + process //
LOGGER_ITEMS.info("DELETE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":+" + item.getEnchantLevel() //
+ " " + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), PrevCount(" + old //
+ "), " + actor //
+ ", " + reference);
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
else
{
LOGGER_ITEMS.info("DELETE:" + process //
LOGGER_ITEMS.info("DELETE:" + String.valueOf(process) // in case of null
+ ", item " + item.getObjectId() //
+ ":" + item.getItem().getName() //
+ "(" + item.getCount() //
+ "), PrevCount(" + old //
+ "), " + actor //
+ ", " + reference);
}
+ "), " + String.valueOf(actor) // in case of null
+ ", " + String.valueOf(reference)); // in case of null
}
}
}
if (actor != null)
{
if (actor.isGM())
if ((actor != null) && actor.isGM())
{
String referenceName = "no-reference";
if (reference instanceof L2Object)
@@ -388,7 +377,7 @@ public class ItemTable
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]" //
, process //
, String.valueOf(process) // in case of null
+ "(id: " + item.getId() //
+ " count: " + item.getCount() //
+ " itemObjId: " //
@@ -397,7 +386,6 @@ public class ItemTable
, "L2Object referencing this action is: " + referenceName);
}
}
}
// if it's a pet control item, delete the pet as well
if (item.getItem().isPetItem())