static ProjectInfoData ExtractProjectInfoFromJson(JSONValue jsonProject)
 {
     return(new ProjectInfoData(
                jsonProject.AsDict()[k_JsonOrgIdNodeName].AsString(),
                jsonProject.AsDict()[k_JsonNameNodeName].AsString(),
                jsonProject.AsDict()[k_JsonGuidNodeName].AsString()));
 }
        internal AnalyticsValidatorEvent(JSONValue json)
        {
            m_TimeStamp = k_UnixEpoch.AddMilliseconds(Convert.ToDouble(json.AsDict()[k_JsonKeyTime].AsObject()));
            m_Type = json.AsDict()[k_JsonKeyType].AsString();
            m_JsonParams = json.AsDict()[k_JsonKeyParams].AsString();

            var jsonParser = new JSONParser(m_JsonParams);
            try
            {
                var jsonInnerData = jsonParser.Parse();
                m_Platform = jsonInnerData.AsDict()[k_JsonKeyPlatfrom].AsString();
                m_SdkVersion = jsonInnerData.AsDict()[k_JsonKeySdkVersion].AsString();
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }
Ejemplo n.º 3
0
    private static void OnPackages(JSONValue jv, PackageDataSource packageDataSource)
    {
        IList <Package> allPackages         = packageDataSource.GetAllPackages();
        Dictionary <string, JSONValue> strs = jv.AsDict(false);
        string empty = string.Empty;

        allPackages.Clear();
        foreach (KeyValuePair <string, JSONValue> keyValuePair in strs)
        {
            int       num     = int.Parse(keyValuePair.Key);
            JSONValue value   = keyValuePair.Value;
            Package   package = packageDataSource.FindByID(num) ?? new Package(num);
            empty = string.Concat(empty, AssetStoreAPI.OnPackageReceived(value, package));
            empty = string.Concat(empty, AssetStoreAPI.RefreshMainAssets(value, package));
            allPackages.Add(package);
        }

        packageDataSource.OnDataReceived(empty);
    }
Ejemplo n.º 4
0
    private static void OnPackages(JSONValue jv, PackageDataSource packageDataSource)
    {
        IList <Package> allPackages = packageDataSource.GetAllPackages();
        Dictionary <string, JSONValue> dictionary = jv.AsDict(false);
        string text = string.Empty;

        foreach (KeyValuePair <string, JSONValue> current in dictionary)
        {
            int       num     = int.Parse(current.Key);
            JSONValue value   = current.Value;
            Package   package = packageDataSource.FindByID(num);
            if (package == null)
            {
                package = new Package(num);
            }
            text += AssetStoreAPI.OnPackageReceived(value, package);
            text += AssetStoreAPI.RefreshMainAssets(value, package);
            allPackages.Add(package);
        }
        packageDataSource.OnDataReceived(text);
    }