QuentinGruber / h1z1-server

Library used to emulate h1z1 game servers
https://h1emu.com
GNU General Public License v3.0
97 stars 56 forks source link

weapons stop working after server is up 120+ hours (FIXED) #2176

Closed resinate closed 1 month ago

resinate commented 1 month ago

has this long time bug still exist for v38+ when server is up for too long weapons and projectiles stop working. but everything else still works perfectly melee, building, looting, killing zombies, farming all work. just not guns/projectiles

resinate commented 1 month ago

i am currently running a test on possible fix, but im only at 70 hours atm so itll be few days

QuentinGruber commented 1 month ago

something we can take in account in 120hours there is 432 000 000ms and the max uint32 is 4 294 967 295, i mean it's possible that somewhere we end up having a loo large number that make these packets being ignored by the game, so we have to look at the packets and test them

resinate commented 1 month ago

i made a code to refresh all definitions every hour, thats only thing i see mainly when server starts. basically im like soft rebooting server while server is live

server is currently at 4300 minutes

if u ever wanna discord lemme know cuz ive been deep diving performance issues like crazy i made alot of custom fixes with it. no way to do major stress test tho

resinate commented 1 month ago

i found this code, dont know if u guys updated and renamed everything but yea thats why im testing reload definitions image

resinate commented 1 month ago

my discord id - 767761048156766209

resinate commented 1 month ago

i just noticed that not ONLY does weapons not send, but im still in godmode even tho i run around and jump and stuff which means the bug is in here ClientFinishedLoading - server.sendGameTimeSync(client); under zone packet handler

    if (!server.hookManager.checkHook("OnClientFinishedLoading", client))
        return;

image

resinate commented 1 month ago

i built hookmanager recycler to see if that fixes the issue

resinate commented 1 month ago

ok back with more updates hook manager is not it but i noticed this ClientFinishedLoading(server, client, packet) { this packet is ran in 2 different ways

1st launch = runs this packet twice relog = runs this packet ONCE

resinate commented 1 month ago

found the issue server.hookManager.checkHook("OnClientFinishedLoading", client)

hook-manager system is the bug, i disabled this and forced pack definitions on login. image i would like to talk and show someone on discord about this. unless u guys prefer not to fix this bug?

Z2Doggo commented 1 month ago

Resinated, it would be much preferred to show your changes and 'fixes' here on GitHub rather than showing one dev in a vc. Like your math teach in elementary once said? "Show your work and how you solved it."

resinate commented 1 month ago

i cant explain what i did, all i did was disable hook manager checks, thats all also i did show my work little bit if u scroll up.

resinate commented 1 month ago

i also built this code,

async updateWeaponStance(server, client) { server.sendAlert(client, "Procressing Definitions...."); await server.sendRawData(client, server.itemDefinitionsCache); await server.sendRawData(client, server.weaponDefinitionsCache); await server.sendRawData(client, server.projectileDefinitionsCache); await server.sendRawData(client, server.profileDefinitionsCache); await utils_1.Scheduler.wait(250); server.sendData(client, "Character.WeaponStance", { // activates weaponstance key characterId: client.character.characterId, stance: 1, }); server.sendData(client, "Synchronization", { serverTime: (0, utils_1.Int64String)(server.getGameTime()), serverTime2: (0, utils_1.Int64String)(server.getGameTime()), }); client.character.updateEquipment(server); // needed or third person character will be invisible client.character.updateContainers(server, client); client.character.updateLoadout(server); // needed or all loadout context menu entries aren't shown let loadoutItem = client.character.getEquippedWeapon(); if (server.isWeapon(loadoutItem.itemDefinitionId)) { server.switchLoadoutSlot(client, loadoutItem); } await utils_1.Scheduler.wait(500); server.setGodMode(client, false); server.sendAlert(client, "Procressing Definitions.... (Completed)"); }

resinate commented 1 month ago

im still building off the v24 core XD, importing certain updates fixes and tweaking them to make them work faster and better

i gave the reports where and showed it was fixed, i leave all the rest to u guys if u want to look into it. my server is doing great atm. just waiting for full AI system for zombies....

i gain nothing sharing this.

Z2Doggo commented 1 month ago

Since you said you're still on version 24 of the server core, I'm question what you said at the end of your reply... "I gain nothing sharing this." Because neither do we, we're on version 39 at this point and this is pointless for such a big version difference.