lcy
2 天以前 4435dad5cb74b7d68f57d4b62f04d3e3de4adbd9
Main/System/GeneralConfig/GeneralDefine.cs
@@ -8,6 +8,10 @@
public class GeneralDefine
{
    static readonly List<int> DEFAULT_PAY_METHOD_MONEY_TYPES = new List<int> { 97, 99 };
    static Dictionary<string, int[]> payMethodMoneyTypeByChannel;
    public static Dictionary<int, int> MoneyDisplayModel { get; private set; }
    public static int activityItemID { get; private set; }
    
@@ -52,6 +56,7 @@
    public static int[] heroSkinGiftList;
    public static void Init()
    {
        payMethodMoneyTypeByChannel = null;
        try
        {
            MoneyDisplayModel = ConfigParse.ParseIntDict(GetInputString("MoneyDisplayModel", 1));
@@ -117,6 +122,8 @@
            config = FuncConfigConfig.Get("HeroSkinGift");
            heroSkinGiftList = JsonMapper.ToObject<int[]>(config.Numerical1);
            payMethodMoneyTypeByChannel = JsonMapper.ToObject<Dictionary<string, int[]>>(FuncConfigConfig.Get("DJQShow").Numerical1);
        }
        catch (Exception ex)
        {
@@ -323,4 +330,31 @@
    {
        return playerID < 1000000;
    }
    public static List<int> GetPayMethodAvailableMoneyTypes()
    {
        if (payMethodMoneyTypeByChannel == null)
            return new List<int>(DEFAULT_PAY_METHOD_MONEY_TYPES);
        var versionConfig = VersionConfig.Get();
        string channel = versionConfig != null ? versionConfig.appId : string.Empty;
        if (string.IsNullOrEmpty(channel) || payMethodMoneyTypeByChannel == null ||
            !payMethodMoneyTypeByChannel.TryGetValue(channel, out var moneyTypes) || moneyTypes == null || moneyTypes.Length == 0)
        {
            return new List<int>(DEFAULT_PAY_METHOD_MONEY_TYPES);
        }
        var result = new List<int>();
        for (int i = 0; i < moneyTypes.Length; i++)
        {
            if (!result.Contains(moneyTypes[i]))
            {
                result.Add(moneyTypes[i]);
            }
        }
        return result.Count > 0 ? result : new List<int>(DEFAULT_PAY_METHOD_MONEY_TYPES);
    }
}