Get_UserInfo 결과값으로 UserInfo만 주지 말고 Mail 도 같이 넘겨서 Get_MailList 호출 줄이기
This commit is contained in:
parent
1dd27e6697
commit
9100f89597
|
|
@ -119,7 +119,14 @@ function Add_Mail(args)
|
||||||
handlers.Get_UserInfo = function (args)
|
handlers.Get_UserInfo = function (args)
|
||||||
{
|
{
|
||||||
var readonlydata = Get_UserReadOnlyData();
|
var readonlydata = Get_UserReadOnlyData();
|
||||||
return Get_Return(Get_Error(readonlydata, args.Token), { GetUserReadOnlyData: readonlydata.Data });
|
return Get_Return(
|
||||||
|
Get_Error(readonlydata, args.Token),
|
||||||
|
{
|
||||||
|
isNewUser : readonlydata.Data.UserInfo ? false : true,
|
||||||
|
UserInfo: readonlydata.Data.UserInfo ? JSON.parse(readonlydata.Data.UserInfo.Value) : {},
|
||||||
|
Mail: readonlydata.Data.Mail ? JSON.parse(readonlydata.Data.Mail.Value) : []
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
handlers.Get_OtherUserInfo = function (args)
|
handlers.Get_OtherUserInfo = function (args)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ public class OptionInfo : MonoBehaviourSingletonTemplateBackKeyAdd<OptionInfo>
|
||||||
public GameObject[] go_check; // 0 데미지 텍스트, 1 그림자, 2 자동 적 추적 카메라, 3 로컬푸시, 4 야간로컬푸시
|
public GameObject[] go_check; // 0 데미지 텍스트, 1 그림자, 2 자동 적 추적 카메라, 3 로컬푸시, 4 야간로컬푸시
|
||||||
public Image sprite_loginicon;
|
public Image sprite_loginicon;
|
||||||
public GameObject[] gos_resoultion; // 0 상, 1 중, 2 하
|
public GameObject[] gos_resoultion; // 0 상, 1 중, 2 하
|
||||||
public TextMeshProUGUI lable_ver, label_id, label_save;
|
public TextMeshProUGUI lable_ver, label_id;
|
||||||
public TextMeshProUGUI tmp_bgm, tmp_sfx;
|
public TextMeshProUGUI tmp_bgm, tmp_sfx;
|
||||||
public TMP_InputField if_coupon;
|
public TMP_InputField if_coupon;
|
||||||
public DelAccountUI m_DelAccountUI;
|
public DelAccountUI m_DelAccountUI;
|
||||||
|
|
@ -43,25 +43,12 @@ public class OptionInfo : MonoBehaviourSingletonTemplateBackKeyAdd<OptionInfo>
|
||||||
base.Awake();
|
base.Awake();
|
||||||
Screen.sleepTimeout = SleepTimeout.NeverSleep; // 게임 실행 중 화면 안 꺼지게
|
Screen.sleepTimeout = SleepTimeout.NeverSleep; // 게임 실행 중 화면 안 꺼지게
|
||||||
QualitySettings.SetQualityLevel(PlayerPrefs.GetInt("QualitySettings", 1)); // 퀄리티 중을 기본으로
|
QualitySettings.SetQualityLevel(PlayerPrefs.GetInt("QualitySettings", 1)); // 퀄리티 중을 기본으로
|
||||||
|
|
||||||
Set_Repeat_for1sec(() =>
|
|
||||||
{
|
|
||||||
if (SaveTime > 0)
|
|
||||||
{
|
|
||||||
--SaveTime;
|
|
||||||
if (SaveTime <= 0)
|
|
||||||
label_save.text = table_localtext.Ins.Get_Text(11);
|
|
||||||
else
|
|
||||||
label_save.text = DSUtil.Format("{0}", SaveTime);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
go_OptionUI.SetActive(false);
|
go_OptionUI.SetActive(false);
|
||||||
m_DelAccountUI.Check();
|
m_DelAccountUI.Check();
|
||||||
label_save.text = table_localtext.Ins.Get_Text(11);
|
|
||||||
|
|
||||||
Application.targetFrameRate = 60;
|
Application.targetFrameRate = 60;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3019,6 +3019,12 @@ public class SD_FarmSlot_Read
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 서버 응답 클래스
|
#region 서버 응답 클래스
|
||||||
|
public class SC_GetUserInfoResult
|
||||||
|
{
|
||||||
|
public bool isNewUser;
|
||||||
|
public ServerData_Read UserInfo;
|
||||||
|
public List<ServerMailData> Mail;
|
||||||
|
}
|
||||||
public class SC_InitResult
|
public class SC_InitResult
|
||||||
{
|
{
|
||||||
public int error;
|
public int error;
|
||||||
|
|
|
||||||
|
|
@ -338,30 +338,24 @@ public class ServerInfo : MyCoroutine
|
||||||
{
|
{
|
||||||
//try
|
//try
|
||||||
{
|
{
|
||||||
Dictionary<string, object> jsonData = Json.Deserialize(urod.FunctionResult.ToString()) as Dictionary<string, object>;
|
var str_result = urod.FunctionResult.ToString();
|
||||||
var gurod = Json.Serialize(jsonData["GetUserReadOnlyData"]);
|
var error = MyErrorCheck(str_result);
|
||||||
var gurodjson = Json.Deserialize(gurod) as Dictionary<string, object>;
|
var json = JsonConvert.DeserializeObject<SC_GetUserInfoResult>(str_result);
|
||||||
bool newUser = false;
|
|
||||||
|
|
||||||
if (gurodjson.ContainsKey("UserInfo"))
|
if (!json.isNewUser)
|
||||||
{ // 기존 유저
|
{ // 기존 유저
|
||||||
var userinfo = Json.Serialize(gurodjson["UserInfo"]);
|
m_ServerData = json.UserInfo.Get_ServerData(false);
|
||||||
var userinfojson = Json.Deserialize(userinfo) as Dictionary<string, object>;
|
//OffLineReward.m_Sec = (int)(ServerTime - m_ServerData.LastTime).TotalSeconds;
|
||||||
ServerData_Read Read = JsonConvert.DeserializeObject<ServerData_Read>(userinfojson["Value"].ToString());
|
|
||||||
m_ServerData = Read.Get_ServerData(false);
|
|
||||||
|
|
||||||
OffLineReward.m_Sec = (int)(ServerTime - m_ServerData.LastTime).TotalSeconds;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // 신규 유저
|
{ // 신규 유저
|
||||||
m_ServerData = new ServerData();
|
m_ServerData = new ServerData();
|
||||||
newUser = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OptionInfo.Ins.Set_UI();
|
OptionInfo.Ins.Set_UI();
|
||||||
|
|
||||||
// 서버 데이터 가져오기 완료
|
// 서버 데이터 가져오기 완료
|
||||||
if (newUser) // 기본 데이터 서버에 저장하고 닉네임 만들기
|
if (json.isNewUser) // 기본 데이터 서버에 저장하고 닉네임 만들기
|
||||||
Write(() => { SetFirstName(_servercomplete, true); });
|
Write(() => { SetFirstName(_servercomplete, true); });
|
||||||
else
|
else
|
||||||
_servercomplete(false);
|
_servercomplete(false);
|
||||||
|
|
@ -372,11 +366,11 @@ public class ServerInfo : MyCoroutine
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
FailCheck(urod, "유저 정보 받아오기 실패");
|
Set_Coroutine(() => { Get_UserInfo(_servercomplete); }, 2f);
|
||||||
},
|
},
|
||||||
fail =>
|
fail =>
|
||||||
{
|
{
|
||||||
FailCheck(fail, "유저 정보 받아오기 실패");
|
Set_Coroutine(() => { Get_UserInfo(_servercomplete); }, 2f);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void SetFirstName(Action<bool> _servercomplete, bool newuser)
|
void SetFirstName(Action<bool> _servercomplete, bool newuser)
|
||||||
|
|
@ -2367,10 +2361,10 @@ public class ServerInfo : MyCoroutine
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 우편
|
#region 우편
|
||||||
public void Get_MailList(bool _netwait, Action<SC_Mail> _act)
|
public void Get_MailList(Action<SC_Mail> _act)
|
||||||
{
|
{
|
||||||
if (NewGameUI.isIns) NewGameUI.Ins.gos_noti[0].SetActive(false);
|
if (NewGameUI.isIns) NewGameUI.Ins.gos_noti[0].SetActive(false);
|
||||||
NetWait.Ins.Set(_netwait);
|
NetWait.Ins.Set(true);
|
||||||
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
||||||
{
|
{
|
||||||
FunctionName = MethodBase.GetCurrentMethod().Name,
|
FunctionName = MethodBase.GetCurrentMethod().Name,
|
||||||
|
|
@ -2382,7 +2376,7 @@ public class ServerInfo : MyCoroutine
|
||||||
},
|
},
|
||||||
result =>
|
result =>
|
||||||
{
|
{
|
||||||
if (_netwait) NetWait.Ins.Set(false);
|
NetWait.Ins.Set(false);
|
||||||
if (result.Error == null)
|
if (result.Error == null)
|
||||||
{
|
{
|
||||||
var str_result = result.FunctionResult.ToString();
|
var str_result = result.FunctionResult.ToString();
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,13 @@ public class MailUI : MonoBehaviourSingletonuScrollViewMgr<MailUI>
|
||||||
|
|
||||||
SC_Mail MailData;
|
SC_Mail MailData;
|
||||||
|
|
||||||
public void Set(bool _first)
|
public override void Set()
|
||||||
{
|
|
||||||
ServerInfo.Ins.Get_MailList(!_first, mails => { MailData = mails; Set_UI(MailData); });
|
|
||||||
if (!_first)
|
|
||||||
{
|
{
|
||||||
|
ServerInfo.Ins.Get_MailList(mails => { MailData = mails; Set_UI(MailData); });
|
||||||
base.Set();
|
base.Set();
|
||||||
CardBase_AllOff();
|
CardBase_AllOff();
|
||||||
DSUtil.ActivateGameObjects(gos);
|
DSUtil.ActivateGameObjects(gos);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void Set_UI(SC_Mail mail)
|
void Set_UI(SC_Mail mail)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ public class NewGameUI : MonoBehaviourSingletonTemplate<NewGameUI>
|
||||||
var cameraData = Camera.main.GetUniversalAdditionalCameraData();
|
var cameraData = Camera.main.GetUniversalAdditionalCameraData();
|
||||||
cameraData.cameraStack.Add(UICamera);
|
cameraData.cameraStack.Add(UICamera);
|
||||||
|
|
||||||
MailUI.Ins.Set(true);
|
|
||||||
Set_Noti();
|
Set_Noti();
|
||||||
ServerInfo.Ins.Check_OfflineReward();
|
ServerInfo.Ins.Check_OfflineReward();
|
||||||
}
|
}
|
||||||
|
|
@ -111,7 +110,7 @@ public class NewGameUI : MonoBehaviourSingletonTemplate<NewGameUI>
|
||||||
case "btn_collection": m_CollectionUI.Set(); break;
|
case "btn_collection": m_CollectionUI.Set(); break;
|
||||||
case "btn_mission": m_MissionUI.Set(); break;
|
case "btn_mission": m_MissionUI.Set(); break;
|
||||||
case "btn_buffad": m_BuffADUI.Set(); break;
|
case "btn_buffad": m_BuffADUI.Set(); break;
|
||||||
case "btn_mail": MailUI.Ins.Set(false); break;
|
case "btn_mail": MailUI.Ins.Set(); break;
|
||||||
|
|
||||||
case "btn_farm": InGameInfo.Ins.Load_Map(0); break;
|
case "btn_farm": InGameInfo.Ins.Load_Map(0); break;
|
||||||
case "btn_btn_plantingseed": break;
|
case "btn_btn_plantingseed": break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue