using asap.core;
using asap.playfab.async;
using cfg;
using game;
using PlayFab.ClientModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using UnityEngine;
namespace GameCore
{
public enum ELeaderboardState : byte
{
Success = 0,
Failed = 1,
Delay = 2
}
public class GetLeaderboardsRequest
{
public string playerId { get; set; }
public bool includeOther { get; set; }
public int? Score { get; set; }
}
///
/// Leaderboard Model
///
public class GetLeaderboardsResp
{
public ELeaderboardState state { get; set; }
///
/// Event Id from table
///
public int eventId { get; set; }
///
/// Level of Leaderboard eg. T0 T1 T2
///
public int rankLevel { get; set; }
///
///
/// Max players of this leaderboard
///
public int capacity { get; set; }
///
/// Num of current member in this leaderboard (Players + Bots)
///
//public int Count => data?.Length ?? 0;
///
/// Avaliable Rank Datas
///
public RankData[] data { get; set; }
}
public class UpdateScoreRequest
{
public string playerId { get; set; }
public float Score { get; set; }
}
public class UpdateScoreResp
{
public ELeaderboardState state { get; set; }
public int rank { get; set; }
public int preRank { get; set; }
public double score { get; set; }
public double preScore { get; set; }
}
public class GetRewardsRequest
{
public string playerId { get; set; }
}
public class GetRewardsResp
{
public bool success { get; set; }
public List rewardDatas { get; set; }
}
//public class ManualUpdateRequest
//{
// public int eventId { get; set; }
//}
public class RewardData
{
public int rankLevel { get; set; }
public int dropId { get; set; }
public int eventId { get; set; }
public RankData[] ranks { get; set; }
}
public class RankData
{
///
/// Player PlayFab ID
///
public string id { get; set; }
///
/// Leaderboard ranking
///
public int rank { get; set; }
///
/// leaderboard score
///
public float score { get; set; }
///
/// Is this player myself
///
public bool isMe { get; set; }
public bool isBot { get; set; }
public string displayName { get; set; }
public string avatarUrl { get; set; }
}
public class EventRankData
{
}
public class PFRankDataEvent
{
public bool isLocal;
}
public class LeadboardData
{
[Inject]
public IUserService userService { get; set; }
// [REMOVED] CustomServerMgr deleted
public static int LV_MODELING = 100000;
//public const string leadboardLevelName = "Level";
public const string leadboardLevelName = "LevelB";
const int RefreshSeconds = 300;
bool isRefreshing = false;
// [REMOVED] LeadboardItemData type no longer exists
// public List LeadboardDataList = new List();
// public List LeadboardContinentDataList = new List();
public List