Jump to content

Tryskell

Legendary Member
  • Posts

    5,343
  • Credits

  • Joined

  • Last visited

  • Days Won

    52
  • Feedback

    0%

Everything posted by Tryskell

  1. For the automatic despawn : When you create the Spawn and once you spawned the Npc, you can define the despawn delay with npc.scheduleDespawn(despawnDelay); (which will generate a despawn task, there is no way to cancel it since it's not tracked) ---- For the move part : You have to keep either a Spawn or Npc List/Set in Player, as suggested Anarchy. If you want a guaranteed disappear on any type of move (even during a move), you have to write your disappear content on PlayerMove#updatePosition. Simply write a !_actor.getWhateverSpawns().isEmpty() check, for loop your list and despawn NPCs. Be sure to use a concurrent list/set (prefer ConcurrentHashMap.newKeySet over CopyOnWriteArrayList due to performance), and not an arraylist (to avoid CME, which probably will occur if you decide to use item while moving). ----- You also probably want to delete "old" Npcs before summoning new ones. Use same content than your PlayerMove#updatePosition check in the item handler before #spawnServitors call, to avoid to get billions of random NPCs.
  2. SQLSyntaxError is due to query issue (wrongly formatted mySQL query). Verify your customs (probably characters offline), I can't help you.
  3. KeyPacket isn't an existing packet on any L2 chronicle (at least up to Grand Crusade, and since you use net.sf.l2j you're probably IL or near), so I suppose it's a custom packet used by strix patlform and it fails somehow. Technically speaking, it can be explained as your "buffer" from where you try to parse your writeB doesn't exist. It's not empty, it simply doesn't exist. Can be because you flushed the _buf meanwhile (_buf = null while accessing it and not locking it), can be because you tried to access to it while it wasn't initialized. Better ask to Strix guys why their custom stuff doesn't work :].
  4. ScheduledQuest is actually perfect for timed events, if you don't want to use it you will have to implement/clone ScheduledQuest logic. That's basically a Calendar set in a given time - actual Calendar and the difference of those 2 is the time to fire the task. You don't need to check every 5 sec. Once the event is called, you simply recalculate it and launch another task. You calculate/launch it at server startup and then it fires automatically based on the calculations.
  5. Simply copy-paste whatever Npc you want to clone, put the original idTemplate to refer to that visual, edit the id to be a unused custom npcId, put usingServerSideName / usingServerSideTitle and you're done.
  6. It probably uses male height, or use rounded int values and not double. Edit As expected : They probably rounded higher to avoid to get foots inside the ground.
  7. If by auto wipe you mean dropping all players data and such, the easiest is to disconnect all Players, avoid login entrance and then to call used tables on the full reset db installer. Once everything is done, you can allow anew login and force server restart for proper reset. For the task itself, check gameserver.taskmanager. You can also implement it using ScheduledQuest if you want it triggered/managed by scripts.xml.
  8. It did throw an error, simply read your console properly. L2Npc has to be replaced by Npc or by Folk (immortal Npc). Also use the dedicated custom npc range, which begins at 50000-50999.
  9. I got a TODO for this one on my Issues board since 2020 (UserInfo/CharInfo handling in a more universal way). While it would be a good optimization (for L2J in general) I don't see why it is actually a "nightmare" for you - until post H5 clients react differently, because L2J got that "problem" on many other aspects. I would be interested by committing it, so eventually reach me on Discord to speak about it (I could debug / speak about the concept). Otherwise, wait.
  10. Fix the import, that's the first recommended line.
  11. I don't see anything blocking, even on latest. I don't even think there is a single import edit to do : IXmlReader is on since multiple dozens revs (377), Player aswell (367). If you got issues applying on network packets (because of lines edition), simply read the actual content and apply manually...
  12. You can first try delete the import and fixing imports (ctrl+shift+O), you can also try to copy-paste the faulty import from a valid class to the lacking class. You seem to use post-367, since Playable isn't named L2Playable and I did it everything in rev 367-368. So Player class is supposed to already exists in your temporality (you can make a search and see if it exists).
  13. For me, it's definitively not. Whatever is shared as a library must be shared as a source. There is strictly no reason to not share sources, since Java is extremely easy to decompile - the 2 only reasons are to try to make more money out of nothing, and to bother people. Anyway I stop the offtopic. ;)
  14. Shortly said : yes, it is allowed and I got no problem about people reselling old customized sources, but you buy a second-hand product where I had strictly no control over it (introduced issues / missing features / backdoors). If you meet a problem, I won't be your man. Simply use basic morale, and if not, your empathy. If you lack both, consider you aren't a human. Also, and since I read the description (and except if the seller did an error) : I never recommend ANYONE to buy a precompiled pack without sources. It's a big red flag for me, and it should be for you aswell.
  15. That's not something I have to take in consideration, also, in case of autobot/fakeplayers, nothing stop you to use the method used by the monsters (which actually use geopath). It looks like L2OFF "rewards" ppl for good positioning, that's simply part of the gameplay and I do as I see it. Since the time, you should know it's not the house's motto ;). Consider I generate some jobs for people. If you begin to add booleans for such things, it's a never ending path you decide to choose (and which I never considered, since people are enough clever to share themselves customs when they want to). You can also educate people to play the actual real game. PS : there's actual real cases where auto-attack is supposed to occur, like arenas. And they are normally respected.
  16. if (player.isIn3DRadius(zone.getLastSpawn(), getInt("zoneRadius")) ...or 2D if you don't need Z check.
  17. Not sure why aCis is mentioned, but if L2JOrion is "solo developer" after years of existence, it either means (pick one or multiple reasons) the project isn't appealing to "developers", the project is too shady/complicated to enter/dive in, or it is simply a wish of Vilmis to stay alone. PS : if it's not a wish to stay alone, consider to edit your formula. I write my own formulas, and it worked well so far.
  18. Client got nothing to do with used pack, and the answer is definitively no - if you speak about ExServerPrimitive packet, it simply accumulates until client can't handle it, and at my knowledge there is no counters, except disconnecting. If you manage to discover a pack where it properly works, feel free to show me some sources.
  19. If someone wants to make a t-shirt : https://ibb.co/gdchrCz and don't forget royalties. Plot twist : Lucera is more or less customized L2Scripts.
  20. lease and defaultBid from clanHalls.xml In a general matter, static data is ALWAYS on XML and dynamic data is ALWAYS on SQL. Exceptions can occur, but for 95% of content it's the motto.
  21. The thread is simply an executable class, the ScheduledThreadPoolExecutor handles the management of it. How ? Who cares, it was optimized for you by some high-grade dudes years ago and added directly in Java. Seeing how much tasks are generated by seconds (network, AI, and random tasks), it probably costs almost none CPU/RAM. You only have to assure yourself to avoid to bottleneck the system. Not sure why you need this answer, your best bet is to make tests yourself because litteraly none did that before you (at least, I didn't).
  22. If you properly use L2J ThreadPoolManager implementation, you simply pick a thread from an existing pool and once executed it returns to the pool - similar to a db connection factory. L2J implementation is nothing more than dedicated ThreadPoolExecutor / ScheduledThreadPoolExecutor, 4 of each types. You can read more on Google, as introduction : https://www.baeldung.com/thread-pool-java-and-guava https://www.geeksforgeeks.org/thread-pools-java/ And whatever related to ThreadPoolExecutor / ScheduledThreadPoolExecutor classes.
  23. You shouldn't connect your server db to your website, it's extremely easy to down your server attacking your webserver (+ potential security breaches if you suck at webcoding). About the VPS itself, nowadays you can connect it to any VPS, from the moment you got 2G dedicated to JVM that's enough for 150-200ppl. You can even run it on a Raspberry Pi.
×
×
  • Create New...