Jump to content

eressea

Legendary Member
  • Posts

    534
  • Credits

  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Posts posted by eressea

  1. If you want just to learn and it's not gonna be public server, maybe you should start with leaked C4 files.

     

    If you want to have running server ASAP, without bugs and have support for it, buy IL from AdvExt team (they sell two different Interlude extenders, AdvExt and Vanganth). You can probably buy test version limited to 20 players which is quite cheaper.

  2. So I've been looking into the NASC files to see if I can understand their structure - and I'm honestly more inclined to work with the compiled AI (split txt) files. Is there any reason I shouldn't do this?

     

    I think partly the reason I'm leaning towards the compiled ai, is because of the available documentation that explains it pretty well. Is there any information like this for the NASC files?

     

    Also, when I use the splitAI method, some of the paths/names of the files exceed the windows limit. Do you think you can add the path to the ai folder as an option in the .ini file?

     

    That documentation can be used for NASC as well. It's generally bad idea to edit compiled OBJ code, it's much harder to write it in OBJ code and the NASC code is really much easier to understand.

     

    Just compare this:

    handler 4 13	//  TALK_SELECTED
    	variable_begin
    		"talker"
    		"myself"
    		"_choiceN"
    		"_code"
    		"_from_choice"
    	variable_end
    
    	push_event	//  myself
    	push_const 784			//ShowPage
    	add
    	fetch_i			//ShowPage
    	push_event	//  talker
    	push_const 40			//talker
    	add
    	fetch_i
    S1. "noquest.htm"
    	push_string S1
    	func_call 235012165	//  func[ShowPage]
    	shift_sp -2
    	shift_sp -1
    handler_end
    
    

    and

    	EventHandler TALK_SELECTED(talker)
    	{
    		ShowPage(talker, "noquest.htm");
    	}
    
    

    It's obvious that you'll make fewer mistakes in NASC. Also NCsoft wrote all the AI code in NASC (the compiler we're using is done by NCsoft itself). It's the same as if you asked me whether it's better to do something in C++ sources or in compiled EXE file. Both is possible but the latter one is much much harder.

  3. 
    

    INSERT INTO user_auth (account, password, quiz1, quiz2, answer1, answer2)

    VALUES ('teste', HashBytes('MD5', 'teste123'), '1', '1', CAST('' AS VARBINARY), CAST('' AS VARBINARY));

    INSERT INTO user_account (account, pay_stat, login_flag, warn_flag, block_flag, block_flag2, subscription_flag)

    VALUES ('teste', 1, 0, 0, 0, 0, 0);

  4. So you're using old NCsoft hash. You should use at least MD5Simple, just change 

    MD5Simple=0

     to 

    MD5Simple=1

    and then you can create user account this way:

    INSERT INTO user_auth (account, password, quiz1, quiz2, answer1, answer2, new_pwd_flag, lastat)
        VALUES ('mylogin', HashBytes('MD5', 'mypassword'), '1', '1', CAST('' AS VARBINARY), CAST('' AS VARBINARY), 0, NULL);
    INSERT INTO user_account (account, pay_stat, login_flag, warn_flag, block_flag, block_flag2, subscription_flag)
        VALUES ('mylogin', 1, 0, 0, 0, 0, 0);
  5. Whole l2npc.exe is just a huge virtual machine running ai.obj.

     

    Txt files (or ai.obj) = compiled AI

    NASC files = AI sources

     

    There are few "decompilers" that can convert compiled AI back to source (usually with few errors that must be fixed manually)

     

    If you really want to do anything bigger with AI, you should start from sources. Editing ai.obj code is pain in the ass and also it usually prevents "decompilation" (decompilers don't use any real heuristic to analyze the code, they just know some patterns and know how to convert them back to NASC code, so if you do some manual changes in obj, decompiler probably won't be able to decompile it)

  6. Do you have a way of automating the creation of classes.txt file for split AI? Or do you just add all file names and rearrange them by hand?

     

    I have a python script that joins nasc files into one big nasc file, runs compiler on it and then splits it again to individual classes and generates classes.txt file

     

    http://download.l2shrine.com/makeai/ai.tar.gz

  7. It's additional proxy or you just have server behind NAT and need port forwarding?

     

    If it's just port forwarding, you don't need anything else than DNAT and enabling IPv4 forwarding

    sysctl net.ipv4.ip_forward=1
    

    Also packets from server must go back through the proxy (it must be default gateway for the server)

     

     

    If it's real proxy (another server endpoint):

     

    http://www.maxcheaters.com/topic/206180-patched-hauth-to-support-multiple-ip-addressesproxies/?hl=hauthd

     

    Also you'll have to learn something about policy-based routing because when you have two endpoints, server will still send packets via default gateway - which will be your primary IP address. So if packet comes to l2server via proxy, it must go back to client via the very same proxy - not via default gateway.

     

    You should read something about it (google linux policy based routing), this can help you a bit:

     

    On router:

     

    Mark incoming packets and restore mark for outgoing packets:

     

    iptables -t mangle -A PREROUTING -i tun0 -p tcp -m tcp --dport 7777 -j CONNMARK --set-mark 100 # mark packets from 1st proxy
    iptables -t mangle -A PREROUTING -i tun1 -p tcp -m tcp --dport 7777 -j CONNMARK --set-mark 101 # mark packets from 2nd proxy
    iptables -t mangle -A PREROUTING -i tun2 -p tcp -m tcp --dport 7777 -j CONNMARK --set-mark 102 # mark packets from 3rd proxy
    iptables -t mangle -A PREROUTING -i br1 -p tcp -m tcp --sport 7777 -j CONNMARK --restore-mark # restore mark on packets going back
    
    Use policy-based routing based on packet mark:
     
    ip rule add fwmark 100 table 100 # if packet is marked as from 1st proxy, use routing table 100
    ip route add default via 10.8.0.1 table 100 # routing table 100 - default gateway is 1st proxy internal address
    ip rule add fwmark 101 table 101 # if packet is marked as from 2nd proxy, use routing table 101
    ip route add default via 10.8.1.1 table 101 # routing table 101 - default gateway is 2nd proxy internal address
    ip rule add fwmark 102 table 102 # if packet is marked as from 3rd proxy, use routing table 102
    ip route add default via 10.8.2.1 table 102 # routing table 102 - default gateway is 3rd proxy internal address
    
    On proxy:
     
    up iptables -t nat -A PREROUTING -m tcp -p tcp --dport 7777 -j DNAT --to-destination 10.8.0.2:7777
    
  8. You can write something that would periodically monitor server/log/chat folder (for example each second), when new file appears, open it and monitor it too - and process it until another new file appears (then just read the "old" file to the end and close it and conitnue with the new file). By "processing it" I mean reading it line-by-line, parsing that line (to get datetime, chat type, character name, recipient name (if it's PM) and insert it all to some database).

     

    I would recommend using different database than the one l2cached uses - not necessarily different database server, but at least different database...

     

    Of course there are other ways, for example getting logd from Master Toma - if I got it correctly, that would make it log everything to database.

     

    Other way is changing chat log function in l2server (with extender of course) to log it somewhere else. In that case make sure it's nonblocking (asynchronous), otherwise it will cause lags.

  9. can you post error log pls... othewise noone will be able to help u

    blabing error does not mean anything... be specific or do not w8 for magic help

    laters

    We've already discussed it via PM. The problem is you must use patched l2npc as well (vanilla l2npc does work only with gracia final; patched means it uses MyExt64.dll)

     

    http://download.l2shrine.com/L2NPCMyExt64.exe

×
×
  • Create New...