2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-06-13 14:38:43 +00:00
This commit is contained in:
2026-06-09 01:40:29 +03:00
parent 2bdd5d5022
commit a741013621
19 changed files with 887 additions and 185 deletions
@@ -1011,17 +1011,25 @@ partial class EpConnection
Instance.Warehouse.Query(resourceLink).Then(queryCallback);
}
void EpRequestTypeDefByName(uint callback, PlainTdu tdu)
void EpRequestTypeDefIdsByNames(uint callback, PlainTdu tdu)
{
var value = Codec.ParseSync(tdu, Instance.Warehouse);
var className = (string)value;
var classNames = (string[])value;
var typeDef = Instance.Warehouse.GetRemoteTypeDefByName(_remoteDomain, className);
var typeDefs = new List<ulong>();
if (typeDef != null)
foreach (var className in classNames)
{
SendReply(EpPacketReply.Completed, callback, typeDef.Compose(this));
//@TODO: need to search in remoteTypeDefs as well
var typeDef = Instance.Warehouse.GetLocalTypeDefByName(className);
if (typeDef != null)
typeDefs.Add(typeDef.Id);
}
if (typeDefs.Count > 0)
{
SendReply(EpPacketReply.Completed, callback, typeDefs.ToArray());
}
else
{
@@ -2567,6 +2575,18 @@ partial class EpConnection
return reply;
}
public AsyncReply<ulong[]> GetTypeDefIds(string[] fullNames)
{
var reply = new AsyncReply<ulong[]>();
SendRequest(EpPacketRequest.TypeDefIdsByNames, fullNames)
.Then(result =>
{
reply.Trigger((ulong[])result);
}).Error(ex => reply.TriggerError(ex));
return reply;
}
/// <summary>
/// Create a new resource.