[FIXED] Raid bosses minions not spawn on server launch

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
jonhanon
Posts: 3
Joined: Wed Sep 19, 2018 10:21 pm

[FIXED] Raid bosses minions not spawn on server launch

Post by jonhanon » Mon Jun 17, 2019 2:42 pm

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...

Edoogel
Posts: 58
Joined: Wed Mar 23, 2016 2:05 am
Location: Russia
Contact:

Re: Raid bosses minions not spawn on server launch

Post by Edoogel » Mon Jun 17, 2019 4:20 pm

I confirm, there is such a problem on the server. And how to fix, too, can not find.

jonhanon
Posts: 3
Joined: Wed Sep 19, 2018 10:21 pm

Re: Raid bosses minions not spawn on server launch

Post by jonhanon » Thu Jun 20, 2019 12:25 pm

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

Edoogel
Posts: 58
Joined: Wed Mar 23, 2016 2:05 am
Location: Russia
Contact:

Re: Raid bosses minions not spawn on server launch

Post by Edoogel » Fri Jun 21, 2019 9:01 am

Checked, everything works fine. Thank you jonhanon! :+1:

Sacrifice
Advanced User
Advanced User
Posts: 1022
Joined: Thu Aug 14, 2014 6:31 am
Location: Spain

Re: Raid bosses minions not spawn on server launch

Post by Sacrifice » 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:
Retail GameMaster and Developer using Eclipse for Java Developers (64 bits), OpenJDK14 (64 bits), MySQL 8.0+ (64 bits).

Edoogel
Posts: 58
Joined: Wed Mar 23, 2016 2:05 am
Location: Russia
Contact:

Re: Raid bosses minions not spawn on server launch

Post by Edoogel » Wed Jun 26, 2019 6:36 am

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.

Sacrifice
Advanced User
Advanced User
Posts: 1022
Joined: Thu Aug 14, 2014 6:31 am
Location: Spain

Re: Raid bosses minions not spawn on server launch

Post by Sacrifice » 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!
Retail GameMaster and Developer using Eclipse for Java Developers (64 bits), OpenJDK14 (64 bits), MySQL 8.0+ (64 bits).

Edoogel
Posts: 58
Joined: Wed Mar 23, 2016 2:05 am
Location: Russia
Contact:

Re: Raid bosses minions not spawn on server launch

Post by Edoogel » Fri Jun 28, 2019 1:57 pm

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.

Sacrifice
Advanced User
Advanced User
Posts: 1022
Joined: Thu Aug 14, 2014 6:31 am
Location: Spain

Re: Raid bosses minions not spawn on server launch

Post by Sacrifice » Fri Jun 28, 2019 5:58 pm

Okey, no problem them :clap: :wave:
Retail GameMaster and Developer using Eclipse for Java Developers (64 bits), OpenJDK14 (64 bits), MySQL 8.0+ (64 bits).

User avatar
Avanael92
Advanced User
Advanced User
Posts: 189
Joined: Thu Aug 07, 2014 5:26 pm
Location: Germany

Re: Raid bosses minions not spawn on server launch

Post by Avanael92 » 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.
Image

Edoogel
Posts: 58
Joined: Wed Mar 23, 2016 2:05 am
Location: Russia
Contact:

Re: Raid bosses minions not spawn on server launch

Post by Edoogel » Sun Jun 30, 2019 3:06 pm

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.
You do not have the required permissions to view the files attached to this post.

User avatar
Avanael92
Advanced User
Advanced User
Posts: 189
Joined: Thu Aug 07, 2014 5:26 pm
Location: Germany

Re: Raid bosses minions not spawn on server launch

Post by Avanael92 » Sun Jun 30, 2019 6:03 pm

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
Image

Sacrifice
Advanced User
Advanced User
Posts: 1022
Joined: Thu Aug 14, 2014 6:31 am
Location: Spain

Re: Raid bosses minions not spawn on server launch

Post by Sacrifice » Fri Jul 05, 2019 5:36 am

Avanael92, will he have to learn one day? Don't?...

Edoogel, not are sufficient mister.
Retail GameMaster and Developer using Eclipse for Java Developers (64 bits), OpenJDK14 (64 bits), MySQL 8.0+ (64 bits).

gfigueroav
Posts: 1
Joined: Fri Jun 26, 2020 4:42 pm

Re: Raid bosses minions not spawn on server launch

Post by gfigueroav » Wed Jul 01, 2020 5:24 am

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!

User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 6982
Joined: Tue Aug 11, 2009 3:36 am

Re: Raid bosses minions not spawn on server launch

Post by Zoey76 » Thu Jul 09, 2020 11:14 pm

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.
Using Eclipse 4.16 - OpenJDK14 - MariaDB 10.4 - L2J Server 2.6.2.0

Post Reply