L2 Launcher ?

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
dinor
Posts: 141
Joined: Tue Aug 26, 2008 10:07 am

L2 Launcher ?

Post by dinor »

I was thinking if there is a way to make a launcher for L2 private server without editing hosts file and ofcourse L2.ini.

What i am currently using is a batch file, which i make into exe with the use of a tool (for admin rights):

Code: Select all

@echo offecho 127.0.0.1 localhost > %windir%\system32\drivers\etc\hostsecho xxx.xxx.xxx.xxx L2authd.lineage2.com >> %windir%\system32\drivers\etc\hostsecho xxx.xxx.xxx.xxx L2testauthd.lineage2.com >> %windir%\system32\drivers\etc\hostsecho 216.107.250.194 nProtect.lineage2.com >> %windir%\system32\drivers\etc\hostsecho 216.107.250.194 update.nProtect.com >> %windir%\system32\drivers\etc\hostsecho 216.107.250.194 update.nProtect.net >> %windir%\system32\drivers\etc\hostsstart l2.binexit
In short, this just change your hosts file and start the game.

In Aion project i have seen to do a batch file this way:

Code: Select all

start xxx.bin -ip=xxx.xxx.xxx.xxx -port=xxxx
But unfortunatly it doesn't work for L2.

So my question is. Is there a way to launch a private L2j Server without changing the hosts file or L2.ini??? Just like the way it is in Aion.
Deadmeat
Posts: 286
Joined: Fri Sep 22, 2006 1:03 am
Location: Red Rock, Mars

Re: L2 Launcher ?

Post by Deadmeat »

The Aion BIN/EXE file supports parameters for the IP address and port number which the L2.bin file does not or if it does the parameters are not -ip or -port, you can do this same thing with your batch file like this.

Code: Select all

Test.batecho %1 L2authd.lineage2.com > %2echo %1 L2testauthd.lineage2.com >> %2 
Example: You can type from the command prompt "test.bat 99.99.99.99 test.txt" and you have a new file in the same directory as the test.bat file looking like this.

Code: Select all

test.txt99.99.99.99 L2authd.lineage2.com99.99.99.99 L2testauthd.lineage2.com 
Batch files support parameters after the command like this "Command.bat %1 %2 %3 %4 and so on"
when we type "test.bat 99.99.99.99 test.txt" there is a space between 99.99.99.99 and test.txt so it took the 99.99.99.99 as the first parameter and the test.txt as the second parameter which changed the batch file to look like this

Code: Select all

Test.batecho 99.99.99.99 L2authd.lineage2.com > test.txtecho 99.99.99.99 L2testauthd.lineage2.com >> test.txt
In DOS the echo command by default just echoes back any code type after the command to the screen and in your code your using two pararmeters to redirect what you type to a file and the first pararmeter of "> %windir%\system32\drivers\etc\hosts" will copy your output to a new file named hosts and if the file is already there it will overwrite it and the second parameter of ">> %windir%\system32\drivers\etc\hosts" will append your text to a current file named hosts and will not delete any info in the current file it will just add your text to the end of the file. (BTW: For Windows Vista and Windows 7 users they will have to run this file as administrator or Windows will not let them delete or append any data to any system files.)

For most users this is fine but if you have any users that also use thier computer for work and have any info in the hosts file to connect to any work servers or domains your file will delete this info and they will not be able to connect to there work comupters anymore or if they play any other games that change the hosts file they will not be able to connect to any of those games anymore.
dinor
Posts: 141
Joined: Tue Aug 26, 2008 10:07 am

Re: L2 Launcher ?

Post by dinor »

Thanks for the explaination. Isn't really a way other that editing hosts?

I have tried this solution here viewtopic.php?p=76469#p76409 but gives critical error.
Deadmeat
Posts: 286
Joined: Fri Sep 22, 2006 1:03 am
Location: Red Rock, Mars

Re: L2 Launcher ?

Post by Deadmeat »

That post is talking about using an INI file to pass parameters to the L2.bin file and opening the Developer console window when you first login to the game, it does not show a sample of the INI file so I don't know what parameters it is passing to the L2.bin file and I don't know of any parameters for the L2.bin file so I cannot help you with that, but if you already have the INI file thier talking about make sure when you created it and saved it as a plain text file and not as a rich text file because DOS can only read plain text and cannot read rich text, you can make an INI file for your batch files the same way like this.

test.ini
%1
%2
%3
%4
and so on

So insted of always typing in every parameter you can just type the INI file.
Test.bat %1 %2 %3 %4
or just type
Test.bat test.ini
dinor
Posts: 141
Joined: Tue Aug 26, 2008 10:07 am

Re: L2 Launcher ?

Post by dinor »

I have managed to start the client like this:

Code: Select all

start L2.bin -INI=myl2.txt
where myl2.txt is the decoded (plain text) l2.ini
but whenever i enter world i get disconected and receive this message in console

Code: Select all

SEVERE: Client: [Character: Test[268479860] - Account: Test - IP: 127.0.0.1] - Failed running: [C] 03 EnterWorld - L2J Server Version: 4420M - DP Revision: 7668M ; Could not initialize class java.awt.Rectanglejava.lang.NoClassDefFoundError: Could not initialize class java.awt.Rectangle    at java.awt.Polygon.calculateBounds(Unknown Source)    at java.awt.Polygon.getBoundingBox(Unknown Source)    at java.awt.Polygon.contains(Unknown Source)    at com.l2jserver.gameserver.instancemanager.DimensionalRiftManager$DimensionalRiftRoom.checkIfInZone(DimensionalRiftManager.java:454)    at com.l2jserver.gameserver.instancemanager.DimensionalRiftManager.checkIfInRiftZone(DimensionalRiftManager.java:255)    at com.l2jserver.gameserver.network.clientpackets.EnterWorld.runImpl(EnterWorld.java:436)    at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62)    at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:973)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)    at java.lang.Thread.run(Unknown Source)
If anyone know how to fix this, you are more that welcome.

Deadmeat, i don't think i am allowed to post the l2.ini contets here but i guess one line is ok.
the only line in l2.ini that needs to be changed in order to work is

Code: Select all

ServerAddr= (host)
So, do you think a parameter like this would work?

Code: Select all

start L2.bin -ServerAddr=127.0.0.1
hope
Posts: 1160
Joined: Thu Aug 30, 2007 5:17 pm

Re: L2 Launcher ?

Post by hope »

Read forum rules about client molding
dinor
Posts: 141
Joined: Tue Aug 26, 2008 10:07 am

Re: L2 Launcher ?

Post by dinor »

I am not editing client files.... I am making my own l2.ini and according to MELERIX on this topic viewtopic.php?p=76469#p76409 it's fine.
MELERIX wrote:well, you don't need to modify l2.ini, you can create your own .ini file with other name :P

also you can make a bat file like this...

Code: Select all

@echo offstart l2.bin -INI=YOURINIFILENAME.INI -windowedexit
Deadmeat
Posts: 286
Joined: Fri Sep 22, 2006 1:03 am
Location: Red Rock, Mars

Re: L2 Launcher ?

Post by Deadmeat »

Dinor, Hope is correct you cannot use any code that has been decrypted from NCZoft, I thought you and MELERIX where talking about using a txt file to override the commands for ServerAddr="your IP" and Port=7777 in the L2.ini file and if your just talking about pointing it to a new decrypted version of the L2.ini file than you are still using a MODDED Client and you cannot play dumb with this one and say I just found the code online and did not decrypt it myself, first you have to have the same version of the L2.ini file that your client uses and second you have to encrypt the file again after you change the server address because the server can only read the encrypted version of the file which means you had to decrypt/encrypt the file yourself to get your server IP in the file and if your doing that than why make a batch file to point to the new file when you can just replace the file in the system folder and launch the game from the normal icon?
dinor
Posts: 141
Joined: Tue Aug 26, 2008 10:07 am

Re: L2 Launcher ?

Post by dinor »

Well...
In that point of view, you are right.
But when providing an extra file to override some settings, in my opinion, is not illegal.

Anyway, that wasn't even in my thoughts when i was trying to find a way to do override the "ServerAddr" setting.
I am trying to make a launcher for L2 that will not have to include hosts or L2 files editting.

I have found one more way using the command "route" but it doesn't have "host to ip" redirect. only "ip to ip".

One more thought that i had was if it is possible to create a pseudo-hosts file excusively for L2 game, but haven't find anything about that.

What i actually need is a way to redirect from "L2authd.Lineage2.com to ip" in cmd
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: L2 Launcher ?

Post by jurchiks »

L2authd.Lineage2.com resolves to an ip, for example ping -t L2authd.Lineage2.com > 64.25.35.104
That's in win cmd ofc. If it doesn't "just work", try finding the current IP of the hostname and then route where you want. But really, what's the point?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
dinor
Posts: 141
Joined: Tue Aug 26, 2008 10:07 am

Re: L2 Launcher ?

Post by dinor »

Well, i just want to make a simple launcher, that's all.

a command that will start L2.bin routed to the private server.
Then *.bat to *.exe with admin privileges.

1) because i don't want to share L2 edited files.
2) because many people really don't know how to change hosts file.
3) Some friends play on official as well, it's really troublesome to change hosts all the time.
User avatar
Flashy
Posts: 310
Joined: Mon Sep 29, 2008 11:49 am
Location: Germany

Re: L2 Launcher ?

Post by Flashy »

dinor wrote:Well, i just want to make a simple launcher, that's all.

a command that will start L2.bin routed to the private server.
Then *.bat to *.exe with admin privileges.

1) because i don't want to share L2 edited files.
2) because many people really don't know how to change hosts file.
3) Some friends play on official as well, it's really troublesome to change hosts all the time.
Try to distribute with your updater a small vpn - tunnel application and route the ip to your private server.
no client modding and changes in hosts File is needed this way...
Post Reply