mirror of
https://github.com/esiur/esiur-dart.git
synced 2025-05-06 04:02:57 +00:00
IIP3.5
This commit is contained in:
parent
53d801bc38
commit
7971c836b7
@ -1183,7 +1183,7 @@ class DistributedConnection extends NetworkConnection with IStore
|
||||
var item = new AsyncReply<DistributedResourceQueueItem>();
|
||||
_queue.add(item);
|
||||
|
||||
Codec.parseVarArray(content, 0, content.length, this).then((arguments)
|
||||
Codec.parse(content, 0, this).then((arguments)
|
||||
{
|
||||
var et = r.instance.template.getEventTemplateByIndex(index);
|
||||
if (et != null)
|
||||
@ -1846,8 +1846,12 @@ class DistributedConnection extends NetworkConnection with IStore
|
||||
{
|
||||
Warehouse.query(resourceLink).then((r)
|
||||
{
|
||||
//if (r != null)
|
||||
//{
|
||||
if (r == null)
|
||||
{
|
||||
sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound.index);
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = r.where((x) => x.instance.applicable(session, ActionType.Attach, null) != Ruling.Denied).toList();
|
||||
|
||||
if (list.length == 0)
|
||||
@ -1856,6 +1860,7 @@ class DistributedConnection extends NetworkConnection with IStore
|
||||
sendReply(IIPPacketAction.QueryLink, callback)
|
||||
.addDC(Codec.composeResourceArray(list, this, true))
|
||||
.done();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1895,8 +1900,6 @@ class DistributedConnection extends NetworkConnection with IStore
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
var fi = null ;//r.GetType().GetTypeInfo().GetMethod(ft.name);
|
||||
|
||||
|
||||
@ -2595,7 +2598,7 @@ class DistributedConnection extends NetworkConnection with IStore
|
||||
|
||||
// private void Instance_EventOccurred(IResource resource, string name, string[] users, DistributedConnection[] connections, object[] args)
|
||||
|
||||
void _instance_EventOccurred(IResource resource, issuer, List<Session> receivers, String name, List args)
|
||||
void _instance_EventOccurred(IResource resource, issuer, List<Session> receivers, String name, dynamic args)
|
||||
{
|
||||
var et = resource.instance.template.getEventTemplateByName(name);
|
||||
|
||||
@ -2614,7 +2617,7 @@ class DistributedConnection extends NetworkConnection with IStore
|
||||
sendEvent(IIPPacketEvent.EventOccurred)
|
||||
.addUint32(resource.instance.id)
|
||||
.addUint8(et.index)
|
||||
.addDC(Codec.composeVarArray(args, this, true))
|
||||
.addDC(Codec.compose(args, this, true))
|
||||
.done();
|
||||
}
|
||||
}
|
||||
|
@ -165,14 +165,13 @@ class DistributedResource extends IResource {
|
||||
return true;
|
||||
}
|
||||
|
||||
void emitEventByIndex(int index, List<dynamic> args) {
|
||||
void emitEventByIndex(int index, dynamic args) {
|
||||
// neglect events when the object is not yet attached
|
||||
if (!_attached) return;
|
||||
|
||||
var et = instance.template.getEventTemplateByIndex(index);
|
||||
//events[index]?.Invoke(this, args);
|
||||
emitArgs(et.name, args);
|
||||
|
||||
emitArgs(et.name, [args]);
|
||||
//emitArgs(event, arguments)
|
||||
instance.emitResourceEvent(null, null, et.name, args);
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,8 @@ class IIPPacket
|
||||
|
||||
offset += cl;
|
||||
}
|
||||
else if (event == IIPPacketEvent.PropertyUpdated)
|
||||
else if (event == IIPPacketEvent.PropertyUpdated
|
||||
|| event == IIPPacketEvent.EventOccurred)
|
||||
{
|
||||
if (_notEnough(offset, ends, 2))
|
||||
return -_dataLengthNeeded;
|
||||
@ -210,23 +211,23 @@ class IIPPacket
|
||||
offset += size;
|
||||
}
|
||||
}
|
||||
else if (event == IIPPacketEvent.EventOccurred)
|
||||
{
|
||||
if (_notEnough(offset, ends, 5))
|
||||
return -_dataLengthNeeded;
|
||||
// else if (event == IIPPacketEvent.EventOccurred)
|
||||
// {
|
||||
// if (_notEnough(offset, ends, 5))
|
||||
// return -_dataLengthNeeded;
|
||||
|
||||
methodIndex = data[offset++];
|
||||
// methodIndex = data[offset++];
|
||||
|
||||
var cl = data.getUint32( offset);
|
||||
offset += 4;
|
||||
// var cl = data.getUint32( offset);
|
||||
// offset += 4;
|
||||
|
||||
if (_notEnough(offset, ends, cl))
|
||||
return -_dataLengthNeeded;
|
||||
// if (_notEnough(offset, ends, cl))
|
||||
// return -_dataLengthNeeded;
|
||||
|
||||
content = data.clip(offset, cl);
|
||||
offset += cl;
|
||||
// content = data.clip(offset, cl);
|
||||
// offset += cl;
|
||||
|
||||
}
|
||||
// }
|
||||
// Attribute
|
||||
else if (event == IIPPacketEvent.AttributesUpdated)
|
||||
{
|
||||
|
@ -453,7 +453,7 @@ class Instance extends IEventHandler
|
||||
}
|
||||
}
|
||||
|
||||
emitResourceEvent(issuer, List<Session> receivers, String name, List<dynamic> args)
|
||||
emitResourceEvent(issuer, List<Session> receivers, String name, dynamic args)
|
||||
{
|
||||
emitArgs("resourceEventOccurred", [_resource, issuer, receivers, name, args]);
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ class EventTemplate extends MemberTemplate
|
||||
var exp = DC.stringToBytes(expansion);
|
||||
return new BinaryList()
|
||||
.addUint8(0x50)
|
||||
.addInt32(exp.length)
|
||||
.addDC(exp)
|
||||
.addUint8(name.length)
|
||||
.addDC(name)
|
||||
.addInt32(exp.length)
|
||||
.addDC(exp)
|
||||
.toDC();
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user