示例#1
0
    void RequestGetRequestingListCallback(object data, int errorCode)
    {
        Debug.Log("RequestGetRequestingListCallback result with errorCode " + errorCode);
        if (errorCode == ErrorCode.SUCCESS)
        {
            try
            {
                List <object> resultData = (List <object>)data;
                if (resultData != null)
                {
                    foreach (object obj in resultData)
                    {
                        try
                        {
                            FbRequestEntity fbRequestEntity = new FbRequestEntity();
                            fbRequestEntity.UserIdTo   = (((Dictionary <string, object>)obj)["uidt"]).ToString();
                            fbRequestEntity.UserIdFrom = (((Dictionary <string, object>)obj)["uidf"]).ToString();
                            fbRequestEntity.Type       = int.Parse(string.Format("{0}", ((Dictionary <string, object>)obj)["type"]));
                            fbRequestEntity.RequestId  = int.Parse(string.Format("{0}", ((Dictionary <string, object>)obj)["id"]));

                            FBRequests.Add(fbRequestEntity);
                        }
                        catch (Exception ex)
                        {
                            Debug.LogError("RequestGetRequestingListCallback result " + ex.ToString());
                        }
                    }
                    resultData.Clear();
                }
            }
            catch (Exception ex)
            {
                Debug.LogWarning("RequestGetRequestingListCallback result " + ex.ToString());
            }
        }
    }
示例#2
0
	void RequestGetRequestingListCallback(object data, int errorCode)
	{
		Debug.Log("RequestGetRequestingListCallback result with errorCode " + errorCode);
		if (errorCode == ErrorCode.SUCCESS)
		{
			try
			{
				List<object> resultData = (List<object>)data;
				if (resultData != null)
				{
					foreach(object obj in resultData)
					{
						try 
						{
							FbRequestEntity fbRequestEntity = new FbRequestEntity();
							fbRequestEntity.UserIdTo = (((Dictionary<string, object>)obj)["uidt"]).ToString();
							fbRequestEntity.UserIdFrom = (((Dictionary<string, object>)obj)["uidf"]).ToString();
							fbRequestEntity.Type = int.Parse(string.Format("{0}", ((Dictionary<string, object>)obj)["type"]));
							fbRequestEntity.RequestId = int.Parse(string.Format("{0}", ((Dictionary<string, object>)obj)["id"]));

							FBRequests.Add(fbRequestEntity);
						}
						catch(Exception ex)
						{
							Debug.LogError("RequestGetRequestingListCallback result " + ex.ToString());
						}
					}
					resultData.Clear();
				}
			}
			catch(Exception ex)
			{
				Debug.LogWarning("RequestGetRequestingListCallback result " + ex.ToString());
			}
		}
	}