- 뒤끝 SDK 버전 : 5.15.1
- 프로젝트명 : Puzzle&Summon
다름아니라 리더보드 정보 업데이트 시 추가항목을 넣어서 UpdateMyDataAndRefreshLeaderboard 함수로 등록 성공까지 확인하였는데, 막상 인게임에서 리더보드 데이터를 받으면 추가항목이 빠져있습니다.
콘솔에서 csv 파일을 받아서 확인해봐도 빠져있는게 확인했는데 코드적인 문제인지 알 수 있을까요?
아래 관련 구현 코드입니다.
public void UpdateLeaderboard(DungeonType recordType)
{
string uuid = GetLeaderboardUUID(recordType);
string tableName = "USER_DUNGEON";
string fieldName = string.Empty;
int record = DataManager.Instance.userDataController.playerData.dungeonRecords[(int)recordType];
switch (recordType)
{
case DungeonType.Nature:
fieldName = "dungeonRecordNature";
break;
case DungeonType.Water:
fieldName = "dungeonRecordWater";
break;
case DungeonType.Stone:
fieldName = "dungeonRecordStone";
break;
case DungeonType.Fire:
fieldName = "dungeonRecordFire";
break;
}
var playerData = DataManager.Instance.userDataController.playerData;
// 이름이 짤릴 것을 염두해두고 마지막에 넣음
string extraData = $"{playerData.level}|{(int)playerData.pClass}|{(int)playerData.gender}|{playerData.dungeonLevel[(int)recordType]}|{playerData.displayName}";
Debug.Log($"extraData: {extraData}");
Param param = new Param();
param.Add(fieldName, record);
param.Add("extraData", extraData);
if (string.IsNullOrEmpty(leaderboardRowIndate))
{
//var bro = Backend.GameData.Get(fieldName, new Where());
var bro = Backend.GameData.Get(tableName, new Where());
if (bro.IsSuccess() == false)
{
Debug.LogError(bro);
return;
}
if (bro.FlattenRows().Count > 0)
{
leaderboardRowIndate = bro.FlattenRows()[0]["inDate"].ToString();
}
else
{
var bro2 = Backend.GameData.Insert(tableName, param);
if (bro2.IsSuccess())
{
leaderboardRowIndate = bro2.GetInDate();
}
else
{
Debug.LogError(bro2);
return;
}
}
}
if (string.IsNullOrEmpty(leaderboardRowIndate))
{
Debug.LogError("Leaderboard's RowInDate is Null");
return;
}
Backend.Leaderboard.User.UpdateMyDataAndRefreshLeaderboard(uuid, tableName, leaderboardRowIndate, param, callback =>
{
if (callback.IsSuccess())
{
Debug.Log($"리더보드 등록 성공({recordType})");
}
else
{
Debug.Log($"리더보드 등록 실패({recordType}) : " + callback);
}
});
}