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,
AccessDenied: 1,
ResourceNotFound: 2,
AttachDenied: 3,
InvalidMethod: 4,
InvokeDenied: 5,
CreateDenied: 6,
AddParentDenied: 7,
AddChildDenied: 8,
ViewAttributeDenied: 9,
UpdateAttributeDenied: 10,
StoreNotFound: 11,
ParentNotFound: 12,
ChildNotFound: 13,
ResourceIsNotStore: 14,
DeleteDenied: 15,
DeleteFailed: 16,
UpdateAttributeFailed: 17,
GetAttributesFailed: 18,
ClearAttributesFailed: 19,
TemplateNotFound: 20,
RenameDenied: 21,
ClassNotFound: 22,
MethodNotFound: 23,
PropertyNotFound: 24,
SetPropertyDenied: 25,
ReadOnlyProperty: 26
UserNotFound: 2,
ChallengeFailed: 3,
ResourceNotFound: 4,
AttachDenied: 5,
InvalidMethod: 6,
InvokeDenied: 7,
CreateDenied: 8,
AddParentDenied: 9,
AddChildDenied: 10,
ViewAttributeDenied: 11,
UpdateAttributeDenied: 12,
StoreNotFound: 13,
ParentNotFound: 14,
ChildNotFound: 15,
ResourceIsNotStore: 16,
DeleteDenied: 17,
DeleteFailed: 18,
UpdateAttributeFailed: 19,
GetAttributesFailed: 20,
ClearAttributesFailed: 21,
TemplateNotFound: 22,
RenameDenied: 23,
ClassNotFound: 24,
MethodNotFound: 25,
PropertyNotFound: 26,
SetPropertyDenied: 27,
ReadOnlyProperty: 28
};

View File

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

View File

@ -417,7 +417,11 @@ export default class DistributedConnection extends IStore {
}
else {
// 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();
}
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) {

View File

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