From 16b5bc2b42a87ba3f0fcaadc8d5340ce62f07073 Mon Sep 17 00:00:00 2001 From: Ino Date: Tue, 28 Jan 2025 15:46:25 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=83=81=ED=95=9C=20=EB=AF=B8?= =?UTF-8?q?=EA=B6=81=20=EB=9E=AD=ED=82=B9=20=EC=A0=80=EC=9E=A5=EA=B9=8C?= =?UTF-8?q?=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Ino_nerdnavis.txt | 5 +-- .../Editor/Resources/.CloudScript.js | 13 ++++++ .../Resources/PlayFabEditorPrefsSO.asset | 2 +- .../Projectile/Skill/Skill_MultiShot.cs | 1 + Assets/Script/Info/DungeonInfo.cs | 35 +++++++++++---- Assets/Script/Server/ServerInfo.cs | 45 +++++++++++-------- .../UI/Ingame/Dungeon/DungeonResult_Maze.cs | 8 +++- .../UI/Ingame/Dungeon/Ingame_Dungeon.cs | 2 +- Assets/Script/UI/Stage/StageResult.cs | 2 +- 9 files changed, 79 insertions(+), 34 deletions(-) diff --git a/Assets/Ino_nerdnavis.txt b/Assets/Ino_nerdnavis.txt index b1381cd9d..87c3a3f17 100644 --- a/Assets/Ino_nerdnavis.txt +++ b/Assets/Ino_nerdnavis.txt @@ -51,7 +51,6 @@ messageinfo 엄청 느린 버그 - 결과 화면 (승리 보상 지급) 수상한 미궁 - - 맵 벽과 플레이 사이 더 멀게 만들자 + - 맵 벽과 플레이 사이 더 멀게 만들자 (카메라가 벽 밖에 안 나가게) - 결과 화면 (보상 지급) - - 랭킹 (플레이팹 v2 연결) - + - 랭킹 화면 \ No newline at end of file diff --git a/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js b/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js index 8e92e527f..5201f063c 100644 --- a/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js +++ b/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js @@ -394,6 +394,19 @@ handlers.GuideQuestComplete = function(args) } } +handlers.Save_Rank = function(args) +{ + progression.UpdateLeaderboardEntries({PlayFabId: currentPlayerId, LeaderboardName: args.LeaderboardName, + Entries : + [ + { + "EntityId": currentPlayerId, + "Metadata": args.Metadata, + "Scores": args.Scores + } + ]}); +} + handlers.SaveToStageRank = function(args) { var error = Get_Error(args.Token); diff --git a/Assets/PlayFabEditorExtensions/Editor/Resources/PlayFabEditorPrefsSO.asset b/Assets/PlayFabEditorExtensions/Editor/Resources/PlayFabEditorPrefsSO.asset index e77c556f5..a098d94ef 100644 --- a/Assets/PlayFabEditorExtensions/Editor/Resources/PlayFabEditorPrefsSO.asset +++ b/Assets/PlayFabEditorExtensions/Editor/Resources/PlayFabEditorPrefsSO.asset @@ -19,5 +19,5 @@ MonoBehaviour: EdExPath: LocalCloudScriptPath: C:/Git/nn_himminji/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js PanelIsShown: 0 - curMainMenuIdx: 0 + curMainMenuIdx: 4 curSubMenuIdx: 0 diff --git a/Assets/Script/Character/Projectile/Skill/Skill_MultiShot.cs b/Assets/Script/Character/Projectile/Skill/Skill_MultiShot.cs index b526bf59d..94a2399cd 100644 --- a/Assets/Script/Character/Projectile/Skill/Skill_MultiShot.cs +++ b/Assets/Script/Character/Projectile/Skill/Skill_MultiShot.cs @@ -24,6 +24,7 @@ public class Skill_MultiShot : ProjectileBase { yield return null; m_LifeTime -= Time.deltaTime; + if (DSUtil.CheckNull(m_ProjecTileData.shooter)) break; transform.position = m_ProjecTileData.shooter.Get_Center_position(); } diff --git a/Assets/Script/Info/DungeonInfo.cs b/Assets/Script/Info/DungeonInfo.cs index 5fba45db7..ada4bdd41 100644 --- a/Assets/Script/Info/DungeonInfo.cs +++ b/Assets/Script/Info/DungeonInfo.cs @@ -1,6 +1,7 @@ using CodeStage.AntiCheat.ObscuredTypes; using System; using System.Collections; +using System.Collections.Generic; using UnityEngine; public class DungeonInfo : MonoBehaviourSingletonTemplate @@ -8,12 +9,16 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate public Action act_Time; public Action act_MobDieCount; - private ObscuredFloat _Time; - public float m_Time + public float m_TotalTime; + Dictionary dic_time = new Dictionary(); + public void Set_Time(int floor, float time) { - get { return _Time; } - set { _Time = value; _Time.RandomizeCryptoKey(); } + if (!dic_time.ContainsKey(MyValue.MyChoiceMapData.n_DungeonLv)) + dic_time.Add(MyValue.MyChoiceMapData.n_DungeonLv, 0f); + dic_time[MyValue.MyChoiceMapData.n_DungeonLv] = time; + dic_time[MyValue.MyChoiceMapData.n_DungeonLv].RandomizeCryptoKey(); } + public float Get_Time(int floor) { return dic_time.ContainsKey(floor) ? dic_time[floor] : 0f; } private ObscuredInt _MaxDieMobCount; public int m_MaxDieMobCount @@ -37,6 +42,13 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate } eDungeon m_Dungeon; + bool bTotalTimeUpdate = false; + + private void Update() + { + if (bTotalTimeUpdate) + m_TotalTime += Time.deltaTime; + } public void Stop_Dungeon(bool? win) { @@ -47,11 +59,12 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate } IEnumerator Co_Update_Time() { - while (m_Time > 0f) + while (dic_time[MyValue.MyChoiceMapData.n_DungeonLv] > 0f) { yield return null; - m_Time -= Time.deltaTime; - act_Time?.Invoke(m_Time); + dic_time[MyValue.MyChoiceMapData.n_DungeonLv] -= Time.deltaTime; + dic_time[MyValue.MyChoiceMapData.n_DungeonLv].RandomizeCryptoKey(); + act_Time?.Invoke(dic_time[MyValue.MyChoiceMapData.n_DungeonLv]); } // 시간 오버 @@ -63,6 +76,7 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate act_MobDieCount?.Invoke(m_DieCount); if (m_DieCount == m_MaxDieMobCount) { + bTotalTimeUpdate = false; switch (m_Dungeon) { case eDungeon.d1_Mimic: Stop_Dungeon(true); break; @@ -93,7 +107,12 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate public void Start_Dungeon(bool first) { m_DieCount = 0; - if (first) m_MazeClear = 0; + if (first) + { + m_TotalTime = 0f; + m_MazeClear = 0; + } + bTotalTimeUpdate = true; m_Dungeon = MyValue.MyChoiceMapData.Get_MapData().e_Dungeon; switch (m_Dungeon) diff --git a/Assets/Script/Server/ServerInfo.cs b/Assets/Script/Server/ServerInfo.cs index 949f0ad2a..323691152 100644 --- a/Assets/Script/Server/ServerInfo.cs +++ b/Assets/Script/Server/ServerInfo.cs @@ -446,31 +446,38 @@ public class ServerInfo : MyCoroutine fail => { }); } - void Set_MyRank(Action _act) + public void Get_RankDefinition(string leaderboard) { - PlayFabClientAPI.GetLeaderboardAroundPlayer(new GetLeaderboardAroundPlayerRequest { StatisticName = "Stage", MaxResultsCount = 1 }, + PlayFabProgressionAPI.GetLeaderboardDefinition(new GetLeaderboardDefinitionRequest { Name = leaderboard }, result => { - _act?.Invoke(); - }, - fail => - { - _act?.Invoke(); - }); - } - - public void Save_Rank(string leaderboard, int _v) - { - var req = new UpdatePlayerStatisticsRequest { Statistics = new List() }; - req.Statistics.Add(new StatisticUpdate { StatisticName = leaderboard, Value = _v }); - PlayFabClientAPI.UpdatePlayerStatistics(req, - result => - { - // 정상 등록 아무것도 안함 + Debug.Log(result); }, error => { - Set_Coroutine(() => { Save_Rank(leaderboard, _v); }, 2f); + Debug.Log(error); + }); + } + public void Save_Rank(string leaderboard, List scores) + { + PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest + { + FunctionName = "Save_Rank", + GeneratePlayStreamEvent = true, + FunctionParameter = new + { + LeaderboardName = leaderboard, + Metadata = "메타 데이터", + Scores = scores, + } + }, + result => + { + Debug.Log(result); + }, + fail => + { + Debug.Log(fail); }); } public void Get_MyRank(string leaderboard, Action my) diff --git a/Assets/Script/UI/Ingame/Dungeon/DungeonResult_Maze.cs b/Assets/Script/UI/Ingame/Dungeon/DungeonResult_Maze.cs index 64fe115b5..8b56e7da8 100644 --- a/Assets/Script/UI/Ingame/Dungeon/DungeonResult_Maze.cs +++ b/Assets/Script/UI/Ingame/Dungeon/DungeonResult_Maze.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using TMPro; public class DungeonResult_Maze : DungeonResultBase @@ -9,13 +10,18 @@ public class DungeonResult_Maze : DungeonResultBase base.Set(win); var sdata = ServerInfo.Ins.m_ServerData; var curFloor = sdata.Get_DungeonLv(eDungeon.d2_Maze); - var nextFloor = MyValue.MyChoiceMapData.n_DungeonLv; + var nextFloor = MyValue.MyChoiceMapData.n_DungeonLv - 1; // 현재 층은 실패했으니 아랫층 texts[0].text = DSUtil.Format("기존 층수 : {0}\n\n최고 층수 : {1}", curFloor, nextFloor); if (nextFloor > curFloor) { sdata.Set_DungeonLv(eDungeon.d2_Maze, nextFloor); ServerInfo.Ins.Write(null, false); + + var maxTime = MyValue.MyChoiceMapData.Get_DungeonMapData_orNull().f_Time; + var floorTime = DungeonInfo.Ins.Get_Time(nextFloor); + ServerInfo.Ins.Save_Rank("Rank_Maze", + new List { nextFloor.ToString(), ((int)(maxTime - floorTime)).ToString(), "0" }); } } } \ No newline at end of file diff --git a/Assets/Script/UI/Ingame/Dungeon/Ingame_Dungeon.cs b/Assets/Script/UI/Ingame/Dungeon/Ingame_Dungeon.cs index 51dcdbece..91d1be568 100644 --- a/Assets/Script/UI/Ingame/Dungeon/Ingame_Dungeon.cs +++ b/Assets/Script/UI/Ingame/Dungeon/Ingame_Dungeon.cs @@ -14,7 +14,7 @@ public class Ingame_Dungeon : MonoBehaviour for (int i = 0; i < ingame_Dungeons.Length; i++) ingame_Dungeons[i].gameObject.SetActive(false); ingame_Dungeons[MyValue.MyChoiceMapData.Get_DungeonIndex()].Set_DungeonInfo(maxMobCount); - DungeonInfo.Ins.m_Time = time; + DungeonInfo.Ins.Set_Time(MyValue.MyChoiceMapData.n_DungeonLv, time); DungeonInfo.Ins.act_Time = Set_TextTime; } diff --git a/Assets/Script/UI/Stage/StageResult.cs b/Assets/Script/UI/Stage/StageResult.cs index eeab2c646..01fdfd0e2 100644 --- a/Assets/Script/UI/Stage/StageResult.cs +++ b/Assets/Script/UI/Stage/StageResult.cs @@ -53,7 +53,7 @@ public class StageResult : BackKeyAdd m_TweenPosition.enabled = true; m_TweenPosition.ResetToBeginning(); m_TweenPosition.Play(true); - ServerInfo.Ins.Save_Rank("Level", afterLv); + //ServerInfo.Ins.Save_Rank("Level", afterLv); } else m_TweenPosition.enabled = false;