mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-26 09:38:32 +01:00
fix: enforce operated paid mode contracts
This commit is contained in:
@@ -1258,6 +1258,27 @@ class GameModeManager {
|
||||
};
|
||||
}
|
||||
|
||||
getPublicPreferredPaymentMode(user) {
|
||||
if (!this.paymentsEnabled) {
|
||||
return 'free';
|
||||
}
|
||||
|
||||
const preferred = String(user?.preferred_payment_mode || '').trim().toLowerCase();
|
||||
if (preferred === 'direct' && this.directModeEnabled) {
|
||||
return 'direct';
|
||||
}
|
||||
if (preferred === 'credits' && this.creditsModeEnabled) {
|
||||
return 'credits';
|
||||
}
|
||||
if (this.creditsModeEnabled) {
|
||||
return 'credits';
|
||||
}
|
||||
if (this.directModeEnabled) {
|
||||
return 'direct';
|
||||
}
|
||||
return 'free';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available payment options for a user
|
||||
* @param {string} socketId - Socket ID
|
||||
|
||||
Reference in New Issue
Block a user