Jump to content

Recommended Posts

Posted (edited)

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
Posted (edited)

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
Posted (edited)

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
Posted (edited)

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
Posted (edited)

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
Posted (edited)

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
Posted (edited)

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
Posted

 

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.

  • 2 weeks later...
Posted

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
Posted (edited)

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<
Posted (edited)

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<
Guest
This topic is now closed to further replies.



  • Posts

    • Lineage2 Freya High Five @ Reshade with fog and rain etc @ Gracia final epilogue atmosphere   this reshade will eat lots of GPU power 50% or more of an RTX 3060 so be carefull depending on what effects are activated and their settings will eat even more GPU recomended 60hz monitor settings and via nvidia panel in Lineage2 game profile vsync settings to on effects are set up till film deck and the rest are not used but still working again this can eat alot of GPU Don't overheat GPU this is for freya high five but might work on others too copy in the  System  folder the folder  reshade-shaders  and the files  d3d9.dll  ReShade.ini  ReShadePreset.ini  ReShade.log  CccDddCcc.ini insert opens the menu and delete is on and of some settings need  ctrl + left click  to be changed   making another profile will reset the not activated effects to their default values so just copy the profile  CccDddCcc  and rename if needed also something needs to be closed from settings in game menu, the blur at distance and advanced shaders but keeping the advanced water effects all reflections   for those that don't like the h5 look of the sky and the red fog and rain and ambien red at night on all maps well if we want the cool gracia final epilogue back then we need to do this rename the  Maps  folder to Mapsretail or whatever copy the  Maps  folder from gracia final epilogue to h5 also we need the  L2_Skies.utx  from gracia final epilogue  Textures  folder to be replaced and also we need to do the same to the files  timeenv0.int  timeenv1.int  timeenv2.int  timeenv3.int  found in  system  folder   another setting that will probably be needed but not really tested out is to open file  option.ini  from  system  folder and add cachesize like this   [FirstRun] FirstRun=2   [Engine.GameEngine] CacheSizeMegs=512   also maybe is good to change those to 4.000000   [ClippingRange] Terrain=4.000000 Actor=4.000000 StaticMesh=4.000000 StaticMeshLod=4.000000 Pawn=4.000000       sorry bad english   https://mega.nz/file/aRNXxDrQ#mbxrNERBtW0XEEezK6w8-86oZWuX1k6NgtR6RZWKRVM   the compression on the video is kinda bad but meh    
    • Thanks, tho if possible let's lock the topic. I decided to finish up myself as I only created this to save up my time, but seems that while waiting for prop dev. finished myself.
    • Plus he have Discord where using Celestine, Nightwolf and others names to ensure that he is legit, what a looser, that's why mxc have bad reputation, coming here is like 50/50 get scammed.
    • Greetings, MaxCheaters community! We are the development team behind projects like AdenLand, Classic GvE, TinyEssence, PvPEssence, and several others. Over the years of managing high-traffic servers, we’ve built our own ecosystem of tools for datapack and client editing, simply because standard software often failed to meet our production needs or was too slow. Today, we are opening access to these professional solutions for our colleagues in the dev scene. You can explore our suite of editors and utilities here: 👉 https://la2.tools/ Why choose our tools? Battle-Tested: This software is used daily to maintain and update our own live projects. Efficiency: Designed to automate routine tasks that usually take hours or even days. Stability: Built to handle complex client/server structures where generic tools often crash. We are ready to provide consultations on integrating these tools into your development workflow to make your process faster and more secure.  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..