diff --git a/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js b/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js index 02ac0d517..3677befa3 100644 --- a/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js +++ b/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js @@ -119,7 +119,14 @@ function Add_Mail(args) handlers.Get_UserInfo = function (args) { 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) { diff --git a/Assets/Script/Info/OptionInfo.cs b/Assets/Script/Info/OptionInfo.cs index c6ee0d590..ce7e9fbd4 100644 --- a/Assets/Script/Info/OptionInfo.cs +++ b/Assets/Script/Info/OptionInfo.cs @@ -24,7 +24,7 @@ public class OptionInfo : MonoBehaviourSingletonTemplateBackKeyAdd public GameObject[] go_check; // 0 데미지 텍스트, 1 그림자, 2 자동 적 추적 카메라, 3 로컬푸시, 4 야간로컬푸시 public Image sprite_loginicon; 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 TMP_InputField if_coupon; public DelAccountUI m_DelAccountUI; @@ -43,25 +43,12 @@ public class OptionInfo : MonoBehaviourSingletonTemplateBackKeyAdd base.Awake(); Screen.sleepTimeout = SleepTimeout.NeverSleep; // 게임 실행 중 화면 안 꺼지게 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() { go_OptionUI.SetActive(false); m_DelAccountUI.Check(); - label_save.text = table_localtext.Ins.Get_Text(11); Application.targetFrameRate = 60; diff --git a/Assets/Script/Server/ServerClass.cs b/Assets/Script/Server/ServerClass.cs index 5c55c86e5..a5f7bde12 100644 --- a/Assets/Script/Server/ServerClass.cs +++ b/Assets/Script/Server/ServerClass.cs @@ -3019,6 +3019,12 @@ public class SD_FarmSlot_Read #endregion #region 서버 응답 클래스 +public class SC_GetUserInfoResult +{ + public bool isNewUser; + public ServerData_Read UserInfo; + public List Mail; +} public class SC_InitResult { public int error; diff --git a/Assets/Script/Server/ServerInfo.cs b/Assets/Script/Server/ServerInfo.cs index 2e21f9391..42077f33b 100644 --- a/Assets/Script/Server/ServerInfo.cs +++ b/Assets/Script/Server/ServerInfo.cs @@ -338,30 +338,24 @@ public class ServerInfo : MyCoroutine { //try { - Dictionary jsonData = Json.Deserialize(urod.FunctionResult.ToString()) as Dictionary; - var gurod = Json.Serialize(jsonData["GetUserReadOnlyData"]); - var gurodjson = Json.Deserialize(gurod) as Dictionary; - bool newUser = false; + var str_result = urod.FunctionResult.ToString(); + var error = MyErrorCheck(str_result); + var json = JsonConvert.DeserializeObject(str_result); - if (gurodjson.ContainsKey("UserInfo")) + if (!json.isNewUser) { // 기존 유저 - var userinfo = Json.Serialize(gurodjson["UserInfo"]); - var userinfojson = Json.Deserialize(userinfo) as Dictionary; - ServerData_Read Read = JsonConvert.DeserializeObject(userinfojson["Value"].ToString()); - m_ServerData = Read.Get_ServerData(false); - - OffLineReward.m_Sec = (int)(ServerTime - m_ServerData.LastTime).TotalSeconds; + m_ServerData = json.UserInfo.Get_ServerData(false); + //OffLineReward.m_Sec = (int)(ServerTime - m_ServerData.LastTime).TotalSeconds; } else { // 신규 유저 m_ServerData = new ServerData(); - newUser = true; } OptionInfo.Ins.Set_UI(); // 서버 데이터 가져오기 완료 - if (newUser) // 기본 데이터 서버에 저장하고 닉네임 만들기 + if (json.isNewUser) // 기본 데이터 서버에 저장하고 닉네임 만들기 Write(() => { SetFirstName(_servercomplete, true); }); else _servercomplete(false); @@ -372,11 +366,11 @@ public class ServerInfo : MyCoroutine //} } else - FailCheck(urod, "유저 정보 받아오기 실패"); + Set_Coroutine(() => { Get_UserInfo(_servercomplete); }, 2f); }, fail => { - FailCheck(fail, "유저 정보 받아오기 실패"); + Set_Coroutine(() => { Get_UserInfo(_servercomplete); }, 2f); }); } void SetFirstName(Action _servercomplete, bool newuser) @@ -2367,10 +2361,10 @@ public class ServerInfo : MyCoroutine #endregion #region 우편 - public void Get_MailList(bool _netwait, Action _act) + public void Get_MailList(Action _act) { if (NewGameUI.isIns) NewGameUI.Ins.gos_noti[0].SetActive(false); - NetWait.Ins.Set(_netwait); + NetWait.Ins.Set(true); PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest { FunctionName = MethodBase.GetCurrentMethod().Name, @@ -2382,7 +2376,7 @@ public class ServerInfo : MyCoroutine }, result => { - if (_netwait) NetWait.Ins.Set(false); + NetWait.Ins.Set(false); if (result.Error == null) { var str_result = result.FunctionResult.ToString(); diff --git a/Assets/Script/UI/Center/Mail/MailUI.cs b/Assets/Script/UI/Center/Mail/MailUI.cs index 82a2d0131..7b6e0d104 100644 --- a/Assets/Script/UI/Center/Mail/MailUI.cs +++ b/Assets/Script/UI/Center/Mail/MailUI.cs @@ -8,15 +8,12 @@ public class MailUI : MonoBehaviourSingletonuScrollViewMgr 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) - { - base.Set(); - CardBase_AllOff(); - DSUtil.ActivateGameObjects(gos); - } + ServerInfo.Ins.Get_MailList(mails => { MailData = mails; Set_UI(MailData); }); + base.Set(); + CardBase_AllOff(); + DSUtil.ActivateGameObjects(gos); } void Set_UI(SC_Mail mail) diff --git a/Assets/Script/UI/NewGameUI.cs b/Assets/Script/UI/NewGameUI.cs index 96c4013f5..a491fa5fd 100644 --- a/Assets/Script/UI/NewGameUI.cs +++ b/Assets/Script/UI/NewGameUI.cs @@ -36,7 +36,6 @@ public class NewGameUI : MonoBehaviourSingletonTemplate var cameraData = Camera.main.GetUniversalAdditionalCameraData(); cameraData.cameraStack.Add(UICamera); - MailUI.Ins.Set(true); Set_Noti(); ServerInfo.Ins.Check_OfflineReward(); } @@ -111,7 +110,7 @@ public class NewGameUI : MonoBehaviourSingletonTemplate case "btn_collection": m_CollectionUI.Set(); break; case "btn_mission": m_MissionUI.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_btn_plantingseed": break;