public static async Task <int> RemoteDeleteCOOPRankItem(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, key), () => { if (COOPRankPool == null) { Logger.LogError("COOPRankPool == null"); return -1; } var rank = COOPRankPool.Remove(key); Logger.LogDebug($"[Success]ServerId[{serverId}] delete COOPRankItem Key[{key}]Rank[{rank}]"); return rank; } )); }
public static async Task <int> RemoteDeletePKRankItem(int serverId, int userId) { if (RunServerId.Value < 0) { return(-1); } if (userId == 0) { return(-1); } return(await RpcProxy.RunAsync(typeof(RankCenterService), RunServerId.Value, RpcProxy.BuildArgs(serverId, userId), () => { if (PKRankPool == null) { Logger.LogError("PKRankPool == null"); return -1; } var rank = PKRankPool.Remove(userId); Logger.LogDebug($"[Success]ServerId[{serverId}] delete PKRankItem UserId[{userId}]Rank[{rank}]"); return rank; } )); }