moved some stuff around to better reflect the code organization, hopefully

This commit is contained in:
13xforever
2018-07-20 01:55:54 +05:00
committed by Roberto Anić Banić
parent 6d3ac6c767
commit 833fa16ca9
27 changed files with 40 additions and 38 deletions

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using CompatBot.Attributes;
using CompatBot.Commands.Attributes;
using CompatBot.Database;
using CompatBot.Providers;
using CompatBot.Database.Providers;
using CompatBot.Utils;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;

View File

@@ -3,7 +3,7 @@ using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
namespace CompatBot.Attributes
namespace CompatBot.Commands.Attributes
{
internal abstract class CheckBaseAttributeWithReactions: CheckBaseAttribute
{

View File

@@ -1,9 +1,9 @@
using System;
using System.Threading.Tasks;
using CompatBot.Providers;
using CompatBot.Database.Providers;
using DSharpPlus.CommandsNext;
namespace CompatBot.Attributes
namespace CompatBot.Commands.Attributes
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
internal class RequiresBotModRole: CheckBaseAttributeWithReactions

View File

@@ -1,9 +1,9 @@
using System;
using System.Threading.Tasks;
using CompatBot.Providers;
using CompatBot.Database.Providers;
using DSharpPlus.CommandsNext;
namespace CompatBot.Attributes
namespace CompatBot.Commands.Attributes
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
internal class RequiresBotSudoerRole: CheckBaseAttributeWithReactions

View File

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
namespace CompatBot.Attributes
namespace CompatBot.Commands.Attributes
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
internal class RequiresDm: CheckBaseAttribute

View File

@@ -7,7 +7,7 @@ using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Converters;
using DSharpPlus.Entities;
namespace CompatBot.Converters
namespace CompatBot.Commands.Converters
{
internal sealed class CustomDiscordChannelConverter : IArgumentConverter<DiscordChannel>
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using CompatBot.Attributes;
using CompatBot.Commands.Attributes;
using CompatBot.Database;
using CompatBot.Utils;
using DSharpPlus;

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using CompatBot.Converters;
using CompatBot.Commands.Converters;
using CompatBot.Database;
using DSharpPlus;
using DSharpPlus.CommandsNext;

View File

@@ -1,6 +1,6 @@
using System.Text;
using System.Threading.Tasks;
using CompatBot.Providers;
using CompatBot.Database.Providers;
using CompatBot.Utils;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;

View File

@@ -1,5 +1,5 @@
using System.Threading.Tasks;
using CompatBot.Attributes;
using CompatBot.Commands.Attributes;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;

View File

@@ -3,9 +3,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CompatApiClient;
using CompatBot.Attributes;
using CompatBot.Commands.Attributes;
using CompatBot.Database;
using CompatBot.Providers;
using CompatBot.Database.Providers;
using CompatBot.Utils;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;

View File

@@ -3,7 +3,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CompatApiClient;
using CompatBot.Attributes;
using CompatBot.Commands.Attributes;
using CompatBot.Database;
using CompatBot.Utils;
using DSharpPlus;

View File

@@ -2,9 +2,8 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using CompatBot.Database;
namespace CompatBot.Providers
namespace CompatBot.Database.Providers
{
internal static class ModProvider
{

View File

@@ -2,11 +2,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CompatBot.Database;
using Microsoft.EntityFrameworkCore;
using NReco.Text;
namespace CompatBot.Providers
namespace CompatBot.Database.Providers
{
internal static class PiracyStringProvider
{

View File

@@ -2,7 +2,7 @@
using System.Threading.Tasks;
using CompatApiClient;
using CompatBot.Commands;
using CompatBot.Providers;
using CompatBot.Database.Providers;
using CompatBot.Utils;
using DSharpPlus;
using DSharpPlus.Entities;

View File

@@ -4,8 +4,9 @@ using System.Linq;
using System.Threading.Tasks;
using CompatApiClient;
using CompatBot.Commands;
using CompatBot.LogParsing;
using CompatBot.LogParsing.SourceHandlers;
using CompatBot.EventHandlers.LogParsing;
using CompatBot.EventHandlers.LogParsing.POCOs;
using CompatBot.EventHandlers.LogParsing.SourceHandlers;
using CompatBot.ResultFormatters;
using CompatBot.Utils;
using DSharpPlus;

View File

@@ -3,9 +3,10 @@ using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using CompatBot.Providers;
using CompatBot.Database.Providers;
using CompatBot.EventHandlers.LogParsing.POCOs;
namespace CompatBot.LogParsing
namespace CompatBot.EventHandlers.LogParsing
{
internal partial class LogParser
{

View File

@@ -4,9 +4,10 @@ using System.Collections.Generic;
using System.IO.Pipelines;
using System.Linq;
using System.Threading.Tasks;
using CompatBot.EventHandlers.LogParsing.POCOs;
using CompatBot.Utils;
namespace CompatBot.LogParsing
namespace CompatBot.EventHandlers.LogParsing
{
internal static partial class LogParser
{

View File

@@ -5,9 +5,10 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using CompatBot.EventHandlers.LogParsing.POCOs;
using NReco.Text;
namespace CompatBot.LogParsing
namespace CompatBot.EventHandlers.LogParsing
{
using SectionAction = KeyValuePair<string, Action<string, LogParseState>>;

View File

@@ -1,6 +1,6 @@
using System.Collections.Specialized;
namespace CompatBot.LogParsing
namespace CompatBot.EventHandlers.LogParsing.POCOs
{
internal class LogParseState
{

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace CompatBot.LogParsing
namespace CompatBot.EventHandlers.LogParsing.POCOs
{
internal class LogSection
{

View File

@@ -5,7 +5,7 @@ using System.Net.Http;
using System.Threading.Tasks;
using DSharpPlus.Entities;
namespace CompatBot.LogParsing.SourceHandlers
namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
{
public class GzipHandler: ISourceHandler
{
@@ -28,7 +28,7 @@ namespace CompatBot.LogParsing.SourceHandlers
{
var memory = writer.GetMemory(Config.MinimumBufferSize);
read = await gzipStream.ReadAsync(memory, Config.Cts.Token);
writer.Advance(read); //todo: test that .Advance(0) works as expected
writer.Advance(read);
flushed = await writer.FlushAsync(Config.Cts.Token).ConfigureAwait(false);
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || Config.Cts.IsCancellationRequested));
}

View File

@@ -2,7 +2,7 @@
using System.Threading.Tasks;
using DSharpPlus.Entities;
namespace CompatBot.LogParsing.SourceHandlers
namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
{
internal interface ISourceHandler
{

View File

@@ -4,7 +4,7 @@ using System.Net.Http;
using System.Threading.Tasks;
using DSharpPlus.Entities;
namespace CompatBot.LogParsing.SourceHandlers
namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
{
public class PlainTextHandler: ISourceHandler
{
@@ -26,7 +26,7 @@ namespace CompatBot.LogParsing.SourceHandlers
{
var memory = writer.GetMemory(Config.MinimumBufferSize);
read = await stream.ReadAsync(memory, Config.Cts.Token);
writer.Advance(read); //todo: test that .Advance(0) works as expected
writer.Advance(read);
flushed = await writer.FlushAsync(Config.Cts.Token).ConfigureAwait(false);
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || Config.Cts.IsCancellationRequested));
}

View File

@@ -10,7 +10,7 @@ using System.Threading.Tasks;
using CompatBot.Utils;
using DSharpPlus.Entities;
namespace CompatBot.LogParsing.SourceHandlers
namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
{
public class ZipHandler: ISourceHandler
{
@@ -65,7 +65,7 @@ namespace CompatBot.LogParsing.SourceHandlers
{
var memory = writer.GetMemory(Config.MinimumBufferSize);
read = await zipStream.ReadAsync(memory, Config.Cts.Token);
writer.Advance(read); //todo: test that .Advance(0) works as expected
writer.Advance(read);
flushed = await writer.FlushAsync(Config.Cts.Token).ConfigureAwait(false);
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || Config.Cts.IsCancellationRequested));
}

View File

@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using CompatBot.Commands;
using CompatBot.Converters;
using CompatBot.Commands.Converters;
using CompatBot.Database;
using CompatBot.EventHandlers;
using DSharpPlus;

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using CompatApiClient;
using CompatApiClient.POCOs;
using CompatBot.EventHandlers;
using CompatBot.LogParsing;
using CompatBot.EventHandlers.LogParsing.POCOs;
using DSharpPlus;
using DSharpPlus.Entities;