-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix NPC not working - Change how farmlist is sent - Remove old hero UI version - Optimize how bot execute task, it should pause lesser than before - Optimize how to tab things work - Optimize how things is loaded (it may delay in the first time you click it, but that it, everything later is faster) If you like my work, you can donate to me through [ko-fi.com/vinaghost](https://ko-fi.com/vinaghost)
- Loading branch information
Showing
325 changed files
with
8,563 additions
and
77,997 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using FluentMigrator.Runner; | ||
using MainCore.Helper.Implementations; | ||
using MainCore.Helper.Interface; | ||
using MainCore.Migrations; | ||
using MainCore.Services.Implementations; | ||
using MainCore.Services.Interface; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using ModuleCore.Parser; | ||
|
||
#if TRAVIAN_OFFICIAL | ||
|
||
using TravianOfficialCore.Parsers; | ||
|
||
#elif TTWARS | ||
|
||
using TTWarsCore.Parsers; | ||
|
||
#else | ||
|
||
#error You forgot to define Travian version here | ||
|
||
#endif | ||
|
||
namespace MainCore | ||
{ | ||
public static class DependencyInjectionCoreContainer | ||
{ | ||
private const string _connectionString = "DataSource=TBS.db;Cache=Shared"; | ||
|
||
public static IServiceCollection ConfigureServices(this IServiceCollection services) | ||
{ | ||
services.AddDbContextFactory<AppDbContext>(options => options.UseSqlite(_connectionString)); | ||
services.AddSingleton<IChromeManager, ChromeManager>(); | ||
services.AddSingleton<IRestClientManager, RestClientManager>(); | ||
services.AddSingleton<IUseragentManager, UseragentManager>(); | ||
services.AddSingleton<IEventManager, EventManager>(); | ||
services.AddSingleton<ITimerManager, TimerManager>(); | ||
services.AddSingleton<ITaskManager, TaskManager>(); | ||
services.AddSingleton<IPlanManager, PlanManager>(); | ||
services.AddSingleton<ILogManager, LogManager>(); | ||
|
||
services.AddFluentMigratorCore() | ||
.ConfigureRunner(rb => rb | ||
.AddSQLite() | ||
.WithGlobalConnectionString(_connectionString) | ||
.WithMigrationsIn(typeof(Farming).Assembly)); | ||
return services; | ||
} | ||
|
||
public static IServiceCollection ConfigureParser(this IServiceCollection services) | ||
{ | ||
services.AddSingleton<IBuildingTabParser, BuildingTabParser>(); | ||
services.AddSingleton<IFarmListParser, FarmListParser>(); | ||
services.AddSingleton<IHeroSectionParser, HeroSectionParser>(); | ||
services.AddSingleton<INavigationBarParser, NavigationBarParser>(); | ||
services.AddSingleton<IRightBarParser, RightBarParser>(); | ||
services.AddSingleton<IStockBarParser, StockBarParser>(); | ||
services.AddSingleton<ISubTabParser, SubTabParser>(); | ||
services.AddSingleton<ISystemPageParser, SystemPageParser>(); | ||
services.AddSingleton<IVillageCurrentlyBuildingParser, VillageCurrentlyBuildingParser>(); | ||
services.AddSingleton<IVillageFieldParser, VillageFieldParser>(); | ||
services.AddSingleton<IVillageInfrastructureParser, VillageInfrastructureParser>(); | ||
services.AddSingleton<IVillagesTableParser, VillagesTableParser>(); | ||
return services; | ||
} | ||
|
||
public static IServiceCollection ConfigureHelper(this IServiceCollection services) | ||
{ | ||
services.AddSingleton<IAccessHelper, AccessHelper>(); | ||
services.AddSingleton<IBuildingsHelper, BuildingsHelper>(); | ||
services.AddSingleton<ICheckHelper, CheckHelper>(); | ||
services.AddSingleton<IClickHelper, ClickHelper>(); | ||
services.AddSingleton<IGithubHelper, GithubHelper>(); | ||
services.AddSingleton<IHeroHelper, HeroHelper>(); | ||
services.AddSingleton<INavigateHelper, NavigateHelper>(); | ||
services.AddSingleton<IUpdateHelper, UpdateHelper>(); | ||
services.AddSingleton<IUpgradeBuildingHelper, UpgradeBuildingHelper>(); | ||
return services; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using FluentResults; | ||
|
||
namespace MainCore.Errors | ||
{ | ||
public class Cancel : Error | ||
{ | ||
public Cancel() | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using FluentResults; | ||
|
||
namespace MainCore.Errors | ||
{ | ||
public class Login : Error | ||
{ | ||
public Login() : base("Account is logged out.") | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using FluentResults; | ||
|
||
namespace MainCore.Errors | ||
{ | ||
public class NetworkProblem : Error | ||
{ | ||
public NetworkProblem(string message) : base($"{message}.") | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using FluentResults; | ||
|
||
namespace MainCore.Errors | ||
{ | ||
public class Retry : Error | ||
{ | ||
public Retry(string message) : base($"{message}. Bot must retry") | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using FluentResults; | ||
|
||
namespace MainCore.Errors | ||
{ | ||
public class Skip : Error | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using FluentResults; | ||
|
||
namespace MainCore.Errors | ||
{ | ||
public class Stop : Error | ||
{ | ||
public Stop(string message) : base($"{message}. Bot must stop") | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using FluentResults; | ||
|
||
namespace MainCore.Errors | ||
{ | ||
public class Trace : Error | ||
{ | ||
public Trace(string message) : base(message) | ||
{ | ||
} | ||
|
||
public static string TraceMessage( | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0) | ||
{ | ||
return $"from file: {sourceFilePath} [{sourceLineNumber - 1}]"; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.