2
0
mirror of https://github.com/esiur/esiur-js.git synced 2025-05-06 12:32:58 +00:00

Challenge Faield Added

This commit is contained in:
Ahmed Zamil 2020-01-23 16:30:42 +03:00
parent f7f57a5f43
commit 9e86e3fa00
4 changed files with 53 additions and 38 deletions

View File

@ -2,29 +2,31 @@ export default //const ExceptionCode =
{ {
HostNotReachable: 0, HostNotReachable: 0,
AccessDenied: 1, AccessDenied: 1,
ResourceNotFound: 2, UserNotFound: 2,
AttachDenied: 3, ChallengeFailed: 3,
InvalidMethod: 4, ResourceNotFound: 4,
InvokeDenied: 5, AttachDenied: 5,
CreateDenied: 6, InvalidMethod: 6,
AddParentDenied: 7, InvokeDenied: 7,
AddChildDenied: 8, CreateDenied: 8,
ViewAttributeDenied: 9, AddParentDenied: 9,
UpdateAttributeDenied: 10, AddChildDenied: 10,
StoreNotFound: 11, ViewAttributeDenied: 11,
ParentNotFound: 12, UpdateAttributeDenied: 12,
ChildNotFound: 13, StoreNotFound: 13,
ResourceIsNotStore: 14, ParentNotFound: 14,
DeleteDenied: 15, ChildNotFound: 15,
DeleteFailed: 16, ResourceIsNotStore: 16,
UpdateAttributeFailed: 17, DeleteDenied: 17,
GetAttributesFailed: 18, DeleteFailed: 18,
ClearAttributesFailed: 19, UpdateAttributeFailed: 19,
TemplateNotFound: 20, GetAttributesFailed: 20,
RenameDenied: 21, ClearAttributesFailed: 21,
ClassNotFound: 22, TemplateNotFound: 22,
MethodNotFound: 23, RenameDenied: 23,
PropertyNotFound: 24, ClassNotFound: 24,
SetPropertyDenied: 25, MethodNotFound: 25,
ReadOnlyProperty: 26 PropertyNotFound: 26,
SetPropertyDenied: 27,
ReadOnlyProperty: 28
}; };

View File

@ -297,43 +297,43 @@ export default class DC extends Uint8Array
getInt16Array(offset, length) getInt16Array(offset, length)
{ {
return new Int16Array(this.buffer, offset, length); return new Int16Array(this.clip(offset, length).buffer);
} }
getUint16Array(offset, length) getUint16Array(offset, length)
{ {
return new Uint16Array(this.buffer, offset, length); return new Uint16Array(this.clip(offset, length).buffer);
} }
getInt32Array(offset, length) getInt32Array(offset, length)
{ {
return new Int32Array(this.buffer, offset, length); return new Int32Array(this.clip(offset, length).buffer);
} }
getUint32Array(offset, length) getUint32Array(offset, length)
{ {
return new Uint32Array(this.buffer, offset, length); return new Uint32Array(this.clip(offset, length).buffer);
} }
getFloat32Array(offset, length) getFloat32Array(offset, length)
{ {
return new Float32Array(this.buffer, offset, length); return new Float32Array(this.clip(offset, length).buffer);
} }
getFloat64Array(offset, length) getFloat64Array(offset, length)
{ {
return new Float64Array(this.buffer, offset, length); return new Float64Array(this.clip(offset, length).buffer);
} }
getInt64Array(offset, length) getInt64Array(offset, length)
{ {
return new Int64Array(this.buffer, offset, length); return new Int64Array(this.clip(offset, length).buffer);
} }
getUint64Array(offset, length) getUint64Array(offset, length)
{ {
return new Uint64Array(this.buffer, offset, length); return new Uint64Array(this.clip(offset, length).buffer);
} }
getBoolean(offset) getBoolean(offset)

View File

@ -417,7 +417,11 @@ export default class DistributedConnection extends IStore {
} }
else { else {
// incorrect password // incorrect password
this.sendParams().addUint8(0xc0).addInt32(1).addUint16(5).addString("Error").done(); this.sendParams().addUint8(0xc0)
.addInt32(ExceptionCode.AccessDenied)
.addUint16(13)
.addString("Access Denied")
.done();
} }
} }
}); });
@ -471,7 +475,11 @@ export default class DistributedConnection extends IStore {
this.sendParams().addUint8(0x20).addUint16(0).done(); this.sendParams().addUint8(0x20).addUint16(0).done();
} }
else { else {
this.sendParams().addUint8(0xc0).addUint32(1).addUint16(5).addString("Error").done(); this.sendParams().addUint8(0xc0)
.addUint32(ExceptionCode.ChallengeFailed)
.addUint16(16)
.addString("Challenge Failed")
.done();
} }
} }
else if (authPacket.action == IIPAuthPacketAction.ConnectionEstablished) { else if (authPacket.action == IIPAuthPacketAction.ConnectionEstablished) {

View File

@ -1,7 +1,12 @@
import wh from './Resource/Warehouse.js'; import wh from './Resource/Warehouse.js';
import Structure from './Data/Structure.js';
import DistributedResource from './Net/IIP/DistributedResource.js'
if (window) if (window) {
window.wh = wh; window.wh = wh;
window.Structure = Structure;
window.DistributedResource = DistributedResource;
}
export default wh; export default wh;