Skip to content

Commit bef646d

Browse files
authored
Merge pull request #2871 from QuentinGruber/fix/clientprotocol-1080-opcode-reconciliation
Misc client/server packet parity
2 parents f9224d8 + 7b2202a commit bef646d

7 files changed

Lines changed: 12 additions & 32 deletions

File tree

‎src/packets/ClientProtocol/ClientProtocol_1080/character.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,8 @@ export const characterPackets: PacketStructures = [
12611261
{
12621262
fields: [
12631263
{ name: "characterId", type: "uint64string", defaultValue: "0" },
1264-
{ name: "twitchName", type: "string", defaultValue: "" }
1264+
{ name: "twitchName", type: "string", defaultValue: "" },
1265+
{ name: "unknownQword1", type: "uint64string", defaultValue: "0" }
12651266
]
12661267
}
12671268
],

‎src/packets/ClientProtocol/ClientProtocol_1080/clientUpdate.ts‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -166,35 +166,18 @@ export const clientUpdatePackets: PacketStructures = [
166166
]
167167
}
168168
],
169-
[
170-
"ClientUpdate.ZonePopulation",
171-
0x112f00,
172-
{
173-
fields: [
174-
{
175-
name: "populations",
176-
type: "array",
177-
defaultValue: [{}],
178-
elementType: "uint8"
179-
}
180-
]
181-
}
182-
],
183169
[
184170
// 2016
185171
"ClientUpdate.RespawnLocations",
186172
0x111f00,
187173
{
188174
fields: [
189-
{ name: "unknownFlags", type: "uint8", defaultValue: 0 },
190175
{
191176
name: "locations",
192177
type: "array",
193178
defaultValue: [{}],
194179
fields: respawnLocationSchema
195180
},
196-
{ name: "unknownDword1", type: "uint32", defaultValue: 0 },
197-
{ name: "unknownDword2", type: "uint32", defaultValue: 0 },
198181
{
199182
name: "locations2",
200183
type: "array",

‎src/packets/ClientProtocol/ClientProtocol_1080/loadout.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const loadoutPackets: PacketStructures = [
2424
],
2525

2626
[
27-
"Loadout.Unk1",
27+
"Loadout.SetCurrentLoadoutSlot",
2828
0x8703,
2929
{
3030
fields: [

‎src/packets/ClientProtocol/ClientProtocol_1080/shared.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,9 +1457,9 @@ export function packItemSubData(obj: any) {
14571457
data.writeUInt8(obj["hasSubData"] ? 1 : 0, 0);
14581458
if (!obj.hasSubData) return data;
14591459
const v = Buffer.alloc(4);
1460-
v.writeUInt32LE(obj["unknownDword1"], 0);
1460+
v.writeUInt32LE(obj["subDataType"], 0);
14611461
data = Buffer.concat([data, v]);
1462-
if (obj.unknownDword1 <= 0) return data;
1462+
if (obj.subDataType !== 1) return data; // client reads unknownData1 only when subDataType == 1
14631463
const unknownData1Obj = DataSchema.pack(
14641464
unknownData1Schema,
14651465
obj["unknownData1"]
@@ -2641,8 +2641,6 @@ export const respawnLocationSchema: PacketFields = [
26412641
{ name: "iconId2", type: "uint32", defaultValue: 0 },
26422642
{ name: "respawnTotalTime", type: "uint32", defaultValue: 0 },
26432643
{ name: "respawnTimeMs", type: "uint32", defaultValue: 0 },
2644-
{ name: "nameId", type: "uint32", defaultValue: 0 },
2645-
{ name: "distance", type: "float", defaultValue: 0.0 },
26462644
{ name: "unknownByte1", type: "uint8", defaultValue: 0 },
26472645
{ name: "unknownByte2", type: "uint8", defaultValue: 0 },
26482646
{

‎src/packets/ClientProtocol/ClientProtocol_1080/weapon.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const weaponPackets: PacketStructures = [
143143
fields: [
144144
{ name: "guid", type: "uint64string", defaultValue: "0" },
145145
{ name: "unknownBoolean1", type: "boolean", defaultValue: false },
146-
{ name: "unknownDword1", type: "uint32", defaultValue: 0 }
146+
{ name: "unknownData1", type: "byteswithlength" }
147147
]
148148
}
149149
],
@@ -166,7 +166,7 @@ const weaponPackets: PacketStructures = [
166166
{ name: "guid", type: "uint64string", defaultValue: "0" },
167167
{ name: "unknownByte1", type: "uint8", defaultValue: 0 },
168168
{ name: "unknownBoolean1", type: "boolean", defaultValue: false },
169-
{ name: "unknownDword1", type: "uint32", defaultValue: 0 }
169+
{ name: "unknownData1", type: "byteswithlength" }
170170
]
171171
}
172172
],

‎src/types/packets.ts‎

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

‎src/types/zone2016packets.ts‎

Lines changed: 3 additions & 5 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)