// WingsEmu // // Developed by NosWings Team using System.Collections.Generic; using System.Threading.Tasks; using TranslationServer.Loader; using WingsAPI.Communication; using WingsAPI.Communication.Translations; using WingsAPI.Data.GameData; namespace TranslationServer.Services { public class GrpcGameLanguageService : ITranslationService { private readonly BannedNamesConfiguration _bannedNamesConfiguration; private readonly IResourceLoader _loader; public GrpcGameLanguageService(IResourceLoader loader, BannedNamesConfiguration bannedNamesConfiguration) { _loader = loader; _bannedNamesConfiguration = bannedNamesConfiguration; } public async Task GetTranslations(EmptyRpcRequest rpcRequest) { IReadOnlyList tmp = await _loader.LoadAsync(); return new GetTranslationsResponse { Translations = tmp }; } public async Task GetForbiddenWords(EmptyRpcRequest rpcRequest) => new GetForbiddenWordsResponse { ForbiddenWords = _bannedNamesConfiguration.BannedNames }; } }