using UnityEngine;

namespace Cute;

public class UpdateBirthTask : NetworkTask
{
	private class UpdateBirthPostParams : PostParams
	{
		public string birth = "";
	}

	private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.BirthUpdate;

	public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";

	public void SetParameter(string birth)
	{
		UpdateBirthPostParams updateBirthPostParams = new UpdateBirthPostParams();
		updateBirthPostParams.birth = birth;
		base.Params = updateBirthPostParams;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		CreateItemList.BirthDayUpdateServerTime = base.ResponseData["data_headers"]["servertime"].ToInt();
		CreateItemList.BirthDayUpdateRealTime = Time.realtimeSinceStartup;
		return num;
	}
}
