Example #1
0
 public static async void CreateEntryAsync(ItemDropLogInfo info)
 {
     if (!info.IsValid)
     {
         TShock.Log.ConsoleError("ItemDropLogger tried to create an entry based on invalid info.");
         return;
     }
     await Task.Run(() =>
     {
         ItemDropLogPlugin.db.Query("INSERT INTO `ItemLog` (`Timestamp`,`ServerName`,`SourcePlayerName`,`SourceIP`,`TargetPlayerName`,`TargetIP`,`Action`,`DropX`,`DropY`,`ItemNetId`,`ItemName`,`ItemStack`,`ItemPrefix`) VALUES (@0,@1,@2,@3,@4,@5,@6,@7,@8,@9,@10,@11,@12)", new object[]
         {
             info.Timestamp.ToString("s"),
             info.ServerName,
             info.SourcePlayerName,
             info.SourceIP,
             info.TargetPlayerName,
             info.TargetIP,
             info.Action,
             info.DropX,
             info.DropY,
             info.ItemNetId,
             info.ItemName,
             info.ItemStack,
             info.ItemPrefix
         });
     });
 }
Example #2
0
		public static async void CreateEntryAsync(ItemDropLogInfo info)
		{
			if (!info.IsValid)
			{
				TShock.Log.ConsoleError("ItemDropLogger tried to create an entry based on invalid info.");
				return;
			}
            await Task.Run(() =>
            {
                ItemDropLogPlugin.db.Query("INSERT INTO `ItemLog` (`Timestamp`,`ServerName`,`SourcePlayerName`,`SourceIP`,`TargetPlayerName`,`TargetIP`,`Action`,`DropX`,`DropY`,`ItemNetId`,`ItemName`,`ItemStack`,`ItemPrefix`) VALUES (@0,@1,@2,@3,@4,@5,@6,@7,@8,@9,@10,@11,@12)", new object[]
                {
                    info.Timestamp.ToString("s"),
                    info.ServerName,
                    info.SourcePlayerName,
                    info.SourceIP,
                    info.TargetPlayerName,
                    info.TargetIP,
                    info.Action,
                    info.DropX,
                    info.DropY,
                    info.ItemNetId,
                    info.ItemName,
                    info.ItemStack,
                    info.ItemPrefix
                });
            });
		}
Example #3
0
 internal static void UpdateItemEntry(ItemDropLogInfo info)
 {
     ItemDropLogPlugin.db.Query("UPDATE `ItemLog` SET `TargetPlayerName`=@0, `TargetIP`=@1, `Action`=@2 WHERE `ServerName`=@3 AND `Action`=@4 AND `SourcePlayerName`=@5 AND `ItemNetId`=@6 AND `ItemStack`=@7 AND `ItemPrefix`=@8", new object[]
     {
         info.TargetPlayerName,
         info.TargetIP,
         info.Action,
         info.ServerName,
         "PlayerDrop",
         info.SourcePlayerName,
         info.ItemNetId,
         info.ItemStack,
         info.ItemPrefix
     });
 }
Example #4
0
 internal static void CreateItemEntry(ItemDropLogInfo info)
 {
     ItemDropLogPlugin.db.Query("INSERT INTO `ItemLog` (`Timestamp`,`ServerName`,`SourcePlayerName`,`SourceIP`,`Action`,`DropX`,`DropY`,`ItemNetId`,`ItemName`,`ItemStack`,`ItemPrefix`) VALUES (@0,@1,@2,@3,@4,@5,@6,@7,@8,@9,@10)", new object[]
     {
         info.Timestamp.ToString("s"),
         info.ServerName,
         info.SourcePlayerName,
         info.SourceIP,
         info.Action,
         info.DropX,
         info.DropY,
         info.ItemNetId,
         info.ItemName,
         info.ItemStack,
         info.ItemPrefix
     });
 }
Example #5
0
		internal static async void UpdateItemEntryAsync(ItemDropLogInfo info)
		{
            await Task.Run(() =>
            {
                ItemDropLogPlugin.db.Query("UPDATE `ItemLog` SET `TargetPlayerName`=@0, `TargetIP`=@1, `Action`=@2 WHERE `ServerName`=@3 AND `Action`=@4 AND `SourcePlayerName`=@5 AND `ItemNetId`=@6 AND `ItemStack`=@7 AND `ItemPrefix`=@8", new object[]
                {
                    info.TargetPlayerName,
                    info.TargetIP,
                    info.Action,
                    info.ServerName,
                    "PlayerDrop",
                    info.SourcePlayerName,
                    info.ItemNetId,
                    info.ItemStack,
                    info.ItemPrefix
                });
            });
		}
Example #6
0
		internal static async void CreateItemEntryAsync(ItemDropLogInfo info)
		{
            await Task.Run(() =>
            {
                ItemDropLogPlugin.db.Query("INSERT INTO `ItemLog` (`Timestamp`,`ServerName`,`SourcePlayerName`,`SourceIP`,`Action`,`DropX`,`DropY`,`ItemNetId`,`ItemName`,`ItemStack`,`ItemPrefix`) VALUES (@0,@1,@2,@3,@4,@5,@6,@7,@8,@9,@10)", new object[]
                {
                    info.Timestamp.ToString("s"),
                    info.ServerName,
                    info.SourcePlayerName,
                    info.SourceIP,
                    info.Action,
                    info.DropX,
                    info.DropY,
                    info.ItemNetId,
                    info.ItemName,
                    info.ItemStack,
                    info.ItemPrefix
                });
            });
		}
Example #7
0
 public ItemDropLogInfo(string action, string sourcePlayerName, string targetPlayerName, int itemNetId, int itemStack, int itemPrefix)
 {
     this = new ItemDropLogInfo(action, sourcePlayerName, targetPlayerName, itemNetId, itemStack, itemPrefix, 0f, 0f);
 }
Example #8
0
 public ItemDropLogInfo(string action, string sourcePlayerName, string targetPlayerName, int itemNetId, int itemStack, int itemPrefix)
 {
     this = new ItemDropLogInfo(action, sourcePlayerName, targetPlayerName, itemNetId, itemStack, itemPrefix, 0f, 0f);
 }