1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Refactor item purchase logic into core, implement promo codes #70

This commit is contained in:
NG (Graham)
2026-01-03 11:19:24 -05:00
parent 2c6ef3edbe
commit 2f826835dc
10 changed files with 298 additions and 68 deletions

View File

@@ -37,6 +37,7 @@ pub trait ConfigProvider<C: Clone> {
fn pit_settings(&self) -> PitSettings;
fn tdm_settings(&self) -> TeamDeathMatchSettings;
fn shop_entries(&self) -> ShopEntriesResolver;
fn promo_codes(&self) -> std::collections::HashMap<String, PromoCode>;
}
pub struct DevMessageProvider<C: Clone> {
@@ -486,3 +487,13 @@ pub enum ShopGain {
PaidCurrency(i64),
TechPoints(i32)
}
#[derive(Debug)]
pub struct PromoCode {
pub message: Option<String>,
pub bundle_id: String,
pub promo_id: String,
pub is_serial: bool,
pub value: f32,
pub transaction: ShopAction,
}