From 57798d75a9476cac27990f0e196fc44d77e58882 Mon Sep 17 00:00:00 2001 From: Ino Date: Mon, 4 Aug 2025 15:58:27 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=A0=EA=B7=9C=20=EC=9C=A0=EC=A0=80?= =?UTF-8?q?=EC=9D=98=20=EA=B2=BD=EC=9A=B0,=20=ED=81=B4=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EC=96=B8=ED=8A=B8=EC=97=90=EC=84=9C=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=EB=A5=BC=20=EB=A7=8C=EB=93=A0=20=EB=92=A4,=20?= =?UTF-8?q?=EC=84=9C=EB=B2=84=EC=97=90=20=EC=A0=80=EC=9E=A5=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EB=A1=9C=EC=A7=81=EC=9D=84=20=EC=A0=9C=EA=B1=B0?= =?UTF-8?q?=ED=95=98=EA=B3=A0=20=EC=84=9C=EB=B2=84=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=A7=8C=EB=93=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/Resources/.CloudScript.js | 256 +++++++++++++++--- Assets/Script/Server/ServerClass.cs | 27 +- Assets/Script/Server/ServerInfo.cs | 15 +- Assets/Script/UI/PC/Limit/PCLimitUI_Right.cs | 2 +- 4 files changed, 231 insertions(+), 69 deletions(-) diff --git a/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js b/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js index 6b0e775f3..b96ad5d65 100644 --- a/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js +++ b/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js @@ -134,55 +134,32 @@ handlers.Get_UserInfo = function (args) if (sec > 0) { - for (var i = 0; i < urod.Farm.Slot.length; i++) - { - if (urod.Farm.Slot[i].Time > 0) - { - urod.Farm.Slot[i].Time -= sec; - if (urod.Farm.Slot[i].Time < 0) urod.Farm.Slot[i].Time = 0; - } - } - - for (var i = 0; i < urod.Farm.Shop.length; i++) - { - if (urod.Farm.Shop[i][2] > 0) - { - urod.Farm.Shop[i][2] -= sec; - if (urod.Farm.Shop[i][2] < 0) urod.Farm.Shop[i][2] = 0; - } - } - - for (var key in urod.Shop) - { - if (urod.Shop.hasOwnProperty(key)) - { - if (urod.Shop[key][2] > 0) - { - urod.Shop[key][2] -= sec; - if (urod.Shop[key][2] < 0) urod.Shop[key][2] = 0; - } - } - } - - for (var i = 0; i < urod.Buff.Time.length; i++) - { - if (urod.Buff.Time[i] > 0) - { - urod.Buff.Time[i] -= sec; - if (urod.Buff.Time[i] < 0) urod.Buff.Time[i] = 0; - } - } - - savedata = true; + // 오프라인 보상 } } else { savedata = true; + + var table = Get_MissionTable(); + var itemtable = Get_ItemTable(); + + urod = Create_NewUserData(); + // 최초 클래스 및 스킬 추가 + var classid = urod.Equip.Equip.PC; + Add_Item(table, itemtable, urod, classid, 1); + var skilllst = Get_SkillTable().filter(f=>f.e_SkillType != "JobPassive" && f.n_SkillClassID == classid); + for (var i = 0; i < skilllst.length; ++i) + Add_Item(table, itemtable, urod, skilllst[i].n_SkillID, 1); + // 코스튬, 펫, 짐꾼 추가 + Add_Item(table, itemtable, urod, 110001, 1); + Add_Item(table, itemtable, urod, Get_GlobalValue_nValue("n_FirstEquipPet"), 1); + Add_Item(table, itemtable, urod, 70001, 1); Make_EqiupmentEnchantOption(urod); } - if (savedata) Set_JsonUserData(urod); + // 테스트 완료 후 주석 제거 + //if (savedata) Set_JsonUserData(urod); return Get_Return( Get_Error(readonlydata, args.Token), @@ -194,6 +171,203 @@ handlers.Get_UserInfo = function (args) } ); } +function Create_NewUserData() { + var data = {}; + + data.LastTime = Get_CurKoreaTime(); + data.Common = Array.from({ length: eCommon.Max }, () => 0); + data.MapData = {}; + data.Buff = Init_Buff(); + data.Equip = Init_Equip(); + data.Equipment = {}; + data.Slot = Init_Slot(); + data.Item = {}; + data.Enchant = Init_Enchant(); + data.Skill = {}; + data.Ability = {}; + data.PC = Init_PC(); + data.Awaken = Init_Awaken(); + data.LimitSlot = Init_LimitSlot(); + data.Pet = {}; + data.PetData = { GachaLv: 1, GachaExp : 0, PetGachaADTime : Get_CurKoreaTime() }; + data.Relic = {}; + data.Collection = {}; + data.MobKill = {}; + data.Farm = Init_Farm(); + data.Dungeon = {}; + data.Mission = {}; + data.Gacha = {}; + data.Shop = {}; + + return data; +} +const eCommon = { + Agree: 0, + Noti: 1, + NightNoti: 2, + DOY_Day: 3, + DOY_Week: 4, + DOY_Month: 5, + PlayTime: 6, + Auto: 7, + FirstStatInit: 8, + ADRemove: 9, + GuideStep: 10, + GuideCount: 11, + + NickChange: 12, + X2: 13, + CloverShopResetTime: 14, + CloverShopID_Weapon: 15, + CloverShopID_Ring: 16, + CloverShopID_Neck: 17, + CloverShopID_Boots: 18, + CloverShopID_Fairy: 19, + CloverShopID_Magic: 20, + CloverShopID_Pet: 21, + InAppBuyCount: 22, + FieldFirstFree: 23, + Roullette_Ticket: 24, + Roullette_Count: 25, + Roullette_ADCount: 26, + Roullette_LuckyCount: 27, + AttendanceStep: 28, + AttendanceDOY: 29, + + Max: 30 +}; +function Init_Buff() { + return { + Infinity: 0, + Time: [new Date(), new Date(), new Date()] + }; +} +function Init_Equip() { + const equip = {}; + + var classid = Get_GlobalValue_nValue("n_FirstClassID"); + equip.Equip = { + PC: classid, + PCCostume: 110001, + Weapon: 0, + WeaponCostume: 0, + Armor: 0, + Helmet: 0, + Extra: 0, + Necklace: 0, + Ring: 0, + Pet: Get_GlobalValue_nValue("n_FirstEquipPet"), + Farmer: 0, + Worker: 70001 + }; + + equip.Preset = 1; + equip.LimitPreset = 1; + + var skilllst = Get_SkillTable().filter(f=>f.e_SkillType != "JobPassive" && f.n_SkillClassID == classid); + const equipSkillValues = [ + skilllst[0].n_SkillID, + skilllst[1].n_SkillID, + skilllst[2].n_SkillID, + 0, 0, 0 + ]; + + equip.Skill = { + 1: [], + 2: [], + 3: [] + }; + + for (const preset in equip.Skill) { + equip.Skill[preset] = [...equipSkillValues]; + } + + return equip; +} +function Init_Slot() { + const dic_EquipmentKey = { + Weapon: { id: 0, key: "Weapon" }, + Armor: { id: 1, key: "Armor" }, + Helmet: { id: 2, key: "Helmet" }, + Extra: { id: 3, key: "Extra" }, + Necklace: { id: 4, key: "Necklace" }, + Ring: { id: 5, key: "Ring" } + }; + + const slotList = []; + + for (const parts in dic_EquipmentKey) { + slotList.push({ + Parts: parts, // key string 사용 + Lv: 0, + Use: 0, + Enchant: [ + { ID : 0, EXTRA : 0, Lv : 0 }, + { ID : 0, EXTRA : 0, Lv : 0 }, + { ID : 0, EXTRA : 0, Lv : 0 } + ] + }); + } + + return slotList; +} +function Init_Enchant() { + var enchant = {}; + var list = Get_EnchantListTable(); + for (var i = 0; i < list.length; i++) + enchant[list[i].n_EnchantID] = [0, 1, 0, 0]; + return enchant; +} +function Init_Awaken() { + return { + STR: { LV : 1, Exp : 0 }, + DEX: { LV : 1, Exp : 0 }, + INT: { LV : 1, Exp : 0 }, + LUK: { LV : 1, Exp : 0 } + }; +} +function Init_PC() { + return { + Lv: 1, + LLv: 1, + ALv: 1, + Exp: 0, + AExp: 0, + Stat: [0, 0, 0, 0], + Obtain: [] + }; +} +function Init_LimitSlot() { + var result = { "1": [], "2": [], "3": [] }; + for (var key in result) { + for (var i = 0; i < 6; i++) { + result[key].push({ ID: 0, Lock: 0 }); + } + } + return result; +} +function Init_FarmSlot(slotIndex) { + return { + Slot: slotIndex, + Grade: 0, + EnchantID: 0, + Time: new Date() + }; +} +function Init_Farm() { + const farmSlotList = []; + for (let i = 0; i < 8; i++) { + farmSlotList.push(Init_FarmSlot(i)); + } + + return { + MaxSlot: 0, + Slot: farmSlotList, + Eat: {}, + Shop: {} + }; +} + handlers.Get_OtherUserInfo = function (args) { var urod = server.GetUserReadOnlyData({ PlayFabId: args.ID }).Data; diff --git a/Assets/Script/Server/ServerClass.cs b/Assets/Script/Server/ServerClass.cs index 896ea6bdd..ce866b45e 100644 --- a/Assets/Script/Server/ServerClass.cs +++ b/Assets/Script/Server/ServerClass.cs @@ -334,29 +334,26 @@ public class ServerData_Read temp.LimitBreakOption = LimitBreakOption; temp.EnchantOption = EnchantOption; - temp.Book = new List(); - for (int i = 0; i < Book.Count; i++) - temp.Book.Add(Book[i].Get()); + //temp.Book = new List(); + //for (int i = 0; i < Book.Count; i++) + // temp.Book.Add(Book[i].Get()); - temp.ChapterQuest = new List(); - for (int i = 0; i < ChapterQuest.Count; i++) - temp.ChapterQuest.Add(ChapterQuest[i].Get()); + //temp.ChapterQuest = new List(); + //for (int i = 0; i < ChapterQuest.Count; i++) + // temp.ChapterQuest.Add(ChapterQuest[i].Get()); - temp.Title = DSUtil.Get_T_List(Title); - temp.Pass = DSUtil.Get_T_List(Pass); + //temp.Title = DSUtil.Get_T_List(Title); + //temp.Pass = DSUtil.Get_T_List(Pass); - foreach (var item in Inven) - temp.Inven.Add(item.Key, item.Value); + //foreach (var item in Inven) + // temp.Inven.Add(item.Key, item.Value); - temp.Potion = DSUtil.Get_T_Dic(Potion); - if (Event != null) temp.Event = DSUtil.Get_T_Dic(Event); + //temp.Potion = DSUtil.Get_T_Dic(Potion); + //if (Event != null) temp.Event = DSUtil.Get_T_Dic(Event); //temp.TotalAdd = TotalAdd; //temp.TotalUse = TotalUse; - #region 추가 데이터 체크 - DataCheck(Common, temp.Common, (int)eCommon.Max); - #endregion return temp; } diff --git a/Assets/Script/Server/ServerInfo.cs b/Assets/Script/Server/ServerInfo.cs index b8784b107..ae035d6bc 100644 --- a/Assets/Script/Server/ServerInfo.cs +++ b/Assets/Script/Server/ServerInfo.cs @@ -321,23 +321,14 @@ public class ServerInfo : MyCoroutine var str_result = urod.FunctionResult.ToString(); var error = MyErrorCheck(str_result); var json = JsonConvert.DeserializeObject(str_result); + m_ServerData = json.UserInfo.Get_ServerData(false); OffLineReward.m_Sec = json.ReconnectSec; Get_MailList(json.Mail, null); - if (!json.isNewUser) - { // 기존 유저 - m_ServerData = json.UserInfo.Get_ServerData(false); - } - else - { // 신규 유저 - m_ServerData = new ServerData(); - } - OptionInfo.Ins.Set_UI(); - // 서버 데이터 가져오기 완료 - if (json.isNewUser) // 기본 데이터 서버에 저장하고 닉네임 만들기 - Write(() => { SetFirstName(_servercomplete, true); }); + if (json.isNewUser) // 닉네임 만들기 + SetFirstName(_servercomplete, true); else _servercomplete(false); } diff --git a/Assets/Script/UI/PC/Limit/PCLimitUI_Right.cs b/Assets/Script/UI/PC/Limit/PCLimitUI_Right.cs index 9b6addf23..f57e38c02 100644 --- a/Assets/Script/UI/PC/Limit/PCLimitUI_Right.cs +++ b/Assets/Script/UI/PC/Limit/PCLimitUI_Right.cs @@ -38,7 +38,7 @@ public class LimitSlotChangeData Price = TotalPrice; Count = MissionCount; SelectPreset = sdata.Equip.LimitPreset; - Preset = sdata.LimitBreakOption.Preset; + Preset = sdata.LimitBreakOption != null ? sdata.LimitBreakOption.Preset : null; Copy_ServerLimitSlot(); return this; }