diff --git a/src/EllieBot.GrpcApiBase/protos/other.proto b/src/EllieBot.GrpcApiBase/protos/other.proto index 64a3170..123c195 100644 --- a/src/EllieBot.GrpcApiBase/protos/other.proto +++ b/src/EllieBot.GrpcApiBase/protos/other.proto @@ -12,7 +12,6 @@ service GrpcOther { rpc GetRoles(GetRolesRequest) returns (GetRolesReply); rpc GetCurrencyLb(GetLbRequest) returns (CurrencyLbReply); - rpc GetXpLb(GetLbRequest) returns (XpLbReply); rpc GetWaifuLb(GetLbRequest) returns (WaifuLbReply); rpc GetShardStats(google.protobuf.Empty) returns (stream ShardStatsReply); @@ -78,17 +77,6 @@ message GetLbRequest { int32 perPage = 2; } -message XpLbReply { - repeated XpLbEntryReply entries = 1; -} - -message XpLbEntryReply { - string user = 1; - uint64 userId = 2; - int64 totalXp = 3; - int64 level = 4; -} - message WaifuLbReply { repeated WaifuLbEntry entries = 1; } diff --git a/src/EllieBot.GrpcApiBase/protos/xp.proto b/src/EllieBot.GrpcApiBase/protos/xp.proto index 72bcba9..faf7b16 100644 --- a/src/EllieBot.GrpcApiBase/protos/xp.proto +++ b/src/EllieBot.GrpcApiBase/protos/xp.proto @@ -10,22 +10,8 @@ service GrpcXp { rpc GetXpSettings(GetXpSettingsRequest) returns (GetXpSettingsReply); - rpc AddExclusion(AddExclusionRequest) returns (AddExclusionReply); - rpc DeleteExclusion(DeleteExclusionRequest) returns (DeleteExclusionReply); - rpc AddReward(AddRewardRequest) returns (AddRewardReply); rpc DeleteReward(DeleteRewardRequest) returns (DeleteRewardReply); - - rpc SetServerExclusion(SetServerExclusionRequest) returns (SetServerExclusionReply); -} - -message SetServerExclusionRequest { - uint64 guildId = 1; - bool serverExcluded = 2; -} - -message SetServerExclusionReply { - bool success = 1; } message GetXpLbRequest { @@ -57,47 +43,19 @@ message ResetUserXpReply { } message GetXpSettingsReply { - repeated ExclItemReply exclusions = 1; repeated RewItemReply rewards = 2; - bool serverExcluded = 3; } message GetXpSettingsRequest { uint64 guildId = 1; } -message ExclItemReply { - string type = 1; - uint64 id = 2; - string name = 3; -} - message RewItemReply { int32 level = 1; string type = 2; string value = 3; } -message AddExclusionRequest { - uint64 guildId = 1; - string type = 2; - uint64 id = 3; -} - -message AddExclusionReply { - bool success = 1; -} - -message DeleteExclusionRequest { - uint64 guildId = 1; - string type = 2; - uint64 id = 3; -} - -message DeleteExclusionReply { - bool success = 1; -} - message AddRewardRequest { uint64 guildId = 1; int32 level = 2; diff --git a/src/EllieBot/Services/GrpcApi/OtherSvc.cs b/src/EllieBot/Services/GrpcApi/OtherSvc.cs index 8138345..514ad55 100644 --- a/src/EllieBot/Services/GrpcApi/OtherSvc.cs +++ b/src/EllieBot/Services/GrpcApi/OtherSvc.cs @@ -111,31 +111,6 @@ public sealed class OtherSvc : GrpcOther.GrpcOtherBase, IGrpcSvc, IEService return reply; } - [GrpcNoAuthRequired] - public override async Task<XpLbReply> GetXpLb(GetLbRequest request, ServerCallContext context) - { - var users = await _xp.GetGlobalUserXps(request.Page); - - var reply = new XpLbReply(); - - var entries = users.Select(x => - { - var lvl = new LevelStats(x.TotalXp); - - return new XpLbEntryReply() - { - Level = lvl.Level, - TotalXp = x.TotalXp, - User = x.Username, - UserId = x.UserId - }; - }); - - reply.Entries.AddRange(entries); - - return reply; - } - [GrpcNoAuthRequired] public override async Task<WaifuLbReply> GetWaifuLb(GetLbRequest request, ServerCallContext context) { diff --git a/src/EllieBot/Services/GrpcApi/XpSvc.cs b/src/EllieBot/Services/GrpcApi/XpSvc.cs index 674dc48..ff8db41 100644 --- a/src/EllieBot/Services/GrpcApi/XpSvc.cs +++ b/src/EllieBot/Services/GrpcApi/XpSvc.cs @@ -35,27 +35,10 @@ public class XpSvc : GrpcXp.GrpcXpBase, IGrpcSvc, IEService if (guild is null) throw new RpcException(new Status(StatusCode.NotFound, "Guild not found")); - var excludedChannels = new List<ulong>(); - var excludedRoles = new List<ulong>(); var isServerExcluded = false; var reply = new GetXpSettingsReply(); - reply.Exclusions.AddRange(excludedChannels - .Select(x => new ExclItemReply() - { - Id = x, - Type = "Channel", - Name = guild.GetChannel(x)?.Name ?? "????" - }) - .Concat(excludedRoles - .Select(x => new ExclItemReply() - { - Id = x, - Type = "Role", - Name = guild.GetRole(x)?.Name ?? "????" - }))); - var settings = await _xp.GetFullXpSettingsFor(request.GuildId); var curRews = settings.CurrencyRewards; var roleRews = settings.RoleRewards; @@ -77,8 +60,6 @@ public class XpSvc : GrpcXp.GrpcXpBase, IGrpcSvc, IEService reply.Rewards.AddRange(rews); - reply.ServerExcluded = isServerExcluded; - return reply; }