Skip to content

Commit

Permalink
Introduce new packets and fixed a problem calling property of a not f…
Browse files Browse the repository at this point in the history
…ound entity
vthibault committed Feb 1, 2016
1 parent 431b5ef commit 0ad3dc4
Showing 3 changed files with 250 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Engine/MapEngine/Entity.js
Original file line number Diff line number Diff line change
@@ -379,19 +379,19 @@ define(function( require )
return;
}

type = ChatBox.TYPE.PUBLIC;
entity = EntityManager.get(pkt.GID);

if (entity) {
entity.dialog.set( pkt.msg );
}

type = ChatBox.TYPE.PUBLIC;

// Should not happened
if (entity === Session.Entity) {
type |= ChatBox.TYPE.SELF;
}
else if (entity.isAdmin) {
type |= ChatBox.TYPE.ADMIN;
// Should not happen
if (entity === Session.Entity) {
type |= ChatBox.TYPE.SELF;
}
else if (entity.isAdmin) {
type |= ChatBox.TYPE.ADMIN;
}
}

ChatBox.addText( pkt.msg, type );
6 changes: 6 additions & 0 deletions src/Network/PacketRegister.js
Original file line number Diff line number Diff line change
@@ -556,7 +556,13 @@ define( ['./PacketStructure' ], function( PACKET )
0x99d: PACKET.HC.ACCEPT_ENTER_NEO_UNION_LIST, // ok
0x9a0: PACKET.HC.CHARLIST_NOTIFY,
0x9ca: PACKET.ZC.SKILL_ENTRY5, // ok
0x9db: PACKET.ZC.NOTIFY_MOVEENTRY8, // ok
0x9dc: PACKET.ZC.NOTIFY_STANDENTRY8, // ok
0x9dd: PACKET.ZC.NOTIFY_NEWENTRY8, // ok
0x9df: PACKET.ZC.ACK_WHISPER2,
0x9fd: PACKET.ZC.NOTIFY_MOVEENTRY9, // ok
0x9fe: PACKET.ZC.NOTIFY_STANDENTRY9, // ok
0x9ff: PACKET.ZC.NOTIFY_NEWENTRY9, // ok
//0x9d5: npcmarketopenType
//0x9d7: npcmarketresultackType
0xa00: PACKET.ZC.SHORTCUT_KEY_LIST_V3, // ok
235 changes: 235 additions & 0 deletions src/Network/PacketStructure.js
Original file line number Diff line number Diff line change
@@ -11013,6 +11013,122 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
PACKET.ZC.SKILL_ENTRY5.size = -1;


// 0x9db
PACKET.ZC.NOTIFY_MOVEENTRY8 = function PACKET_ZC_NOTIFY_MOVEENTRY8(fp, end) {
this.objecttype = fp.readUChar();
this.AID = fp.readULong();
this.GID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
this.effectState = fp.readLong();
this.job = fp.readShort();
this.head = fp.readShort();
this.weapon = fp.readLong();
this.accessory = fp.readShort();
this.moveStartTime = fp.readULong();
this.accessory2 = fp.readShort();
this.accessory3 = fp.readShort();
this.headpalette = fp.readShort();
this.bodypalette = fp.readShort();
this.headDir = fp.readShort();
this.Robe = fp.readShort();
this.GUID = fp.readULong();
this.GEmblemVer = fp.readShort();
this.honor = fp.readShort();
this.virtue = fp.readLong();
this.isPKModeON = fp.readUChar();
this.sex = fp.readUChar();
this.MoveData = fp.readPos2();
this.xSize = fp.readUChar();
this.ySize = fp.readUChar();
this.clevel = fp.readShort();
this.font = fp.readShort();
this.hp = fp.readLong();
this.maxhp = fp.readLong();
this.isBoss = fp.readUChar();
this.name = fp.readString(24);
};
PACKET.ZC.NOTIFY_MOVEENTRY8.size = -1;


// 0x9dc
PACKET.ZC.NOTIFY_STANDENTRY8 = function PACKET_ZC_NOTIFY_STANDENTRY8(fp, end) {
this.objecttype = fp.readUChar();
this.AID = fp.readULong();
this.GID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
this.effectState = fp.readLong();
this.job = fp.readShort();
this.head = fp.readShort();
this.weapon = fp.readLong();
this.accessory = fp.readShort();
this.accessory2 = fp.readShort();
this.accessory3 = fp.readShort();
this.headpalette = fp.readShort();
this.bodypalette = fp.readShort();
this.headDir = fp.readShort();
this.Robe = fp.readShort();
this.GUID = fp.readULong();
this.GEmblemVer = fp.readShort();
this.honor = fp.readShort();
this.virtue = fp.readLong();
this.isPKModeON = fp.readUChar();
this.sex = fp.readUChar();
this.PosDir = fp.readPos();
this.xSize = fp.readUChar();
this.ySize = fp.readUChar();
this.clevel = fp.readShort();
this.font = fp.readShort();
this.hp = fp.readLong();
this.maxhp = fp.readLong();
this.isBoss = fp.readUChar();
this.name = fp.readString(end - fp.tell());
};
PACKET.ZC.NOTIFY_STANDENTRY8.size = -1;


// 0x9dd
PACKET.ZC.NOTIFY_NEWENTRY8 = function PACKET_ZC_NOTIFY_NEWENTRY8(fp, end) {
this.objecttype = fp.readUChar();
this.AID = fp.readULong();
this.GID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
this.effectState = fp.readLong();
this.job = fp.readShort();
this.head = fp.readShort();
this.weapon = fp.readLong();
this.accessory = fp.readShort();
this.accessory2 = fp.readShort();
this.accessory3 = fp.readShort();
this.headpalette = fp.readShort();
this.bodypalette = fp.readShort();
this.headDir = fp.readShort();
this.Robe = fp.readShort();
this.GUID = fp.readULong();
this.GEmblemVer = fp.readShort();
this.honor = fp.readShort();
this.virtue = fp.readLong();
this.isPKModeON = fp.readUChar();
this.sex = fp.readUChar();
this.PosDir = fp.readPos();
this.xSize = fp.readUChar();
this.ySize = fp.readUChar();
this.state = fp.readUChar();
this.clevel = fp.readShort();
this.font = fp.readShort();
this.hp = fp.readLong();
this.maxhp = fp.readLong();
this.isBoss = fp.readUChar();
this.name = fp.readString(end - fp.tell());
};
PACKET.ZC.NOTIFY_NEWENTRY8.size = -1;


// 0x9df
PACKET.ZC.ACK_WHISPER2 = function PACKET_ZC_ACK_WHISPER2(fp, end) {
this.result = fp.readUChar();
@@ -11021,6 +11137,125 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
PACKET.ZC.ACK_WHISPER2.size = 7;


// 0x9fd
PACKET.ZC.NOTIFY_MOVEENTRY9 = function PACKET_ZC_NOTIFY_MOVEENTRY9(fp, end) {
this.objecttype = fp.readUChar();
this.AID = fp.readULong();
this.GID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
this.effectState = fp.readLong();
this.job = fp.readShort();
this.head = fp.readShort();
this.weapon = fp.readLong();
this.accessory = fp.readShort();
this.moveStartTime = fp.readULong();
this.accessory2 = fp.readShort();
this.accessory3 = fp.readShort();
this.headpalette = fp.readShort();
this.bodypalette = fp.readShort();
this.headDir = fp.readShort();
this.Robe = fp.readShort();
this.GUID = fp.readULong();
this.GEmblemVer = fp.readShort();
this.honor = fp.readShort();
this.virtue = fp.readLong();
this.isPKModeON = fp.readUChar();
this.sex = fp.readUChar();
this.MoveData = fp.readPos2();
this.xSize = fp.readUChar();
this.ySize = fp.readUChar();
this.clevel = fp.readShort();
this.font = fp.readShort();
this.hp = fp.readLong();
this.maxhp = fp.readLong();
this.isBoss = fp.readUChar();
this.body = fp.readShort();
this.name = fp.readString(24);
};
PACKET.ZC.NOTIFY_MOVEENTRY9.size = -1;


// 0x9fe
PACKET.ZC.NOTIFY_STANDENTRY9 = function PACKET_ZC_NOTIFY_STANDENTRY9(fp, end) {
this.objecttype = fp.readUChar();
this.AID = fp.readULong();
this.GID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
this.effectState = fp.readLong();
this.job = fp.readShort();
this.head = fp.readShort();
this.weapon = fp.readLong();
this.accessory = fp.readShort();
this.accessory2 = fp.readShort();
this.accessory3 = fp.readShort();
this.headpalette = fp.readShort();
this.bodypalette = fp.readShort();
this.headDir = fp.readShort();
this.Robe = fp.readShort();
this.GUID = fp.readULong();
this.GEmblemVer = fp.readShort();
this.honor = fp.readShort();
this.virtue = fp.readLong();
this.isPKModeON = fp.readUChar();
this.sex = fp.readUChar();
this.PosDir = fp.readPos();
this.xSize = fp.readUChar();
this.ySize = fp.readUChar();
this.clevel = fp.readShort();
this.font = fp.readShort();
this.hp = fp.readLong();
this.maxhp = fp.readLong();
this.isBoss = fp.readUChar();
this.body = fp.readShort();
this.name = fp.readString(end - fp.tell());
};
PACKET.ZC.NOTIFY_STANDENTRY9.size = -1;


// 0x9dd
PACKET.ZC.NOTIFY_NEWENTRY9 = function PACKET_ZC_NOTIFY_NEWENTRY9(fp, end) {
this.objecttype = fp.readUChar();
this.AID = fp.readULong();
this.GID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
this.effectState = fp.readLong();
this.job = fp.readShort();
this.head = fp.readShort();
this.weapon = fp.readLong();
this.accessory = fp.readShort();
this.accessory2 = fp.readShort();
this.accessory3 = fp.readShort();
this.headpalette = fp.readShort();
this.bodypalette = fp.readShort();
this.headDir = fp.readShort();
this.Robe = fp.readShort();
this.GUID = fp.readULong();
this.GEmblemVer = fp.readShort();
this.honor = fp.readShort();
this.virtue = fp.readLong();
this.isPKModeON = fp.readUChar();
this.sex = fp.readUChar();
this.PosDir = fp.readPos();
this.xSize = fp.readUChar();
this.ySize = fp.readUChar();
this.state = fp.readUChar();
this.clevel = fp.readShort();
this.font = fp.readShort();
this.hp = fp.readLong();
this.maxhp = fp.readLong();
this.isBoss = fp.readUChar();
this.body = fp.readShort();
this.name = fp.readString(end - fp.tell());
};
PACKET.ZC.NOTIFY_NEWENTRY9.size = -1;


// 0xa00
PACKET.ZC.SHORTCUT_KEY_LIST_V3 = function PACKET_ZC_SHORTCUT_KEY_LIST_V3(fp, end) {
fp.seek(0x1, SEEK_CUR);

0 comments on commit 0ad3dc4

Please sign in to comment.