Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1bddde4
Implemented GameType enum to determine the source game
leMicin Dec 10, 2024
646b45b
Added Path of Exile 2 leagues to the league selection.
leMicin Dec 10, 2024
bc3b7c1
Fixed trade links
leMicin Dec 10, 2024
d2defc3
Improved league display on results
leMicin Dec 10, 2024
bf5a3a7
Fixed setup prompting on every run
leMicin Dec 10, 2024
5333c6a
Improved ease of use of game language provider
leMicin Dec 10, 2024
c5bf747
Organized the test project to start creating Poe2 parser tests
leMicin Dec 10, 2024
9b11945
Added boot parsing for PoE 2
leMicin Dec 11, 2024
f8e24aa
Allow more flexibility in initialization priorities. Also fixed a sce…
leMicin Dec 11, 2024
25a5825
Parse sockets
leMicin Dec 11, 2024
695b0cf
Improvements to the modifier parsing
leMicin Dec 11, 2024
131267f
Isolated SocketParser and first unit test pass
leMicin Dec 11, 2024
0bbcc66
Progress on parsing filters and classes
leMicin Dec 11, 2024
d0c7d52
Fixed issues when running the program because of missing classes
leMicin Dec 11, 2024
1392c25
Implemented PoE2 modifier parsing
leMicin Dec 11, 2024
a81fb72
Add basic support for the API item categories
domialex Dec 11, 2024
b03ab4b
Add metadataprovider call for the api item categories
domialex Dec 11, 2024
394d146
Merge branch 'feature/poe2' of https://github.com/Sidekick-Poe/Sideki…
domialex Dec 11, 2024
cd2ec58
Updated unit tests
leMicin Dec 11, 2024
9f83d56
Incremented version to 4.0
leMicin Dec 11, 2024
e931f7e
Removed ClassEnum and adjusted all relevant unit tests.
leMicin Dec 11, 2024
eecc3d1
Implemented trade search filters and updated trade search visuals for…
leMicin Dec 11, 2024
bf0d015
Update the default currency settings when changing games.
leMicin Dec 11, 2024
258e626
Fixed the item category filter
leMicin Dec 11, 2024
0094d9d
Fixed parsed flags not being updated
leMicin Dec 11, 2024
1027f23
Added comments to explain the new socket colours
leMicin Dec 11, 2024
0683694
Implemented the right order when initializing services
leMicin Dec 11, 2024
960c0da
Removed pseudo modifiers for PoE2
leMicin Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 28 additions & 24 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ dotnet_naming_symbols.types_and_namespaces_symbols.applicable_kinds = namespace,
dotnet_naming_symbols.type_parameters_symbols.applicable_accessibilities = *
dotnet_naming_symbols.type_parameters_symbols.applicable_kinds = type_parameter
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
dotnet_separate_import_directive_groups = false
Expand All @@ -508,7 +508,7 @@ dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
file_header_template =
file_header_template =
fsharp_align_function_signature_to_indentation = false
fsharp_alternative_long_member_definitions = false
fsharp_indent_on_try_with = false
Expand Down Expand Up @@ -659,13 +659,15 @@ resharper_cpp_wrap_lines = true
resharper_cpp_wrap_multiple_type_parameter_constraints_style = chop_if_long
resharper_cpp_wrap_parameters_style = wrap_if_long
resharper_csharp_align_multiline_binary_expressions_chain = true
resharper_csharp_align_multiline_calls_chain = false
resharper_csharp_align_multiline_expression = false
resharper_csharp_align_multiline_for_stmt = false
resharper_csharp_blank_lines_around_single_line_invocable = 1
resharper_csharp_case_block_braces = next_line_shifted_2
resharper_csharp_empty_block_style = multiline
resharper_csharp_keep_blank_lines_in_code = 1
resharper_csharp_keep_blank_lines_in_declarations = 1
resharper_csharp_keep_existing_enum_arrangement = false
resharper_csharp_keep_nontrivial_alias = false
resharper_csharp_max_line_length = 3073
resharper_csharp_naming_rule.enum_member = AaBb
Expand All @@ -676,13 +678,14 @@ resharper_csharp_space_after_unary_operator = false
resharper_csharp_space_around_alias_eq = false
resharper_csharp_stick_comment = false
resharper_csharp_wrap_after_declaration_lpar = true
resharper_csharp_wrap_after_invocation_lpar = true
resharper_csharp_wrap_after_invocation_lpar = false
resharper_csharp_wrap_arguments_style = chop_if_long
resharper_csharp_wrap_before_binary_opsign = true
resharper_csharp_wrap_before_first_type_parameter_constraint = true
resharper_csharp_wrap_before_ternary_opsigns = false
resharper_csharp_wrap_extends_list_style = chop_if_long
resharper_csharp_wrap_lines = true
resharper_csharp_wrap_multiple_declaration_style = chop_always
resharper_csharp_wrap_multiple_type_parameter_constraints_style = chop_always
resharper_csharp_wrap_parameters_style = chop_if_long
resharper_cxxcli_property_declaration_braces = next_line
Expand Down Expand Up @@ -712,8 +715,8 @@ resharper_force_attribute_style = separate
resharper_force_chop_compound_do_expression = false
resharper_force_chop_compound_if_expression = false
resharper_force_chop_compound_while_expression = false
resharper_formatter_off_tag =
resharper_formatter_on_tag =
resharper_formatter_off_tag =
resharper_formatter_on_tag =
resharper_formatter_tags_accept_regexp = false
resharper_formatter_tags_enabled = false
resharper_format_leading_spaces_decl = false
Expand Down Expand Up @@ -757,7 +760,7 @@ resharper_indent_nested_while_stmt = false
resharper_indent_pars = inside
resharper_indent_preprocessor_directives = none
resharper_indent_preprocessor_if = no_indent
resharper_indent_preprocessor_other = do_not_change
resharper_indent_preprocessor_other = no_indent
resharper_indent_preprocessor_region = usual_indent
resharper_indent_primary_constructor_decl_pars = inside
resharper_indent_raw_literal_string = align
Expand All @@ -776,13 +779,14 @@ resharper_int_align_enum_initializers = false
resharper_int_align_eq = false
resharper_int_align_fix_in_adjacent = true
resharper_keep_existing_attribute_arrangement = false
resharper_keep_existing_declaration_block_arrangement = false
resharper_keep_existing_declaration_parens_arrangement = false
resharper_keep_existing_embedded_arrangement = false
resharper_keep_existing_expr_member_arrangement = false
resharper_keep_existing_invocation_parens_arrangement = false
resharper_keep_existing_linebreaks = false
resharper_keep_existing_line_break_before_declaration_body = true
resharper_keep_existing_list_patterns_arrangement = false
resharper_keep_existing_list_patterns_arrangement = true
resharper_keep_existing_primary_constructor_declaration_parens_arrangement = false
resharper_keep_existing_property_patterns_arrangement = false
resharper_keep_existing_switch_expression_arrangement = false
Expand All @@ -806,19 +810,19 @@ resharper_line_break_before_requires_clause = do_not_change
resharper_linkage_specification_braces = end_of_line
resharper_linkage_specification_indentation = none
resharper_local_function_body = block_body
resharper_macro_block_begin =
resharper_macro_block_end =
resharper_macro_block_begin =
resharper_macro_block_end =
resharper_max_array_initializer_elements_on_line = 1
resharper_max_attribute_length_for_same_line = 10000
resharper_max_enum_members_on_line = 1
resharper_max_formal_parameters_on_line = 1
resharper_max_formal_parameters_on_line = 6
resharper_max_initializer_elements_on_line = 1
resharper_max_invocation_arguments_on_line = 3
resharper_max_invocation_arguments_on_line = 6
resharper_max_primary_constructor_parameters_on_line = 1
resharper_member_initializer_list_style = do_not_change
resharper_namespace_declaration_braces = next_line
resharper_namespace_indentation = all
resharper_nested_ternary_style = autodetect
resharper_nested_ternary_style = compact
resharper_never_outdent_pipe_operators = true
resharper_new_line_before_catch = true
resharper_new_line_before_else = true
Expand Down Expand Up @@ -848,12 +852,12 @@ resharper_place_accessor_attribute_on_same_line = if_owner_is_single_line
resharper_place_comments_at_first_column = false
resharper_place_constructor_initializer_on_same_line = false
resharper_place_event_attribute_on_same_line = false
resharper_place_expr_accessor_on_single_line = if_owner_is_single_line
resharper_place_expr_accessor_on_single_line = true
resharper_place_expr_method_on_single_line = true
resharper_place_expr_property_on_single_line = true
resharper_place_field_attribute_on_same_line = false
resharper_place_linq_into_on_new_line = true
resharper_place_method_attribute_on_same_line = if_owner_is_single_line
resharper_place_linq_into_on_new_line = false
resharper_place_method_attribute_on_same_line = false
resharper_place_namespace_definitions_on_same_line = false
resharper_place_property_attribute_on_same_line = false
resharper_place_record_field_attribute_on_same_line = if_owner_is_single_line
Expand All @@ -880,7 +884,7 @@ resharper_remove_unused_only_aliases = false
resharper_requires_expression_braces = next_line
resharper_resx_attribute_indent = single_indent
resharper_resx_keep_user_linebreaks = true
resharper_resx_linebreak_before_elements =
resharper_resx_linebreak_before_elements =
resharper_resx_max_blank_lines_between_tags = 0
resharper_resx_max_line_length = 2147483647
resharper_resx_pi_attribute_style = do_not_touch
Expand Down Expand Up @@ -1091,23 +1095,23 @@ resharper_wrap_before_declaration_rpar = false
resharper_wrap_before_eq = false
resharper_wrap_before_expression_rbrace = true
resharper_wrap_before_extends_colon = true
resharper_wrap_before_first_method_call = true
resharper_wrap_before_first_method_call = false
resharper_wrap_before_invocation_lpar = false
resharper_wrap_before_invocation_rpar = false
resharper_wrap_before_linq_expression = false
resharper_wrap_before_primary_constructor_declaration_lpar = false
resharper_wrap_before_primary_constructor_declaration_rpar = false
resharper_wrap_before_primary_constructor_declaration_lpar = true
resharper_wrap_before_primary_constructor_declaration_rpar = true
resharper_wrap_before_type_parameter_langle = false
resharper_wrap_braced_init_list_style = wrap_if_long
resharper_wrap_chained_binary_expressions = chop_if_long
resharper_wrap_chained_binary_patterns = chop_if_long
resharper_wrap_chained_method_calls = chop_always
resharper_wrap_chained_method_calls = chop_if_long
resharper_wrap_ctor_initializer_style = wrap_if_long
resharper_wrap_enumeration_style = chop_if_long
resharper_wrap_enum_declaration = chop_always
resharper_wrap_for_stmt_header_style = chop_if_long
resharper_wrap_linq_expressions = chop_always
resharper_wrap_list_pattern = chop_always
resharper_wrap_list_pattern = chop_if_long
resharper_wrap_multiple_declaration_style = chop_if_long
resharper_wrap_primary_constructor_parameters_style = chop_if_long
resharper_wrap_property_pattern = chop_always
Expand All @@ -1126,7 +1130,7 @@ resharper_xmldoc_wrap_tags_and_pi = true
resharper_xmldoc_wrap_text = true
resharper_xml_attribute_indent = align_by_first_attribute
resharper_xml_keep_user_linebreaks = true
resharper_xml_linebreak_before_elements =
resharper_xml_linebreak_before_elements =
resharper_xml_max_blank_lines_between_tags = 2
resharper_xml_max_line_length = 120
resharper_xml_pi_attribute_style = do_not_touch
Expand Down Expand Up @@ -3897,7 +3901,7 @@ dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static

dotnet_naming_style.static_field_style.capitalization = camel_case
dotnet_naming_style.static_field_style.required_prefix =
dotnet_naming_style.static_field_style.required_prefix =

# Instance fields are camelCase
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
Expand All @@ -3907,7 +3911,7 @@ dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_s
dotnet_naming_symbols.instance_fields.applicable_kinds = field

dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix =
dotnet_naming_style.instance_field_style.required_prefix =

# Locals and parameters are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
Expand Down
Binary file added Game Localization.xlsm
Binary file not shown.
Binary file removed Game Localiztion.xlsm
Binary file not shown.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 3.0
next-version: 4.0
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatchTag
assembly-informational-format: '{Major}.{Minor}.{Patch}.{BuildMetaData}'
Expand Down
8 changes: 0 additions & 8 deletions src/Sidekick.Apis.Poe/Authentication/AuthenticationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Text.Json;
using Sidekick.Apis.Poe.Authentication.Models;
using Sidekick.Common.Browser;
using Sidekick.Common.Initialization;
using Sidekick.Common.Platform.Interprocess;
using Sidekick.Common.Settings;

Expand Down Expand Up @@ -46,13 +45,6 @@ public AuthenticationService(

private TaskCompletionSource? AuthenticateTask { get; set; }

public InitializationPriority Priority => InitializationPriority.Low;

public Task Initialize()
{
return Task.CompletedTask;
}

public async Task<AuthenticationState> GetCurrentState()
{
if (AuthenticateTask != null && AuthenticateTask.Task.Status != TaskStatus.RanToCompletion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Sidekick.Apis.Poe.Authentication
{
public interface IAuthenticationService : IInitializableService
public interface IAuthenticationService
{
event Action? OnStateChanged;

Expand Down
18 changes: 5 additions & 13 deletions src/Sidekick.Apis.Poe/Bulk/BulkTradeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Sidekick.Apis.Poe.Trade.Results;
using Sidekick.Common.Enums;
using Sidekick.Common.Exceptions;
using Sidekick.Common.Extensions;
using Sidekick.Common.Game.Items;
using Sidekick.Common.Game.Languages;
using Sidekick.Common.Settings;
Expand All @@ -33,13 +34,8 @@ public async Task<BulkResponseModel> SearchBulk(Item item, TradeCurrency currenc
{
logger.LogInformation("[Trade API] Querying Exchange API.");

if (gameLanguageProvider.Language == null)
{
throw new ApiErrorException("[Trade API] Could not find a valid language.");
}

var leagueId = await settingsService.GetString(SettingKeys.LeagueId);
var uri = $"{gameLanguageProvider.Language.PoeTradeApiBaseUrl}exchange/{leagueId}";
var uri = $"{gameLanguageProvider.Language.GetTradeApiBaseUrl(item.Metadata.Game)}exchange/{leagueId.GetUrlSlugForLeague()}";

var itemId = itemStaticDataProvider.GetId(item.Metadata);
if (itemId == null)
Expand Down Expand Up @@ -102,14 +98,10 @@ public async Task<BulkResponseModel> SearchBulk(Item item, TradeCurrency currenc

public async Task<Uri> GetTradeUri(Item item, string queryId)
{
var baseUri = gameLanguageProvider.Language?.PoeTradeExchangeBaseUrl;
if (baseUri == null)
{
throw new Exception("[Trade API] Could not find the trade uri.");
}

var baseUrl = gameLanguageProvider.Language.GetTradeBaseUrl(item.Metadata.Game);
var baseUri = new Uri(baseUrl + "exchange/");
var leagueId = await settingsService.GetString(SettingKeys.LeagueId);
return new Uri(baseUri, $"{leagueId}/{queryId}");
return new Uri(baseUri, $"{leagueId.GetUrlSlugForLeague()}/{queryId}");
}
}
}
8 changes: 0 additions & 8 deletions src/Sidekick.Apis.Poe/Clients/ClientNames.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Sidekick.Apis.Poe.Clients
namespace Sidekick.Apis.Poe.Clients.Exceptions
{
[Serializable]
public class PoeApiException : Exception
Expand Down
7 changes: 0 additions & 7 deletions src/Sidekick.Apis.Poe/Clients/FetchResult.cs

This file was deleted.

11 changes: 3 additions & 8 deletions src/Sidekick.Apis.Poe/Clients/IPoeApiClient.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System.Text.Json;
namespace Sidekick.Apis.Poe.Clients;

namespace Sidekick.Apis.Poe.Clients
public interface IPoeApiClient
{
public interface IPoeApiClient
{
JsonSerializerOptions Options { get; }

Task<TReturn?> Fetch<TReturn>(string path);
}
Task<TReturn?> Fetch<TReturn>(string path);
}
16 changes: 9 additions & 7 deletions src/Sidekick.Apis.Poe/Clients/IPoeTradeClient.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
using System.Text.Json;
using Sidekick.Apis.Poe.Clients.Models;
using Sidekick.Common.Game;
using Sidekick.Common.Game.Languages;

namespace Sidekick.Apis.Poe.Clients
namespace Sidekick.Apis.Poe.Clients;

public interface IPoeTradeClient
{
public interface IPoeTradeClient
{
HttpClient HttpClient { get; set; }
HttpClient HttpClient { get; }

JsonSerializerOptions Options { get; }
JsonSerializerOptions Options { get; }

Task<FetchResult<TReturn>> Fetch<TReturn>(string path, bool useDefaultLanguage = false);
}
Task<FetchResult<TReturn>> Fetch<TReturn>(GameType game, IGameLanguage language, string path);
}
8 changes: 8 additions & 0 deletions src/Sidekick.Apis.Poe/Clients/Models/ClientNames.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Sidekick.Apis.Poe.Clients.Models
{
public static class ClientNames
{
public const string PoeClient = "PoeClient";
public const string TradeClient = "PoeTradeClient";
}
}
7 changes: 7 additions & 0 deletions src/Sidekick.Apis.Poe/Clients/Models/FetchResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Sidekick.Apis.Poe.Clients.Models
{
public class FetchResult<T>
{
public List<T> Result { get; init; } = new();
}
}
Loading
Loading