Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Commit

Permalink
Added support for setting the WalletAmount through appsettings.json
Browse files Browse the repository at this point in the history
Removed the need for a HTTPS certificate
  • Loading branch information
LennardF1989 committed Jul 16, 2023
1 parent a42ab81 commit c1f9f9e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Src/HM5.Server/Controllers/Hitman/HitmanController.cs
Expand Up @@ -205,6 +205,7 @@ public abstract class BaseGetAverageScoresRequest : IEdmFunctionImport
};

private readonly IMetadataService _metadataService;
private readonly Options _options;

public HitmanController(
ISimpleLogger simpleLogger,
Expand All @@ -214,6 +215,7 @@ Options options
: base(simpleLogger)
{
_metadataService = metadataService;
_options = options;

//Apply options to the mocked contracts
_mockedContractWithoutCompetition.UserId = options.MockedContractSteamId;
Expand Down
Expand Up @@ -42,7 +42,7 @@ public IActionResult GetUserOverviewData([FromQuery] GetUserOverviewDataRequest
RichestAverage = 1337,
RichestRank = 1337,
TrophiesEarned = 1337,
WalletAmount = 1337
WalletAmount = _options.WalletAmount
});
}
}
Expand Down
Expand Up @@ -28,7 +28,7 @@ public class GetUserWalletRequest : IEdmFunctionImport
[Route("GetUserWallet")]
public IActionResult GetUserWallet([FromQuery] GetUserWalletRequest request)
{
return JsonOperationValueResponse(1_000_000);
return JsonOperationValueResponse(_options.WalletAmount);
}
}
}
1 change: 1 addition & 0 deletions Src/HM5.Server/Options.cs
Expand Up @@ -7,5 +7,6 @@ public class Options
public bool EnableRequestBodyLogging { get; set; } = false;
public bool EnableResponseBodyLogging { get; set; } = false;
public string MockedContractSteamId { get; set; } = "76561198161220058";
public int WalletAmount { get; set; } = 1337;
}
}
6 changes: 2 additions & 4 deletions Src/HM5.Server/appsettings.json
Expand Up @@ -3,9 +3,6 @@
"Endpoints": {
"Http": {
"Url": "http://localhost:80"
},
"Https": {
"Url": "https://localhost:443"
}
}
},
Expand All @@ -14,6 +11,7 @@
"EnableRequestLogging": true,
"EnableRequestBodyLogging": true,
"EnableResponseBodyLogging": true,
"MockedContractSteamId": "76561198161220058"
"MockedContractSteamId": "76561198161220058",
"WalletAmount": 1337
}
}

0 comments on commit c1f9f9e

Please sign in to comment.