🐛 Fix some issues in moving realm service

This commit is contained in:
2025-10-22 21:56:50 +08:00
parent d6c37784e1
commit ff03584518
6 changed files with 120 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
using DysonNetwork.Shared.Models;
using DysonNetwork.Shared.Proto;
using Google.Protobuf.WellKnownTypes;
namespace DysonNetwork.Shared.Registry;
@@ -26,6 +27,20 @@ public class RemoteRealmService(RealmService.RealmServiceClient realms)
return response.RealmIds.Select(Guid.Parse).ToList();
}
public async Task<List<SnRealm>> GetPublicRealms()
{
var response = await realms.GetPublicRealmsAsync(new Empty());
return response.Realms.Select(SnRealm.FromProtoValue).ToList();
}
public async Task<List<SnRealm>> GetRealmBatch(List<string> ids)
{
var request = new GetRealmBatchRequest();
request.Ids.AddRange(ids);
var response = await realms.GetRealmBatchAsync(request);
return response.Realms.Select(SnRealm.FromProtoValue).ToList();
}
public async Task SendInviteNotify(SnRealmMember member)
{
var protoMember = member.ToProtoValue();