Skip to content

Commit

Permalink
Fixed #127 - Add new server packets
Browse files Browse the repository at this point in the history
  • Loading branch information
vthibault committed Feb 2, 2016
1 parent 0ad3dc4 commit b2a6b52
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
8 changes: 7 additions & 1 deletion src/Engine/MapEngine/Entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ define(function( require )
// Remove "pseudo : |00Dialogue
pkt.msg = pkt.msg.replace(/\: \|\d{2}/, ': ');

entity = EntityManager.get(pkt.accountID);
entity = pkt.accountID ? EntityManager.get(pkt.accountID) : Session.Entity;
if (entity) {
entity.dialog.set( pkt.msg );
}
Expand Down Expand Up @@ -980,6 +980,12 @@ define(function( require )
Network.hookPacket( PACKET.ZC.NOTIFY_STANDENTRY7, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_NEWENTRY7, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_MOVEENTRY7, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_STANDENTRY8, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_NEWENTRY8, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_MOVEENTRY8, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_STANDENTRY9, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_NEWENTRY9, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_MOVEENTRY9, onEntitySpam );
Network.hookPacket( PACKET.ZC.NOTIFY_VANISH, onEntityVanish );
Network.hookPacket( PACKET.ZC.NOTIFY_MOVE, onEntityMove );
Network.hookPacket( PACKET.ZC.STOPMOVE, onEntityStopMove );
Expand Down
12 changes: 6 additions & 6 deletions src/Network/PacketStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -11016,8 +11016,8 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
// 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.AID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
Expand Down Expand Up @@ -11055,8 +11055,8 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
// 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.AID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
Expand Down Expand Up @@ -11093,8 +11093,8 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
// 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.AID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
Expand Down Expand Up @@ -11140,8 +11140,8 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
// 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.AID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
Expand Down Expand Up @@ -11180,8 +11180,8 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
// 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.AID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
Expand Down Expand Up @@ -11219,8 +11219,8 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
// 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.AID = fp.readULong();
this.speed = fp.readShort();
this.bodyState = fp.readShort();
this.healthState = fp.readShort();
Expand Down
14 changes: 6 additions & 8 deletions src/Network/PacketVerManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ define(['Core/Configs'], function( Configs )
blockSize++;
}

// Weapon move from short to int
// Body
if (_value >= 20141022) {
blockSize += 2;
}
Expand Down Expand Up @@ -125,7 +125,7 @@ define(['Core/Configs'], function( Configs )
if (!blockSize || length % blockSize) {
console.error('CHARACTER_INFO size error!! blockSize : "'+ blockSize +'", list length: ' + length + ', auto-detect...');

var knownSize = [106, 108, 112, 116, 124, 128, 132, 136, 140, 144, 146, 147];
var knownSize = [106, 108, 112, 116, 124, 128, 132, 136, 140, 144, 145, 147];
var matches = [];

for (i = 0, count = knownSize.length; i < count; ++i) {
Expand Down Expand Up @@ -171,13 +171,11 @@ define(['Core/Configs'], function( Configs )
out[i].job = fp.readShort();
out[i].head = fp.readShort();

if (blockSize >= 146) {
out[i].weapon = fp.readLong();
}
else {
out[i].weapon = fp.readShort();
if (blockSize >= 147) {
out[i].body = fp.readShort();
}

out[i].weapon = fp.readShort();
out[i].level = fp.readShort();
out[i].sppoint = fp.readShort();
out[i].accessory = fp.readShort();
Expand Down Expand Up @@ -231,7 +229,7 @@ define(['Core/Configs'], function( Configs )
out[i].RenameAddon = fp.readLong();
}

if (blockSize >= 147) {
if (blockSize >= 145) {
out[i].sex = fp.readUChar();
}
}
Expand Down

0 comments on commit b2a6b52

Please sign in to comment.