![]() |
|
|
#1 |
|
Архивный участник
Join Date: Jul 2005
Posts: 108
|
Let me make some things clear first
what this is NOT: - tutorial for setting up L2 off server - tutorial for troubleshooting a non working L2 off server I assume that you are already familiar with the processes of L2 server and you know the database the l2 uses well... I assume that your L2 server works well ( you can connect and play on your server ) I assume that the l2authd.exe program runs on the same machine as the MSSQL Database I also assume that your internet connection is on the machine where the l2authd program runs. First of all you need a dynamic domain, dont worry, there are hundreds free out there. I recommend http://www.dyndns.org. For the purpose of this tutorial i will assume you registered l2serv.dyndns.org domain After you made your account and created a Dynamic DNS domain you need a program that can update your ip to the domain every time it changes. Use this one: http://www.directupdate.net/download.html i will explain why. (this is not freeware, expires in 60 days, but i'm sure you will find ways )Install it on the machine where the DSN files reside. ( you will need the lin2db.dsn that you already created. By default it is in: C:\Program Files\Common Files\ODBC\Data Sources\lin2db.dsn) After installation, setup your account that you made at the DynDNS site in the DirectUpdate program. After you make sure that the DirectUpdate updates your ip to the domain correctly every time it changes. You will need the following javascript script that i made for this purpose: Code:
var args = WScript.Arguments;
var Wsh = new ActiveXObject("WScript.Shell");
//Terminates the l2authd program
Wsh.Exec("taskkill /F /IM l2authd.exe");
//Wait 3 seconds
WScript.Sleep(3000);
//Connect to MSSQL
var conn = new ActiveXObject("ADODB.Connection");
//Change this path to whatever path you have the lin2db.dsn file
conn.Open("File Name=C:\\Program Files\\Common Files\\ODBC\\Data Sources\\lin2db.dsn")
//Update the ip taken from the argument to the server with world id 1
conn.Execute("UPDATE server SET ip='"+args(0)+"' WHERE id=1");
conn.Close();
WScript.Sleep(3000);
//Run again the l2authd server
/* Change the command to your settings
for example cmd /D /C DRIVE & CD DRIVE:\\path\\to\\l2authd\\ & l2authd.exe
*/
Wsh.Run("cmd /D /C D: & CD D:\\ProjectC2-Beta3-Final\\NewAuth & l2authd.exe");
//This should work just fine, otherwise you did something wrong, double check paths...
Now you need to open the administration module of direct update and select Actions and do the following: "When a new Ip is detected..." check: Launch the external application click modify Full path: %windir%\system32\wscript.exe Parameters: \your\path\to\updateip.js *IP* Sample image follows: ![]() You can click test to see if it works correctly. If it doesn't then you did something wrong! Let me assure you that terminating and restarting the l2authd server does not crash neither the L2server nor the L2npc and the l2server will always try to reconnect to the l2authd. Now all you need to do is to put the address you registered on the dyndns site to your l2.ini ServerAddr=l2serv.dyndns.org After that you should be able to connect to your server anytime after the ip changes and no further actions should be required ![]() Feel free to modify the javascript code and improve it if you like ![]() It's kind of quick and dirty solution but works ![]() Give me feedback of success/failure stories ![]() Hope that tutorial helps cheers(excuse my english, I'm greek :P) |
|
|
|
|