/// <summary> /// Log an action of player's inventory (loot, buy, trade, etc...) /// </summary> /// <param name="source">Source of the item</param> /// <param name="destination">Destination of the item</param> /// <param name="type">Type of action (trade, loot, quest, ...)</param> /// <param name="item">The item or money account traded</param> public static void LogInventoryAction(string source, string destination, eInventoryActionType type, long money) { // Check if you can log this action if (!_IsLoggingEnabled(type)) { return; } string format; if (!ActionXformat.TryGetValue(type, out format)) { return; // Error, this format does not exists ?! } try { GameServer.Instance.LogInventoryAction(string.Format(format, source ?? "(null)", destination ?? "(null)", GetMoneyString(money))); } catch (Exception e) { if (log.IsErrorEnabled) { log.Error("Log inventory error", e); } } }
private static bool _IsLoggingEnabled(eInventoryActionType type) { if (!ServerProperties.Properties.LOG_INVENTORY) { return(false); } switch (type) { case eInventoryActionType.Trade: return(ServerProperties.Properties.LOG_INVENTORY_TRADE); case eInventoryActionType.Loot: return(ServerProperties.Properties.LOG_INVENTORY_LOOT); case eInventoryActionType.Craft: return(ServerProperties.Properties.LOG_INVENTORY_CRAFT); case eInventoryActionType.Merchant: return(ServerProperties.Properties.LOG_INVENTORY_MERCHANT); case eInventoryActionType.Quest: return(ServerProperties.Properties.LOG_INVENTORY_QUEST); case eInventoryActionType.Other: return(ServerProperties.Properties.LOG_INVENTORY_OTHER); } return(false); }
/// <summary> /// Log an action of player's inventory (loot, buy, trade, etc...) /// </summary> /// <param name="source">Source of the item</param> /// <param name="destination">Destination of the item</param> /// <param name="type">Type of action (trade, loot, quest, ...)</param> /// <param name="item">The item or money account traded</param> public static void LogInventoryAction(GameObject source, string destination, eInventoryActionType type, ItemTemplate item, int count = 1) { LogInventoryAction(GetGameObjectString(source), destination, type, item, count); }
/// <summary> /// Log an action of player's inventory (loot, buy, trade, etc...) /// </summary> /// <param name="source">Source of the item</param> /// <param name="destination">Destination of the item</param> /// <param name="type">Type of action (trade, loot, quest, ...)</param> /// <param name="item">The item or money account traded</param> public static void LogInventoryAction(string source, GameObject destination, eInventoryActionType type, ItemTemplate item, int count = 1) { LogInventoryAction(source, GetGameObjectString(destination), type, item, count); }
private static bool _IsLoggingEnabled(eInventoryActionType type) { if (!ServerProperties.Properties.LOG_INVENTORY) return false; switch (type) { case eInventoryActionType.Trade: return ServerProperties.Properties.LOG_INVENTORY_TRADE; case eInventoryActionType.Loot: return ServerProperties.Properties.LOG_INVENTORY_LOOT; case eInventoryActionType.Craft: return ServerProperties.Properties.LOG_INVENTORY_CRAFT; case eInventoryActionType.Merchant: return ServerProperties.Properties.LOG_INVENTORY_MERCHANT; case eInventoryActionType.Quest: return ServerProperties.Properties.LOG_INVENTORY_QUEST; case eInventoryActionType.Other: return ServerProperties.Properties.LOG_INVENTORY_OTHER; } return false; }
/// <summary> /// Log an action of player's inventory (loot, buy, trade, etc...) /// </summary> /// <param name="source">Source of the item</param> /// <param name="destination">Destination of the item</param> /// <param name="type">Type of action (trade, loot, quest, ...)</param> /// <param name="item">The item or money account traded</param> public static void LogInventoryAction(string source, string destination, eInventoryActionType type, long money) { // Check if you can log this action if (!_IsLoggingEnabled(type)) return; string format; if (!ActionXformat.TryGetValue(type, out format)) return; // Error, this format does not exists ?! try { GameServer.Instance.LogInventoryAction(string.Format(format, source ?? "(null)", destination ?? "(null)", GetMoneyString(money))); } catch (Exception e) { if (log.IsErrorEnabled) log.Error("Log inventory error", e); } }
/// <summary> /// Log an action of player's inventory (loot, buy, trade, etc...) /// </summary> /// <param name="source">Source of the item</param> /// <param name="destination">Destination of the item</param> /// <param name="type">Type of action (trade, loot, quest, ...)</param> /// <param name="item">The item or money account traded</param> public static void LogInventoryAction(GameObject source, string destination, eInventoryActionType type, long money) { LogInventoryAction(GetGameObjectString(source), destination, type, money); }
/// <summary> /// Log an action of player's inventory (loot, buy, trade, etc...) /// </summary> /// <param name="source">Source of the item</param> /// <param name="destination">Destination of the item</param> /// <param name="type">Type of action (trade, loot, quest, ...)</param> /// <param name="item">The item or money account traded</param> public static void LogInventoryAction(string source, GameObject destination, eInventoryActionType type, long money) { LogInventoryAction(source, GetGameObjectString(destination), type, money); }