Ejemplo n.º 1
0
        /// <summary>
        /// 应用用户自定义数据.
        /// </summary>
        /// <param name="iGameName">游戏名.</param>
        protected override void ApplyUserData(string iGameName)
        {
            // 本地设定
            {
                const string name  = "Local";
                var          value = TiangeSdkSettings.GetInstance().Local.ToString();
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value, false);
                }
                if (TiangeSdkSettings.GetInstance().Local == false)
                {
                    return;
                }
            }

            // 游戏名
            {
                const string name  = "GameName";
                var          value = iGameName;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }

            // SDK自动初始化
            {
                const string name  = "AutoSdkInit";
                var          value = TiangeSdkSettings.GetInstance().AutoSdkInit.ToString();
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value, false);
                }
                if (TiangeSdkSettings.GetInstance().Local == false)
                {
                    return;
                }
            }

            // 自动登录
            {
                const string name  = "AutoLogin";
                var          value = TiangeSdkSettings.GetInstance().AutoLogin.ToString();
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value, false);
                }
                if (TiangeSdkSettings.GetInstance().Local == false)
                {
                    return;
                }
            }
            // 屏幕方向
            {
                const string name        = "Orientation";
                var          value       = "1";
                var          orientation = TiangeSdkSettings.GetInstance().Orientation;
                if (UIOrientation.LandscapeLeft == orientation ||
                    UIOrientation.LandscapeRight == orientation)
                {
                    value = "2";
                }
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value, false);
                }
            }

            // 易接SDK 设定
            if (TiangeSdkSettings.GetInstance().data.Options.IsOptionValid(SDKOptions.OneSDK))
            {
                // 易接SDK Key
                {
                    const string name  = "zy_class_name";
                    var          value = TiangeSdkSettings.GetInstance().data.Options.OneSDK.zyClassName;
                    if (false == string.IsNullOrEmpty(value))
                    {
                        AddUserDefineNode(name, value);
                    }
                }

                // 易接SDK MetaDatas
                {
                    var metaDatas = TiangeSdkSettings.GetInstance().data.Options.OneSDK.metaDatas;
                    foreach (var metaData in metaDatas)
                    {
                        if (null != metaData &&
                            false == string.IsNullOrEmpty(metaData.name) &&
                            false == string.IsNullOrEmpty(metaData.value))
                        {
                            AddUserDefineNode(metaData.name, metaData.value, false);
                        }
                    }
                }
            }

            // 保存strings.xml
            StringsXml?.Save();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 应用用户自定义数据.
        /// </summary>
        /// <param name="iGameName">游戏名.</param>
        protected override void ApplyUserData(string iGameName)
        {
            // 本地设定
            {
                const string name  = "Huawei_Local";
                var          value = HuaweiSdkSettings.GetInstance().Local.ToString();
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value, false);
                }
                if (HuaweiSdkSettings.GetInstance().Local == false)
                {
                    return;
                }
            }

            // 游戏名
            {
                const string name  = "Huawei_GameName";
                var          value = iGameName;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }

            // 自动登录
            {
                const string name  = "Huawei_AutoLogin";
                var          value = HuaweiSdkSettings.GetInstance().AutoLogin.ToString();
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value, false);
                }
                if (HuaweiSdkSettings.GetInstance().Local == false)
                {
                    return;
                }
            }

            // AppID
            {
                const string name  = "Huawei_AppID";
                var          value = HuaweiSdkSettings.GetInstance().AppId;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }
            // 浮标密钥
            {
                const string name  = "Huawei_BuoySecret";
                var          value = HuaweiSdkSettings.GetInstance().BuoySecret;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }
            // 支付ID
            {
                const string name  = "Huawei_PayID";
                var          value = HuaweiSdkSettings.GetInstance().PayId;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }
            // 支付私钥
            {
                const string name  = "Huawei_PayPrivateRsa";
                var          value = HuaweiSdkSettings.GetInstance().PayPrivateRsa;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }
            // 支付公钥
            {
                const string name  = "Huawei_PayPublicRsa";
                var          value = HuaweiSdkSettings.GetInstance().PayPublicRsa;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }
            // CPID
            {
                const string name  = "Huawei_CPID";
                var          value = HuaweiSdkSettings.GetInstance().Cpid;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }
            // 登录签名公钥
            {
                const string name  = "Huawei_LoginPublicRsa";
                var          value = HuaweiSdkSettings.GetInstance().LoginPublicRsa;
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value);
                }
            }
            // 屏幕方向
            {
                const string name         = "Huawei_Orientation";
                var          value        = "1";
                var          _orientation = HuaweiSdkSettings.GetInstance().Orientation;
                if (UIOrientation.LandscapeLeft == _orientation ||
                    UIOrientation.LandscapeRight == _orientation)
                {
                    value = "2";
                }
                if (false == string.IsNullOrEmpty(value))
                {
                    AddUserDefineNode(name, value, false);
                }
            }

            // 保存strings.xml
            StringsXml?.Save();
        }