Ejemplo n.º 1
0
        /// <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);
                }
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
		/// <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);
		}
Ejemplo n.º 4
0
		/// <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);
		}
Ejemplo n.º 5
0
		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;
		}
Ejemplo n.º 6
0
		/// <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);
			}
		}
Ejemplo n.º 7
0
		/// <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);
		}
Ejemplo n.º 8
0
		/// <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);
		}
Ejemplo n.º 9
0
 /// <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);
 }
Ejemplo n.º 10
0
 /// <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);
 }
Ejemplo n.º 11
0
 /// <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);
 }
Ejemplo n.º 12
0
 /// <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);
 }