ntt / reverence

Python library for processing EVE Online cache and bulkdata.
Other
149 stars 36 forks source link

access to other servers than Tranquility and Serenity fails #34

Open IngHarm opened 9 years ago

IngHarm commented 9 years ago

if you try to access other installations with eve = blue.EVE(EVEPATH,SERVER) where SERVER = "Singularity" or SERVER is set to an other IP or Name than Tranquility or Serenity, you will get an UnboundLocalError: local variable 'servername' referenced before assignment

This error occurs because the servername in the _getserver(server) in blue.py is not set. I fixed this in the following code for Singularity:

def _getserver(server):
    if server.replace(".","").isdigit():
        serverip = server or None
    else:
        serverip = _serveraliases.get(server.lower(), None)

    if serverip is None:
        raise ValueError("Invalid server name '%s'. Valid names are '%s' or an IP address." %\
            (server, "', '".join((x.capitalize() for x in _serveraliases))))

    if serverip == "87.237.38.200":
        servername = "Tranquility"
    elif serverip == "211.144.214.68":
        servername = "211.144.214.68"
# Fix for Singularity
    elif serverip == "87.237.38.50":
        servername = "Singularity"
# Fix for all others
    else: 
       servername = serverip

    return servername, serverip
DarkFenX commented 9 years ago

According to my experience (dumps from duality/chaos) it doesn't really matter what are you passing to reverence. For chaos, for which you can't actually have cache (because you can't log into there), just specify path to tq/sisi cache and pass according server name to reverence.