Jump to content

eressea

Legendary Member
  • Posts

    534
  • Credits

  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Community Answers

  1. eressea's post in AI parameters was marked as the answer   
    Hi, it's about what's the NPC is doing:
     
    PSTATE_IDLE=0
    PSTATE_MOVE_AROUND=1
    PSTATE_DO_NOTHING=2
    PSTATE_ATTACK=3
    PSTATE_CHASE=4
    PSTATE_FLEE=5
    PSTATE_GET_ITEM=6
    PSTATE_FOLLOW=7
    PSTATE_DECAYING=8
    PSTATE_MOVE_TO_WAY_POINT=9
    PSTATE_USE_SKILL=10
    PSTATE_MOVE_TO=11
    PSTATE_EFFECT_ACTION=12
    PSTATE_EFFECT_ACTION2=13
    PSTATE_PET_DEFAULT=14
    PSTATE_MOVE_TO_TARGET=15
    PSTATE_MOVE_SUPERPOINT=16
    PSTATE_MOVE_FREEWAY=17
  2. eressea's post in Interlude Vanganth and Dynamic IP was marked as the answer   
    Probably there is some way but this is much easier:
    #!/usr/bin/env python from urllib import urlopen from json import loads from sys import stderr from time import sleep from subprocess import Popen from socket import inet_aton from threading import Thread period = 60.0 # seconds serverId = 1 # server ID sqlcmd = "C:\\Program Files (x86)\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\SQLCMD.EXE" # put correct path here! server = "(local)\SQLExpress" # put correct server string here! database = "lin2db" # database name hauthd = "C:\\l2\\auth\\hauthd.exe" # put correct path here! class HauthdThread(Thread): def __init__(self): Thread.__init__(self) self.hauthdProcess = None self.doRun = True def run(self): while self.doRun: self.hauthdProcess = Popen([hauthd]) self.hauthdProcess.wait() self.hauthdProcess = None def stop(self): self.doRun = False if self.hauthdProcess != None: self.hauthdProcess.kill() def restart(self): self.hauthdProcess.kill() currentIp = None ipUpdated = False hauthdThread = None try: while True: try: newIp = loads(urlopen("https://api.ipify.org?format=json").read())["ip"] if newIp != currentIp: inet_aton(newIp) # check IP print >> stderr, "New IP address:", newIp currentIp = newIp isUpdated = False except KeyboardInterrupt, e: raise except: print >> stderr, "Couldn't get current IP address, will retry later" sleep(period) continue if isUpdated: sleep(period) continue try: popen = Popen([sqlcmd, "-S", server, "-d", database, "-Q", "UPDATE dbo.server SET ip='%s' WHERE id=%s" % (currentIp, serverId, )], shell = True) popen.wait() isUpdated = True if hauthdThread == None: hauthdThread = HauthdThread() hauthdThread.start() else: hauthdThread.restart() except KeyboardInterrupt, e: raise except: print >> stderr, "Couldn't update IP address, will try later" sleep(period) except: hauthdThread.stop() hauthdThread.join() raise  
  3. eressea's post in Giran private shop restrictions was marked as the answer   
    Moved to correct section.
     
     
     
    EDIT: As for the no-trade zones, this can be found in leaked Gracia Final (in areadata.txt):
     
    area_begin name=[giran_town_shop13] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{83845;147579;-3400;-2400};{83845;149611;-3400;-2400};{82712;149553;-3464;-2400};{82723;147649;-3464;-2400}} area_end
    area_begin name=[giran_town_shop14] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{82723;147649;-3464;-2464};{82710;147886;-3464;-2464};{80904;147892;-3464;-2464};{80905;147650;-3464;-2464}} area_end
    area_begin name=[giran_town_shop15] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{81451;147699;-3464;-2464};{81696;147699;-3464;-2464};{81684;143459;-3528;-2528};{81444;143429;-3536;-2536}} area_end
    area_begin name=[giran_town_shop16] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{81438;146977;-3528;-2528};{81435;146827;-3528;-2528};{81068;146830;-3528;-2528};{81052;147001;-3528;-2528}} area_end
     
    and we use this on L2 Shrine:
     
    area_begin name=[giran_town_shop_restrict1] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{82956;147657;-3600;-3000};{82956;149557;-3600;-3000};{82707;149557;-3600;-3000};{82707;147657;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict2] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{82707;147657;-3600;-3000};{80908;147657;-3600;-3000};{80908;147895;-3600;-3000};{82707;147895;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict3] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{80908;147895;-3600;-3000};{80908;149557;-3600;-3000};{81153;149557;-3600;-3000};{81153;147895;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict4] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{81153;149557;-3600;-3000};{82707;149557;-3600;-3000};{82707;149313;-3600;-3000};{81153;149313;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict5] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{85825;147947;-3600;-3000};{85825;147073;-3600;-3000};{83596;147073;-3600;-3000};{83596;147947;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict6] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{83085;147468;-3600;-3000};{83773;147468;-3600;-3000};{83773;149771;-3600;-3000};{83085;149771;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict7] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{83773;149273;-3600;-3000};{83773;149771;-3600;-3000};{85106;149771;-3600;-3000};{85106;149273;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict8] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{83085;149566;-3600;-3000};{82956;149566;-3600;-3000};{82956;147657;-3600;-3000};{83085;147657;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict9] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{81664;147657;-3600;-3000};{81664;146789;-3600;-3000};{81422;146789;-3600;-3000};{81422;147657;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict10] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{81422;147032;-3600;-3000};{80564;147032;-3600;-3000};{80564;146789;-3600;-3000};{81422;146789;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict11] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{80564;146789;-3600;-3000};{80564;146353;-3600;-3000};{80862;146353;-3600;-3000};{80862;146789;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict12] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{81990;147657;-3600;-3000};{81990;147467;-3600;-3000};{82211;147467;-3600;-3000};{82211;147657;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict13] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{80908;148723;-3600;-3000};{80908;148517;-3600;-3000};{80440;148517;-3600;-3000};{80440;148723;-3600;-3000}} area_end
    area_begin name=[giran_town_shop_restrict14] map_no = {22;22} type=peace_zone blocked_actions={priv_store;priv_rstore} range = {{81671;149557;-3600;-3000};{81413;149557;-3600;-3000};{81413;149982;-3600;-3000};{81671;149982;-3600;-3000}} area_end
     
  4. eressea's post in Clan dismiss penalty was marked as the answer   
    Are you sure you’re asking in right section? This is for l2off. If you want to change it in l2j, comment out lines 2231-2235 in https://bitbucket.org/l2jserver/l2j_server/src/775bcf917d84c47c3a13073df122204a463a8527/src/main/java/com/l2jserver/gameserver/model/L2Clan.java?at=develop&fileviewer=file-view-default
     
    Please someone move it to proper section :)
  5. eressea's post in Proxy With Hauthd was marked as the answer   
    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
  6. eressea's post in Max Level Cap was marked as the answer   
    Your extender must support it
  7. eressea's post in Adding Npcs was marked as the answer   
    I'm not sure about it but I don't like the ID 1337001 - try something lower (range 32000-33000 should be available and ok)
  8. eressea's post in Xdat Editor Is Die was marked as the answer   
    what if you create new bat file with
     
    javaw -jar libs/editor.jar
     
    ?
  9. eressea's post in Help With Local Mode was marked as the answer   
    Just a wild guess (until you send some picture), what address do you have in lin2db.dbo.server in column ip? If it's 127.0.0.1, you need to put your LAN IP there - you can obtain it from ipconfig
  10. eressea's post in Python String Count() Method was marked as the answer   
    Do you mean something like this?
     
    count1 = st.getQuestItemsCount(Item1)
    count2 = st.getQuestItemsCount(Item2)
    if count1 > 0 and count2 > 0:
        # some code
     
  11. eressea's post in What Error Is It This ? was marked as the answer   
    Seems like you have some protection against SQL injections and you have apostrophe (') in string coming to the database.
    If it automatically escapes it to \', everything should be OK. If not, get some better protection :)
×
×
  • Create New...