Skip to content

Instantly share code, notes, and snippets.

@TwinFuture
Created April 26, 2017 17:37
Show Gist options
  • Save TwinFuture/51dad106831f8a7b92f9658a51c05f0c to your computer and use it in GitHub Desktop.
Save TwinFuture/51dad106831f8a7b92f9658a51c05f0c to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography;
using System.Text;
using BestHTTP;
using JsonFx.Json;
using LKWD.Telemetry;
using LKWD.Utils;
using LKWD.Utils.Extensions;
using LKWD.Utils.Hashing;
using LKWD.WebService.Debug;
using LKWD.WebService.Environment;
using LKWD.WebService.MockAPI;
using LKWD.WebService.Session;
using Lockwood;
using UnityEngine;
namespace LKWD.WebService
{
// Token: 0x02000155 RID: 341
public sealed class WebServices
{
// Token: 0x0600095D RID: 2397 RVA: 0x0005B408 File Offset: 0x00059608
static WebServices()
{
WebServices.State = WebServices.eState.Running;
WebServices.Environment = LKWD.WebService.Environment.Environment.ProductionEnvironment;
WebServices.Session = new SessionData();
WebServices.m_MockAPIFunctions = new Dictionary<string, IMockFunction>();
WebServices.m_ResponseInterceptor = new Dictionary<string, Action<IWebRequest>>
{
{
"user/validate_id/",
new Action<IWebRequest>(WebServices.ValidateUserCallback)
}
};
WebServices.m_DefaultRequestChannel = new RequestChannel();
WebServices.ServerTime = DateTime.UtcNow;
HTTPManager.UseAlternateSSLDefaultValue = true;
}
// Token: 0x17000114 RID: 276
// (get) Token: 0x0600095E RID: 2398 RVA: 0x0001C291 File Offset: 0x0001A491
// (set) Token: 0x0600095F RID: 2399 RVA: 0x0001C298 File Offset: 0x0001A498
public static SessionData Session
{
get;
private set;
}
// Token: 0x17000115 RID: 277
// (get) Token: 0x06000960 RID: 2400 RVA: 0x0001C2A0 File Offset: 0x0001A4A0
// (set) Token: 0x06000961 RID: 2401 RVA: 0x0001C2A7 File Offset: 0x0001A4A7
public static LKWD.WebService.Environment.Environment Environment
{
get;
private set;
}
// Token: 0x17000116 RID: 278
// (get) Token: 0x06000962 RID: 2402 RVA: 0x0001C2AF File Offset: 0x0001A4AF
// (set) Token: 0x06000963 RID: 2403 RVA: 0x0001C2B6 File Offset: 0x0001A4B6
public static DateTime ServerTime
{
get;
private set;
}
// Token: 0x17000117 RID: 279
// (get) Token: 0x06000964 RID: 2404 RVA: 0x0001C2BE File Offset: 0x0001A4BE
// (set) Token: 0x06000965 RID: 2405 RVA: 0x0001C2C5 File Offset: 0x0001A4C5
public static WebServices.eState State
{
get;
private set;
}
// Token: 0x17000118 RID: 280
// (get) Token: 0x06000966 RID: 2406 RVA: 0x0001C2CD File Offset: 0x0001A4CD
public static int CallCount
{
get
{
return WebServices.m_CallCount;
}
}
// Token: 0x17000119 RID: 281
// (get) Token: 0x06000967 RID: 2407 RVA: 0x0001C2D4 File Offset: 0x0001A4D4
public static float SuccessfulCallRatio
{
get
{
return (float)WebServices.m_SucessfulCallCount / (float)WebServices.m_CallCount;
}
}
// Token: 0x1700011A RID: 282
// (get) Token: 0x06000968 RID: 2408 RVA: 0x0001C2E3 File Offset: 0x0001A4E3
public static float AverageCallDuration
{
get
{
return WebServices.m_AvgCallDuration;
}
}
// Token: 0x1700011B RID: 283
// (get) Token: 0x06000969 RID: 2409 RVA: 0x0001C2EA File Offset: 0x0001A4EA
public static float PeakCallDuration
{
get
{
return WebServices.m_PeakCallDuration;
}
}
// Token: 0x0600096A RID: 2410 RVA: 0x0001C2F1 File Offset: 0x0001A4F1
public static void ResetStats()
{
WebServices.m_AvgCallDuration = 0f;
WebServices.m_PeakCallDuration = 0f;
WebServices.m_CallCount = 0;
WebServices.m_SucessfulCallCount = 0;
}
// Token: 0x0600096B RID: 2411 RVA: 0x0001C313 File Offset: 0x0001A513
public static bool ChangeEnvironment(LKWD.WebService.Environment.Environment lEnvironment)
{
DebugLogger.LogFormatted("Client: ChangeEnvironment: lEnvironment={0}", new object[]
{
lEnvironment
});
WebServices.Environment = lEnvironment;
return true;
}
// Token: 0x0600096C RID: 2412 RVA: 0x0005B4F8 File Offset: 0x000596F8
public static void Tick()
{
switch (WebServices.State)
{
case WebServices.eState.Running:
{
IWebRequest webRequest = WebServices.m_DefaultRequestChannel.Peek();
if (webRequest != null)
{
WebRequest webRequest2 = null;
if (webRequest is WebRequest)
{
webRequest2 = (WebRequest)webRequest;
if (Platform.EnableEmulatedLatency)
{
}
if (webRequest2.State <= IWebRequest.eState.Queued)
{
if (Platform.EnableMockAPI && WebServices.m_MockAPIFunctions.ContainsKey(webRequest2.API))
{
Dictionary<string, object> lResponseData = WebServices.m_MockAPIFunctions[webRequest2.API].ProcessRequest(webRequest2.RequestData);
webRequest2.InjectMockAPIResponse(lResponseData);
WebServices.FinalizeRequest(webRequest2);
WebServices.m_DefaultRequestChannel.Pop();
}
else
{
webRequest2.Dispatch();
}
}
if (webRequest2.State == IWebRequest.eState.Waiting)
{
webRequest2.CheckProgress();
}
if (webRequest2.State == IWebRequest.eState.Processing)
{
WebServices.eResponseAction eResponseAction = WebServices.ProcessResponse(webRequest2);
if ((eResponseAction & WebServices.eResponseAction.Replay) > WebServices.eResponseAction.None)
{
webRequest2.Reset();
}
if ((eResponseAction & WebServices.eResponseAction.ReSignIn) > WebServices.eResponseAction.None)
{
if (!string.IsNullOrEmpty(WebServices.Session.ApplicationToken) && !string.IsNullOrEmpty(WebServices.Session.m_SouqaID))
{
WebServices.Session.m_SessionToken = null;
IWebRequest lRequest = WebServices.CreateSignIn(WebServices.Session.ApplicationToken);
WebServices.m_DefaultRequestChannel.PushWebRequest(lRequest);
}
else
{
LKWD.WebService.Debug.Logger.LogError("WebRequest that requires session failed with unauthorized, however we done yet have a ClientToken to sign back in with.");
}
}
if ((eResponseAction & WebServices.eResponseAction.Maintenance) > WebServices.eResponseAction.None)
{
WebServices.State = WebServices.eState.Maintenance;
try
{
if (WebServices.OnMaintenance != null)
{
WebServices.OnMaintenance(null, null);
}
}
catch (Exception ex)
{
LKWD.WebService.Debug.Logger.LogWarning("WebServices.Client : Exception -> OnMaintenance - " + ex.Message);
}
}
if ((eResponseAction & WebServices.eResponseAction.ConnectionLost) > WebServices.eResponseAction.None)
{
WebServices.ConnectionLost();
}
if ((eResponseAction & WebServices.eResponseAction.Finalize) > WebServices.eResponseAction.None)
{
WebServices.FinalizeRequest(webRequest2);
WebServices.m_DefaultRequestChannel.Pop();
}
if (!webRequest2.MockAPIUsed)
{
WebServices.m_CallCount++;
if (webRequest2.ResponseStatus == eResponseStatus.Successful)
{
WebServices.m_SucessfulCallCount++;
}
if ((float)webRequest2.ElapsedTime > WebServices.m_PeakCallDuration)
{
WebServices.m_PeakCallDuration = (float)webRequest2.ElapsedTime;
}
WebServices.m_AvgCallDuration = WebServices.m_AvgCallDuration * ((float)WebServices.m_CallCount - 1f) / (float)WebServices.m_CallCount + (float)(webRequest2.ElapsedTime / (long)WebServices.m_CallCount);
}
}
}
}
break;
}
case WebServices.eState.ConnectionLost:
if (Platform.IsUnity3D)
{
if (UnixTime.Now() - WebServices.m_ConnectionIssueTimeStamp > 2L && Platform.HasInternetConnection())
{
WebServices.State = WebServices.eState.Running;
}
}
else
{
WebServices.State = WebServices.eState.Running;
}
break;
}
if (Platform.IsUnity3D)
{
WebServices.TickServerTime();
}
}
// Token: 0x0600096D RID: 2413 RVA: 0x0005B7BC File Offset: 0x000599BC
private static void TickServerTime()
{
WebServices.ServerTime = WebServices.ServerTime.AddSeconds((double)Time.deltaTime);
}
// Token: 0x0600096E RID: 2414 RVA: 0x0005B7E4 File Offset: 0x000599E4
private static WebServices.eResponseAction ProcessResponse(WebRequest lWebRequest)
{
WebServices.eResponseAction eResponseAction = WebServices.eResponseAction.None;
eResponseAction |= WebServices.ValidateHTTPRequestState(lWebRequest);
if (eResponseAction != WebServices.eResponseAction.None)
{
return eResponseAction;
}
eResponseAction |= WebServices.ValidateHTTPStatusCode(lWebRequest);
if (eResponseAction != WebServices.eResponseAction.None)
{
StringBuilder stringBuilder = new StringBuilder().Append("RETURN (").Append(lWebRequest.API).Append("): ").Append(lWebRequest.HTTPRequest.Response.StatusCode);
List<string> list;
if (lWebRequest.HTTPRequest.Response.Headers != null && lWebRequest.HTTPRequest.Response.Headers.TryGetValue("x-avkn-error", out list))
{
stringBuilder.Append(string.Format(" - Error: {0}", string.Join(", ", list.ToArray())));
}
LKWD.WebService.Debug.Logger.LogInfo(stringBuilder.ToString());
return eResponseAction;
}
WebServices.ConnectionPresent();
WebServices.ProcessHTTPHeader(lWebRequest);
lWebRequest.ExtractResponse();
eResponseAction |= WebServices.ProcessResponseStatus(lWebRequest);
if (eResponseAction != WebServices.eResponseAction.None)
{
return eResponseAction;
}
WebServices.ExtractSessionToken(lWebRequest);
return eResponseAction | WebServices.eResponseAction.Finalize;
}
// Token: 0x0600096F RID: 2415 RVA: 0x0005B8E0 File Offset: 0x00059AE0
private static WebServices.eResponseAction ValidateHTTPRequestState(WebRequest lWebRequest)
{
WebServices.eResponseAction eResponseAction = WebServices.eResponseAction.None;
switch (lWebRequest.HTTPRequest.State)
{
case HTTPRequestStates.Initial:
case HTTPRequestStates.Queued:
case HTTPRequestStates.Processing:
case HTTPRequestStates.Finished:
case HTTPRequestStates.Aborted:
eResponseAction = WebServices.eResponseAction.None;
break;
case HTTPRequestStates.Error:
LKWD.WebService.Debug.Logger.LogWarning("ValidateResponse - Exception : " + lWebRequest.HTTPRequest.Exception.Message + "\n" + lWebRequest.HTTPRequest.Exception.StackTrace);
if ((lWebRequest.WebRequestType & eWebRequestType.Replayable) > eWebRequestType.Standard)
{
if (lWebRequest.AttemptCount > 2)
{
if ((lWebRequest.WebRequestType & eWebRequestType.NonCritical) > eWebRequestType.Standard)
{
eResponseAction |= WebServices.eResponseAction.Finalize;
}
else if (lWebRequest.HTTPRequest.Exception is SocketException || lWebRequest.HTTPRequest.Exception is IOException)
{
eResponseAction |= WebServices.eResponseAction.ConnectionLost;
eResponseAction |= WebServices.eResponseAction.Replay;
}
else
{
eResponseAction |= WebServices.eResponseAction.Finalize;
}
}
else
{
eResponseAction |= WebServices.eResponseAction.Replay;
}
}
else
{
eResponseAction = WebServices.eResponseAction.Finalize;
}
break;
case HTTPRequestStates.ConnectionTimedOut:
if (lWebRequest.AttemptCount > 2)
{
if ((lWebRequest.WebRequestType & eWebRequestType.NonCritical) > eWebRequestType.Standard)
{
eResponseAction |= WebServices.eResponseAction.Finalize;
}
else
{
eResponseAction |= WebServices.eResponseAction.ConnectionLost;
}
}
else
{
eResponseAction |= WebServices.eResponseAction.Replay;
}
break;
case HTTPRequestStates.TimedOut:
if ((lWebRequest.WebRequestType & eWebRequestType.Replayable) > eWebRequestType.Standard)
{
eResponseAction |= WebServices.eResponseAction.Replay;
}
else
{
eResponseAction |= WebServices.eResponseAction.Finalize;
}
break;
}
return eResponseAction;
}
// Token: 0x06000970 RID: 2416 RVA: 0x0005BA48 File Offset: 0x00059C48
private static WebServices.eResponseAction ValidateHTTPStatusCode(WebRequest lWebRequest)
{
WebServices.eResponseAction eResponseAction = WebServices.eResponseAction.None;
if (lWebRequest.HTTPRequest.State == HTTPRequestStates.Finished)
{
switch (Mathf.FloorToInt((float)lWebRequest.StatusCode / 100f))
{
case 2:
eResponseAction = WebServices.eResponseAction.None;
return eResponseAction;
case 3:
LKWD.WebService.Debug.Logger.LogWarning("HTTP status code 3xx recieved not handled internally within BestHTTP");
return eResponseAction;
case 4:
if (lWebRequest.StatusCode == 401)
{
if (lWebRequest.AttemptCount > 1)
{
eResponseAction |= WebServices.eResponseAction.Finalize;
}
else
{
eResponseAction |= WebServices.eResponseAction.Replay;
if ((lWebRequest.WebRequestType & eWebRequestType.RequiresSession) > eWebRequestType.Standard)
{
eResponseAction |= WebServices.eResponseAction.ReSignIn;
}
}
return eResponseAction;
}
break;
}
if (lWebRequest.AttemptCount < 3 && (lWebRequest.WebRequestType & eWebRequestType.Replayable) > eWebRequestType.Standard)
{
eResponseAction |= WebServices.eResponseAction.Replay;
}
else
{
eResponseAction |= WebServices.eResponseAction.Finalize;
}
}
return eResponseAction;
}
// Token: 0x06000971 RID: 2417 RVA: 0x0005BB24 File Offset: 0x00059D24
private static void ProcessHTTPHeader(WebRequest lWebRequest)
{
HTTPResponse response = lWebRequest.HTTPRequest.Response;
if (Platform.UseHTTPHeaderSessionToken && response.HasHeader("X-Avkn-Token"))
{
WebServices.Session.m_SessionToken = response.GetHeaderValues("X-Avkn-Token")[0];
}
if (Platform.UseHTTPHeaderServerTime && response.HasHeader("server_time"))
{
int num = 0;
if (int.TryParse(response.GetHeaderValues("server_time")[0], out num))
{
WebServices.ServerTime = new DateTime(1970, 1, 1, 0, 0, 0);
WebServices.ServerTime = WebServices.ServerTime.AddSeconds((double)num);
}
else
{
LKWD.WebService.Debug.Logger.LogWarning("invalid server_time within HTTP Response Headers");
}
}
}
// Token: 0x06000972 RID: 2418 RVA: 0x0005BBE4 File Offset: 0x00059DE4
private static WebServices.eResponseAction ProcessResponseStatus(WebRequest lWebRequest)
{
WebServices.eResponseAction eResponseAction = WebServices.eResponseAction.None;
switch (lWebRequest.ResponseStatus)
{
case eResponseStatus.Successful:
case eResponseStatus.UnknownAPICall:
case eResponseStatus.Failed:
case eResponseStatus.Error:
case eResponseStatus.Unregistered:
case eResponseStatus.Locked:
case eResponseStatus.Unknown:
eResponseAction |= WebServices.eResponseAction.None;
break;
case eResponseStatus.Unauthorized:
if (lWebRequest.AttemptCount > 1)
{
eResponseAction |= WebServices.eResponseAction.Finalize;
}
else
{
eResponseAction |= WebServices.eResponseAction.Replay;
if ((lWebRequest.WebRequestType & eWebRequestType.RequiresSession) > eWebRequestType.Standard)
{
eResponseAction |= WebServices.eResponseAction.ReSignIn;
}
}
break;
case eResponseStatus.Maintenance:
eResponseAction |= (WebServices.eResponseAction)10;
break;
}
return eResponseAction;
}
// Token: 0x06000973 RID: 2419 RVA: 0x0005BC70 File Offset: 0x00059E70
private static void ExtractSessionToken(WebRequest lWebRequest)
{
if (lWebRequest.HTTPRequest.State == HTTPRequestStates.Finished && !Platform.UseHTTPHeaderSessionToken)
{
Dictionary<string, object> dictionary = JsonReader.Deserialize<Dictionary<string, object>>(lWebRequest.HTTPRequest.Response.DataAsText);
if (dictionary != null && dictionary.ContainsKey("data"))
{
dictionary = (dictionary["data"] as Dictionary<string, object>);
if (dictionary != null && dictionary.ContainsKey("session_token"))
{
WebServices.Session.m_SessionToken = (dictionary["session_token"] as string);
}
}
}
}
// Token: 0x06000974 RID: 2420 RVA: 0x0005BD08 File Offset: 0x00059F08
private static void FinalizeRequest(WebRequest lWebRequest)
{
if (WebServices.m_ResponseInterceptor != null && WebServices.m_ResponseInterceptor.ContainsKey(lWebRequest.API))
{
WebServices.m_ResponseInterceptor[lWebRequest.API](lWebRequest);
}
lWebRequest.Signal();
long num = UnixTime.NowUTCMilliSeconds();
WebServices.m_RequestTimeline.PlotEvent("WebServices", lWebRequest.API, num - lWebRequest.ElapsedTime, num);
}
// Token: 0x06000975 RID: 2421 RVA: 0x0005BD74 File Offset: 0x00059F74
private static void InjectSystemField(Dictionary<string, object> lPayload)
{
if (Platform.IsUnity3D)
{
RuntimePlatform appPlatform = Platform.AppPlatform;
switch (appPlatform)
{
case RuntimePlatform.MetroPlayerX86:
case RuntimePlatform.MetroPlayerX64:
case RuntimePlatform.MetroPlayerARM:
WebServices.ValidatedPut<string, object>(lPayload, "system", "Windows8");
break;
default:
if (appPlatform != RuntimePlatform.Android)
{
WebServices.ValidatedPut<string, object>(lPayload, "system", Platform.AppPlatform);
}
else
{
WebServices.ValidatedPut<string, object>(lPayload, "system", (!Hub.AmazonBuild) ? "Android" : "Amazon");
}
break;
}
}
else
{
WebServices.ValidatedPut<string, object>(lPayload, "system", "WindowsEditor");
}
}
// Token: 0x06000976 RID: 2422 RVA: 0x0005BE20 File Offset: 0x0005A020
internal static string PrettyPrintJson(string lJSONString)
{
if (Platform.IsUnity3DEditor)
{
lJSONString = lJSONString.Replace("{", "\n{").Replace("}", "}\n").Replace("[", "\n[").Replace("]", "]\n").Replace(",", ",\n").Replace("\n{\n\n}", "{}").Replace("\n\n", "\n").Replace("\n,\n", ",\n");
}
return lJSONString;
}
// Token: 0x06000977 RID: 2423 RVA: 0x0005BEB4 File Offset: 0x0005A0B4
internal static Dictionary<string, object> PatchPayloadWithSessionData(Dictionary<string, object> lPayload)
{
Dictionary<string, object> dictionary = WebServices.DeepClone(lPayload);
if (!dictionary.ContainsKey("user"))
{
dictionary.Add("user", new Dictionary<string, object>
{
{
"souqa_id",
WebServices.Session.m_SouqaID
}
});
}
WebServices.ValidatedPut<string, object>(dictionary, "device_id", WebServices.Session.DeviceId);
WebServices.ValidatedPut<string, object>(dictionary, "project", WebServices.Environment.ProjectName);
WebServices.ValidatedPut<string, object>(dictionary, "client_id", Platform.BuildVersion);
WebServices.ValidatedPut<string, object>(dictionary, "s", WebServices.Session.SequenceID);
WebServices.ValidatedPut<string, object>(dictionary, "api_version", WebServices.Environment.APIVersion);
WebServices.InjectSystemField(dictionary);
if (string.IsNullOrEmpty(WebServices.Session.m_SessionToken))
{
if (!string.IsNullOrEmpty(WebServices.Session.m_SocialNetworkID) && !dictionary.ContainsKey("client_token"))
{
dictionary.Add("client_token", WebServices.GenerateClientToken(WebServices.Session.m_SocialNetworkID));
}
}
else
{
WebServices.ValidatedPut<string, object>(dictionary, "session_token", WebServices.Session.m_SessionToken);
}
return dictionary;
}
// Token: 0x06000978 RID: 2424 RVA: 0x0005BFE0 File Offset: 0x0005A1E0
public static Dictionary<string, object> DeepClone(Dictionary<string, object> lSource)
{
Dictionary<string, object> result;
using (MemoryStream memoryStream = new MemoryStream())
{
BinaryFormatter binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(memoryStream, lSource);
memoryStream.Seek(0L, SeekOrigin.Begin);
result = (Dictionary<string, object>)binaryFormatter.Deserialize(memoryStream);
}
return result;
}
// Token: 0x06000979 RID: 2425 RVA: 0x0001C330 File Offset: 0x0001A530
public static void ValidatedPut<K, V>(IDictionary<K, V> lCollection, K lKey, V lValue)
{
if (lCollection != null)
{
if (!lCollection.ContainsKey(lKey))
{
lCollection.Add(lKey, lValue);
}
else
{
lCollection[lKey] = lValue;
LKWD.WebService.Debug.Logger.LogWarning(string.Format("ValidatedPut had to overwrite the entry : {0}", System.Environment.StackTrace));
}
}
}
// Token: 0x0600097A RID: 2426 RVA: 0x0005C040 File Offset: 0x0005A240
public static IWebRequest CreateSignIn(string lToken)
{
LKWD.WebService.Debug.Logger.LogInfo("WebServices.Client :: CreateSignIn");
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"token",
lToken
},
{
"client_token",
WebServices.GenerateClientToken(WebServices.Session.m_SouqaID)
}
};
if (!Platform.UseRemovedPrimaryChannel)
{
dictionary.Add("prime_channel_marker", WebServices.Session.PrimaryChannelMarker);
}
eWebRequestType lRequestType = eWebRequestType.SessionData | eWebRequestType.Replayable;
return WebServices.CreateRequest("application/signin/", dictionary, lRequestType, eHTTPMethod.POST);
}
// Token: 0x0600097B RID: 2427 RVA: 0x0005C0B8 File Offset: 0x0005A2B8
public static IWebRequest CreateRequest(string lAPI, object lPayload = null, eWebRequestType lRequestType = eWebRequestType.Default, eHTTPMethod lMethod = eHTTPMethod.POST)
{
return new WebRequest(lAPI, lPayload, lRequestType, lMethod);
}
// Token: 0x0600097C RID: 2428 RVA: 0x0005C0D0 File Offset: 0x0005A2D0
public static IWebRequest SubmitRequest(string lAPI, Dictionary<string, object> lPayload = null, eWebRequestType lRequestType = eWebRequestType.Default)
{
IWebRequest webRequest = WebServices.CreateRequest(lAPI, lPayload, lRequestType, eHTTPMethod.POST);
WebServices.SubmitRequest(webRequest);
return webRequest;
}
// Token: 0x0600097D RID: 2429 RVA: 0x0001C36D File Offset: 0x0001A56D
public static IWebRequest SubmitRequest(IWebRequest lRequest)
{
WebServices.m_DefaultRequestChannel.QueueWebRequest(lRequest);
return lRequest;
}
// Token: 0x0600097E RID: 2430 RVA: 0x0001C37B File Offset: 0x0001A57B
public static void Reset()
{
WebServices.Session.Reset();
}
// Token: 0x0600097F RID: 2431 RVA: 0x0005C0F0 File Offset: 0x0005A2F0
public static string EncryptPassword(string lPassword)
{
MD5CryptoServiceProvider mD5CryptoServiceProvider = new MD5CryptoServiceProvider();
if (mD5CryptoServiceProvider != null)
{
byte[] array = mD5CryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(lPassword));
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < array.Length; i++)
{
stringBuilder.Append(array[i].ToString("x2"));
}
return stringBuilder.ToString();
}
return lPassword;
}
// Token: 0x06000980 RID: 2432 RVA: 0x0001C387 File Offset: 0x0001A587
internal static string GenerateClientToken(string lID)
{
WebServices.Session.m_ClientToken = SessionToken.Generate(WebServices.Environment.APIVersion, lID, WebServices.Environment.APISecret, WebServices.ServerTime);
return WebServices.Session.m_ClientToken;
}
// Token: 0x06000981 RID: 2433 RVA: 0x0005C158 File Offset: 0x0005A358
internal static Dictionary<string, object> TransformToAllBundle(string lAPI, Dictionary<string, object> lPayload)
{
lPayload = WebServices.PatchPayloadWithSessionData(lPayload);
lPayload.Remove("api_version");
lPayload.Remove("client_token");
lPayload.Remove("session_token");
List<Dictionary<string, object>> value = new List<Dictionary<string, object>>
{
new Dictionary<string, object>
{
{
lAPI,
lPayload
}
}
};
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"api_version",
WebServices.Environment.APIVersion
},
{
"operations",
value
}
};
if (string.IsNullOrEmpty(WebServices.Session.m_SessionToken))
{
if (!string.IsNullOrEmpty(WebServices.Session.m_SocialNetworkID))
{
dictionary.Add("client_token", WebServices.GenerateClientToken(WebServices.Session.m_SocialNetworkID));
}
}
else
{
dictionary.Add("session_token", WebServices.Session.m_SessionToken);
}
return dictionary;
}
// Token: 0x06000982 RID: 2434 RVA: 0x0005C23C File Offset: 0x0005A43C
private static void ConnectionLost()
{
WebServices.State = WebServices.eState.ConnectionLost;
WebServices.m_ConnectionIssueTimeStamp = UnixTime.Now();
LKWD.WebService.Debug.Logger.LogInfo("WebServices::Client::OnConnectionIssue Event Connection Lost");
WebServices.m_ConnectionIssue = true;
try
{
if (WebServices.OnConnectionIssue != null)
{
WebServices.OnConnectionIssue(WebServices.m_ConnectionIssue);
}
}
catch (Exception ex)
{
LKWD.WebService.Debug.Logger.LogWarning("WebServices::Client::OnConnectionIssue Event hit Exception -> " + ex.Message);
}
}
// Token: 0x06000983 RID: 2435 RVA: 0x0005C2B4 File Offset: 0x0005A4B4
private static void ConnectionPresent()
{
if (WebServices.m_ConnectionIssue)
{
LKWD.WebService.Debug.Logger.LogInfo("WebServices::Client::OnConnectionIssue Event Connection Present");
WebServices.m_ConnectionIssue = false;
try
{
if (WebServices.OnConnectionIssue != null)
{
WebServices.OnConnectionIssue(WebServices.m_ConnectionIssue);
}
}
catch (Exception ex)
{
LKWD.WebService.Debug.Logger.LogWarning("WebServices::Client::OnConnectionIssue Event hit Exception -> " + ex.Message);
}
}
}
// Token: 0x06000984 RID: 2436 RVA: 0x0005C324 File Offset: 0x0005A524
public static bool RegisterMockAPIFunction(IMockFunction lAPIFunction)
{
bool result = false;
if (!WebServices.m_MockAPIFunctions.ContainsKey(lAPIFunction.GetAPI()))
{
WebServices.m_MockAPIFunctions.Add(lAPIFunction.GetAPI(), lAPIFunction);
result = true;
}
return result;
}
// Token: 0x06000985 RID: 2437 RVA: 0x0001C3BC File Offset: 0x0001A5BC
public static void DeRegisterMockAPIFunction(string lAPI)
{
WebServices.m_MockAPIFunctions.Remove(lAPI);
}
// Token: 0x06000986 RID: 2438 RVA: 0x0005C35C File Offset: 0x0005A55C
public static IWebRequest ServiceAvailability(string lClientIdentityHash)
{
LKWD.WebService.Debug.Logger.LogInfo("WebServices :: ServiceAvailability");
IWebRequest webRequest = WebServices.CreateRequest("application/service_availability/", null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
webRequest.AddHeader("X-Avkn-ClientHash", lClientIdentityHash);
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x06000987 RID: 2439 RVA: 0x0001C3CA File Offset: 0x0001A5CA
[Obsolete("Prefer 'ServiceAvailability' instead.", true)]
public static IWebRequest CanRegister()
{
LKWD.WebService.Debug.Logger.LogInfo("WebServices :: CanRegister");
return WebServices.SubmitRequest("application/can_register/", null, eWebRequestType.Standard);
}
// Token: 0x06000988 RID: 2440 RVA: 0x0001C3E2 File Offset: 0x0001A5E2
[Obsolete("Prefer 'ServiceAvailability' instead.", true)]
public static IWebRequest CanLogin()
{
LKWD.WebService.Debug.Logger.LogInfo("WebServices :: CanLogin");
return WebServices.SubmitRequest("application/can_login/", null, eWebRequestType.Standard);
}
// Token: 0x06000989 RID: 2441 RVA: 0x0001C3FA File Offset: 0x0001A5FA
public static IWebRequest ConnectionCheck()
{
LKWD.WebService.Debug.Logger.LogInfo("WebServices :: ConnectionCheck");
return WebServices.SubmitRequest("application/can_login/", null, eWebRequestType.Standard);
}
// Token: 0x0600098A RID: 2442 RVA: 0x0005C394 File Offset: 0x0005A594
public static IWebRequest SignIn(string lToken)
{
LKWD.WebService.Debug.Logger.LogInfo("WebServices :: SignIn");
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"token",
lToken
},
{
"client_token",
WebServices.GenerateClientToken(WebServices.Session.m_SouqaID)
}
};
if (!Platform.UseRemovedPrimaryChannel)
{
dictionary.Add("prime_channel_marker", WebServices.Session.PrimaryChannelMarker);
}
eWebRequestType lRequestType = eWebRequestType.SessionData | eWebRequestType.Replayable;
return WebServices.SubmitRequest("application/signin/", dictionary, lRequestType);
}
// Token: 0x0600098B RID: 2443 RVA: 0x0005C40C File Offset: 0x0005A60C
public static IWebRequest SignOut()
{
LKWD.WebService.Debug.Logger.LogInfo("WebServices :: SignOut");
Dictionary<string, object> dictionary = new Dictionary<string, object>();
if (!Platform.UseRemovedPrimaryChannel)
{
dictionary.Add("prime_channel_marker", WebServices.Session.PrimaryChannelMarker);
}
eWebRequestType lRequestType = eWebRequestType.SessionData | eWebRequestType.Replayable;
return WebServices.SubmitRequest("application/signout/", dictionary, lRequestType);
}
// Token: 0x0600098C RID: 2444 RVA: 0x0005C45C File Offset: 0x0005A65C
public static IWebRequest SetRating(int lInstanceID, int lRating)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"instance_id",
lInstanceID
},
{
"rating",
lRating
}
};
IWebRequest lRequest = WebServices.CreateRequest("ratings/area_set/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600098D RID: 2445 RVA: 0x0005C4A8 File Offset: 0x0005A6A8
public static IWebRequest GetUserRating(int lInstanceID)
{
IWebRequest lRequest = WebServices.CreateRequest(string.Format("ratings/area_get_own/?instance_id={0}", lInstanceID), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600098E RID: 2446 RVA: 0x0005C4D8 File Offset: 0x0005A6D8
public static IWebRequest GetRating(params int[] lInstanceIDList)
{
StringBuilder stringBuilder = new StringBuilder().Append("ratings/area_get/");
for (int i = 0; i < lInstanceIDList.Length; i++)
{
stringBuilder.Append((i != 0) ? "&" : "?").Append("instance_id=").Append(lInstanceIDList[i]);
}
IWebRequest lRequest = WebServices.CreateRequest(stringBuilder.ToString(), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600098F RID: 2447 RVA: 0x0005C550 File Offset: 0x0005A750
public static IWebRequest ClearRatings(int lAreaID)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"id",
lAreaID
}
};
IWebRequest lRequest = WebServices.CreateRequest("ratings/area_clear/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000990 RID: 2448 RVA: 0x0005C58C File Offset: 0x0005A78C
public static IWebRequest GetArea(string userID, string lAreaID)
{
IWebRequest lRequest = WebServices.CreateRequest(string.Format("areas/get/?id={0}", lAreaID), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000991 RID: 2449 RVA: 0x0005C5B4 File Offset: 0x0005A7B4
public static IWebRequest GetHeaderData(int lAreaID, string lFriendID = null)
{
string lAPI = string.Format("areas/get_header/?id={0}", lAreaID);
if (!string.IsNullOrEmpty(lFriendID))
{
lAPI = string.Format("areas/get_header/?id={0}&friend={1}", lAreaID, lFriendID);
}
IWebRequest lRequest = WebServices.CreateRequest(lAPI, null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000992 RID: 2450 RVA: 0x0005C600 File Offset: 0x0005A800
public static IWebRequest GetAllAreas()
{
IWebRequest lRequest = WebServices.CreateRequest("areas/list/", null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000993 RID: 2451 RVA: 0x0005C624 File Offset: 0x0005A824
public static IWebRequest GetAllAreasBySouqaID(long lUserID)
{
IWebRequest lRequest = WebServices.CreateRequest(string.Format("areas/list/?friend={0}", lUserID), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000994 RID: 2452 RVA: 0x0005C654 File Offset: 0x0005A854
public static IWebRequest SaveArea(Dictionary<string, object> lHeaderData, Dictionary<string, object> lAreaData, WebServices.eAreaStatus lStatus, string[] lTags, string lName, int? lAreaID = null)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"data",
JsonWriter.Serialize(lAreaData)
},
{
"status",
lStatus.ToString().ToLower()
},
{
"name",
lName
}
};
if (lAreaID.HasValue)
{
dictionary.Add("id", lAreaID.Value);
}
if (lHeaderData != null)
{
dictionary.Add("header", JsonWriter.Serialize(lHeaderData));
}
if (lTags != null)
{
dictionary.Add("tags", lTags);
}
IWebRequest lRequest = WebServices.CreateRequest("areas/save/", dictionary, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000995 RID: 2453 RVA: 0x0005C704 File Offset: 0x0005A904
public static IWebRequest SaveAreaHeader(int lAreaID, string lAreaName, Dictionary<string, object> lHeaderData, WebServices.eAreaStatus lStatus)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"id",
lAreaID
},
{
"name",
lAreaName
},
{
"header",
JsonWriter.Serialize(lHeaderData)
},
{
"status",
lStatus.ToString().ToLower()
}
};
IWebRequest lRequest = WebServices.CreateRequest("areas/save/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000996 RID: 2454 RVA: 0x0005C778 File Offset: 0x0005A978
public static IWebRequest SetDefaultAvakinId(int lAvakinId)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"default_avakin_id",
lAvakinId
}
};
IWebRequest lRequest = WebServices.CreateRequest("avakins/set_default/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000997 RID: 2455 RVA: 0x0005C7B4 File Offset: 0x0005A9B4
public static IWebRequest LoadAvakin(string lUserId)
{
IWebRequest lRequest = WebServices.CreateRequest(string.Format("avakins/get/?friend={0}", lUserId), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000998 RID: 2456 RVA: 0x0005C7DC File Offset: 0x0005A9DC
internal static IWebRequest SaveDefaultAvakin(string lAvakin)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"data",
lAvakin
},
{
"private",
false
},
{
"tags",
new List<string>().ToArray()
}
};
IWebRequest lRequest = WebServices.CreateRequest("avakins/save/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000999 RID: 2457 RVA: 0x0005C838 File Offset: 0x0005AA38
public static IWebRequest SaveAvakin(AvakinConfig lAvakin)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"data",
lAvakin.CreateJsonAvakin(false, false)
},
{
"private",
false
},
{
"tags",
lAvakin.Tags.ToArray()
}
};
if (lAvakin.Id != 0)
{
dictionary.Add("id", lAvakin.Id);
}
IWebRequest lRequest = WebServices.CreateRequest("avakins/save/", dictionary, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600099A RID: 2458 RVA: 0x0005C8C0 File Offset: 0x0005AAC0
public static IWebRequest DeleteAvakin(params int[] lAvakinIDList)
{
IWebRequest lRequest = WebServices.CreateRequest("avakins/del/", lAvakinIDList, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600099B RID: 2459 RVA: 0x0005C8E4 File Offset: 0x0005AAE4
public static IWebRequest SavePetkin(Dictionary<string, object> lPetkinData)
{
IWebRequest lRequest = WebServices.CreateRequest("avapets/save/", lPetkinData, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600099C RID: 2460 RVA: 0x0005C908 File Offset: 0x0005AB08
public static IWebRequest GetPetkin(int lPetkinUUID)
{
IWebRequest lRequest = WebServices.CreateRequest(string.Format("avapets/getbyid/?id={0}", lPetkinUUID), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600099D RID: 2461 RVA: 0x0005C938 File Offset: 0x0005AB38
public static IWebRequest GetPetkin(string lUserID, string lUID)
{
IWebRequest lRequest = WebServices.CreateRequest(string.Format("avapets/getbyuid/?friend={0}&unique_id={1}", lUserID, lUID), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600099E RID: 2462 RVA: 0x0005C964 File Offset: 0x0005AB64
public static IWebRequest GetAllPetkins(string lUserID)
{
IWebRequest lRequest = WebServices.CreateRequest(string.Format("avapets/get/?friend={0}", lUserID), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x0600099F RID: 2463 RVA: 0x0005C98C File Offset: 0x0005AB8C
public static IWebRequest TouchPetkin(Dictionary<string, object> lPetkinData)
{
IWebRequest lRequest = WebServices.CreateRequest("avapets/touch/", lPetkinData, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A0 RID: 2464 RVA: 0x0005C9B0 File Offset: 0x0005ABB0
public static IWebRequest GetPlaying(string lSouqaId)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"friend",
new Dictionary<string, object>
{
{
"souqa_id",
lSouqaId
}
}
}
};
IWebRequest lRequest = WebServices.CreateRequest("buddys/join/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A1 RID: 2465 RVA: 0x0005C9F8 File Offset: 0x0005ABF8
public static IWebRequest FriendsList()
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/list/", null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A2 RID: 2466 RVA: 0x0005CA1C File Offset: 0x0005AC1C
public static IWebRequest GetUserDetail(string lSouqaID)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/detail_get/?friend=" + lSouqaID, null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A3 RID: 2467 RVA: 0x0005CA44 File Offset: 0x0005AC44
public static IWebRequest FriendsAdd(params string[] lIDList)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/add_buddy/", lIDList, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A4 RID: 2468 RVA: 0x0005CA68 File Offset: 0x0005AC68
public static IWebRequest FriendsDelete(params string[] lIDList)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/del_buddy/", lIDList, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A5 RID: 2469 RVA: 0x0005CA8C File Offset: 0x0005AC8C
public static IWebRequest FriendsSendRequest(params string[] lSouqaIDList)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/add_request/", lSouqaIDList, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A6 RID: 2470 RVA: 0x0005CAB0 File Offset: 0x0005ACB0
public static IWebRequest CancelFriendRequest(params string[] lSouqaIDList)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/del_request/", lSouqaIDList, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A7 RID: 2471 RVA: 0x0005CAD4 File Offset: 0x0005ACD4
public static IWebRequest FriendsReject(params string[] lSouqaIDList)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/rej_request/", lSouqaIDList, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A8 RID: 2472 RVA: 0x0005CAF8 File Offset: 0x0005ACF8
public static IWebRequest FriendsBlock(params string[] lSouqaIDList)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/add_blocked/", lSouqaIDList, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009A9 RID: 2473 RVA: 0x0005CB1C File Offset: 0x0005AD1C
public static IWebRequest FriendsBlockDelete(params string[] lSouqaIDList)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/del_blocked/", lSouqaIDList, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009AA RID: 2474 RVA: 0x0005CB40 File Offset: 0x0005AD40
public static IWebRequest FriendLike(string lSouqaId, bool lLike)
{
if (WebServices.Session.m_SouqaID == lSouqaId)
{
return null;
}
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"like",
lLike
},
{
"friend",
lSouqaId
}
};
IWebRequest lRequest = WebServices.CreateRequest("buddys/set_like/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009AB RID: 2475 RVA: 0x0005CBA0 File Offset: 0x0005ADA0
public static IWebRequest FriendSearch(string lSearchName)
{
if (!string.IsNullOrEmpty(lSearchName))
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/search/?partial_friend=" + lSearchName, null, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
return null;
}
// Token: 0x060009AC RID: 2476 RVA: 0x0005CBD8 File Offset: 0x0005ADD8
public static IWebRequest GetUserName(string lSouqaID)
{
IWebRequest lRequest = WebServices.CreateRequest("buddys/lite_get/?friend=" + lSouqaID, null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009AD RID: 2477 RVA: 0x0005CC00 File Offset: 0x0005AE00
public static IWebRequest GetChallengeData(string[] lFriendIDs, bool lGlobal = false)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>();
if (lFriendIDs != null && lFriendIDs.Length > 0)
{
List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
for (int i = 0; i < lFriendIDs.Length; i++)
{
list.Add(new Dictionary<string, object>
{
{
"souqa_id",
lFriendIDs[i]
}
});
}
dictionary.Add("friends", list.ToArray());
}
if (lGlobal)
{
dictionary.Add("global", lGlobal);
}
IWebRequest lRequest = WebServices.CreateRequest("challenges/get/", dictionary, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009AE RID: 2478 RVA: 0x0005CC98 File Offset: 0x0005AE98
public static IWebRequest CompleteChallenge(string lChallengeName, bool lGlobal)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"challenge",
lChallengeName
}
};
if (lGlobal)
{
dictionary.Add("global", lGlobal);
}
IWebRequest lRequest = WebServices.CreateRequest("challenges/completed/", dictionary, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009AF RID: 2479 RVA: 0x0005CCE8 File Offset: 0x0005AEE8
public static IWebRequest GetCoins()
{
IWebRequest lRequest = WebServices.CreateRequest("balance/16/", null, eWebRequestType.RequiresSession | eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009B0 RID: 2480 RVA: 0x0005CD0C File Offset: 0x0005AF0C
public static IWebRequest SubmitValidateEmail()
{
eWebRequestType lRequestType = eWebRequestType.Replayable | eWebRequestType.RawJSONContent;
IWebRequest lRequest = WebServices.CreateRequest("validate_email/request/", null, lRequestType, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009B1 RID: 2481 RVA: 0x0005CD30 File Offset: 0x0005AF30
public static IWebRequest FBValidatePurchase(string productID, string tokenId, IDictionary<string, object> receipt)
{
IWebRequest webRequest = WebServices.CreateRequest("iap/16/purchase", new Dictionary<string, object>
{
{
"operation",
"complete"
},
{
"method",
"facebook"
},
{
"our_ref",
tokenId
},
{
"item_id",
productID
},
{
"receipt",
receipt
}
}, eWebRequestType.RequiresSession | eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice, eHTTPMethod.POST);
webRequest.OnFinished = new Action<IWebRequest>(WebServices.ValidatePurchaseOnFinished);
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009B2 RID: 2482 RVA: 0x0001C412 File Offset: 0x0001A612
private static void ValidatePurchaseOnFinished(IWebRequest lRequest)
{
if (lRequest.ResponseStatus == eResponseStatus.Successful)
{
if (UserStats.Instance != null)
{
UserStats.Instance.UpdateIAP(lRequest.ResponseData);
}
User.Instance.UpdateInventoryItems(lRequest.ResponseData);
}
}
// Token: 0x060009B3 RID: 2483 RVA: 0x0005CDB0 File Offset: 0x0005AFB0
public static IWebRequest PostFeedback(string lMessage)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"message",
lMessage
}
};
return WebServices.SubmitRequest("feedback/add/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009B4 RID: 2484 RVA: 0x0005CDE0 File Offset: 0x0005AFE0
[Obsolete("Use GiftItems")]
public static IWebRequest GiftItem(string lItem, string lFriend, int? lSalePrice, string lMessage)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"default_version",
WebServices.Environment.ItemCostVersion
},
{
"item_ids",
new string[]
{
lItem
}
},
{
"message",
lMessage
},
{
"friend",
new Dictionary<string, object>
{
{
"souqa_id",
lFriend
}
}
}
};
if (lSalePrice.HasValue)
{
dictionary.Add("sale_price", lSalePrice);
}
IWebRequest webRequest = WebServices.CreateRequest("items/gift_many/", dictionary, eWebRequestType.Default, eHTTPMethod.POST);
IWebRequest expr_8E = webRequest;
expr_8E.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_8E.OnFinished, new Action<IWebRequest>(WebServices.PurchaseCallback));
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009B5 RID: 2485 RVA: 0x0005CEA4 File Offset: 0x0005B0A4
public static IWebRequest GiftCollectItem(string lItem)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"item_id",
lItem
}
};
return WebServices.SubmitRequest("items/gift", lPayload, eWebRequestType.DefaultJson);
}
// Token: 0x060009B6 RID: 2486 RVA: 0x0005CED4 File Offset: 0x0005B0D4
public static IWebRequest InstantGiftStatsCall(string userID)
{
string lAPI = string.Format("code/redeem/?code={0}", userID);
IWebRequest webRequest = WebServices.CreateRequest(lAPI, null, eWebRequestType.RequiresSession, eHTTPMethod.GET);
webRequest.AddHeader("X-Avkn-Session", WebServices.Session.m_SessionToken);
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009B7 RID: 2487 RVA: 0x0005CF14 File Offset: 0x0005B114
public static IWebRequest GetMarketFeed(Dictionary<string, object> lPayload)
{
bool flag = false;
string lAPI = "marketingfeed/user/";
eWebRequestType eWebRequestType = eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.NonCritical;
if (flag)
{
lAPI = "http://localhost:6000/user/";
}
else
{
eWebRequestType |= eWebRequestType.Microservice;
}
IWebRequest lRequest = WebServices.CreateRequest(lAPI, lPayload, eWebRequestType, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009B8 RID: 2488 RVA: 0x0005CF58 File Offset: 0x0005B158
public static IWebRequest GetMysteryBoxState()
{
eWebRequestType lRequestType = eWebRequestType.Replayable | eWebRequestType.RawJSONContent;
IWebRequest lRequest = WebServices.CreateRequest("mbox/state/", null, lRequestType, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009B9 RID: 2489 RVA: 0x0005CF7C File Offset: 0x0005B17C
public static IWebRequest MysteryBoxVideoStarted(bool VideoOrPaid, bool IsAGemBox)
{
if (VideoOrPaid)
{
IWebRequest lRequest = WebServices.CreateRequest("mbox/play?currency=video", null, eWebRequestType.RequiresSession, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
if (IsAGemBox)
{
IWebRequest lRequest2 = WebServices.CreateRequest("mbox/play?currency=gems", null, eWebRequestType.RequiresSession, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest2);
}
IWebRequest lRequest3 = WebServices.CreateRequest("mbox/play?currency=coins", null, eWebRequestType.RequiresSession, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest3);
}
// Token: 0x060009BA RID: 2490 RVA: 0x0005CFD4 File Offset: 0x0005B1D4
public static IWebRequest SetProfileImage(string uuid, Action<IWebRequest> OnFinished)
{
DebugLogger.Log("<color=yellow>PhotoService : SetProfileImage uuid " + uuid + "</color>");
eWebRequestType lRequestType = eWebRequestType.SessionData | eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice;
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"id",
uuid
}
};
IWebRequest webRequest = WebServices.CreateRequest("imageapi/v1/profile/", lPayload, lRequestType, eHTTPMethod.POST);
webRequest.OnFinished = OnFinished;
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009BB RID: 2491 RVA: 0x0005D028 File Offset: 0x0005B228
public static IWebRequest GetProfileImages(List<string> userIDs, int sizeMask, Action<IWebRequest> OnFinishedCallback, Action<WebServices.PhotoJob, Texture2D> OnJobFinishedCallback)
{
eWebRequestType lRequestType = eWebRequestType.SessionData | eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice;
StringBuilder stringBuilder = new StringBuilder().Append("imageapi/v1").Append("/profile/");
foreach (string current in userIDs)
{
stringBuilder.Append(current).Append(",");
}
stringBuilder.Length--;
IWebRequest webRequest = WebServices.CreateRequest(stringBuilder.ToString(), null, lRequestType, eHTTPMethod.GET);
webRequest.OnFinished = OnFinishedCallback;
WebServices.PhotoJob photoJob = new WebServices.PhotoJob(sizeMask, OnJobFinishedCallback);
foreach (string current2 in userIDs)
{
photoJob.m_PhotoIDs.Add(current2);
}
webRequest.AdditionalData = photoJob;
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009BC RID: 2492 RVA: 0x0005D134 File Offset: 0x0005B334
public static IWebRequest GetPhotoServiceStatus(Action<IWebRequest> OnFinishedCallback, Action<WebServices.PhotoServiceStatus, bool> OnJobFinishedCallback)
{
WebServices.PhotoServiceStatus additionalData = new WebServices.PhotoServiceStatus(OnJobFinishedCallback);
return WebServices.GetPhotoServiceStatus(OnFinishedCallback, additionalData);
}
// Token: 0x060009BD RID: 2493 RVA: 0x0005D150 File Offset: 0x0005B350
public static IWebRequest GetPhotoServiceStatus(Action<IWebRequest> onFinishedCallback, object additionalData = null)
{
eWebRequestType lRequestType = eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice;
Dictionary<string, object> lPayload = new Dictionary<string, object>();
IWebRequest webRequest = WebServices.CreateRequest("imageapi/v1/service_status", lPayload, lRequestType, eHTTPMethod.GET);
webRequest.OnFinished = onFinishedCallback;
if (additionalData != null)
{
webRequest.AdditionalData = additionalData;
}
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009BE RID: 2494 RVA: 0x0001C449 File Offset: 0x0001A649
public static string GetMediaApiUrl(string uuid)
{
return "imageapi/v1/images/" + uuid;
}
// Token: 0x060009BF RID: 2495 RVA: 0x0001C456 File Offset: 0x0001A656
public static string GetMediaApiUrl(List<string> uuids)
{
return "imageapi/v1/images/" + string.Join(",", uuids.ToArray());
}
// Token: 0x060009C0 RID: 2496 RVA: 0x0005D190 File Offset: 0x0005B390
public static string GetFullMediaUrl(string uuid)
{
string text = WebServices.Environment.APIEndpoint;
if (text.EndsWith("api/"))
{
text = text.Remove(text.Length - 4);
}
return text + WebServices.GetMediaApiUrl(uuid);
}
// Token: 0x060009C1 RID: 2497 RVA: 0x0005D1D8 File Offset: 0x0005B3D8
public static IWebRequest GetMediaMetaData(List<string> uuids, bool thumbnails, Action<IWebRequest> onfinishedCallback)
{
eWebRequestType lRequestType = eWebRequestType.SessionData | eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice;
Dictionary<string, object> lPayload = new Dictionary<string, object>();
string lAPI;
if (thumbnails)
{
lAPI = WebServices.GetMediaApiUrl(uuids) + "?thumbnails=true";
}
else
{
lAPI = WebServices.GetMediaApiUrl(uuids);
}
IWebRequest webRequest = WebServices.CreateRequest(lAPI, lPayload, lRequestType, eHTTPMethod.GET);
webRequest.OnFinished = onfinishedCallback;
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009C2 RID: 2498 RVA: 0x0005D228 File Offset: 0x0005B428
public static IWebRequest DeleteMedia(string uuid, Action<IWebRequest> onfinishedCallback)
{
eWebRequestType lRequestType = eWebRequestType.SessionData | eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice;
Dictionary<string, object> lPayload = new Dictionary<string, object>();
IWebRequest webRequest = WebServices.CreateRequest(WebServices.GetMediaApiUrl(uuid), lPayload, lRequestType, eHTTPMethod.DELETE);
webRequest.OnFinished = onfinishedCallback;
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009C3 RID: 2499 RVA: 0x0005D25C File Offset: 0x0005B45C
public static IWebRequest UploadMedia(WebServices.MediaImageType imageType, byte[] imageData, Action<IWebRequest> onfinishedCallback)
{
if (imageData == null)
{
DebugLogger.LogError("UploadMedia passed null bytes");
if (onfinishedCallback != null)
{
onfinishedCallback(null);
}
return null;
}
eWebRequestType lRequestType = eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice;
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"image_type",
imageType.ToString()
},
{
"metadata",
new Dictionary<string, object>
{
{
"content_length",
imageData.Length
},
{
"content_md5",
LKWD.Utils.Hashing.MD5.ConvertHexStringToBase64(LKWD.Utils.Hashing.MD5.GenerateHash(imageData))
},
{
"content_type",
"image/webp"
}
}
},
{
"ppid",
"public"
}
};
IWebRequest webRequest = WebServices.CreateRequest("imageapi/v1/requestupload/", lPayload, lRequestType, eHTTPMethod.POST);
webRequest.OnFinished = onfinishedCallback;
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009C4 RID: 2500 RVA: 0x0001C472 File Offset: 0x0001A672
public static IWebRequest UploadProfilePic(byte[] lImageData)
{
return WebServices.UploadPicture(lImageData, "Profile", "Profile");
}
// Token: 0x060009C5 RID: 2501 RVA: 0x0001C484 File Offset: 0x0001A684
public static IWebRequest UploadPicture(byte[] lImageData, string lName, string lType)
{
return WebServices.SubmitRequest("picture/upload/", null, eWebRequestType.Default);
}
// Token: 0x060009C6 RID: 2502 RVA: 0x0001C493 File Offset: 0x0001A693
public static string UserPicUrl(int lPicId)
{
return WebServices.FriendPicUrl(lPicId, WebServices.Session.m_SouqaID);
}
// Token: 0x060009C7 RID: 2503 RVA: 0x0001C4A5 File Offset: 0x0001A6A5
public static string FriendPicUrl(int lPicId, string lSouqaID)
{
return string.Concat(new string[]
{
WebServices.Environment.APIEndpoint,
"picture/get/",
lPicId.ToString(),
"/",
lSouqaID
});
}
// Token: 0x060009C8 RID: 2504 RVA: 0x0005D324 File Offset: 0x0005B524
public static IWebRequest LoadProfile(string lUserId, string lEmailAddress, string lAccessToken, string[] lEntries, string[] lRestrictedEntries)
{
WebServices.Session.m_SocialNetworkID = lUserId;
Dictionary<string, object> dictionary = new Dictionary<string, object>();
dictionary.Add("project", WebServices.Environment.ProjectName);
dictionary.Add("access_token", lAccessToken);
WebServices.InjectSystemField(dictionary);
if (!Platform.UseRemovedPrimaryChannel)
{
dictionary.Add("prime_channel_marker", WebServices.Session.PrimaryChannelMarker);
}
if (!string.IsNullOrEmpty(lEmailAddress))
{
dictionary.Add("email_address", lEmailAddress);
}
if (lEntries != null && lEntries.Length > 0)
{
dictionary.Add("userentry_keys", lEntries);
}
if (lRestrictedEntries != null && lRestrictedEntries.Length > 0)
{
dictionary.Add("restrictedentry_keys", lRestrictedEntries);
}
IWebRequest webRequest = WebServices.CreateRequest("get_profile/", dictionary, eWebRequestType.Replayable | eWebRequestType.LegacyBundleCall, eHTTPMethod.POST);
IWebRequest expr_BC = webRequest;
expr_BC.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_BC.OnFinished, new Action<IWebRequest>(WebServices.LoadProfileCallback));
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009C9 RID: 2505 RVA: 0x0005D414 File Offset: 0x0005B614
public static IWebRequest LoadProfileViaLoginDetail(LoginDetails lLoginDetails, string[] lEntries, string[] lRestrictedEntries)
{
WebServices.Session.m_SocialNetworkID = lLoginDetails.Id;
Dictionary<string, object> value = new Dictionary<string, object>
{
{
lLoginDetails.Type,
lLoginDetails.Id
}
};
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"user",
value
},
{
"project",
WebServices.Environment.ProjectName
}
};
if (lLoginDetails.Type == "ios")
{
dictionary.Add("gc_access", lLoginDetails.AccessToken);
}
else
{
if (!string.IsNullOrEmpty(lLoginDetails.AccessToken))
{
dictionary.Add("access_token", lLoginDetails.AccessToken);
}
if (!string.IsNullOrEmpty(lLoginDetails.AccessCode))
{
dictionary.Add("access_code", lLoginDetails.AccessCode);
}
}
WebServices.InjectSystemField(dictionary);
if (!Platform.UseRemovedPrimaryChannel)
{
dictionary.Add("prime_channel_marker", WebServices.Session.PrimaryChannelMarker);
}
if (!string.IsNullOrEmpty(lLoginDetails.Email))
{
dictionary.Add("email_address", lLoginDetails.Email);
}
dictionary.Add("birthday", lLoginDetails.DateOfBirth);
if (!string.IsNullOrEmpty(lLoginDetails.Gender))
{
dictionary.Add("gender", lLoginDetails.Gender);
}
if (!string.IsNullOrEmpty(lLoginDetails.UserName))
{
dictionary.Add("real_name", lLoginDetails.UserName);
}
if (lEntries != null && lEntries.Length > 0)
{
dictionary.Add("userentry_keys", lEntries);
}
if (lRestrictedEntries != null && lRestrictedEntries.Length > 0)
{
dictionary.Add("restrictedentry_keys", lRestrictedEntries);
}
IWebRequest webRequest = WebServices.CreateRequest("get_profile/", dictionary, eWebRequestType.Replayable | eWebRequestType.LegacyBundleCall, eHTTPMethod.POST);
IWebRequest expr_1A9 = webRequest;
expr_1A9.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_1A9.OnFinished, new Action<IWebRequest>(WebServices.LoadProfileCallback));
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009CA RID: 2506 RVA: 0x0005D5F4 File Offset: 0x0005B7F4
public static IWebRequest LoadProfileViaEmail(string lEmail, string lPassword, string[] lEntries, string[] lRestrictedEntries)
{
WebServices.Session.m_SocialNetworkID = lEmail;
Dictionary<string, object> dictionary = new Dictionary<string, object>();
Dictionary<string, object> value = new Dictionary<string, object>
{
{
"email_address",
lEmail
},
{
"password",
WebServices.EncryptPassword(lPassword)
}
};
dictionary.Add("user", value);
if (!Platform.UseRemovedPrimaryChannel)
{
dictionary.Add("prime_channel_marker", WebServices.Session.PrimaryChannelMarker);
}
if (lEntries != null && lEntries.Length > 0)
{
dictionary.Add("userentry_keys", lEntries);
}
if (lRestrictedEntries != null && lRestrictedEntries.Length > 0)
{
dictionary.Add("restrictedentry_keys", lRestrictedEntries);
}
IWebRequest webRequest = WebServices.CreateRequest("get_profile/", dictionary, eWebRequestType.Replayable | eWebRequestType.LegacyBundleCall, eHTTPMethod.POST);
IWebRequest expr_AC = webRequest;
expr_AC.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_AC.OnFinished, new Action<IWebRequest>(WebServices.LoadProfileCallback));
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009CB RID: 2507 RVA: 0x0005D6D4 File Offset: 0x0005B8D4
public static IWebRequest LoadProfileViaToken(string lSouqaId, string lTokenId, string[] lEntries, string[] lRestrictedEntries)
{
WebServices.Session.m_SouqaID = lSouqaId;
WebServices.Session.m_SocialNetworkID = lSouqaId;
WebServices.Session.m_ApplicationToken = lTokenId;
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"token",
lTokenId
}
};
if (!Platform.UseRemovedPrimaryChannel)
{
dictionary.Add("prime_channel_marker", WebServices.Session.PrimaryChannelMarker);
}
if (lEntries != null && lEntries.Length > 0)
{
dictionary.Add("userentry_keys", lEntries);
}
if (lRestrictedEntries != null && lRestrictedEntries.Length > 0)
{
dictionary.Add("restrictedentry_keys", lRestrictedEntries);
}
IWebRequest webRequest = WebServices.CreateRequest("get_profile/", dictionary, eWebRequestType.Replayable | eWebRequestType.LegacyBundleCall, eHTTPMethod.POST);
IWebRequest expr_9F = webRequest;
expr_9F.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_9F.OnFinished, new Action<IWebRequest>(WebServices.LoadProfileCallback));
return WebServices.SubmitRequest(webRequest);
}
// Token: 0x060009CC RID: 2508 RVA: 0x0005D7A8 File Offset: 0x0005B9A8
internal static void LoadProfileCallback(IWebRequest lRequest)
{
if (lRequest.ResponseStatus == eResponseStatus.Successful)
{
Dictionary<string, object> responseData = lRequest.ResponseData;
WebServices.LoadProfileData(responseData);
}
}
// Token: 0x060009CD RID: 2509 RVA: 0x0005D7D0 File Offset: 0x0005B9D0
internal static void LoadProfileData(Dictionary<string, object> lData)
{
if (lData.ContainsKey("server_time"))
{
WebServices.ServerTime = new DateTime(1970, 1, 1, 0, 0, 0);
WebServices.ServerTime = WebServices.ServerTime.AddSeconds((double)((int)lData["server_time"]));
}
Dictionary<string, object> dictionary = (Dictionary<string, object>)lData["user_data"];
if (dictionary.ContainsKey("souqa_id"))
{
WebServices.Session.m_SouqaID = dictionary["souqa_id"].ToString();
}
else
{
WebServices.Session.m_SouqaID = dictionary["id"].ToString();
}
WebServices.Session.m_Debug = dictionary.ContainsKey("debug");
WebServices.Session.Developer = dictionary.ContainsKey("developer");
WebServices.Session.m_DevServer = dictionary.ContainsKey("dev_server");
if (WebServices.Session.m_Debug)
{
DebugVU.State(DebugVU.eState.On);
}
else
{
DebugVU.State(DebugVU.eState.Off);
}
User.Instance.LoadProfile(lData, string.Empty);
}
// Token: 0x060009CE RID: 2510 RVA: 0x0005D8F8 File Offset: 0x0005BAF8
public static IWebRequest PromoCodeCall(string PromoCode)
{
string lAPI = string.Format("code/redeem/?code={0}", PromoCode);
IWebRequest lRequest = WebServices.CreateRequest(lAPI, null, eWebRequestType.RequiresSession, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009CF RID: 2511 RVA: 0x0001C4DD File Offset: 0x0001A6DD
public static IWebRequest GetPromotions()
{
throw new NotImplementedException("GetPromotions");
}
// Token: 0x060009D0 RID: 2512 RVA: 0x0005D924 File Offset: 0x0005BB24
public static IWebRequest GetRewardWheelSpin(string lCampaign)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"campaign",
lCampaign
}
};
return WebServices.SubmitRequest("promocamp/spin/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009D1 RID: 2513 RVA: 0x0005D954 File Offset: 0x0005BB54
[Obsolete("Please use PaymentService.PurchaseQueryInventory")]
public static IWebRequest PurchaseQueryInventory(string lCurrencyCode, string lPlatform)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"method",
"paypal"
},
{
"currency",
lCurrencyCode
}
};
if (!string.IsNullOrEmpty(lPlatform))
{
dictionary.Add("platform", lPlatform);
}
return WebServices.SubmitRequest("items/list_packs/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009D2 RID: 2514 RVA: 0x0005D9AC File Offset: 0x0005BBAC
[Obsolete("Use the PurchaseItem call that takes a single item ID and optional friend ID for gifting.", true)]
public static IWebRequest GiftItems(List<string> lItemList, List<int?> lSalePrices, List<string> lFriends, string lMessage)
{
List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
for (int i = lItemList.Count - 1; i > -1; i--)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>();
dictionary.Add("unique_id", lItemList[i]);
if (lSalePrices != null && lSalePrices[i].HasValue)
{
dictionary.Add("sale_price", lSalePrices[i]);
}
list.Add(dictionary);
}
Dictionary<string, object> dictionary2 = new Dictionary<string, object>();
for (int j = lFriends.Count - 1; j > -1; j--)
{
dictionary2.Add("souqa_id", lFriends[j]);
}
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"default_version",
WebServices.Environment.ItemCostVersion
},
{
"item_ids",
list.ToArray()
},
{
"friend",
dictionary2
},
{
"message",
lMessage
}
};
IWebRequest webRequest = WebServices.SubmitRequest("items/gift_many/", lPayload, eWebRequestType.Default);
IWebRequest expr_10C = webRequest;
expr_10C.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_10C.OnFinished, new Action<IWebRequest>(WebServices.PurchaseCallback));
return webRequest;
}
// Token: 0x060009D3 RID: 2515 RVA: 0x0005DAE8 File Offset: 0x0005BCE8
[Obsolete("Use the PurchaseItem call that takes a single item ID and optional friend ID for gifting.", true)]
public static IWebRequest PurchaseItems(List<string> lItemList, List<int?> lSalePrices)
{
List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
for (int i = lItemList.Count - 1; i > -1; i--)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>();
dictionary.Add("unique_id", lItemList[i]);
if (lSalePrices != null && lSalePrices[i].HasValue)
{
dictionary.Add("sale_price", lSalePrices[i]);
}
list.Add(dictionary);
}
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"default_version",
WebServices.Environment.ItemCostVersion
},
{
"item_ids",
list.ToArray()
}
};
IWebRequest webRequest = WebServices.SubmitRequest("items/purchase_many/", lPayload, eWebRequestType.Default);
IWebRequest expr_BA = webRequest;
expr_BA.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_BA.OnFinished, new Action<IWebRequest>(WebServices.PurchaseCallback));
return webRequest;
}
// Token: 0x060009D4 RID: 2516 RVA: 0x0005DBD4 File Offset: 0x0005BDD4
[Obsolete("Use the PurchaseItem call that takes a single item ID and optional friend ID for gifting.", true)]
public static IWebRequest PurchaseItem(string lItemCoins, int? lSalePrice)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"default_version",
WebServices.Environment.ItemCostVersion
},
{
"item_ids",
new string[]
{
lItemCoins
}
}
};
if (lSalePrice.HasValue)
{
dictionary.Add("sale_price", lSalePrice);
}
IWebRequest webRequest = WebServices.SubmitRequest("items/purchase_many/", dictionary, eWebRequestType.Default);
IWebRequest expr_63 = webRequest;
expr_63.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_63.OnFinished, new Action<IWebRequest>(WebServices.PurchaseCallback));
return webRequest;
}
// Token: 0x060009D5 RID: 2517 RVA: 0x0005DC68 File Offset: 0x0005BE68
public static IWebRequest PurchaseItem(string itemID, string friendID = null)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"item_id",
itemID
}
};
if (!string.IsNullOrEmpty(friendID))
{
int num = int.Parse(friendID);
dictionary.Add("friend_id", num);
}
IWebRequest webRequest = WebServices.SubmitRequest("purchase/item", dictionary, eWebRequestType.DefaultJson);
if (string.IsNullOrEmpty(friendID))
{
IWebRequest expr_51 = webRequest;
expr_51.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_51.OnFinished, new Action<IWebRequest>(WebServices.PurchaseCallback));
}
return webRequest;
}
// Token: 0x060009D6 RID: 2518 RVA: 0x0001C4E9 File Offset: 0x0001A6E9
private static void PurchaseCallback(IWebRequest lRequest)
{
if (lRequest.ResponseStatus == eResponseStatus.Successful)
{
User.Instance.UpdateInventoryItems(lRequest.ResponseData);
}
}
// Token: 0x060009D7 RID: 2519 RVA: 0x0005DCE8 File Offset: 0x0005BEE8
[Obsolete("Please use PaymentService.PurchaseStatus")]
public static IWebRequest PurchaseStatus(string lOrderId)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"order_id",
lOrderId
}
};
return WebServices.SubmitRequest("items/purchase_status/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009D8 RID: 2520 RVA: 0x0005DD18 File Offset: 0x0005BF18
[Obsolete("Please use PaymentService.PurchaseGenerateToken")]
public static IWebRequest PurchaseGenerateToken(string lFriendID, string lProductId, string lMethod)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"item_id",
lProductId
},
{
"method",
lMethod
},
{
"operation",
"own_ref"
}
};
if (!string.IsNullOrEmpty(lFriendID))
{
dictionary.Add("friend", new Dictionary<string, object>
{
{
"souqa_id",
lFriendID
}
});
}
return WebServices.SubmitRequest("items/purchase/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009D9 RID: 2521 RVA: 0x0005DD8C File Offset: 0x0005BF8C
[Obsolete("Please use PaymentService.PurchaseGeneratePayPalToken")]
public static IWebRequest PurchaseGeneratePayPalToken(string lFriendID, string lItemId, string lCurrencyCode)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"item_id",
lItemId
},
{
"method",
"paypal"
},
{
"operation",
"started"
},
{
"currency",
lCurrencyCode
}
};
if (!string.IsNullOrEmpty(lFriendID))
{
Dictionary<string, object> value = new Dictionary<string, object>
{
{
"souqa_id",
lFriendID
}
};
dictionary.Add("friend", value);
}
return WebServices.SubmitRequest("items/purchase/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009DA RID: 2522 RVA: 0x0005DE14 File Offset: 0x0005C014
[Obsolete("Please use PaymentService.PurchaseInAppProductGoogle")]
public static IWebRequest PurchaseInAppProductGoogle(string lUserId, string lFriendId, string lProductId, string lTokenId, string lJsonData, string lSignature, string lOrderId)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"item_id",
lProductId
},
{
"method",
"googleplay"
},
{
"operation",
"complete"
},
{
"our_ref",
lTokenId
},
{
"purchaseorder",
lJsonData
},
{
"signature",
lSignature
},
{
"transaction_id",
lOrderId
}
};
if (!string.IsNullOrEmpty(lFriendId))
{
dictionary.Add("friend", new Dictionary<string, object>
{
{
"souqa_id",
lFriendId
}
});
}
return WebServices.SubmitRequest("items/purchase/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009DB RID: 2523 RVA: 0x0005DEC0 File Offset: 0x0005C0C0
[Obsolete("Please use PaymentService.PurchaseInAppProductITunes")]
public static IWebRequest PurchaseInAppProductITunes(string lUserId, string lFriendId, string lProductId, string lTokenId, string lReceiptData)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"item_id",
lProductId
},
{
"method",
"itunes"
},
{
"operation",
"complete"
},
{
"our_ref",
lTokenId
},
{
"receipt_data",
lReceiptData
}
};
if (!string.IsNullOrEmpty(lFriendId))
{
dictionary.Add("friend", new Dictionary<string, object>
{
{
"souqa_id",
lFriendId
}
});
}
return WebServices.SubmitRequest("items/purchase/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009DC RID: 2524 RVA: 0x0005DF50 File Offset: 0x0005C150
[Obsolete("Please use PaymentService.PurchaseInAppProductAmazon")]
public static IWebRequest PurchaseInAppProductAmazon(string lUserId, string lFriendId, string lAmazonId, string lProductId, string lTokenId, string lPurchaseTokenId)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"item_id",
lProductId
},
{
"method",
"amazon"
},
{
"operation",
"complete"
},
{
"our_ref",
lTokenId
},
{
"externaluser",
lAmazonId
},
{
"purchasetoken",
lPurchaseTokenId
}
};
if (!string.IsNullOrEmpty(lFriendId))
{
dictionary.Add("friend", new Dictionary<string, object>
{
{
"souqa_id",
lFriendId
}
});
}
return WebServices.SubmitRequest("items/purchase/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009DD RID: 2525 RVA: 0x0005DFF0 File Offset: 0x0005C1F0
[Obsolete("Please use PaymentService.PurchaseInAppProductPayPal")]
public static IWebRequest PurchaseInAppProductPayPal(string lFriendID, string lProductId, string lTokenId)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"item_id",
lProductId
},
{
"method",
"paypal"
},
{
"operation",
"poll"
},
{
"our_ref",
lTokenId
}
};
if (!string.IsNullOrEmpty(lFriendID))
{
dictionary.Add("friend", new Dictionary<string, object>
{
{
"souqa_id",
lFriendID
}
});
}
return WebServices.SubmitRequest("items/purchase/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009DE RID: 2526 RVA: 0x0005E074 File Offset: 0x0005C274
[Obsolete("Please use PaymentService.PurchaseCancelled")]
public static IWebRequest PurchaseCancelled(string lMethodId, string lProductId, string lTokenId)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"item_id",
lProductId
},
{
"method",
lMethodId
},
{
"operation",
"cancelled"
},
{
"our_ref",
lTokenId
}
};
return WebServices.SubmitRequest("items/purchase/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009DF RID: 2527 RVA: 0x0005E0CC File Offset: 0x0005C2CC
[Obsolete("Please use PaymentService.PurchaseReset")]
public static IWebRequest PurchaseReset(string lMethodId, string lProductId, string lTokenId)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"item_id",
lProductId
},
{
"method",
lMethodId
},
{
"operation",
"reset"
},
{
"our_ref",
lTokenId
}
};
return WebServices.SubmitRequest("items/purchase/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009E0 RID: 2528 RVA: 0x0005E124 File Offset: 0x0005C324
public static IWebRequest PushNotificationRegister(string lDeviceToken, string lPlatform)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"device_token",
lDeviceToken
},
{
"platform",
lPlatform
}
};
return WebServices.SubmitRequest("user/subscribe/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009E1 RID: 2529 RVA: 0x0001C506 File Offset: 0x0001A706
public static IWebRequest PushNotificationUnRegister(string lDeviceToken, string lPlatform)
{
throw new NotImplementedException("PushNotificationUnRegister");
}
// Token: 0x060009E2 RID: 2530 RVA: 0x0001C512 File Offset: 0x0001A712
public static void PushNotificationMessageUser(string lMessage, int lPriority, string lFriendId)
{
throw new NotImplementedException("PushNotificationMessageUser");
}
// Token: 0x060009E3 RID: 2531 RVA: 0x0005E160 File Offset: 0x0005C360
public static IWebRequest PushNotificationRegister(string lDeviceId, int lDeviceType)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"pwdevice_id",
lDeviceId
},
{
"pwdevice_type",
lDeviceType
}
};
return WebServices.SubmitRequest("pushw/register/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009E4 RID: 2532 RVA: 0x0005E1A0 File Offset: 0x0005C3A0
public static IWebRequest PushNotificationUnRegister(string lDeviceId)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"pwdevice_id",
lDeviceId
}
};
return WebServices.SubmitRequest("pushw/unregister/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009E5 RID: 2533 RVA: 0x0005E1D0 File Offset: 0x0005C3D0
public static IWebRequest PushNotificationSettings(bool lMail, bool lBuddyReq, bool lGift)
{
Dictionary<string, object> value = new Dictionary<string, object>
{
{
"mail_notify",
lMail
},
{
"buddyreq_notify",
lBuddyReq
},
{
"gift_notify",
lGift
}
};
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"settings",
value
}
};
return WebServices.SubmitRequest("pushw/set_settings/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009E6 RID: 2534 RVA: 0x0005E23C File Offset: 0x0005C43C
public static IWebRequest FriendReferralAdd(string[] lEmailList, string lRefererReward, string lRefereeReward)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"friend_email_addresses",
lEmailList
}
};
if (!string.IsNullOrEmpty(lRefereeReward))
{
dictionary.Add("referee_reward", lRefereeReward);
}
if (!string.IsNullOrEmpty(lRefererReward))
{
dictionary.Add("referer_reward", lRefererReward);
}
return WebServices.SubmitRequest("referral/add/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009E7 RID: 2535 RVA: 0x0001C51E File Offset: 0x0001A71E
public static IWebRequest FriendReferralCheck()
{
return WebServices.SubmitRequest("referral/check/", null, eWebRequestType.Default);
}
// Token: 0x060009E8 RID: 2536 RVA: 0x0005E298 File Offset: 0x0005C498
public static IWebRequest RewardListDetails(string[] lRewardIDList, bool lGlobal)
{
StringBuilder stringBuilder = new StringBuilder().Append("rewards/details/").Append("?users_period_count=true");
for (int i = 0; i < lRewardIDList.Length; i++)
{
stringBuilder.Append("&reward=").Append(lRewardIDList[i]);
}
if (lGlobal)
{
stringBuilder.Append("&global=true");
}
IWebRequest lRequest = WebServices.CreateRequest(stringBuilder.ToString(), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009E9 RID: 2537 RVA: 0x0005E310 File Offset: 0x0005C510
public static IWebRequest AwardReward(string lRewardName, bool lGlobal)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"global",
lGlobal
},
{
"reward",
lRewardName
}
};
IWebRequest lRequest = WebServices.CreateRequest("rewards/award/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009EA RID: 2538 RVA: 0x0005E358 File Offset: 0x0005C558
public static IWebRequest RewardReceive(params string[] lRewardArray)
{
IWebRequest lRequest = WebServices.CreateRequest("rewards/receive/", lRewardArray, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009EB RID: 2539 RVA: 0x0005E37C File Offset: 0x0005C57C
public static IWebRequest RewardForLevel()
{
IWebRequest lRequest = WebServices.CreateRequest("projxp/get/", null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009EC RID: 2540 RVA: 0x0005E3A0 File Offset: 0x0005C5A0
public static IWebRequest GetUserXP(string lUserID)
{
IWebRequest lRequest = WebServices.CreateRequest(string.Format("userxp/get/?user={0}", lUserID), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x060009ED RID: 2541 RVA: 0x0005E3C8 File Offset: 0x0005C5C8
public static IWebRequest RequestServerTime()
{
IWebRequest webRequest = WebServices.SubmitRequest("server/time/", null, eWebRequestType.Replayable);
IWebRequest expr_0E = webRequest;
expr_0E.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_0E.OnFinished, new Action<IWebRequest>(WebServices.RequestServerTimeCallback));
return webRequest;
}
// Token: 0x060009EE RID: 2542 RVA: 0x0005E408 File Offset: 0x0005C608
private static void RequestServerTimeCallback(IWebRequest lRequest)
{
if (lRequest.ResponseStatus == eResponseStatus.Successful && lRequest.ResponseData.HasValidKey("server_time"))
{
WebServices.ServerTime = new DateTime(1970, 1, 1, 0, 0, 0);
WebServices.ServerTime = WebServices.ServerTime.AddSeconds((double)((int)lRequest.ResponseData["server_time"]));
Hub.m_HubActionCallback(Hub.eHubAction.ServerTimeUpdated, null);
}
}
// Token: 0x060009EF RID: 2543 RVA: 0x0005E484 File Offset: 0x0005C684
public static IWebRequest GetSettings(params string[] lKeys)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"project",
"avakinlife"
},
{
"keys",
JsonWriter.Serialize(lKeys)
}
};
return WebServices.SubmitRequest("settings/get/", lPayload, eWebRequestType.Replayable | eWebRequestType.XFORMContent);
}
// Token: 0x060009F0 RID: 2544 RVA: 0x0005E4C8 File Offset: 0x0005C6C8
public static IWebRequest RequestShoutcastBlacklist()
{
eWebRequestType lRequestType = eWebRequestType.SessionData | eWebRequestType.Replayable;
return WebServices.SubmitRequest("shoutcast/blacklist/", null, lRequestType);
}
// Token: 0x060009F1 RID: 2545 RVA: 0x0005E4E4 File Offset: 0x0005C6E4
public static IWebRequest TimedResourcePurchaseMachine(bool lGlobal, int lSlotID)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"global",
lGlobal
},
{
"slot",
lSlotID
},
{
"level",
0
}
};
return WebServices.SubmitRequest("items/purchase_mach/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009F2 RID: 2546 RVA: 0x0005E53C File Offset: 0x0005C73C
public static IWebRequest TimedResourceUpgrade(int lSlotID, int lLevel)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"slot",
lSlotID
},
{
"level",
lLevel
}
};
return WebServices.SubmitRequest("items/purchase_mach/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009F3 RID: 2547 RVA: 0x0005E580 File Offset: 0x0005C780
public static IWebRequest TimedResourceBuild(string lItemID, int lResourceID)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"item_id",
lItemID
},
{
"slot_id",
lResourceID
}
};
return WebServices.SubmitRequest("items/build/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009F4 RID: 2548 RVA: 0x0005E5C0 File Offset: 0x0005C7C0
public static IWebRequest TimedResourcePurchaseItem(string lItemID, int lResourceID)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"item_id",
lItemID
},
{
"slot_id",
lResourceID
}
};
return WebServices.SubmitRequest("items/build_purchase/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009F5 RID: 2549 RVA: 0x0005E600 File Offset: 0x0005C800
public static IWebRequest TimedResourceCollectItem(string lItemID, int lResourceID)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"item_id",
lItemID
},
{
"slot_id",
lResourceID
}
};
return WebServices.SubmitRequest("items/build_collect/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009F6 RID: 2550 RVA: 0x0005E640 File Offset: 0x0005C840
public static IWebRequest TimedResourceCancelItem(string lItemID, int lResourceID)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"item_id",
lItemID
},
{
"slot_id",
lResourceID
}
};
return WebServices.SubmitRequest("items/build_cancel/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009F7 RID: 2551 RVA: 0x0005E680 File Offset: 0x0005C880
public static IWebRequest TimedResourceRefresh(int lResourceID)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"slot_id",
lResourceID
}
};
return WebServices.SubmitRequest("items/build_list/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009F8 RID: 2552 RVA: 0x0001C52D File Offset: 0x0001A72D
public static IWebRequest TimedResourceRefresh()
{
return WebServices.SubmitRequest("items/build_list/", null, eWebRequestType.Default);
}
// Token: 0x060009F9 RID: 2553 RVA: 0x0005E6B4 File Offset: 0x0005C8B4
public static IWebRequest TimedResourceBoost(int buildMachineId, string currencyType)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"bm_id",
buildMachineId
},
{
"currency",
currencyType
}
};
WebRequest webRequest = new WebRequest("bmachine/16/boost", lPayload, eWebRequestType.RequiresSession | eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice, eHTTPMethod.POST);
WebServices.SubmitRequest(webRequest);
return webRequest;
}
// Token: 0x060009FA RID: 2554 RVA: 0x0005E700 File Offset: 0x0005C900
public static IWebRequest RegisterNewUser(string lRealName, string lNickname, double lDOB, string lEmail, string lPassword, string lGender, string lAvakinData, bool lNewsLetter, Dictionary<string, object> lAlternativeLogin, string[] lEntries, string[] lRestrictedEntries)
{
WebServices.Session.m_SocialNetworkID = lEmail;
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"api_version",
WebServices.Environment.APIVersion
},
{
"client_token",
WebServices.GenerateClientToken(WebServices.Session.m_SocialNetworkID)
},
{
"project",
WebServices.Environment.ProjectName
},
{
"password",
WebServices.EncryptPassword(lPassword)
},
{
"real_name",
lRealName
},
{
"nickname",
lNickname
},
{
"avakin",
lAvakinData
},
{
"gender",
lGender
},
{
"birthday",
lDOB
},
{
"migrated",
true
},
{
"new_user",
true
},
{
"newsletter_opt_in",
lNewsLetter
}
};
if (lEntries != null && lEntries.Length > 0)
{
dictionary.Add("userentry_keys", lEntries);
}
if (lRestrictedEntries != null && lRestrictedEntries.Length > 0)
{
dictionary.Add("restrictedentry_keys", lRestrictedEntries);
}
dictionary.Add("user", new Dictionary<string, object>
{
{
"email_address",
lEmail
}
});
if (lAlternativeLogin != null)
{
dictionary.Add("user_alternatives", lAlternativeLogin);
}
if (WebServices.Environment.APIVersion >= 12)
{
dictionary.Add("device_id", WebServices.Session.DeviceId);
}
return WebServices.SubmitRequest("user/register/", dictionary, eWebRequestType.Replayable);
}
// Token: 0x060009FB RID: 2555 RVA: 0x0001C53C File Offset: 0x0001A73C
public static IWebRequest RequestValidationEmail(bool lValidate, string lArea)
{
throw new NotImplementedException("RequestValidationEmail");
}
// Token: 0x060009FC RID: 2556 RVA: 0x0005E894 File Offset: 0x0005CA94
public static IWebRequest ChangeProfileData(Dictionary<string, object> lProfileData)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"user",
new Dictionary<string, object>
{
{
"souqa_id",
User.Instance.SouqaID
}
}
}
};
string value = string.Empty;
foreach (KeyValuePair<string, object> current in lProfileData)
{
string key = current.Key;
if (key != null)
{
if (WebServices.<>f__switch$map3 == null)
{
WebServices.<>f__switch$map3 = new Dictionary<string, int>(2)
{
{
"old_password",
0
},
{
"password",
1
}
};
}
int num;
if (WebServices.<>f__switch$map3.TryGetValue(key, out num))
{
if (num == 0)
{
value = WebServices.EncryptPassword((string)current.Value);
continue;
}
if (num == 1)
{
dictionary.Add(current.Key, WebServices.EncryptPassword((string)current.Value));
continue;
}
}
}
dictionary.Add(current.Key, current.Value);
}
if (!string.IsNullOrEmpty(value) && dictionary["user"] is Dictionary<string, object>)
{
Dictionary<string, object> dictionary2 = (Dictionary<string, object>)dictionary["user"];
dictionary2.Add("password", value);
}
return WebServices.SubmitRequest("user/set/", dictionary, eWebRequestType.Default);
}
// Token: 0x060009FD RID: 2557 RVA: 0x0005EA28 File Offset: 0x0005CC28
public static IWebRequest ChangeNickname(string lNickname)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"nickname",
lNickname
}
};
return WebServices.SubmitRequest("user/set_nickname/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009FE RID: 2558 RVA: 0x0005EA58 File Offset: 0x0005CC58
public static IWebRequest ChangeMood(Person.eMood lMood)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"mood",
lMood
}
};
return WebServices.SubmitRequest("user/set_mood/", lPayload, eWebRequestType.Default);
}
// Token: 0x060009FF RID: 2559 RVA: 0x0005EA8C File Offset: 0x0005CC8C
public static IWebRequest ChangeBioTags(List<Person.eBioTag> lBioList)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"bio",
lBioList.ToArray()
}
};
return WebServices.SubmitRequest("user/set_bio/", lPayload, eWebRequestType.Default);
}
// Token: 0x06000A00 RID: 2560 RVA: 0x0001C548 File Offset: 0x0001A748
public static IWebRequest GetLocationFromIP()
{
return WebServices.SubmitRequest("user/geoip/", null, eWebRequestType.Default);
}
// Token: 0x06000A01 RID: 2561 RVA: 0x0005EAC0 File Offset: 0x0005CCC0
public static IWebRequest ChangeLocale(string lLocale)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"language",
lLocale
}
};
return WebServices.SubmitRequest("user/set_locale/", lPayload, eWebRequestType.Default);
}
// Token: 0x06000A02 RID: 2562 RVA: 0x0005EAF0 File Offset: 0x0005CCF0
public static IWebRequest ChangeLocation(string lLocation)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"location",
lLocation
}
};
return WebServices.SubmitRequest("user/set_location/", lPayload, eWebRequestType.Default);
}
// Token: 0x06000A03 RID: 2563 RVA: 0x0005EB20 File Offset: 0x0005CD20
public static IWebRequest ChangeInterestedIn(int lInterestedIn)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"interested_in",
lInterestedIn
}
};
return WebServices.SubmitRequest("user/set_interested_in/", lPayload, eWebRequestType.Default);
}
// Token: 0x06000A04 RID: 2564 RVA: 0x0005EB54 File Offset: 0x0005CD54
public static IWebRequest ChangeRelationshipStatus(int lRelationship)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"relationship_status",
lRelationship
}
};
return WebServices.SubmitRequest("user/set_relationship_status/", lPayload, eWebRequestType.Default);
}
// Token: 0x06000A05 RID: 2565 RVA: 0x0005EB88 File Offset: 0x0005CD88
public static IWebRequest ChangeLookingFor(int lLookingFor)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"looking_for",
lLookingFor
}
};
return WebServices.SubmitRequest("user/set_looking_for/", lPayload, eWebRequestType.Default);
}
// Token: 0x06000A06 RID: 2566 RVA: 0x0005EBBC File Offset: 0x0005CDBC
public static IWebRequest ResetPassword(string lEmailAddress)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"email_address",
lEmailAddress
}
};
return WebServices.SubmitRequest("user/forgotten_password/request/", lPayload, eWebRequestType.Replayable);
}
// Token: 0x06000A07 RID: 2567 RVA: 0x0005EBEC File Offset: 0x0005CDEC
public static IWebRequest GetPlayerStats(bool lUpdateTapjoy)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>();
if (lUpdateTapjoy)
{
dictionary.Add("tapjoy_check", true);
}
return WebServices.SubmitRequest("user/stats_profile/", dictionary, eWebRequestType.Default);
}
// Token: 0x06000A08 RID: 2568 RVA: 0x0005EC24 File Offset: 0x0005CE24
public static IWebRequest CheckUserNameAvailability(string lUserName)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"username",
lUserName
}
};
return WebServices.SubmitRequest("user/username_check/", lPayload, eWebRequestType.Replayable);
}
// Token: 0x06000A09 RID: 2569 RVA: 0x0005EC54 File Offset: 0x0005CE54
public static IWebRequest MigrateAccount(string lSouqaId, string lRealName, string lNickname, double lDOB, string lEmail, string lGender, string lPassword, string lOldPassword, bool lNewsLetter, Dictionary<string, object> lAlternativeLogin)
{
WebServices.Session.m_SocialNetworkID = lSouqaId;
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"api_version",
WebServices.Environment.APIVersion
},
{
"email_address",
lEmail
},
{
"real_name",
lRealName
},
{
"nickname",
lNickname
},
{
"birthday",
lDOB
},
{
"migrated",
true
},
{
"return_profile",
true
},
{
"newsletter_opt_in",
lNewsLetter
},
{
"gender",
lGender
}
};
if (lAlternativeLogin != null)
{
dictionary.Add("user_alternatives", lAlternativeLogin);
}
if (!string.IsNullOrEmpty(lPassword))
{
dictionary.Add("password", WebServices.EncryptPassword(lPassword));
}
if (!string.IsNullOrEmpty(lOldPassword))
{
dictionary.Add("user", new Dictionary<string, object>
{
{
"souqa_id",
lSouqaId
},
{
"password",
WebServices.EncryptPassword(lOldPassword)
}
});
}
return WebServices.SubmitRequest("user/set/", dictionary, eWebRequestType.Default);
}
// Token: 0x06000A0A RID: 2570 RVA: 0x0001C557 File Offset: 0x0001A757
public static IWebRequest DuplicateClear()
{
return WebServices.SubmitRequest("user/dpc_clear/", null, eWebRequestType.Replayable);
}
// Token: 0x06000A0B RID: 2571 RVA: 0x0005ED80 File Offset: 0x0005CF80
public static IWebRequest RegisterTempUser(string lUsername, string[] lEntries, string[] lRestrictedEntries)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"api_version",
WebServices.Environment.APIVersion
},
{
"client_token",
WebServices.GenerateClientToken(lUsername)
},
{
"project",
WebServices.Environment.ProjectName
},
{
"birthday",
1980
},
{
"migrated",
true
},
{
"new_user",
true
}
};
if (lEntries != null && lEntries.Length > 0)
{
dictionary.Add("userentry_keys", lEntries);
}
if (lRestrictedEntries != null && lRestrictedEntries.Length > 0)
{
dictionary.Add("restrictedentry_keys", lRestrictedEntries);
}
dictionary.Add("user", new Dictionary<string, object>
{
{
"username",
lUsername
}
});
dictionary.Add("device_id", WebServices.Session.DeviceId);
return WebServices.SubmitRequest("user/register/", dictionary, eWebRequestType.Replayable);
}
// Token: 0x06000A0C RID: 2572 RVA: 0x0005EE84 File Offset: 0x0005D084
public static IWebRequest GetUser(string lUserId)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"user",
new Dictionary<string, object>
{
{
"souqa_id",
lUserId
}
}
}
};
return WebServices.SubmitRequest("user/get/", lPayload, eWebRequestType.Default);
}
// Token: 0x06000A0D RID: 2573 RVA: 0x0005EEC4 File Offset: 0x0005D0C4
public static IWebRequest SetPlaying(string lDescription, Dictionary<string, object> lGameData)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"description",
lDescription
},
{
"data",
JsonWriter.Serialize(lGameData)
}
};
return WebServices.SubmitRequest("user/set_playing/", lPayload, eWebRequestType.Default);
}
// Token: 0x06000A0E RID: 2574 RVA: 0x0005EF04 File Offset: 0x0005D104
public static IWebRequest SetUserName(string lName)
{
if (User.Instance.TempAccount && !string.IsNullOrEmpty(lName))
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"nickname",
lName
},
{
"temp_account",
false
}
};
return WebServices.SubmitRequest("user/set/", lPayload, eWebRequestType.Default);
}
throw new NotImplementedException("SetUserName - Null lName");
}
// Token: 0x06000A0F RID: 2575 RVA: 0x0001C565 File Offset: 0x0001A765
public static IWebRequest ValidateUser()
{
return WebServices.SubmitRequest("user/validate_id/", null, eWebRequestType.Default);
}
// Token: 0x06000A10 RID: 2576 RVA: 0x0005EF68 File Offset: 0x0005D168
private static void ValidateUserCallback(IWebRequest lRequest)
{
if (lRequest.ResponseStatus == eResponseStatus.Successful && lRequest.ResponseData.ContainsKey("token"))
{
WebServices.Session.m_ApplicationToken = (lRequest.ResponseData["token"] as string);
}
}
// Token: 0x06000A11 RID: 2577 RVA: 0x0005EFB4 File Offset: 0x0005D1B4
public static IWebRequest UpdateUserName(string lUserName)
{
if (!string.IsNullOrEmpty(lUserName))
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"username",
lUserName
}
};
IWebRequest webRequest = WebServices.CreateRequest("user/update_username/", lPayload, eWebRequestType.Default, eHTTPMethod.POST);
webRequest.AdditionalData = lUserName;
IWebRequest expr_36 = webRequest;
expr_36.OnFinished = (Action<IWebRequest>)Delegate.Combine(expr_36.OnFinished, new Action<IWebRequest>(WebServices.UpdateUserNameCallback));
return WebServices.SubmitRequest(webRequest);
}
throw new NotImplementedException("UpdateUserName - Null lUsername");
}
// Token: 0x06000A12 RID: 2578 RVA: 0x0005F02C File Offset: 0x0005D22C
public static void UpdateUserNameCallback(IWebRequest lWebRequest)
{
if (lWebRequest.ResponseStatus == eResponseStatus.Successful)
{
string nickname = lWebRequest.AdditionalData as string;
User.Instance.UpdateInventoryItems(lWebRequest.ResponseData);
User.Instance.Nickname = nickname;
Hub.m_HubActionCallback(Hub.eHubAction.NicknameChanged, null);
}
}
// Token: 0x06000A13 RID: 2579 RVA: 0x0005F078 File Offset: 0x0005D278
public static IWebRequest GetSFSLoginToken()
{
IWebRequest lRequest = WebServices.CreateRequest("auth/16/sfstoken", null, eWebRequestType.RequiresSession | eWebRequestType.Replayable | eWebRequestType.RawJSONContent | eWebRequestType.Microservice, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A14 RID: 2580 RVA: 0x0005F09C File Offset: 0x0005D29C
public static IWebRequest SetProjectData(string lKey, Dictionary<string, object> lStored, bool lGlobal)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"key",
lKey
},
{
"value",
JsonWriter.Serialize(lStored)
},
{
"global",
lGlobal
}
};
IWebRequest lRequest = WebServices.CreateRequest("userentry/set/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A15 RID: 2581 RVA: 0x0005F0F4 File Offset: 0x0005D2F4
public static IWebRequest GetProjectData(string lKey, bool lGlobal)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"key",
lKey
},
{
"global",
lGlobal
}
};
IWebRequest lRequest = WebServices.CreateRequest("userentry/get/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A16 RID: 2582 RVA: 0x0005F13C File Offset: 0x0005D33C
public static IWebRequest GetUsersProjectData(string lKey, string lSouqaID, bool lGlobal)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"key",
lKey
},
{
"global",
lGlobal
},
{
"friend",
new Dictionary<string, object>
{
{
"souqa_id",
lSouqaID
}
}
}
};
IWebRequest lRequest = WebServices.CreateRequest("userentry/get/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A17 RID: 2583 RVA: 0x0005F1A4 File Offset: 0x0005D3A4
public static IWebRequest GetProjectListData(bool lGlobal)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"global",
lGlobal
}
};
IWebRequest lRequest = WebServices.CreateRequest("userentry/list/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A18 RID: 2584 RVA: 0x0005F1E0 File Offset: 0x0005D3E0
public static IWebRequest MessageSend(string lSouqaId, string lType, Dictionary<string, object> lMessageData)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"friend",
new Dictionary<string, object>
{
{
"souqa_id",
lSouqaId
}
}
},
{
"type",
(!string.IsNullOrEmpty(lType)) ? lType : "normal"
},
{
"message",
lMessageData
}
};
IWebRequest lRequest = WebServices.CreateRequest("usermail/send/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A19 RID: 2585 RVA: 0x0005F258 File Offset: 0x0005D458
public static IWebRequest MessageList(int lLastAccessed)
{
IWebRequest lRequest = WebServices.CreateRequest("usermail/get/?last_accessed=" + lLastAccessed.ToString(), null, eWebRequestType.DefaultJson, eHTTPMethod.GET);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A1A RID: 2586 RVA: 0x0005F288 File Offset: 0x0005D488
public static IWebRequest MessageDelete(int[] lMessageIDs)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"message_ids",
lMessageIDs
}
};
IWebRequest lRequest = WebServices.CreateRequest("usermail/delete/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A1B RID: 2587 RVA: 0x0005F2C0 File Offset: 0x0005D4C0
public static IWebRequest MessageDeleteAll(bool lAll)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"message_ids",
new int[0]
},
{
"delete",
(!lAll) ? "read" : "all"
}
};
IWebRequest lRequest = WebServices.CreateRequest("usermail/delete/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A1C RID: 2588 RVA: 0x0005F31C File Offset: 0x0005D51C
public static IWebRequest MessageRead(int[] lMessageIDs)
{
Dictionary<string, object> lPayload = new Dictionary<string, object>
{
{
"message_ids",
lMessageIDs
}
};
IWebRequest lRequest = WebServices.CreateRequest("usermail/read/", lPayload, eWebRequestType.DefaultJson, eHTTPMethod.POST);
return WebServices.SubmitRequest(lRequest);
}
// Token: 0x06000A1D RID: 2589 RVA: 0x0005F354 File Offset: 0x0005D554
public static IWebRequest SubmitReportUser(string lSouqaID, string lType, string lDescription, string lData = null, string lURL = null)
{
Dictionary<string, object> dictionary = new Dictionary<string, object>
{
{
"reported",
new Dictionary<string, object>
{
{
"souqa_id",
lSouqaID
}
}
},
{
"type",
lType
},
{
"description",
lDescription
}
};
if (!string.IsNullOrEmpty(lData))
{
dictionary.Add("data", lData);
dictionary.Add("source", 3);
}
if (!string.IsNullOrEmpty(lURL))
{
dictionary.Add("url", lURL);
}
return WebServices.SubmitRequest("userreport/add/", dictionary, eWebRequestType.Default);
}
// Token: 0x04000672 RID: 1650
private const long CONNECTIONLOST_DOWNTIME = 2L;
// Token: 0x04000673 RID: 1651
private const int MAX_ATTEMPT_COUNT = 3;
// Token: 0x04000674 RID: 1652
private const string ImageApiBaseUrl = "imageapi/v1";
// Token: 0x04000675 RID: 1653
private static RequestChannel m_DefaultRequestChannel;
// Token: 0x04000676 RID: 1654
private static Dictionary<string, IMockFunction> m_MockAPIFunctions;
// Token: 0x04000677 RID: 1655
private static bool m_ConnectionIssue = false;
// Token: 0x04000678 RID: 1656
private static long m_ConnectionIssueTimeStamp = 0L;
// Token: 0x04000679 RID: 1657
private static Timeline m_RequestTimeline = TelemetryRegistry.Timeline("WebServices");
// Token: 0x0400067A RID: 1658
private static float m_AvgCallDuration = 0f;
// Token: 0x0400067B RID: 1659
private static float m_PeakCallDuration = 0f;
// Token: 0x0400067C RID: 1660
private static int m_CallCount = 0;
// Token: 0x0400067D RID: 1661
private static int m_SucessfulCallCount = 0;
// Token: 0x0400067E RID: 1662
public static Action<Action<object>, object> OnMaintenance = delegate
{
};
// Token: 0x0400067F RID: 1663
public static Action<bool> OnConnectionIssue = delegate
{
};
// Token: 0x04000680 RID: 1664
public static Dictionary<string, Action<IWebRequest>> m_ResponseInterceptor;
// Token: 0x04000681 RID: 1665
private static byte[] encodedImage;
// Token: 0x02000156 RID: 342
public enum eState
{
// Token: 0x0400068A RID: 1674
Initial,
// Token: 0x0400068B RID: 1675
Running,
// Token: 0x0400068C RID: 1676
Paused,
// Token: 0x0400068D RID: 1677
ConnectionLost,
// Token: 0x0400068E RID: 1678
Maintenance
}
// Token: 0x02000157 RID: 343
private enum eResponseAction
{
// Token: 0x04000690 RID: 1680
None,
// Token: 0x04000691 RID: 1681
ReSignIn,
// Token: 0x04000692 RID: 1682
Replay,
// Token: 0x04000693 RID: 1683
ConnectionLost = 4,
// Token: 0x04000694 RID: 1684
Maintenance = 8,
// Token: 0x04000695 RID: 1685
Finalize = 16
}
// Token: 0x02000158 RID: 344
public struct AvailabilityData
{
// Token: 0x06000A20 RID: 2592 RVA: 0x0005F3F0 File Offset: 0x0005D5F0
public void Populate(string checkType, IDictionary<string, object> lResponseData, string languageTag)
{
this.Available = true;
this.TimeOut = 30;
this.Message = string.Empty;
IDictionary<string, object> lJsonData = null;
if (lResponseData.GetValidEntry(checkType, out lJsonData, null))
{
if (!lJsonData.GetValidEntry("available", out this.Available, false))
{
}
if (!lJsonData.GetValidEntry("timeout", out this.TimeOut, 0))
{
}
IDictionary<string, object> lJsonData2 = null;
if (lJsonData.GetValidEntry("message", out lJsonData2, null))
{
lJsonData2.GetValidEntry(languageTag, out this.Message, null);
}
}
}
// Token: 0x04000696 RID: 1686
public bool Available;
// Token: 0x04000697 RID: 1687
public int TimeOut;
// Token: 0x04000698 RID: 1688
public string Message;
}
// Token: 0x02000159 RID: 345
public enum eAreaStatus
{
// Token: 0x0400069A RID: 1690
Private,
// Token: 0x0400069B RID: 1691
Public,
// Token: 0x0400069C RID: 1692
Friends_Only
}
// Token: 0x0200015A RID: 346
public class PhotoJob
{
// Token: 0x06000A21 RID: 2593 RVA: 0x0001C574 File Offset: 0x0001A774
public PhotoJob(int sizeMask, Action<WebServices.PhotoJob, Texture2D> OnJobFinishedCallback)
{
this.m_TimeLastTried = Time.time;
this.m_OnJobFinishedCallback = OnJobFinishedCallback;
this.m_PhotoIDs = new List<string>();
this.m_ItemExistsInCloud = false;
this.m_SizeMask = sizeMask;
this.m_Retrys = 3;
}
// Token: 0x06000A22 RID: 2594 RVA: 0x0001C5AE File Offset: 0x0001A7AE
public void DoOnFinishedCallback(Texture2D theTexture)
{
if (this.m_OnJobFinishedCallback != null)
{
this.m_OnJobFinishedCallback(this, theTexture);
}
}
// Token: 0x06000A23 RID: 2595 RVA: 0x0001C5C8 File Offset: 0x0001A7C8
public bool CheckSizeMask(int mask)
{
return (this.m_SizeMask & mask) != 0;
}
// Token: 0x0400069D RID: 1693
public float m_TimeLastTried;
// Token: 0x0400069E RID: 1694
public Action<WebServices.PhotoJob, Texture2D> m_OnJobFinishedCallback;
// Token: 0x0400069F RID: 1695
public List<string> m_PhotoIDs;
// Token: 0x040006A0 RID: 1696
public string m_UserID;
// Token: 0x040006A1 RID: 1697
public string m_ResourceID;
// Token: 0x040006A2 RID: 1698
public bool m_ItemExistsInCloud;
// Token: 0x040006A3 RID: 1699
public int m_SizeMask;
// Token: 0x040006A4 RID: 1700
public int m_Retrys;
}
// Token: 0x0200015B RID: 347
public class PhotoServiceStatus
{
// Token: 0x06000A24 RID: 2596 RVA: 0x0001C5DA File Offset: 0x0001A7DA
public PhotoServiceStatus(Action<WebServices.PhotoServiceStatus, bool> OnJobFinishedCallback)
{
this.automatic_upload = false;
this.m_OnJobFinishedCallback = OnJobFinishedCallback;
}
// Token: 0x06000A25 RID: 2597 RVA: 0x0001C5F0 File Offset: 0x0001A7F0
public void DoOnFinishedCallback(bool haveData)
{
if (this.m_OnJobFinishedCallback != null)
{
this.m_OnJobFinishedCallback(this, haveData);
}
}
// Token: 0x040006A5 RID: 1701
public Action<WebServices.PhotoServiceStatus, bool> m_OnJobFinishedCallback;
// Token: 0x040006A6 RID: 1702
public bool automatic_upload;
}
// Token: 0x0200015C RID: 348
public enum MediaImageType
{
// Token: 0x040006A8 RID: 1704
profile_headshot,
// Token: 0x040006A9 RID: 1705
space_snapshot
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment