Skip to content

Feat: Clantags #2404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
324 changes: 45 additions & 279 deletions data/2016/zoneData/Z1_POIs.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "h1z1-server",
"version": "0.45.3-1",
"version": "0.45.3",
"description": "Library for emulating h1z1 servers",
"author": "Quentin Gruber <[email protected]> (http://github.com/quentingruber)",
"license": "GPL-3.0-only",
Expand Down
20 changes: 17 additions & 3 deletions src/servers/ZoneServer2016/entities/character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ interface MeleeHit {
characterId: string;
}
export class Character2016 extends BaseFullCharacter {
/** The players in-game name */
/** The players in-game name and clan */
name!: string;

clan!: string;
/** The location the player spawned at */
spawnLocation?: string;

Expand Down Expand Up @@ -403,6 +403,18 @@ export class Character2016 extends BaseFullCharacter {
this.materialType = MaterialTypes.FLESH;
}

async getClan(server: ZoneServer2016): Promise<void> {
const clanData = await server.getPlayerClan(this.characterId);
this.clan = clanData ? `[${clanData.tag}]` : "";
}

async updateClanTag(server: ZoneServer2016, clanTag: string): Promise<void> {
this.clan = clanTag ? `[${clanTag}]` : "";
const client = server.getClientByCharId(this.characterId);

//logic to update clan tag for all clients
}

getShaderGroup() {
switch (this.headActor) {
case "SurvivorMale_Head_02.adr":
Expand Down Expand Up @@ -971,11 +983,13 @@ export class Character2016 extends BaseFullCharacter {
* Gets the LightweightPC packet fields for use in SelfSendToClient and AddLightweightPC
*/
pGetLightweight() {
const characterName = this.clan ? `${this.clan} ${this.name}` : this.name;

return {
...super.pGetLightweight(),
rotation: this.state.lookAt,
identity: {
characterName: this.name
characterName: characterName
},
shaderGroupId: this.getShaderGroup()
};
Expand Down
13 changes: 12 additions & 1 deletion src/servers/ZoneServer2016/handlers/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3514,7 +3514,18 @@ export const commands: Array<Command> = [
console.log(server.weatherManager.weather);
server.weatherManager.sendUpdateToAll(server, client, false);
}
},
{
name: "clan",
permissionLevel: PermissionLevels.DEFAULT,
keepCase: true,
execute: async (
server: ZoneServer2016,
client: Client,
args: Array<string>
) => {
server.clanManager.handleClanCommand(server, client, args);
}
}

//#endregion
];
Loading
Loading