/// <summary> /// 获取COOP榜单排名 /// </summary> public static async Task <int> RemoteGetCOOPRank(int serverId, string key) { if (RunServerId.Value < 0) { return(-1); } if (serverId < 0) { return(-1); } if (string.IsNullOrEmpty(key)) { return(-1); } return(await RpcProxy.RunAsync(typeof(RankCenterService), RunServerId.Value, RpcProxy.BuildArgs(serverId), () => { if (COOPRankPool == null) { Logger.LogError("COOPRankPool == null"); return -1; } var rank = COOPRankPool.GetRank(key); Logger.LogDebug($"[Success]ServerId[{serverId}] get COOPRank Key[{key}]Rank[{rank}]"); return rank; } )); }
/// <summary> /// 获取PK榜单排名 /// </summary> public static async Task <int> RemoteGetPKRank(int serverId, int userId) { if (RunServerId.Value < 0) { return(-1); } if (serverId < 0) { return(-1); } if (userId == 0) { return(-1); } return(await RpcProxy.RunAsync(typeof(RankCenterService), RunServerId.Value, RpcProxy.BuildArgs(serverId), () => { if (PKRankPool == null) { Logger.LogError("PKRankPool == null"); return -1; } var rank = PKRankPool.GetRank(userId); Logger.LogDebug($"[Success]ServerId[{serverId}] get PKRank UserId[{userId}]Rank[{rank}]"); return rank; } )); }