public static CloudDataSheetWriteQueueEntry Get(string key, string entry, string url) { CloudDataSheetWriteQueueEntry writeQueueEntry = new CloudDataSheetWriteQueueEntry(); writeQueueEntry.sheetKey = key; writeQueueEntry.putEntry = entry; writeQueueEntry.putUrl = url; return(writeQueueEntry); }
protected virtual CloudDataSheetWriteQueueEntry GetInsertQueueEntry(string cloudDataKey, object val) { // Create put entry string entry = " {" + " \"value\": " + val + " }"; // Format URL string putUrl = getValueUrl(cloudDataKey) + GetAccessUrlPostfix(false); return(CloudDataSheetWriteQueueEntry.Get(cloudDataKey, entry, putUrl)); }
void WriteQueueEntries() { if (m_WriteQueue.Count > 0) { m_CurrentWriteEntry = m_WriteQueue.Dequeue(); // Create request headers var headers = new Dictionary <string, string>(); headers.Add("Content-Type", "application/json"); Debug.Log(string.Format("[Unity Cloud Data] writing key '{0}' for sheet at path '{1}'", m_CurrentWriteEntry.sheetKey, path)); byte[] body = Encoding.UTF8.GetBytes(m_CurrentWriteEntry.putEntry); WWWUtility.StartRequest(m_CurrentWriteEntry.putUrl, body, headers, FinishedWritingEntry); } else { Debug.Log(string.Format("[Unity Cloud Data] Done saving sheet at path '{0}'!", path)); // wait until after the refresh completes to trigger the callback onRefreshCacheComplete += PostWriteRefreshFinished; RefreshCache(); } }