Jump to content

Tryskell

Legendary Member
  • Posts

    5,343
  • Credits

  • Joined

  • Last visited

  • Days Won

    52
  • Feedback

    0%

Posts 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. 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 :].

  3. 3 hours ago, Adon_Ace said:

    Hey thank you!!! I'm getting there xD when I finish I will share! For checking time should I use calendar and threadpool so it checks every 5 secs if the time is 12? sorry if question is noob, trying to learn 😛

     

    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.

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

  5. 48 minutes ago, An4rchy said:

    I couldn't agree more. As you know, I've been changing aCis packets for 110 protocol and it's been a nightmare debugging some server packets. For example when a player uses an equippable item, 3 UserInfo are sent in 0.1 second xD The problem though is, you can't simply remove the sendPacket(new UserInfo(player)) because it's being called by methods that are used somewhere else as well, so you either have to add a ton of variables to make checks and things get really messy, or basically rewrite the whole function.

     

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

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

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

     

     

  8. 1 hour ago, An4rchy said:

     

    It is acceptable to provide your work simply as a library for others, as long as you have the proper plugin system and documentation so people can work on their own things.

     

    Unless you're going for something complex as a faction system where you 100% need access to source.

     

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

  9. 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) :

     

    Quote

    Price for Files+ database + source is 150 Euro without the  source ( price is negotiable )

     

    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.

  10. On 5/5/2022 at 12:04 PM, arm4729 said:

    just admit you never like autobots/fakeplayer , only "devs" who make player chase other player with path finders are the ones who don't want to look stupid in front of stupid players playing with bots  ... imagine a bot in hot springs trying to straight line chase a player that is hidding after a small rock. he will never reach the target damn ... xD

     

    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.

     

      

    5 hours ago, An4rchy said:

    Such behavior should be made retail like but should be fully configurable. I doubt any mid-rate (or even low-rate) owners would like the players to be annoyed having to spam click to attack someone.

     

    Otherwise just hardcode everything for a clean Interlude x1 and only keep networking & database configurations.

     

    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.

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

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

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

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