수상한 미궁 랭킹 저장까지
This commit is contained in:
parent
bdfaf6f726
commit
16b5bc2b42
|
|
@ -51,7 +51,6 @@ messageinfo 엄청 느린 버그
|
||||||
- 결과 화면 (승리 보상 지급)
|
- 결과 화면 (승리 보상 지급)
|
||||||
|
|
||||||
수상한 미궁
|
수상한 미궁
|
||||||
- 맵 벽과 플레이 사이 더 멀게 만들자
|
- 맵 벽과 플레이 사이 더 멀게 만들자 (카메라가 벽 밖에 안 나가게)
|
||||||
- 결과 화면 (보상 지급)
|
- 결과 화면 (보상 지급)
|
||||||
- 랭킹 (플레이팹 v2 연결)
|
- 랭킹 화면
|
||||||
|
|
||||||
|
|
@ -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)
|
handlers.SaveToStageRank = function(args)
|
||||||
{
|
{
|
||||||
var error = Get_Error(args.Token);
|
var error = Get_Error(args.Token);
|
||||||
|
|
|
||||||
|
|
@ -19,5 +19,5 @@ MonoBehaviour:
|
||||||
EdExPath:
|
EdExPath:
|
||||||
LocalCloudScriptPath: C:/Git/nn_himminji/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js
|
LocalCloudScriptPath: C:/Git/nn_himminji/Assets/PlayFabEditorExtensions/Editor/Resources/.CloudScript.js
|
||||||
PanelIsShown: 0
|
PanelIsShown: 0
|
||||||
curMainMenuIdx: 0
|
curMainMenuIdx: 4
|
||||||
curSubMenuIdx: 0
|
curSubMenuIdx: 0
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ public class Skill_MultiShot : ProjectileBase
|
||||||
{
|
{
|
||||||
yield return null;
|
yield return null;
|
||||||
m_LifeTime -= Time.deltaTime;
|
m_LifeTime -= Time.deltaTime;
|
||||||
|
if (DSUtil.CheckNull(m_ProjecTileData.shooter)) break;
|
||||||
transform.position = m_ProjecTileData.shooter.Get_Center_position();
|
transform.position = m_ProjecTileData.shooter.Get_Center_position();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
using CodeStage.AntiCheat.ObscuredTypes;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class DungeonInfo : MonoBehaviourSingletonTemplate<DungeonInfo>
|
public class DungeonInfo : MonoBehaviourSingletonTemplate<DungeonInfo>
|
||||||
|
|
@ -8,12 +9,16 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate<DungeonInfo>
|
||||||
public Action<float> act_Time;
|
public Action<float> act_Time;
|
||||||
public Action<int> act_MobDieCount;
|
public Action<int> act_MobDieCount;
|
||||||
|
|
||||||
private ObscuredFloat _Time;
|
public float m_TotalTime;
|
||||||
public float m_Time
|
Dictionary<int, ObscuredFloat> dic_time = new Dictionary<int, ObscuredFloat>();
|
||||||
|
public void Set_Time(int floor, float time)
|
||||||
{
|
{
|
||||||
get { return _Time; }
|
if (!dic_time.ContainsKey(MyValue.MyChoiceMapData.n_DungeonLv))
|
||||||
set { _Time = value; _Time.RandomizeCryptoKey(); }
|
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;
|
private ObscuredInt _MaxDieMobCount;
|
||||||
public int m_MaxDieMobCount
|
public int m_MaxDieMobCount
|
||||||
|
|
@ -37,6 +42,13 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate<DungeonInfo>
|
||||||
}
|
}
|
||||||
|
|
||||||
eDungeon m_Dungeon;
|
eDungeon m_Dungeon;
|
||||||
|
bool bTotalTimeUpdate = false;
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (bTotalTimeUpdate)
|
||||||
|
m_TotalTime += Time.deltaTime;
|
||||||
|
}
|
||||||
|
|
||||||
public void Stop_Dungeon(bool? win)
|
public void Stop_Dungeon(bool? win)
|
||||||
{
|
{
|
||||||
|
|
@ -47,11 +59,12 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate<DungeonInfo>
|
||||||
}
|
}
|
||||||
IEnumerator Co_Update_Time()
|
IEnumerator Co_Update_Time()
|
||||||
{
|
{
|
||||||
while (m_Time > 0f)
|
while (dic_time[MyValue.MyChoiceMapData.n_DungeonLv] > 0f)
|
||||||
{
|
{
|
||||||
yield return null;
|
yield return null;
|
||||||
m_Time -= Time.deltaTime;
|
dic_time[MyValue.MyChoiceMapData.n_DungeonLv] -= Time.deltaTime;
|
||||||
act_Time?.Invoke(m_Time);
|
dic_time[MyValue.MyChoiceMapData.n_DungeonLv].RandomizeCryptoKey();
|
||||||
|
act_Time?.Invoke(dic_time[MyValue.MyChoiceMapData.n_DungeonLv]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 시간 오버
|
// 시간 오버
|
||||||
|
|
@ -63,6 +76,7 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate<DungeonInfo>
|
||||||
act_MobDieCount?.Invoke(m_DieCount);
|
act_MobDieCount?.Invoke(m_DieCount);
|
||||||
if (m_DieCount == m_MaxDieMobCount)
|
if (m_DieCount == m_MaxDieMobCount)
|
||||||
{
|
{
|
||||||
|
bTotalTimeUpdate = false;
|
||||||
switch (m_Dungeon)
|
switch (m_Dungeon)
|
||||||
{
|
{
|
||||||
case eDungeon.d1_Mimic: Stop_Dungeon(true); break;
|
case eDungeon.d1_Mimic: Stop_Dungeon(true); break;
|
||||||
|
|
@ -93,7 +107,12 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate<DungeonInfo>
|
||||||
public void Start_Dungeon(bool first)
|
public void Start_Dungeon(bool first)
|
||||||
{
|
{
|
||||||
m_DieCount = 0;
|
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;
|
m_Dungeon = MyValue.MyChoiceMapData.Get_MapData().e_Dungeon;
|
||||||
switch (m_Dungeon)
|
switch (m_Dungeon)
|
||||||
|
|
|
||||||
|
|
@ -446,31 +446,38 @@ public class ServerInfo : MyCoroutine
|
||||||
fail => { });
|
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 =>
|
result =>
|
||||||
{
|
{
|
||||||
_act?.Invoke();
|
Debug.Log(result);
|
||||||
},
|
|
||||||
fail =>
|
|
||||||
{
|
|
||||||
_act?.Invoke();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Save_Rank(string leaderboard, int _v)
|
|
||||||
{
|
|
||||||
var req = new UpdatePlayerStatisticsRequest { Statistics = new List<StatisticUpdate>() };
|
|
||||||
req.Statistics.Add(new StatisticUpdate { StatisticName = leaderboard, Value = _v });
|
|
||||||
PlayFabClientAPI.UpdatePlayerStatistics(req,
|
|
||||||
result =>
|
|
||||||
{
|
|
||||||
// 정상 등록 아무것도 안함
|
|
||||||
},
|
},
|
||||||
error =>
|
error =>
|
||||||
{
|
{
|
||||||
Set_Coroutine(() => { Save_Rank(leaderboard, _v); }, 2f);
|
Debug.Log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public void Save_Rank(string leaderboard, List<string> 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<EntityLeaderboardEntry> my)
|
public void Get_MyRank(string leaderboard, Action<EntityLeaderboardEntry> my)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
|
||||||
public class DungeonResult_Maze : DungeonResultBase
|
public class DungeonResult_Maze : DungeonResultBase
|
||||||
|
|
@ -9,13 +10,18 @@ public class DungeonResult_Maze : DungeonResultBase
|
||||||
base.Set(win);
|
base.Set(win);
|
||||||
var sdata = ServerInfo.Ins.m_ServerData;
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||||||
var curFloor = sdata.Get_DungeonLv(eDungeon.d2_Maze);
|
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);
|
texts[0].text = DSUtil.Format("기존 층수 : {0}\n\n최고 층수 : {1}", curFloor, nextFloor);
|
||||||
|
|
||||||
if (nextFloor > curFloor)
|
if (nextFloor > curFloor)
|
||||||
{
|
{
|
||||||
sdata.Set_DungeonLv(eDungeon.d2_Maze, nextFloor);
|
sdata.Set_DungeonLv(eDungeon.d2_Maze, nextFloor);
|
||||||
ServerInfo.Ins.Write(null, false);
|
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<string> { nextFloor.ToString(), ((int)(maxTime - floorTime)).ToString(), "0" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ public class Ingame_Dungeon : MonoBehaviour
|
||||||
for (int i = 0; i < ingame_Dungeons.Length; i++)
|
for (int i = 0; i < ingame_Dungeons.Length; i++)
|
||||||
ingame_Dungeons[i].gameObject.SetActive(false);
|
ingame_Dungeons[i].gameObject.SetActive(false);
|
||||||
ingame_Dungeons[MyValue.MyChoiceMapData.Get_DungeonIndex()].Set_DungeonInfo(maxMobCount);
|
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;
|
DungeonInfo.Ins.act_Time = Set_TextTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public class StageResult : BackKeyAdd
|
||||||
m_TweenPosition.enabled = true;
|
m_TweenPosition.enabled = true;
|
||||||
m_TweenPosition.ResetToBeginning();
|
m_TweenPosition.ResetToBeginning();
|
||||||
m_TweenPosition.Play(true);
|
m_TweenPosition.Play(true);
|
||||||
ServerInfo.Ins.Save_Rank("Level", afterLv);
|
//ServerInfo.Ins.Save_Rank("Level", afterLv);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_TweenPosition.enabled = false;
|
m_TweenPosition.enabled = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue