public override ApolloKVPair FromString(string src) { ApolloStringParser apolloStringParser = new ApolloStringParser(src); this.Key = apolloStringParser.GetString("key"); this.Value = apolloStringParser.GetString("value"); return(this); }
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); } }
public override ApolloWakeupInfo FromString(string src) { ApolloStringParser parser = new ApolloStringParser(src); this.state = (ApolloWakeState)parser.GetInt("State"); this.Platform = (ApolloPlatform)parser.GetInt("Platform"); this.MediaTagName = parser.GetString("MediaTagName"); this.OpenId = parser.GetString("OpenId"); this.Lang = parser.GetString("Lang"); this.Country = parser.GetString("Country"); this.MessageExt = parser.GetString("MessageExt"); string str = parser.GetString("ExtInfo"); if ((str != null) && (string.Empty != str)) { char[] separator = new char[] { ',' }; string[] strArray = str.Split(separator); this.ExtensionInfo.Clear(); foreach (string str2 in strArray) { string str3 = ApolloStringParser.ReplaceApolloString(ApolloStringParser.ReplaceApolloString(str2)); ApolloKVPair item = new ApolloKVPair(); item.FromString(str3); this.ExtensionInfo.Add(item); } } return(this); }
public override ApolloWakeupInfo FromString(string src) { Debug.Log("WakeUpInfo:" + src); ApolloStringParser apolloStringParser = new ApolloStringParser(src); this.state = (ApolloWakeState)apolloStringParser.GetInt("State"); this.Platform = (ApolloPlatform)apolloStringParser.GetInt("Platform"); this.MediaTagName = apolloStringParser.GetString("MediaTagName"); this.OpenId = apolloStringParser.GetString("OpenId"); this.Lang = apolloStringParser.GetString("Lang"); this.Country = apolloStringParser.GetString("Country"); this.MessageExt = apolloStringParser.GetString("MessageExt"); string @string = apolloStringParser.GetString("ExtInfo"); if (@string != null && string.Empty != @string) { string[] array = @string.Split(new char[] { ',' }); this.ExtensionInfo.Clear(); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string src2 = array2[i]; string src3 = ApolloStringParser.ReplaceApolloString(src2); src3 = ApolloStringParser.ReplaceApolloString(src3); ApolloKVPair apolloKVPair = new ApolloKVPair(); apolloKVPair.FromString(src3); this.ExtensionInfo.Add(apolloKVPair); } } return(this); }
public override ApolloLoginInfo FromString(string src) { ApolloStringParser parser = new ApolloStringParser(src); this.AccountInfo = parser.GetObject <ApolloAccountInfo>("AccountInfo"); this.WaitingInfo = parser.GetObject <ApolloWaitingInfo>("WaitingInfo"); string data = parser.GetString("ServerInfo"); if (data != null) { this.ServerInfo = new ApolloServerRouteInfo(); this.ServerInfo.FromString(data); } return(this); }
public override ApolloLoginInfo FromString(string src) { ApolloStringParser apolloStringParser = new ApolloStringParser(src); this.AccountInfo = apolloStringParser.GetObject <ApolloAccountInfo>("AccountInfo"); this.WaitingInfo = apolloStringParser.GetObject <ApolloWaitingInfo>("WaitingInfo"); string text = apolloStringParser.GetString("ServerInfo"); if (text != null) { text = ApolloStringParser.ReplaceApolloStringQuto(text); this.ServerInfo = new ApolloServerRouteInfo(); this.ServerInfo.FromString(text); } return(this); }
private void OnFeedbackNotify(string msg) { ADebug.Log("onFeedbackEvent:" + msg); if (this.onFeedbackEvent != null) { ApolloStringParser apolloStringParser = new ApolloStringParser(msg); int @int = apolloStringParser.GetInt("Flag"); string @string = apolloStringParser.GetString("Desc"); try { this.onFeedbackEvent(@int, @string); } catch (Exception ex) { ADebug.Log("onFeedbackEvent:" + ex); } } }
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); } }