Beispiel #1
0
        private void onAccessTokenRefresedProc(string msg)
        {
            ADebug.Log("onAccessTokenRefresedProc: " + msg);
            ApolloStringParser     parser    = new ApolloStringParser(msg);
            ListView <ApolloToken> tokenList = null;
            ApolloResult           @int      = (ApolloResult)parser.GetInt("Result");

            if (@int == ApolloResult.Success)
            {
                string src = parser.GetString("tokens");
                if (src != null)
                {
                    src = ApolloStringParser.ReplaceApolloString(src);
                    ADebug.Log("onAccessTokenRefresedProc tokens:" + src);
                    if ((src != null) && (src.Length > 0))
                    {
                        char[]   separator = new char[] { ',' };
                        string[] strArray  = src.Split(separator);
                        tokenList = new ListView <ApolloToken>();
                        foreach (string str2 in strArray)
                        {
                            string      str3 = ApolloStringParser.ReplaceApolloString(ApolloStringParser.ReplaceApolloString(str2));
                            ApolloToken item = new ApolloToken();
                            item.FromString(str3);
                            ADebug.Log(string.Format("onAccessTokenRefresedProc str:{0} |||||| {1}   |||||{2}", str3, item.Type, item.Value));
                            tokenList.Add(item);
                        }
                    }
                }
            }
            if (this.RefreshAtkEvent != null)
            {
                this.RefreshAtkEvent(@int, tokenList);
            }
        }
Beispiel #2
0
 public override ApolloAccountInfo FromString(string src)
 {
     Console.WriteLine("ApolloLZK srccc {0}", src);
     char[] separator = new char[] { '&' };
     foreach (string str in src.Split(separator))
     {
         char[]   chArray2  = new char[] { '=' };
         string[] strArray3 = str.Split(chArray2);
         if (strArray3.Length > 1)
         {
             if (strArray3[0].CompareTo("Platform") == 0)
             {
                 this.Platform = (ApolloPlatform)int.Parse(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("OpenId") == 0)
             {
                 this.OpenId = strArray3[1];
             }
             else if (strArray3[0].CompareTo("UserId") == 0)
             {
                 this.UserId = strArray3[1];
             }
             else if (strArray3[0].CompareTo("Uin") == 0)
             {
                 this.Uin = ulong.Parse(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("TokenList") == 0)
             {
                 char[]   chArray3  = new char[] { ',' };
                 string[] strArray4 = strArray3[1].Split(chArray3);
                 this.TokenList.Clear();
                 foreach (string str2 in strArray4)
                 {
                     string      str3 = ApolloStringParser.ReplaceApolloString(ApolloStringParser.ReplaceApolloString(str2));
                     ApolloToken item = new ApolloToken();
                     item.FromString(str3);
                     this.TokenList.Add(item);
                 }
             }
             else if (strArray3[0].CompareTo("Pf") == 0)
             {
                 this.Pf = strArray3[1];
             }
             else if (strArray3[0].CompareTo("PfKey") == 0)
             {
                 this.PfKey = strArray3[1];
             }
             else if (strArray3[0].CompareTo("STKey") == 0)
             {
                 this.STKey = strArray3[1];
             }
         }
     }
     return(this);
 }
Beispiel #3
0
        private void onAccessTokenRefresedProc(string msg)
        {
            ADebug.Log("onAccessTokenRefresedProc: " + msg);
            ApolloStringParser     apolloStringParser = new ApolloStringParser(msg);
            ListView <ApolloToken> listView           = null;
            ApolloResult           @int = (ApolloResult)apolloStringParser.GetInt("Result");

            if (@int == ApolloResult.Success)
            {
                string text = apolloStringParser.GetString("tokens");
                if (text != null)
                {
                    text = ApolloStringParser.ReplaceApolloString(text);
                    ADebug.Log("onAccessTokenRefresedProc tokens:" + text);
                    if (text != null && text.get_Length() > 0)
                    {
                        string[] array = text.Split(new char[]
                        {
                            ','
                        });
                        listView = new ListView <ApolloToken>();
                        string[] array2 = array;
                        for (int i = 0; i < array2.Length; i++)
                        {
                            string src   = array2[i];
                            string text2 = ApolloStringParser.ReplaceApolloString(src);
                            text2 = ApolloStringParser.ReplaceApolloString(text2);
                            ApolloToken apolloToken = new ApolloToken();
                            apolloToken.FromString(text2);
                            ADebug.Log(string.Format("onAccessTokenRefresedProc str:{0} |||||| {1}   |||||{2}", text2, apolloToken.Type, apolloToken.Value));
                            listView.Add(apolloToken);
                        }
                    }
                }
            }
            if (this.RefreshAtkEvent != null)
            {
                this.RefreshAtkEvent(@int, listView);
            }
        }
Beispiel #4
0
 public override ApolloAccountInfo FromString(string src)
 {
     Console.WriteLine("ApolloLZK srccc {0}", src);
     string[] array = src.Split(new char[]
     {
         '&'
     });
     string[] array2 = array;
     for (int i = 0; i < array2.Length; i++)
     {
         string   text   = array2[i];
         string[] array3 = text.Split(new char[]
         {
             '='
         });
         if (array3.Length > 1)
         {
             if (array3[0].CompareTo("Platform") == 0)
             {
                 this.Platform = (ApolloPlatform)int.Parse(array3[1]);
             }
             else if (array3[0].CompareTo("OpenId") == 0)
             {
                 this.OpenId = array3[1];
             }
             else if (array3[0].CompareTo("UserId") == 0)
             {
                 this.UserId = array3[1];
             }
             else if (array3[0].CompareTo("Uin") == 0)
             {
                 this.Uin = ulong.Parse(array3[1]);
             }
             else if (array3[0].CompareTo("TokenList") == 0)
             {
                 string[] array4 = array3[1].Split(new char[]
                 {
                     ','
                 });
                 this.TokenList.Clear();
                 string[] array5 = array4;
                 for (int j = 0; j < array5.Length; j++)
                 {
                     string src2 = array5[j];
                     string src3 = ApolloStringParser.ReplaceApolloString(src2);
                     src3 = ApolloStringParser.ReplaceApolloString(src3);
                     ApolloToken apolloToken = new ApolloToken();
                     apolloToken.FromString(src3);
                     this.TokenList.Add(apolloToken);
                 }
             }
             else if (array3[0].CompareTo("Pf") == 0)
             {
                 this.Pf = array3[1];
             }
             else if (array3[0].CompareTo("PfKey") == 0)
             {
                 this.PfKey = array3[1];
             }
             else if (array3[0].CompareTo("STKey") == 0)
             {
                 this.STKey = array3[1];
             }
         }
     }
     return(this);
 }