Skip to main content

PickupEventStreamLogger

A static class in Root.Township, Alta.Inventory.Pickups.Scripts.

Server: reports pickup, drop, dock and undock actions to the console InventoryChanged event. Skipped in local test scenes.

Fields​

1 private and internal field
MemberWhat it is
private static Logger loggerLogger for this class.

Methods​

MemberWhat it is
static void TryLogDockedEvent(Interactor interactor, Pickup pickup, PickupDock dock, int quantity)Reports an item docked, as player or world inventory depending on the dock's owner.
static void TryLogDropEvent(Interactor interactor, Pickup pickup, int quantity)Reports an item dropped into the world.
static void TryLogPickupEvent(Interactor interactor, Pickup pickup, int quantity)Reports an item picked up from the world.
static void TryLogUndockEvent(Interactor interactor, Pickup pickup, PickupDock dock, int quantity)Reports an item undocked, as player or world inventory depending on the dock's owner.
8 private and internal methods
MemberWhat it is
private static bool CanInvokeLog(Pickup pickup, int quantity)True only on a real server, for a network initialized pickup and a non-zero quantity.
private static uint? GetItemHash(bool isPouch, Item pouchItem, Item pickupItem)Hash of the item, or the pouch's item for a pouch.
private static string GetItemName(bool isPouch, Item pouchItem, Item pickupItem)Name of the item, or the pouch's item for a pouch.
private static string GetPhysicalMaterial(bool isPouch, Pickup pickup)The pickup's physical material as a string; empty for pouches.
private static string GetSaveString(NetworkEntity entity)The entity's save as a string.
private static UserInfo GetUserInfoFromDock(PickupDock dock)The user info of the player who owns a dock, or null.
private static UserInfo GetUserInfoFromInteractor(Interactor interactor)The player user info behind an interactor, or null.
private static void LogInventoryChangeWithConsoleEvents(PickupActionData pickupAction)Fills an InventoryChangeData (user, item, material, quantity, save string) and fires the console event. Only when the interactor is a player.