Jump to content
  • 0

Help to add codes. Newbie on java and eclipse.


Question

Posted

I'm starting on this.

I know enough to be able to make my website with php, html and css. I also know linux to maintain a server but I don't know anything about java and its compilation.

 

Can anyone help me learn how to add this type of code to a server? I'm using L2jMobius, but I have no idea or concept of how to start to add codes.
Do I need to add it before compiling? Can it be added once the datapack is compiled? How do I know where I should add it?

 

I would appreciate any kind of information, please!

 

I wanna to add some codes nex collection, like TvT events, etc:

 

 

See you guys and thanks for all the help are in the forum!

6 answers to this question

Recommended Posts

  • 0
Posted

First of all you need to understand that there is no ultimate guide "how to", server sources has some similar things but it also has some differences that you will be hard to adapt without skills. Saying skills I mean not only java skills, the most required ones is understanding lineage 2 core processes task-scheduling and client-server networking  communication.

 

You need to:

-learn some core information about Java language

-learn some lessons about java programming to understand what is java classes, packages, imports etc.

-learn how to edit java source code with some IDE (one of them eclipse)

-learn how to compile java source code (with ant for example)

 

Then for the best way you need to get most popular sources form thread above and try to integrate that scripts like for native, I mean as I can see that mostly provided scripts are for acis, so take acis sources and ty to integrate or find something directly for mobius etc.

 

Doing all this you will need to understand three things

First - How player communicates with server

What is action bypasses (when player clicks some link in HTML) and where your server handles it (find RequestBypassToServer packet and learn how its working)

What is user/voice/admin commands (when player writes some in chat with "." or "/" or "//") and where your server handles it (find VoiceCommandHandler and learn how its working)

 

Second - How server doing core logic

If addon has some logic that not depends on direct user action it will mostly required some scheduled task (some logic that will be runs periodically), so you need to  find some ThreadPoolManager and Runnable usages and understand how its working

Maybe you will need some data storage, so you will need to find how server working with database (try to find how server executes SQL requests, SELECT, INSERT, UPDATE)

 

Third - How server communicates back to player

You need to find how server sends packets to player, find some sendPacket() method and its usages, for example Say2 packet (its when server sends some chat message to client) etc

 

Unfortunately there is no easy way, some sources will be easier to adapt cuz of similarity between sources some will be harder

 

  • 0
Posted (edited)
2 hours ago, lvlkoo said:

First of all you need to understand that there is no ultimate guide "how to", server sources has some similar things but it also has some differences that you will be hard to adapt without skills. Saying skills I mean not only java skills, the most required ones is understanding lineage 2 core processes task-scheduling and client-server networking  communication.

 

You need to:

-learn some core information about Java language

-learn some lessons about java programming to understand what is java classes, packages, imports etc.

-learn how to edit java source code with some IDE (one of them eclipse)

-learn how to compile java source code (with ant for example)

 

Then for the best way you need to get most popular sources form thread above and try to integrate that scripts like for native, I mean as I can see that mostly provided scripts are for acis, so take acis sources and ty to integrate or find something directly for mobius etc.

 

Doing all this you will need to understand three things

First - How player communicates with server

What is action bypasses (when player clicks some link in HTML) and where your server handles it (find RequestBypassToServer packet and learn how its working)

What is user/voice/admin commands (when player writes some in chat with "." or "/" or "//") and where your server handles it (find VoiceCommandHandler and learn how its working)

 

Second - How server doing core logic

If addon has some logic that not depends on direct user action it will mostly required some scheduled task (some logic that will be runs periodically), so you need to  find some ThreadPoolManager and Runnable usages and understand how its working

Maybe you will need some data storage, so you will need to find how server working with database (try to find how server executes SQL requests, SELECT, INSERT, UPDATE)

 

Third - How server communicates back to player

You need to find how server sends packets to player, find some sendPacket() method and its usages, for example Say2 packet (its when server sends some chat message to client) etc

 

Unfortunately there is no easy way, some sources will be easier to adapt cuz of similarity between sources some will be harder

 

 

First of all thank you for your answer!

 

I understand a little about programming. Enough to create dynamic websites with PHP, bash, etc. That is, I know the general programming syntax.

It's been several hours and I think I'm understanding a little more how java would work.

So far I have understood that in the different codes that are published I have to add/modify the code in the "index" files that are indicated. All this in eclipse before compiling, on java directory.

I'm trying to add one of these:

https://maxcheaters.com/topic/216955-tvt-ctf-and-dm-for-acis/
https://maxcheaters.com/topic/206016-tvt-event-reworked-tvtjoin-tvtleave-tvtstatus/


Now I find small difficulties:

 

- In L2jMobius there are no "net.sf.l2j.*" files because they are "org.l2jmobius". When I add an import what I do is modify that part of the line and eclipse indicates that it is correct. The problem comes from the fact that there are files that do not come on Mobius. For example *.gameserver.model.actor.instance.L2PcInstance.java.

I downloaded from https://bitbucket.org/MobiusDev/l2j_mobius.git

 

- Due to the above I have decided to use L2jAcis (I have read that it has many errors for not pvp server). Specifically this: https://gitlab.com/Tryskell/acis_public .The problem is that it also doesn't have the java files called L2*, like L2PcInstance.

 

I have found this dapatack that does have the L2* (https://github.com/exvo23/l2jacis400). I find it strange that the Tryskell (Acis official) doesn't have L2* files and exvo23 does.

 

I dont understand this with Acis.

 

Basically I want to build a server compiled by me and not pre-built by other people. I want TvT and little else. The idea is a server x20 not retail but without pvp style and without buffer/gmshop.


Thank you very much again for your answer! I will try to continue learning, although I am somewhat lost with so many dapatack and codes for each one.

 

 

 

 

 

Edited by gripao
  • 0
Posted
54 minutes ago, gripao said:

he problem comes from the fact that there are files that do not come on Mobius. For example *.gameserver.model.actor.instance.L2PcInstance.java.

 

This is one of kind of differences that I described in first reply.

L2PcInstance in acis and Player in mobius

https://bitbucket.org/MobiusDev/l2j_mobius/src/master/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java

There could be a lot such diffs like class names, method names, variable names. This names could be very similar like sendClientPacket() in one sources and sendPacketToClient() in another, only understanding in lineage core logic and logical thinking could help to indicate how to adapt scripts between sources. Also don't forget to use IDE features like search, code analysis etc. this could help to understand which class method should be user to replace 

  • 0
Posted
21 hours ago, lvlkoo said:

 

This is one of kind of differences that I described in first reply.

L2PcInstance in acis and Player in mobius

https://bitbucket.org/MobiusDev/l2j_mobius/src/master/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java

There could be a lot such diffs like class names, method names, variable names. This names could be very similar like sendClientPacket() in one sources and sendPacketToClient() in another, only understanding in lineage core logic and logical thinking could help to indicate how to adapt scripts between sources. Also don't forget to use IDE features like search, code analysis etc. this could help to understand which class method should be user to replace 

 

Hello! Thanks again!

 

Once I have decided to use Acis, I find that the version 401 that is published in gitlab does not have the L2PcInstance file either.

Do you know what it is? How could I get the original source code of the latest version of acis that does use L2PcInstance?

 

I download 401 from there: https://gitlab.com/Tryskell/acis_public

I downloaded 382 from there, too, and dont have L2PcInstance: https://gitlab.com/Tryskell/acis_public/-/tree/452cd109c3bce48416f74bba4daa8c3cf5dfc0a0

Same for 370 from 2019: https://gitlab.com/Tryskell/acis_public/-/tree/0f463e0ddc735955aea1c45d3faf3f0c2cea8aa9/aCis_gameserver

 

I am doing something wrong?

 

Why this have L2PcInstance? https://github.com/exvo23/l2jacis400

I tried to used but give me 2s total time when building aCis_datapack. aCis_gameserver build succesful.

 

Sorry for asking too much!! Thanks 😄

  • 0
Posted
2 hours ago, gripao said:

 

Hello! Thanks again!

 

Once I have decided to use Acis, I find that the version 401 that is published in gitlab does not have the L2PcInstance file either.

Do you know what it is? How could I get the original source code of the latest version of acis that does use L2PcInstance?

 

I download 401 from there: https://gitlab.com/Tryskell/acis_public

I downloaded 382 from there, too, and dont have L2PcInstance: https://gitlab.com/Tryskell/acis_public/-/tree/452cd109c3bce48416f74bba4daa8c3cf5dfc0a0

Same for 370 from 2019: https://gitlab.com/Tryskell/acis_public/-/tree/0f463e0ddc735955aea1c45d3faf3f0c2cea8aa9/aCis_gameserver

 

I am doing something wrong?

 

Why this have L2PcInstance? https://github.com/exvo23/l2jacis400

I tried to used but give me 2s total time when building aCis_datapack. aCis_gameserver build succesful.

 

Sorry for asking too much!! Thanks 😄

In acis L2PcInstance = Player

And many other things are just renamed.

Just check other similar files and compare what changed.

 

 

 

  • 0
Posted (edited)

If you see L2PcInstance on aCis, you shouldn't touch that with a stick. It can't be rev 400, it is before rev 367.

 

https://acis.i-live.eu/index.php?topic=30.msg49015;topicseen#msg49015

 

Many cleanups were done on aCis cycle 36 (360-369) to standardize names and make it friendlier/clearer. About that particular case of model.actor.instance, you got the complete explanation of changes in the dedicated changeset.

 

I made a lot of cleanup, which goes from classes to methods rename. Nowadays, those changes are listed under "Organization", in the changesets. That cleanup stabilized few years ago, and nowadays I got limited ideas of re-organization, meaning the pack structure will stay almost the same, now.

 

If you check aCis Creature class (L2Character on other packs), you will see it is roughly 2 times shorter than other packs. It's another type of cleaning, splitting the class in more little, dedicated classes (in that exemple, the move, attack and cast logics were moved to dedicated classes).

 

So, shortly said, I did numerous re-organizations, consisting to :

  • give proper naming convention to standardize method/class naming.
  • generate package to gather stuff (eg. the enums got their own package).
  • split complex classes in less complex classes (and generate package related to it)

Unfortunately, it means you have to adapt your customs if they were shared from another pack - which isn't a real problem, since anyway, 90% of shared diff patches aren't able to be applied directly.

 

If your diff patch can be applied directly, it means (pick 1) :

  • You were extremely lucky and the dude did the patch based on the exact same revision than you use (which is uncommon, moreover if the share is old)
  • You use a dead pack - shortly said, no editions were made during a big amount of time on extremely common classes, such as Player/L2PcInstance.

 

Edit : it got the old knownlist system too, which was deleted in rev 362 - so it's extremely old. In general, don't pick a pack from another source, you got no guarantee it's safe to be used (addition of keylogger/miner/virus/backdoors).

 

In a general matter, don't pick anything coded by a BR/RU. BR are scam masters (I couldn't meet 1 correct BR in 12y of coding), RU got 0 accuracy and 0 code description (but everything will "work").

Edited by Tryskell

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • The beta server wipes Friday. Fresh start for everyone.   We're launching the Founders Sprint - a 6-day race before the official launch on April 17th.   Reach Rebirth #1 → 1 month Supporter (starts at launch) Reach Rebirth #3 → 1 month Champion (starts at launch) Reach Rebirth #7 → 1 month Legend (starts at launch)   First player to reach Rebirth #7 wins €50!   Event runs April 10th – 16th, 15:00 UTC. Launch is April 17th, 15:00 UTC. Your rewards activate on launch day. See you on Friday!
    • Introducing: Containers to Roll   Players now have the ability to win containers/cases via the Roll System. Additionally I also added a global leaderboard displaying the users with the most roll games. This can be disabled/enabled via Admin Management Panel. Also improved the winning display with a volumetric Godrays effect.  
    • I search job: posting your advertisement(sale,service) on various forums. Contacts for communication. You can find link for download messenger using Google search.   Telegram https://t.me/negotiato_r @negotiato_r   Element(based in United Kingdom) You can find me using this name. @negotiato-r:matrix.org   Session(based in Switzerland) You can find me using this name. 05770c2eda571fc8d10ec0e79e258ec0d9189def2a3e1f2ace1cd29a2174d40723   Delta Chat(based in Germany) You can find me using the link below. https://i.delta.chat/#1ABEBFFCBC1AEE629111387073FFDA1835BB423E&i=6WtJxcgJGcFD3vIpglQfhe5J&s=f2EkRsqxAeFYep9g9s1y1aIf&a=xuozjaudg%40nine.testrun.org&n=negotiator   I ask administrator or moderator not to consider this link an advertisement for messenger.  This is only link that people can use to contact me.  There is also QR code option,but you have to use mobile phone to access QR code.  This means you have to install VPN app on your mobile phone,then sync your account from your mobile phone to your laptop or computer.  This is a very cumbersome process.  It's much easier to use pre-made link for laptop or computer. Hello. I intermediary. I search job: posting your advertisement(sale,service) on various forums.  My service is free: posting your advertisement(sale,service) on various forums. I know these forum addresses,i can post your ad(for sale,service) on various forums. Dear sellers and those who provide any services. I offer you cooperation. My commission is not taken from your amount,my commission is added to your amount. From money received from guarantor,you pay me my commission.  Payment is made on Tether USDT TRC20 or on Tron TRX. Commission for sending from your wallet to my wallet paid by buyer. When communicating via messenger,please tell me what your commission is for sending on Tether USDT TRC20 or on Tron TRX.  Amount(fees) you'll pay as shipping fee to my wallet will be added to total amount. Payment will be made by guarantor to your payment details. Buyer deposits total amount with my percentage. Send me in messenger your ad copy with price(s). Independently from that through which messenger will be communication,buyer suggests using forum guarantor,gives forum address(http address) and send link(http address) to me,link i will pass on to you(seller) for consideration. If you as seller are not satisfied garant service on proposed forum,i say buyer goodbye and he goes to look for his product(service) from someone else,as result i will wait new buyer.   If sale amount is less than $1000,i receive 20 percent above your total amount. If sale amount is more than $1000,i receive 10 percent above your total amount. I do not deal with either buyers or sellers from Ukraine(i do not cooperate with this country). I will not accept any advertising related to Ukraine,as i do not cooperate with this country. For buyers from other countries guarantor's services are entirely at buyer's expense. You can offer me any other area cooperation that does not violate law.  I do not give 100% guarantee that i will accept your offer,which is not initially related to my advertising area.  It is 50/50 that i will either refuse you or accept your offer.  Everything will depend on whether this offer does not violate law.  I will read information about your product(service) in Google search engine that you offer me for advertising and make decision,which i will inform you in messenger for communication.  I will need some time to familiarize myself with information from Google search engine. I'm currently interested in 4 areas: 1)promotional offers with discounts only(coupons or promo codes):food,shoes,clothing,furniture,cosmetics,household appliances,consumer electronics,taxis,bus tickets,train tickets,plane tickets,hotel tickets,gas coupons or promo codes for car owners I do not advertise Ukraine,do not cooperate with it and have no dealings with it. I will not advertise anything related to carding.  Buyer deposits amount for product(service) plus my commission(20 percent based on amount for product or service) into guarantor and then receives their product(service) in forum transaction.  I would be grateful if it were possible for buyer to receive their goods somehow after depositing money with guarantor,without return address or contact information for future purchases. It's not in my best interests for buyer to communicate directly with you after first purchase. If this isn't possible,then you will simply agree with buyer to receive money with my percentage higher than your initial payment each time. If same customer purchases from you second time,customer pay you together with my percentage and i receive this percentage from you,this will provide additional incentive to advertise,i will promoting you on other forums.     2)selling real estate(houses or apartments) I'm not interested renting. I'm willing to advertise all countries except Russia and Ukraine.  I won't advertise these two countries. I don't advertise Ukraine,don't cooperate with it and have no dealings with it. I'm not interested house or apartment listings that appear on Google search pages,as buyer can find information there themselves without my help and buy house or apartment in desired country. I'm interested house or apartment that aren't listed on Google search. How i see this ad:buyer sees my listing for desired country and if they're interested,they deposit 10 percent listed price for house or apartment in Garant Service. Buyer sets  deadline in forum transaction,during which i either receive my money or don't.  Then buyer receive an address,day and time to meet with seller. Buyer takes lawyer and notary with them and flies(or is driving car) to  given address. If purchase transaction falls through,buyer collects their percentage from guarantor. I don't think buyer willing to buy  house or apartment worth more than 12545$ is willing to cheat me out  that 10 percent by making up  fake story about  failed deal.       3)selling telegram premium status Buyer has two options: 1) transaction through guarantor 2) transaction without guarantor   If transaction is through guarantor. I(intermediary) conduct transaction with guarantor. Buyer specifies following terms in terms transaction: 1) i authorize the disclosure of the transaction name to third parties(that is to you) 2) i authorize the disclosure of the seller's payment details(your payment details) to third parties(that is to you) 3) i authorize the disclosure of the total transaction amount to third parties(that is to you) 4) i do not authorize the disclosure of my profile link on this forum to third parties 5) i do not authorize the disclosure of my contact information(if i have any in my profile on this forum) to third parties   If activating premium status requires logging into buyer's account,i will do this.  You will provide me with instructions on how to activate premium status for buyer's account. If you want to contact me about selling premium status on telegram, but my telegram account is unavailable(account is frozen or telegram system has deleted it),you can contact me using my other contact information. To activate premium status by logging into buyer's account,i will download portable version telegram from official website and launch it on my laptop.  I will enter mobile phone number buyer provides me in messenger they originally contacted me through and send login code to this number.  Buyer will then send me login code. Once transaction is finalized and buyer has deposited funds into guarantor's account I'll notify you via messenger. You register on  forum suggested by buyer.  Message guarantor privately on forum,asking them to share all points I've outlined above.  Buyer will provide  link to guarantor's forum profile in advance or you can find guarantor's forum profile on forum yourself,it's up to you to decide. After verifying that your payment details are included and that transaction amount matches amount agreed upon in messenger, you upgrade buyer to premium status. Your payment details are specified in application,in formquestionnaire for forum transaction,but you won't receive money from guarantor until buyer will not receive service(product),as soon as buyer receives service from you,guarantor will pay you. If buyer has received premium status,you receive funds from guarantor and then pay me my commission using my payment details. The fee for sending from your wallet to my wallet is covered by buyer,not you. When communicating via messenger please tell me your fee for sending to Tether USDT TRC20 or Tron TRX. Buyer deposits funds into guarantor with total amount already including my percentage plus buyer's fee for sending,which you will spend by paying me my percentage when transferring from Tether USDT TRC20 or Tron TRX. If transaction is without guarantor. Buyer pays money to your payment details received from me via messenger and waits for service to be rendered. I will inform buyer total amount when communicating via messenger. You upgrade buyer to premium status through me and then you pay me my percentage to my payment details.  If activating premium status requires logging into buyer's account. I will do so.  You will provide me with instructions on how to activate premium status for buyer's account. Fee for sending from your wallet to my wallet is covered by buyer,not you.  When communicating via messenger please tell me your fee for sending to Tether(USDT TRC20) or Tron(TRX). Buyer pays you total amount,including my percentage plus buyer's fee for sending,which you will spend by paying me my percentage when transferring from Tether USDT TRC20 or Tron TRX.       4)i offer cooperation to specialists who provide services for collecting and submitting documents to consulate for citizenship,residence permits,visas and schengen visas I will advertise service collecting and sending documents to consulate only for following countries:Commonwealth of Independent States,Europe,Mexico,United states america,Canada,United Kingdom,Asia,Africa. Russia and Ukraine:these two countries i will not advertise. Buyer pays guarantor(amount from seller) for service for collecting and sending documents to consulate plus my commission(10 or 20 percent based on service fee). Buyer sets deadline in forum transaction within which they must receive service. Then in forum transaction buyer wait provision service. If after specified period(which will be specified in transaction),consulate refuses client's service,you as specialist have right to charge exact amount for your work through guarantor,since you spent your time on it(this clause will be specified in transaction). What will be amount you will decide,send solution through me.I'll let the buyer know. Client does not pay my percentage if consulate refuses client's service(this clause will be specified in transaction).  In case refusal to buyer from consulate you will need to confirm this refusal through website. Whenever you collect and submit documents on country's website,request is created through their website.  You will provide access to this request to guarantor.  This is necessary to ensure that buyer doesn't pay for nothing,meaning amount you will be required to receive through  guarantor for service provided if  consulate's request is unsuccessful.
  • 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..