Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Official upgrade packetversion #145

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
42db76d
Fixed item description
andre9x Jul 15, 2017
31b756b
Corrected comments 🙄
andre9x Jul 15, 2017
cc07b6e
Fixed CardList for unidentified items
andre9x Jul 15, 2017
0ef977e
Added parser for AC_ACCEPT_LOGIN3
Milchdealer Jul 23, 2017
70e2b4a
Fixed parsing of PACKET_AC_ACCEPT_LOGIN3
Milchdealer Jul 23, 2017
96e3340
Changed PACKET_HC_CHARLIST_NOTIFY to support Clients >= 20151001
Milchdealer Jul 23, 2017
9213664
#29 - Improved packetversion support
andre9x Jul 23, 2017
d868796
Fixed bug where expireDate was read although it is only send when a c…
Milchdealer Jul 23, 2017
21019f1
#29 - Improved packetversion support
andre9x Jul 23, 2017
28dfa8b
#29 - Improved packetversion support
andre9x Jul 23, 2017
06c997e
Added Packet for Version 0
Milchdealer Jul 23, 2017
abade8d
#29 - Improved packetversion support
andre9x Jul 23, 2017
c50542d
Upgraded parseCharList
Milchdealer Jul 23, 2017
83aa9b9
Merged conflict 🌙
andre9x Jul 23, 2017
4bbcfff
fixed packet version checks
Milchdealer Jul 23, 2017
e927915
#29 - Improved packetversion support
andre9x Jul 23, 2017
3667b51
Added Packet Version 20150422 ENTER Packet
Milchdealer Jul 23, 2017
422b717
Added all packets of 20150422
Milchdealer Jul 23, 2017
f67fdc3
Added ŸEQUIPMENT_ITEMLIST5 as new version of ITEMLIST
Milchdealer Jul 23, 2017
1749e4f
#29 - Improved packetversion support
andre9x Jul 23, 2017
d54c33c
Fixed merge conflict
Milchdealer Jul 23, 2017
9051878
Fixed forgotten attribute and size mismatch
Milchdealer Jul 23, 2017
40bbc66
Fixed new packets for packetver
Milchdealer Jul 23, 2017
0ed29f1
#29 - Improved packetversion support
andre9x Jul 23, 2017
a7c8e79
Fixed typo in size
Milchdealer Jul 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Engine/LoginEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,16 @@ define(function( require )
}

// Hook packets
Network.hookPacket( PACKET.AC.ACCEPT_LOGIN, onConnectionAccepted );
if (PACKETVER.value >= 20170315) {
Network.hookPacket( PACKET.AC.ACCEPT_LOGIN3, onConnectionAccepted );
} else {
Network.hookPacket( PACKET.AC.ACCEPT_LOGIN, onConnectionAccepted );
}
Network.hookPacket( PACKET.AC.REFUSE_LOGIN, onConnectionRefused );
Network.hookPacket( PACKET.AC.REFUSE_LOGIN_R2, onConnectionRefused );
Network.hookPacket( PACKET.SC.NOTIFY_BAN, onServerClosed );
}

}


/**
Expand Down
2 changes: 2 additions & 0 deletions src/Engine/MapEngine/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ define(function( require )
Network.hookPacket( PACKET.ZC.ITEM_PICKUP_ACK2, onItemPickAnswer );
Network.hookPacket( PACKET.ZC.ITEM_PICKUP_ACK3, onItemPickAnswer );
Network.hookPacket( PACKET.ZC.ITEM_PICKUP_ACK5, onItemPickAnswer );
Network.hookPacket( PACKET.ZC.ITEM_PICKUP_ACK6, onItemPickAnswer );
Network.hookPacket( PACKET.ZC.ITEM_THROW_ACK, onIventoryRemoveItem );
Network.hookPacket( PACKET.ZC.NORMAL_ITEMLIST, onInventorySetList );
Network.hookPacket( PACKET.ZC.NORMAL_ITEMLIST2, onInventorySetList );
Expand All @@ -362,6 +363,7 @@ define(function( require )
Network.hookPacket( PACKET.ZC.EQUIPMENT_ITEMLIST2, onInventorySetList );
Network.hookPacket( PACKET.ZC.EQUIPMENT_ITEMLIST3, onInventorySetList );
Network.hookPacket( PACKET.ZC.EQUIPMENT_ITEMLIST4, onInventorySetList );
Network.hookPacket( PACKET.ZC.EQUIPMENT_ITEMLIST6, onInventorySetList );
Network.hookPacket( PACKET.ZC.REQ_TAKEOFF_EQUIP_ACK, onEquipementTakeOff );
Network.hookPacket( PACKET.ZC.REQ_TAKEOFF_EQUIP_ACK2, onEquipementTakeOff );
Network.hookPacket( PACKET.ZC.ACK_TAKEOFF_EQUIP_V5, onEquipementTakeOff );
Expand Down
4 changes: 3 additions & 1 deletion src/Network/PacketCrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ define(['Core/Configs'], function( Configs )
20140416: [0x04810281,0x42814281,0x42814281],
20141016: [0x2DFF467C,0x444B37EE,0x2C1B634F],
20141022: [0x290551EA,0x2B952C75,0x2D67669B],
20150513: [0x62C86D09,0x75944F17,0x112C133D]
20150513: [0x62C86D09,0x75944F17,0x112C133D],
20150422: [0x10D22CE2,0x69E279E2,0x79E279E2],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping them in correct date order would be nice.

20170517: [0x2CC4749A,0x1FA954DC,0x72276857]
};


Expand Down
8 changes: 8 additions & 0 deletions src/Network/PacketRegister.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,14 @@ define( ['./PacketStructure' ], function( PACKET )
//0x9d5: npcmarketopenType
//0x9d7: npcmarketresultackType
0xa00: PACKET.ZC.SHORTCUT_KEY_LIST_V3, // ok
0xa07: PACKET.ZC.ACK_REMOVE_RODEX_ITEM,
0xa09: PACKET.ZC.ADD_EXCHANGE_ITEM3,
0xa0a: PACKET.ZC.ADD_ITEM_TO_STORE3,
0xa0b: PACKET.ZC.ADD_ITEM_TO_CART3,
0xa0c: PACKET.ZC.ITEM_PICKUP_ACK6,
0xa0d: PACKET.ZC.EQUIPMENT_ITEMLIST6,
0xa18: PACKET.ZC.ACCEPT_ENTER3, // ok

0xac4: PACKET.AC.ACCEPT_LOGIN3
};
});
222 changes: 220 additions & 2 deletions src/Network/PacketStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -7459,7 +7459,7 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
for (i = 0; i < count; ++i) {
out[i] = {};
out[i].GID = fp.readULong();
out[i].szExpireDate = fp.readBinaryString(20);
out[i].szExpireDate = fp.readBinaryString(20);
}
return out;
})();
Expand Down Expand Up @@ -10723,6 +10723,7 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
out[i].index = fp.readShort();
out[i].ITID = fp.readUShort();
out[i].type = fp.readUChar();

out[i].count = fp.readShort();
out[i].WearState = fp.readULong();
out[i].slot = {};
Expand Down Expand Up @@ -10994,8 +10995,11 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
// 0x9a0
PACKET.HC.CHARLIST_NOTIFY = function PACKET_HC_CHARLIST_NOTIFY(fp, end) {
this.TotalCnt = fp.readLong();
if (PACKETVER.value >= 20151001) {
this.charSlots = fp.readLong();
}
};
PACKET.HC.CHARLIST_NOTIFY.size = 6;
PACKET.HC.CHARLIST_NOTIFY.size = (PACKETVER.value >= 20151001 ? 10 : 6);


// 0x9ca
Expand Down Expand Up @@ -11274,6 +11278,178 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
PACKET.ZC.SHORTCUT_KEY_LIST_V3.size = 269;


// 0xa07
PACKET.ZC.ACK_REMOVE_RODEX_ITEM = function PACKET_ZC_ACK_REMOVE_RODEX_ITEM(fp, end) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without adding full support for the feature, this seems a little pointless.

this.success = fp.readChar();
this.index = fp.readUShort();
this.amount = fp.readUShort();
this.weight_ = fp.readShort();
};
PACKET.ZC.ACK_REMOVE_RODEX_ITEM.size = 9;


// 0xa08
PACKET.CZ.REQ_OPEN_WRITE_RODEX = function PACKET_CA_LOGIN() {
this.receiver = '';
};
PACKET.CZ.REQ_OPEN_WRITE_RODEX.prototype.build = function() {
var pkt_len = 2 + 24;
var pkt_buf = new BinaryWriter(pkt_len);

pkt_buf.writeShort(0x64);
pkt_buf.writeString(this.receiver);
return pkt_buf;
};


// 0xa09
PACKET.ZC.ADD_EXCHANGE_ITEM3 = function PACKET_ZC_ADD_EXCHANGE_ITEM3(fp, end) {
this.ITID = fp.readUShort();
this.type = fp.readUChar();
this.count = fp.readLong();
this.IsIdentified = fp.readUChar();
this.IsDamaged = fp.readUChar();
this.RefiningLevel = fp.readUChar();
this.slot = {};
this.slot.card1 = fp.readUShort();
this.slot.card2 = fp.readUShort();
this.slot.card3 = fp.readUShort();
this.slot.card4 = fp.readUShort();

this.randomOptions = []
for (var i = 0; i < 5; i++) {
this.randomOptions[i] = {}
this.randomOptions[i].optIndex = fp.readShort();
this.randomOptions[i].value = fp.readShort();
this.randomOptions[i].param = fp.readChar();
}
};
PACKET.ZC.ADD_EXCHANGE_ITEM3.size = 45;


// 0xa0a
PACKET.ZC.ADD_ITEM_TO_STORE3 = function PACKET_ZC_ADD_ITEM_TO_STORE3(fp, end) {
this.index = fp.readShort();
this.count = fp.readLong();
this.ITID = fp.readUShort();
this.type = fp.readUChar();
this.IsIdentified = fp.readUChar();
this.IsDamaged = fp.readUChar();
this.RefiningLevel = fp.readUChar();
this.slot = {};
this.slot.card1 = fp.readUShort();
this.slot.card2 = fp.readUShort();
this.slot.card3 = fp.readUShort();
this.slot.card4 = fp.readUShort();

this.randomOptions = []
for (var i = 0; i < 5; i++) {
this.randomOptions[i] = {}
this.randomOptions[i].optIndex = fp.readShort();
this.randomOptions[i].value = fp.readShort();
this.randomOptions[i].param = fp.readChar();
}
};
PACKET.ZC.ADD_ITEM_TO_STORE3.size = 47;


// 0xa0b
PACKET.ZC.ADD_ITEM_TO_CART3 = function PACKET_ZC_ADD_ITEM_TO_CART3(fp, end) {
this.index = fp.readShort();
this.count = fp.readLong();
this.ITID = fp.readUShort();
this.type = fp.readUChar();
this.IsIdentified = fp.readUChar();
this.IsDamaged = fp.readUChar();
this.RefiningLevel = fp.readUChar();
this.slot = {};
this.slot.card1 = fp.readUShort();
this.slot.card2 = fp.readUShort();
this.slot.card3 = fp.readUShort();
this.slot.card4 = fp.readUShort();

this.randomOptions = []
for (var i = 0; i < 5; i++) {
this.randomOptions[i] = {}
this.randomOptions[i].optIndex = fp.readShort();
this.randomOptions[i].value = fp.readShort();
this.randomOptions[i].param = fp.readChar();
}
};
PACKET.ZC.ADD_ITEM_TO_CART2.size = 47;


// 0xa0c
PACKET.ZC.ITEM_PICKUP_ACK6 = function PACKET_ZC_ITEM_PICKUP_ACK6(fp, end) {
this.index = fp.readUShort();
this.count = fp.readUShort();
this.ITID = fp.readUShort();
this.IsIdentified = fp.readUChar();
this.IsDamaged = fp.readUChar();
this.RefiningLevel = fp.readUChar();
this.slot = {};
this.slot.card1 = fp.readUShort();
this.slot.card2 = fp.readUShort();
this.slot.card3 = fp.readUShort();
this.slot.card4 = fp.readUShort();
this.location = fp.readLong();
this.type = fp.readUChar();
this.result = fp.readUChar();
this.HireExpireDate = fp.readLong();

this.randomOptions = []
for (var i = 0; i < 5; i++) {
this.randomOptions[i] = {}
this.randomOptions[i].optIndex = fp.readShort();
this.randomOptions[i].value = fp.readShort();
this.randomOptions[i].param = fp.readChar();
}
};
PACKET.ZC.ITEM_PICKUP_ACK6.size = 56;


// 0xa0d
PACKET.ZC.EQUIPMENT_ITEMLIST6 = function PACKET_ZC_EQUIPMENT_ITEMLIST6(fp, end) {
this.ItemInfo = (function() {
var i, count = (end - fp.tell()) / 57 | 0,
out = new Array(count);
var flag;
for (i = 0; i < count; ++i) {
out[i] = {};
out[i].index = fp.readShort();
out[i].ITID = fp.readUShort();
out[i].type = fp.readUChar();

out[i].location = fp.readULong();
out[i].WearState = fp.readULong();
out[i].RefiningLevel = fp.readUChar();
out[i].slot = {};
out[i].slot.card1 = fp.readUShort();
out[i].slot.card2 = fp.readUShort();
out[i].slot.card3 = fp.readUShort();
out[i].slot.card4 = fp.readUShort();
out[i].HireExpireDate = fp.readLong();
out[i].bindOnEquipType = fp.readUShort();
out[i].wItemSpriteNumber = fp.readUShort();
out[i].nRandomOptionCnt = fp.readChar();
out[i].option = [];
for (var j = 0; j < 5; j++) {
out[i].option[j] = {};
out[i].option[j].optIndex = fp.readUShort();
out[i].option[j].value = fp.readShort();
out[i].option[j].param = fp.readChar();
}
flag = fp.readUChar();
out[i].IsIdentified = flag & 1;
out[i].IsDamaged = flag & 2;
out[i].PlaceETCTab = flag & 4;
}
return out;
})();
};
PACKET.ZC.EQUIPMENT_ITEMLIST6.size = -1;


// 0xa18
PACKET.ZC.ACCEPT_ENTER3 = function PACKET_ZC_ACCEPT_ENTER3(fp, end) {
this.startTime = fp.readULong();
Expand All @@ -11286,6 +11462,48 @@ define(['Utils/BinaryWriter', './PacketVerManager'], function(BinaryWriter, PACK
PACKET.ZC.ACCEPT_ENTER3.size = 14;


// 0xac4
PACKET.AC.ACCEPT_LOGIN3 = function PACKET_AC_ACCEPT_LOGIN3(fp, end) {
this.AuthCode = fp.readLong();
this.AID = fp.readULong();
this.userLevel = fp.readULong();
this.lastLoginIP = fp.readULong();
this.lastLoginTime = fp.readBinaryString(26);
this.Sex = fp.readUChar();
this.unknown = fp.readBinaryString(17);
this.ServerList = (function() {
var i, count=(end-fp.tell())/160|0, out=new Array(count);
for (i = 0; i < count; ++i) {
out[i] = {};
out[i].ip = fp.readULong();
out[i].port = fp.readUShort();
out[i].name = fp.readString(20);
out[i].usercount = fp.readUShort();
out[i].state = fp.readUShort();
out[i].property = fp.readUShort();
out[i].unknown = fp.readBinaryString(128);
}
return out;
})();
};
PACKET.AC.ACCEPT_LOGIN3.size = -1;


// 0xa3b
PACKET.ZC.HAT_EFFECT = function PACKET_ZC_HAT_EFFECT(fp, end) {
this.GID = fp.readULong();
this.enabled = fp.readChar();
this.hatEffectIDs = (function() {
var i, count=(end-fp.tell())/2|0, out=new Array(count);
for (i = 0; i < count; ++i) {
out[i] = fp.readShort(); // #FixMe: Can also be send as single packet, which sends the effectId as Long...
}
return out;
})();
};
PACKET.ZC.HAT_EFFECT = -1;


/**
* Export
*/
Expand Down
Loading