Ejemplo n.º 1
0
        /// <summary>
        /// Gets the WWWForm representation to pass to the web services with encrypted data.
        /// </summary>
        /// <returns>The form.</returns>
        public WWWForm GetForm()
        {
            WWWForm form = new WWWForm();

            form.AddField("token", Convert.ToBase64String(Encoding.UTF8.GetBytes(CombuManager.sessionToken)));
            if (!CombuManager.instance.language.Equals("en", StringComparison.CurrentCultureIgnoreCase))
            {
                form.AddField("lang", string.IsNullOrEmpty(CombuManager.instance.language) ? "en" : CombuManager.instance.language);
            }
            form.AddField("data", CombuManager.EncryptAES(textData.toJson()));
            foreach (var fieldName in binaryData.Keys)
            {
                form.AddBinaryData(fieldName, binaryData [fieldName]);
            }
            return(form);
        }
 protected virtual void Awake()
 {
     // Ensure we have one only instance
     if (_instance != null)
     {
         Destroy(this);
     }
     else
     {
         if (dontDestroyOnLoad)
         {
             DontDestroyOnLoad(gameObject);
         }
         _instance              = this;
         downloading            = false;
         cancelling             = false;
         _defaultSocialPlatform = Social.Active;
         _platform              = new CombuPlatform();
         if (setAsDefaultSocialPlatform)
         {
             Social.Active = _platform;
         }
     }
 }