public static void GetMetaData(AssetStorePublisher account, PackageDataSource packageDataSource, AssetStoreAPI.DoneCallback callback)
 {
     AssetStoreClient.CreatePendingGet("metadata", "/metadata/0", delegate(AssetStoreResponse res)
     {
         DebugUtils.Log(res.data);
         string errorMessage;
         JSONValue jval;
         bool flag = AssetStoreAPI.Parse(res, out errorMessage, out jval);
         if (flag && !jval.ContainsKey("error_fields"))
         {
             callback(errorMessage);
             return;
         }
         string str = "none";
         try
         {
             str         = "account";
             string text = AssetStoreAPI.OnAssetStorePublisher(jval, account, packageDataSource);
             if (text != null)
             {
                 callback(text);
                 return;
             }
         }
         catch (JSONTypeException ex)
         {
             callback("Malformed metadata response from server: " + str + " - " + ex.Message);
         }
         catch (KeyNotFoundException ex2)
         {
             callback("Malformed metadata response from server. " + str + " - " + ex2.Message);
         }
         callback(null);
     });
 }
        private static string OnAssetStorePublisher(JSONValue jval, AssetStorePublisher account, PackageDataSource packageDataSource)
        {
            string str = "unknown field";

            try
            {
                str = "publisher";
                Dictionary <string, JSONValue> dictionary = jval["publisher"].AsDict(false);
                account.mStatus = AssetStorePublisher.Status.New;
                if (dictionary.ContainsKey("name"))
                {
                    account.mStatus       = AssetStorePublisher.Status.Existing;
                    str                   = "publisher -> id";
                    account.publisherId   = int.Parse(dictionary["id"].AsString(false));
                    str                   = "publisher -> name";
                    account.publisherName = dictionary["name"].AsString(false);
                }
                str = "publisher";
                if (AssetStoreManager.sDbg)
                {
                    DebugUtils.Log("publisher " + jval["publisher"].ToString(string.Empty, "    "));
                    DebugUtils.Log("packs " + jval["packages"].ToString(string.Empty, "    "));
                }
                str = "packages";
                if (!jval.Get("packages").IsNull())
                {
                    AssetStoreAPI.OnPackages(jval["packages"], packageDataSource);
                }
            }
            catch (JSONTypeException ex)
            {
                return("Malformed response from server: " + str + " - " + ex.Message);
            }
            catch (KeyNotFoundException ex2)
            {
                return("Malformed response from server. " + str + " - " + ex2.Message);
            }
            return(null);
        }