Exemple #1
0
        private void InitPara()
        {
            ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false);

            string str    = "Smoba";
            string openId = accountInfo.OpenId;
            string str3   = "qq";
            string str4   = string.Empty;
            string str5   = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID.ToString();

            string str6 = string.Empty;
            string str7 = string.Empty;

            foreach (ApolloToken token in accountInfo.TokenList)
            {
                if (ApolloConfig.platform == ApolloPlatform.Wechat)
                {
                    if (token.Type == ApolloTokenType.Access)
                    {
                        str6 = token.Value;
                    }
                }
                else if (ApolloConfig.platform == ApolloPlatform.QQ)
                {
                    if (token.Type == ApolloTokenType.Pay)
                    {
                        str7 = token.Value;
                    }
                    if (token.Type == ApolloTokenType.Access)
                    {
                        str6 = token.Value;
                    }
                }
            }
            if (ApolloConfig.platform == ApolloPlatform.QQ)
            {
                str3 = "qq";
                if (Application.platform == RuntimePlatform.Android)
                {
                    str4 = "1";
                }
                else if (Application.platform == RuntimePlatform.IPhonePlayer)
                {
                    str4 = "2";
                }
            }
            else if (ApolloConfig.platform == ApolloPlatform.Wechat)
            {
                str3 = "wx";
                if (Application.platform == RuntimePlatform.Android)
                {
                    str4 = "3";
                }
                else if (Application.platform == RuntimePlatform.IPhonePlayer)
                {
                    str4 = "4";
                }
            }
            string str8 = MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString();

            string appID = ApolloConfig.appID;

            if (ApolloConfig.platform == ApolloPlatform.Wechat)
            {
                appID = ApolloConfig.WXAppID;
            }
            string appVersion = CVersion.GetAppVersion();
            string str11      = "1";

            Pandora.setParentGameObject(base.gameObject);
            Pandora.setDepth(0x3e8);
            NotificationCenter.DefaultCenter().AddObserver(this, "OnPandoraEvent");
            Dictionary <string, string> dicPara = new Dictionary <string, string>();

            dicPara.Add("sOpenId", openId);
            dicPara.Add("sServiceType", str);
            dicPara.Add("sAcountType", str3);
            dicPara.Add("sArea", str4);
            dicPara.Add("sPartition", str8);
            dicPara.Add("sAppId", appID);
            dicPara.Add("sRoleId", str5);
            dicPara.Add("sAccessToken", str6);
            dicPara.Add("sPayToken", str7);
            dicPara.Add("sGameVer", appVersion);
            dicPara.Add("sPlatID", str11);
            Pandora.GetInstance().SetUserInfo(dicPara);
        }