Jump to content

Rank Pvp System 3.8.9 [Il - H5]


Recommended Posts

Nice idea!

 

BUT the implementation is not that nice..

Why didn't u wrote that as a DP sided script..

Also u're using thread-safe classes where u don't need to, and not thread-safe where u had to..

Using public variables to access from outside and methods to access inner vars is not so nice either.

Btw we use to add '_' (underscore) prefix to global variables not to local ones so you don't have to use explicit 'this.var = var'

Also we stopped using e.printStackTrace() because in windows it doesn't gets logged on log files, we use Logger for that (Same goes for System.out.println())

(new Thread(new RankPvpSystemPvpTask(player, target))).start();

 Why don't u simply use that instead.

ThreadPoolManager.getInstance().executeTask(new RankPvpSystemPvpTask(player, target));

It also executes the task in another thread without having to create new thread because there is already created a pool of threads used by the whole server.

 

Actually the code is really messed up (That's what we call spaghetti  code) that's why u have 20 pages of typo reports, i think u should start writing a bit more cleaner & safe.

Here i attach similar script i started some time ago, it doesn't supports most of the things u did but count it as an example of how i write things.

Note: This is an alpha version, totally not ready for use version, it may work but it still needs work to be done to consider it as a final version.

PvP.zip

Edited by UnAfraid
Link to comment
Share on other sites

Thanks for this post UnAfraid, but like i sad some time ago i still learn java. I will try apply your clues in my system ;)

 

 

Why didn't u wrote that as a DP sided script

It is better for debug for me if it is in Core packages.

 

 

Also u're using thread-safe classes where u don't need to, and not thread-safe where u had to..

So where i should use thread-safe?

 

 

Using public variables to access from outside and methods to access inner vars is not so nice either.

I use that public variable only in L2PcInstance, reason: I don't want change original code too much (adding getter and setter will add too much code)

 

I use inner methods for obtain inner fields, because i think it's look better, and cleaner :)



_killersList.add(killer);
// or
getKillerList().add(killer);

...but now i think the first line looks better than third line.

 

 

 

ThreadPoolManager.getInstance().executeTask(new RankPvpSystemPvpTask(player, target));

It is applied right now.

 

About _ (underscore), yes i know this rule ;) but some code is auto-generated in eclipse, so mostly i don't look into this methods.

 

About e.printStackTrace(), it will be changed for Logger.

 

 

 

that's why u have 20 pages of typo reports,

Can you explain what do you mean?

 

 

i think u should start writing a bit more cleaner & safe

What mean safe?

 

 

Finally, thanks for check my work. I am really glad :)

Edited by matthewmaster04
Link to comment
Share on other sites

Every time u need some Map/List which will be used only once to add and then only to read doesn't have to be FastMap/FastList (Javolution) they are thread-safe use HashMap (When order is not important LinkedHashMap when u need insert order) and ArrayList.

 

In case you have to use a Map/List to add/remove entries during run-time then u have to use thread-safe Map/List i'd rather use ConcurrentHashMap/CopyOnWriteArrayList (In case when insert order matters only then FastMap)

 

If you like to leave little fingerprints over the source i'd implement some event listeners.

With that you can create some interface bridge between your engine and every other l2j based server.

 

Debugging is easy within Core or DP it doesn't really matters eclipse's debugger works well on both sides equally.

Edited by UnAfraid
Link to comment
Share on other sites

So in this case, standard Map/List will be correct and i can remove FastMap from this pack, i think.

 

ConcurrentHashMap & CopyOnWriteArrayList can be useful but now i am little confused what will be better for me (i need more knowledge).

 

Anyway thanks for help ;)

Edited by matthewmaster04
Link to comment
Share on other sites

Codding safer means you should make sure your code is not going to cause any problems like exceptions (Mostly nulls), exploits..  as you write it.

Edited by UnAfraid
Link to comment
Share on other sites

U also could do that 

for (Entry<Integer, KillerPvpStats> entry = getKillerPvpTable().entrySet())

instead of 

for (FastMap.Entry<Integer, KillerPvpStats> e = getKillerPvpTable().head(), end = getKillerPvpTable().tail(); (e = e.getNext()) != end;)

It looks way more cleaner and understandable also when u change the underlying implementation you'll not have to worry about rewriting all the loops u did in that way.

 

Also i'd use a bit more java 7 features like the ARM (Auto resource management), mostly for database queries look at current l2j sources to see how we handled them

Edited by UnAfraid
Link to comment
Share on other sites

Thanks again, i will apply it in next rev. ;)

 

It should be like:

for (Map.Entry<Integer, Rank> e : rankList.entrySet())

And btw, is exist a Map what allows you add value on selected position?

Example:



_map.insert(position, key, value);
Edited by matthewmaster04
Link to comment
Share on other sites

 

Thanks again, i will apply it in next rev. ;)

 

It should be like:

for (Map.Entry<Integer, Rank> e : rankList.entrySet())

And btw, is exist a Map what allows you add value on selected position?

Example:



_map.insert(position, key, value);

No, you must use comparator.

Link to comment
Share on other sites

  • 2 weeks later...

i suggest you create one more file to show diffs in eclipse so ppl dont have to remove and re-add patches ;) ofc if you have time for that is just a suggestion ;) btw is one of the best features here!

Link to comment
Share on other sites

i have a problem  

 

Buildfile: C:\workspace\L2J_Server\build.xml
checkRequirements:
getChangelogDateVersion:
     [exec] Result: 1
     [exec] Result: 1
init:
   [delete] Deleting directory C:\workspace\L2J_Server\build\bin
    [mkdir] Created dir: C:\workspace\L2J_Server\build\bin
dist:
     [sync] Removed 2 dangling files from C:\workspace\L2J_Server\build\dist
compile:
    [javac] Compiling 1692 source files to C:\workspace\L2J_Server\build\bin
    [javac] C:\workspace\L2J_Server\java\com\l2jserver\gameserver\handler\UserCommandHandler.java:24: error: cannot find symbol
    [javac] import com.l2jserver.gameserver.masteriopack.rankpvpsystem.IUserCommandHandlerPvpInfo;
    [javac]                                                           ^
    [javac]   symbol:   class IUserCommandHandlerPvpInfo
    [javac]   location: package com.l2jserver.gameserver.masteriopack.rankpvpsystem
    [javac] C:\workspace\L2J_Server\java\com\l2jserver\gameserver\handler\VoicedCommandHandler.java:24: error: cannot find symbol
    [javac] import com.l2jserver.gameserver.masteriopack.rankpvpsystem.IVoicedCommandHandlerPvpInfo;
    [javac]                                                           ^
    [javac]   symbol:   class IVoicedCommandHandlerPvpInfo
    [javac]   location: package com.l2jserver.gameserver.masteriopack.rankpvpsystem
    [javac] C:\workspace\L2J_Server\java\com\l2jserver\gameserver\GameServer.java:317: error: load() has private access in ServerSideImage
    [javac] ServerSideImage.getInstance().load();
    [javac]                             ^
    [javac] C:\workspace\L2J_Server\java\com\l2jserver\gameserver\handler\UserCommandHandler.java:41: error: cannot find symbol
    [javac] registerHandler(new IUserCommandHandlerPvpInfo());
    [javac]                    ^
    [javac]   symbol:   class IUserCommandHandlerPvpInfo
    [javac]   location: class UserCommandHandler
    [javac] C:\workspace\L2J_Server\java\com\l2jserver\gameserver\handler\VoicedCommandHandler.java:41: error: cannot find symbol
    [javac] registerHandler(new IVoicedCommandHandlerPvpInfo());
    [javac]                    ^
    [javac]   symbol:   class IVoicedCommandHandlerPvpInfo
    [javac]   location: class VoicedCommandHandler
    [javac] 5 errors
 
BUILD FAILED
C:\workspace\L2J_Server\build.xml:64: Compile failed; see the compiler error output for details.
 
Total time: 7 seconds
Link to comment
Share on other sites

marik20001

Probably you try add this diff files into lower chronicle than H5 or other l2jserver.

 

You should check methods names and parameters what are overrided in command handlers.

 

IUserCommandHandlerPvpInfo should be correctly implemented from IUserCommandHandler interface.

 

valanths1990

You can restore the oryginal class from repo and then apply my patch. THat way is faster i think. (BTW I am too lazy ... ;))

Edited by >Masterio<
Link to comment
Share on other sites

I will apply concurrent hashmap. do not download 3.7.5, new revision today.

 

PS. I will fit this code when I will finish H5 version. (soon)

Edited by >Masterio<
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



  • Posts

    • Hello everyone,   We're shifting our focus away from implementing as much as possible from the Essence gameplay. Instead, the server will now be Interlude, but using the Essence client.   This should be good news for everyone.   The Beta phase will most likely take place in November, with the grand opening to follow shortly after.   Cheers!
    • We remind you that the opening will take place today, on September 28 at: 19:00 (UTC+3) - server time Check current server time(UTC +3) On 17:00 (UTC +3) We allow you login to create character! Dear friends, this topic important! So please take time to read it. First we want to thank all players who took part in the Open Beta testing, was good activity and nice Olympiad Event yesterday, we all get a lot of fun  Thanks to all who conducted tests with us and prepared this game world! You are amazing!  On 17:00 (UTC +3) We allow you to login for create character! To restrict your name and transfer ToDs/Season Pack to your character. Make it before start! On start, we can have problems with WEB! Everything you need to start on the server: It is IMPORTANT to prepare everything for starting the game RIGHT NOW, do not postpone for later, during the opening there may be problems with the web part of the project, and you simply can not register. - Registration and files Download archive unzip it, run launcher, choose SEASON x25 server and press FULL CHECK What you need to know at the start: Registration for 7 seals from Monday, September 30, full cycle 1 week. First Mammons on Friday October 4 All Epic Raid Bosses dead on start. First epic QA will appear on Monday, next day Core + Zaken + QA and so on by schedule All other RBs alive on server start (including Sub and Nobl RB) - Full RoadMap   About possible attacks on server start. We have prepared as good as we can. We will control the start of the server together with you. Want to ask you, in the case of a problem, don't panic, panic is the worst possible thing that could be, even worse than any attack. We have enough specialists to solve any problems, all that will need from you is patience and trust. Wish you all a smooth start and months of enjoyable play in new Season Interlude x25! Have a fun!
    • 🚨🇦🇷🇧🇷🇪🇸🇸🇰🇺🇳🇨🇱🚨 Devianne - Lineage 2 Interlude  Client - Classic. 🔷Rates 🔸Experience (EXP) - 10x 🔸Skill Points (SP) - 10x 🔸Adena - 6x 🔸Drop Items - 3x 🔸Spoil - 3x 🔸Quest Experience (EXP) - 1x 🔸Quest Skill Points (SP) - 1x 🔸Quest Adena - 1x 🔸Quest Items Drop - 1x 🔸Seal stone Drop - 1x 🔸Epic raid - 1x 🔸Raid Drop - 2.0x 🔸Manor - 5x 🔷Dynamic Rates XP/SP 🔸Lv. 1-52 EXP/SP X10 (x7 without VIP or vote reward) 🔸Lv. 52-61 EXP/SP X7(x5 without VIP or vote reward) 🔸Lv. 61-76 EXP-SP X5 (x3 without VIP or vote reward) 🔸Lv. 76-78 EXP/SP X3 (x2 without VIP or vote reward) 🔸Lv. 78-80 EXP/SP X2 (x1 without VIP or vote reward) ⚠️Extra Settings⚠️ 🔸Server time, site - GMT -3 🔸Buffs, Dances, and Songs duration - 1 hour 🔸Max Buffs Slots - 22 + 4 divine 🔸Maximum Slots Dances and Songs - 12 🔸GmShop Grade - C 🔸Global teleport 🔸Grade B-A-S - Craft 🔸Mana potion recharge 🔸1000 (9 seconds delay) 🔸Raid HP - x1.4 🔸Raid epic HP - x1 🔸Blacksmith Mammon - 24/7 🔸Champions System - Yes chance respawn 0.5% 🔸Offline mode Shop - Yes 🔸Auto Learn Skills - Yes 🔸Auto Learn Loot - Yes 🔸Auto Learn Raid & Grand 🔸Boss Loot - No 🔸Buffer offline - Yes 🔸Wedding System - Yes 🔸Max level diff distribution drop in party - 14 🔸Limit the number of active gaming clients on one PC - 2 🔸Limit the number of active gaming clients on one PC for Premium - 3 🔸The clan leader will be replaced after server restart ⚠️Class and Subclass Change⚠️ 🔸1st profession Quest - No 🔸2nd profession Quest - No 🔸3rd profession Quest - Yes 🔸Sub Class Quest- Yes 🔸Sub Class Raid - 8 hours +-30m random 🔸Nobility and Olympiads Nobility Quest - Yes 🔸Olympiads (duration) - 14 days 🔸Max enchant - +6 🔸Respawn Barakiel 6 hours - +-15 min random 🔸Olympiad schedule - 13:00 to 00:00 🔸Minimum players to start olympiad - 11 Clans and Sieges Penalty duration - 8 hours 🔸Sieges every - 15 days Max Ally - 2 🔸Max Members - 36 🔸Slots for academies in clan - 40 ⚠️Enchants Rate⚠️ 🔸Blessed Scroll chance 60% 1-10 11-16 40% 🔸Crystal Scroll chance 65% 1-10 11-16 40% 🔸Normal Scroll chance - 55% 🔸Safe Enchant - +4 ⚠️Premium Info⚠️ 🔅+20% xp sp drop spoil adena 🔅+5% additional enchant rate (premium 30 days)   Free autofarm ⚠️Starter Pack⚠️ 🔅Free Premium - 24 hours 🔅Free Autofarm - 24 hours ❇️Raid boss Info❇️ 🔸Anakim/Lilith respawn 18 hours +1:30min random 🔸Tyrannosaurus - respawn 8 min drop Tl 76 🔸Queen Ant (LVL 80) - Respawn Monday and Saturday 22:00 🔸CORE (LVL 80) - Respawn Tuesday-Friday 20:00 🔸ORFEN (LVL 80) - Respawn Tuesday-Friday 21:00 🔸BAIUM (LVL 80) - Respawn Saturday 21:00 🔸ZAKEN (LVL 80) - Respawn Wednesday-Thursday 22:00 🔸FRINTEZZA (LVL 85) - Sunday 19:45 ⚔️Quest Details⚔️ QUEST WEAPON RECIPES: - Relics of the Old Empire x1: - Gather the Flames x1 x1: QUEST ARMOR RECIPES: - Alliance with Varka Silenos x1 - Alliance with Ketra Orcs x1 - War with Ketra x1 - War with Varka x1 - Gather the Exploration of the Giants’ Cave Part 1 x3 - Exploration of the Giants’ Cave Part 2 x1 - Whispers of Dream part 2 x2 - Legacy of Insolence x1 QUEST RECIPES JEWERLY - The Finest Food x1 QUEST RESOURCES - The Zero Hour x2 - Golden Ram Mercenary x2 - An Ice Merchant dream x2 QUEST FOR FABRIC: - Whispers of Dream part 1 x1 BEAST FARM : - Delicious Top Choice Meat x2 👁️OTHER QUEST👁️ 👁️- Yoke of the Past x2 👁️- In Search of Fragments of Dimension x2 👁️- The finest Ingredients x3 👁️- Supplier of reagents x3 - 👁️3rd class Halisha Marks drop x3 - 👁️Into the flames x3 - 👁️Audience with the land dragon x3 - 👁️An Arrogant Search x3 - 👁️Last Imperial Prince x3 🚨Soul Crystal Details🚨 🔸- Level up crystals to 11, 12, 13 🔸- All epics can level up crystals for the whole party (Queen Ant, Core, Orfen, Zaken, Baium, Antharas, Valakas, Frintezza). - 🔸Bosses in PVP zone: Master Anays, High Priest Van Halter. 👁️🔸- Anakim/Lilith, Uruka. - You can level up crystals in Rift, but only 1 party can challenge Anakazel (10%)PARTY_RANDOM at the same time (if one party is in the boss, you need wait them to go out). 👁️🔸- You can level up crystals in Primeval Island by killing tyrannosaurus with 10% chance PARTY_ALL for the person who cast the crystal and makes last hit. ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️ WEB: https://devianne-l2.com/ DISCORD: https://discord.gg/Q3HAMzasUk 🔥🔥SERVER TEST OPEN !!🔥🔥🔥
    • I am here for the plank jumps and the cookies any news about that?
  • Topics

×
×
  • Create New...