Skip to content

Commit

Permalink
Add market type flag for gambling websites, for transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyskoedijk committed May 9, 2024
1 parent 79535a0 commit ec0de3d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions SCMM.Steam.Data.Models/Attributes/MarketAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public MarketAttribute(params ulong[] supportAppIds)

public bool IsFirstParty { get; set; }

public bool IsCasino { get; set; }

public string Color { get; set; }

public string AffiliateUrl { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion SCMM.Steam.Data.Models/Enums/MarketType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public enum MarketType : byte
SkinSerpent = 35,

[Display(Name = "Rustyloot.gg")]
[Market(Constants.RustAppId, Color = "#ffb135", AffiliateUrl = "https://rustyloot.gg/r/SCMM")]
[Market(Constants.RustAppId, Color = "#ffb135", IsCasino = true, AffiliateUrl = "https://rustyloot.gg/r/SCMM")]
[BuyFrom(Url = "https://rustyloot.gg/r/SCMM?withdraw=true&rust=true", AcceptedPayments = PriceFlags.Trade | PriceFlags.Cash | PriceFlags.Crypto,
HouseCurrencyName = "Coin", HouseCurrencyScale = 2, HouseCurrencyToUsdExchangeRate = 0.64516129032258064516129032258065)]
Rustyloot = 36,
Expand Down
5 changes: 5 additions & 0 deletions SCMM.Steam.Data.Models/Extensions/MarketExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public static bool IsFirstParty(this MarketType marketType)
return GetCustomAttribute<MarketAttribute>(marketType)?.IsFirstParty ?? false;
}

public static bool IsCasino(this MarketType marketType)
{
return GetCustomAttribute<MarketAttribute>(marketType)?.IsCasino ?? false;
}

public static bool IsAppSupported(this MarketType marketType, ulong appId)
{
return GetSupportedAppIds(marketType)?.Contains(appId) == true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,11 @@
<p>
@if (price.Fee > 0)
{
<span>This price includes @State.Currency.ToPriceString(price.Fee) in estimated fees charged by @price.MarketType.GetDisplayName() payment providers</span>
<span>This price includes @State.Currency.ToPriceString(price.Fee) in estimated fees charged by @price.MarketType.GetDisplayName() or their payment providers</span>
}
else
{
<span>This price includes @State.Currency.ToPriceString(price.Fee) in estimate discounts gained by purchasing @price.MarketType.GetDisplayName() balance</span>
<span>This price includes @State.Currency.ToPriceString(price.Fee) in estimated bonus balance from purchasing @price.MarketType.GetDisplayName() balance</span>
}
</p>
}
Expand All @@ -689,6 +689,18 @@
</ChildContent>
</MudTooltip>
}
@if (price.MarketType.IsCasino())
{
<MudTooltip>
<TooltipContent>
<p>@price.MarketType.GetDisplayName() is a gambling website. There <i>might</i> be restrictions on deposits and withdraws, such as minimum wagers.</p>
<p>Make sure you read the @price.MarketType.GetDisplayName() terms of service, ensure you are legally allowed to gamble and that you fully understand the risks of gambling.</p>
</TooltipContent>
<ChildContent>
<i class="fa fa-fw fa-dice ml-1"></i>
</ChildContent>
</MudTooltip>
}
}
else
{
Expand Down

0 comments on commit ec0de3d

Please sign in to comment.