Page 1 of 2

[FIXED] Raid bosses minions not spawn on server launch

Posted: Mon Jun 17, 2019 2:42 pm
by jonhanon
Hello. So i have problem and seems cant find solution. I using latest development branch of h5.
So problem is when gameserver just launched, all bosses that must have minions just standing alone. If rb get killed and respawned by normal means or another instance of rb is spawned through admin console, minions are spawned as well and all seems working fine, but if server restarted after that minions are gone again.
And there is no any errors in console output, so i even dont know where to look...

Re: Raid bosses minions not spawn on server launch

Posted: Mon Jun 17, 2019 4:20 pm
by Edoogel
I confirm, there is such a problem on the server. And how to fix, too, can not find.

Re: Raid bosses minions not spawn on server launch

Posted: Thu Jun 20, 2019 12:25 pm
by jonhanon
Looks like at last i found problem.
In gameserver.java its needed to be RaidBossSpawnManager.getInstance().load(); not just RaidBossSpawnManager.getInstance();
At least all rb now spawning with minions, and no any compile errors

Re: Raid bosses minions not spawn on server launch

Posted: Fri Jun 21, 2019 9:01 am
by Edoogel
Checked, everything works fine. Thank you jonhanon! :+1:

Re: Raid bosses minions not spawn on server launch

Posted: Tue Jun 25, 2019 4:37 pm
by Sacrifice

Code: Select all

RaidBossSpawnManager.getInstance();
in gameserver class is sufficient for all, because the constructor calls, on instantiation of the class at the method

Code: Select all

load();
or something like that, that's meaning that you're duplicating things if you completed the code with this stuff... :think:

RaidBossSpawnManager class require too much rework and not only 6 characters that you're adding.

Without no mention internal class

Code: Select all

MinionData
... That require some things more... :shifty:

Re: Raid bosses minions not spawn on server launch

Posted: Wed Jun 26, 2019 6:36 am
by Edoogel
Sacrifice wrote: Tue Jun 25, 2019 4:37 pm

Code: Select all

RaidBossSpawnManager.getInstance();
in gameserver class is sufficient for all, because the constructor calls, on instantiation of the class at the method

Code: Select all

load();
or something like that, that's meaning that you're duplicating things if you completed the code with this stuff... :think:

RaidBossSpawnManager class require too much rework and not only 6 characters that you're adding.

Without no mention internal class

Code: Select all

MinionData
... That require some things more... :shifty:
I understand, but here it works (RaidBossSpawnManager.getInstance (). load ()) and all raid bosses stand with minenes, and when spelled out (RaidBossSpawnManager.getInstance ()) then redBosses stand without miniens.

Re: Raid bosses minions not spawn on server launch

Posted: Thu Jun 27, 2019 4:44 am
by Sacrifice
I tell you that this is not the best fix, does it work? Yes, but it is not the best fix.

At least I edited about 100 lines of that class and eliminated many more, and in the datapack I also made quite a few deletions and editions related to that.

If that makes you happy ... Ole!

Re: Raid bosses minions not spawn on server launch

Posted: Fri Jun 28, 2019 1:57 pm
by Edoogel
Sacrifice wrote: Thu Jun 27, 2019 4:44 am I tell you that this is not the best fix, does it work? Yes, but it is not the best fix.

At least I edited about 100 lines of that class and eliminated many more, and in the datapack I also made quite a few deletions and editions related to that.

If that makes you happy ... Ole!
it's not about happiness. I'm not saying that this is a panacea, it can just be used until the fix for this bug is released.

Re: Raid bosses minions not spawn on server launch

Posted: Fri Jun 28, 2019 5:58 pm
by Sacrifice
Okey, no problem them :clap: :wave:

Re: Raid bosses minions not spawn on server launch

Posted: Sat Jun 29, 2019 11:27 am
by Avanael92
I don't think that's the problem. With your "fix" you're calling load() twice, nothing else. You're just putting a band-aid on without knowing what's the cause. What about codes that are supposed to launch one time? That's really bad practice what you're doing.

For me minions are spawning just fine after launch and restart. So I guess the problem lies somewhere else.

Re: Raid bosses minions not spawn on server launch

Posted: Sun Jun 30, 2019 3:06 pm
by Edoogel
Avanael92 wrote: Sat Jun 29, 2019 11:27 am I don't think that's the problem. With your "fix" you're calling load() twice, nothing else. You're just putting a band-aid on without knowing what's the cause. What about codes that are supposed to launch one time? That's really bad practice what you're doing.

For me minions are spawning just fine after launch and restart. So I guess the problem lies somewhere else.
here is a completely revised and revised script. Now everything will spawn without the above mentioned addition.

Re: Raid bosses minions not spawn on server launch

Posted: Sun Jun 30, 2019 6:03 pm
by Avanael92
I don't see how that's revised. You didn't change anything related to minions not spawning. The code is literally 99% the same as mine, you just shorted the code a little bit and changed respawntime from long to int. :think:

You should consider changing respawntime back to long asap. The respawn time is saved as unix timestamp in milliseconds and those go way over the max value of int.

Example:
Unix Timestamp: +1,561,916,406,096
Max int value: +2,147,483,647

Re: Raid bosses minions not spawn on server launch

Posted: Fri Jul 05, 2019 5:36 am
by Sacrifice
Avanael92, will he have to learn one day? Don't?...

Edoogel, not are sufficient mister.

Re: Raid bosses minions not spawn on server launch

Posted: Wed Jul 01, 2020 5:24 am
by gfigueroav
Hello.

In public void addNewSpawn() function in RaidBossSpawnManager class, i have added after the following line:

Code: Select all

final long time = Calendar.getInstance().getTimeInMillis();
this:

Code: Select all

...
		if (respawnTime == 0L) {
			respawnTime = time + 50000;
		}
...
This activates the scheduling mechanism. The raid bosses that are alive should not be loaded directly, but should simulate being loaded with a delay. This way you can "temporarily" fix the problem without affecting the overall system performance.

Obviously, this technique should be improved and implemented in a better way or keep looking for the previous error.

I'm not quite sure, but I think something must be happening in the script loading order.

Regards!

Re: Raid bosses minions not spawn on server launch

Posted: Thu Jul 09, 2020 11:14 pm
by Zoey76
The problem seems to be that MinionSpawnManager (datapack script) is loaded after onSpawn() event was already notified, seems it was not tested when it was moved from core to datapack.