Skip to content

Commit

Permalink
Merge branch 'release/0.29.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGruber committed Dec 22, 2023
2 parents 8f4ee15 + 882afda commit 7059cf9
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 32 deletions.
26 changes: 10 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "h1z1-server",
"version": "0.29.7",
"version": "0.29.8",
"description": "Library for emulating h1z1 servers",
"author": "Quentin Gruber <[email protected]> (https://github.com/quentingruber)",
"license": "GPL-3.0-only",
Expand All @@ -17,7 +17,7 @@
"@types/node": "20.8.10",
"debug": "4.3.4",
"h1emu-core": "1.2.6",
"h1z1-dataschema": "1.7.0",
"h1z1-dataschema": "1.7.1",
"js-yaml": "4.1.0",
"mongodb": "6.2.0",
"threads": "1.7.0",
Expand Down
28 changes: 28 additions & 0 deletions src/packets/ClientProtocol/ClientProtocol_1080/h1emu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,33 @@ export const h1emuPackets: PacketStructures = [
{
fields: []
}
],
[
"H1emu.VoiceInit",
0x9904,
{
fields: []
}
],
[
"H1emu.RequestModules",
0x9905,
{
fields: []
}
],
[
"H1emu.RequestWindows",
0x9906,
{
fields: []
}
],
[
"H1emu.VoiceState",
0x9907,
{
fields: [{ name: "message", type: "string", defaultValue: "" }]
}
]
];
24 changes: 22 additions & 2 deletions src/packets/ClientProtocol/ClientProtocol_1080/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,28 @@ export const itemsPackets: PacketStructures = [
["Items.RemoveItemRentalTimer", 0xad0d, {}],
["Items.ExpireItemRentalTimer", 0xad0e, {}],
["Items.UseClientItem", 0xad0f, {}],
["Items.SetAccountItemManager", 0xad10, {}],
["Items.AddAccountItem", 0xad11, {}],
[
"Items.SetAccountItemManager",
0xad10,
{
fields: [
// Todo
{ name: "unknowWord2", type: "uint32", defaultValue: 1 }
]
}
],
[
"Items.AddAccountItem",
0xad1100,
{
fields: [
{ name: "itemId", type: "uint64", defaultValue: 0x3100000000000000n },
{ name: "unknowWord2", type: "uint32", defaultValue: 1 },
{ name: "unknowWord3", type: "uint32", defaultValue: 2 },
{ name: "unknowWord4", type: "uint32", defaultValue: 3 } // count ?
]
}
],
["Items.RemoveAccountItem", 0xad12, {}],
["Items.UpdateAccountItem", 0xad13, {}],
["Items.SetEscrowAccountItemManager", 0xad14, {}],
Expand Down
8 changes: 4 additions & 4 deletions src/packets/LoginUdp/LoginUdp_9/loginpackets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ const packets: any[] = [
{ name: "serverTicket", type: "string" },
{ name: "encryptionKey", type: "byteswithlength" },
{ name: "guid", type: "int64string" },
{ name: "unknownQword2", type: "int64string" },
{ name: "stationName", type: "string" },
{ name: "characterName", type: "string" },
{ name: "unknownString", type: "string" }
{ name: "unknownQword2", type: "int64string", defaultValue: "" },
{ name: "stationName", type: "string", defaultValue: "" },
{ name: "characterName", type: "string", defaultValue: "" },
{ name: "unknownString", type: "string", defaultValue: "" }
]
}
]
Expand Down
64 changes: 64 additions & 0 deletions src/servers/ZoneServer2016/handlers/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,70 @@ export const commands: Array<Command> = [
}
}
},
{
name: "listmodules",
permissionLevel: PermissionLevels.MODERATOR,
execute: async (
server: ZoneServer2016,
client: Client,
args: Array<string>
) => {
if (!args[0]) {
server.sendChatText(
client,
`Correct usage: /listmodules {name | ZoneClientId}`
);
return;
}
const targetClient = server.getClientByNameOrLoginSession(
args[0].toString()
);
if (server.playerNotFound(client, args[0].toString(), targetClient)) {
return;
}
if (!targetClient || !(targetClient instanceof Client)) {
server.sendChatText(client, "Client not found.");
return;
}
server.sendChatText(
client,
`Requesting modules from: ${targetClient.character.name}`
);
server.sendData(client, "H1emu.RequestModules", {});
}
},
{
name: "listwindows",
permissionLevel: PermissionLevels.MODERATOR,
execute: async (
server: ZoneServer2016,
client: Client,
args: Array<string>
) => {
if (!args[0]) {
server.sendChatText(
client,
`Correct usage: /listwindows {name | ZoneClientId}`
);
return;
}
const targetClient = server.getClientByNameOrLoginSession(
args[0].toString()
);
if (server.playerNotFound(client, args[0].toString(), targetClient)) {
return;
}
if (!targetClient || !(targetClient instanceof Client)) {
server.sendChatText(client, "Client not found.");
return;
}
server.sendChatText(
client,
`Requesting windows from: ${targetClient.character.name}`
);
server.sendData(client, "H1emu.RequestWindows", {});
}
},
{
name: "globalmute",
permissionLevel: PermissionLevels.MODERATOR,
Expand Down
6 changes: 5 additions & 1 deletion src/servers/ZoneServer2016/handlers/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { h1z1PacketsType2016 } from "types/packets";
import {
CharacterManagedObject,
CharacterPlayWorldCompositeEffect,
CharacterSeekTarget
CharacterSeekTarget,
ItemsAddAccountItem
} from "types/zone2016packets";
import { Npc } from "../../entities/npc";
import { ZoneClient2016 as Client } from "../../classes/zoneclient";
Expand Down Expand Up @@ -51,6 +52,9 @@ const dev: any = {
});
}, 2000);
},
acc: function (server: ZoneServer2016, client: Client, args: Array<string>) {
server.sendData<ItemsAddAccountItem>(client, "Items.AddAccountItem", {});
},
ui: function (server: ZoneServer2016, client: Client, args: Array<string>) {
server.sendData(client, "Effect.AddUiIndicator", {
characterId: client.character.characterId,
Expand Down
3 changes: 3 additions & 0 deletions src/servers/ZoneServer2016/zonepackethandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3353,6 +3353,9 @@ export class ZonePacketHandlers {
case "01": // asset validator
server.fairPlayManager.handleAssetCheck(server, client, data);
break;
case "02": // client messages
server.sendChatTextToAdmins(`${client.character.name}: ${data}`);
break;
default:
console.log(
`Unknown custom packet opcode: ${opcode} from ${client.loginSessionId}`
Expand Down
8 changes: 4 additions & 4 deletions src/types/LoginUdp_9packets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export interface CharacterLoginReply {
serverTicket: string;
encryptionKey: unknown;
guid: string;
unknownQword2: string;
stationName: string;
characterName: string;
unknownString: string;
unknownQword2?: string;
stationName?: string;
characterName?: string;
unknownString?: string;
};
}
export interface CharacterDeleteRequest {
Expand Down
4 changes: 2 additions & 2 deletions src/types/packets.ts

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion src/types/zone2016packets.ts

Large diffs are not rendered by default.

0 comments on commit 7059cf9

Please sign in to comment.