import os
import app
import locale
import debugInfo
def BuildServerList(orderList):
retMarkAddrDict = {}
retAuthAddrDict = {}
retRegion0 = {}
ridx = 1
for region, auth, mark, channels in orderList:
cidx = 1
channelDict = {}
for channel in channels:
key = ridx * 10 + cidx
channel['key'] = key
channelDict[cidx] = channel
cidx += 1
region['channel'] = channelDict
retRegion0[ridx] = region
retAuthAddrDict[ridx] = auth
retMarkAddrDict[ridx*10] = mark
ridx += 1
return retRegion0, retAuthAddrDict, retMarkAddrDict
if (locale.IsEUROPE() and app.GetLocalePath() == "locale/es"):
STATE_NONE = "OFF"
STATE_DICT = {
0 : "....",
1 : "NORM",
2 : "BUSY",
3 : "FULL"
}
SERVER01_CHANNEL_DICT = {
1:{"key":11,"name":"CH1 ","ip":"aqui va la IP","tcp_port":13000,"udp_port":11002,"state":STATE_NONE,},
2:{"key":12,"name":"CH2 ","ip":"aqui va la IP","tcp_port":16000,"udp_port":11002,"state":STATE_NONE,},
# 3:{"key":13,"name":"CH3 ","ip":"aqui va la IP","tcp_port":18000,"udp_port":11002,"state":STATE_NONE,},
# 4:{"key":14,"name":"CH4 ","ip":"aqui va la IP","tcp_port":42000,"udp_port":11002,"state":STATE_NONE,},
# 5:{"key":15,"name":"CH5 ","ip":"aqui va la IP","tcp_port":22000,"udp_port":22000,"state":STATE_NONE,},
}
SERVER02_CHANNEL_DICT = {
1:{"key":21,"name":"CH1 ","ip":"aqui va la IP","tcp_port":18000,"udp_port":31002,"state":STATE_NONE,},
# 2:{"key":22,"name":"CH2 ","ip":"aqui va la IP","tcp_port":20000,"udp_port":22000,"state":STATE_NONE,},
# 3:{"key":23,"name":"CH3 ","ip":"aqui va la IP","tcp_port":22000,"udp_port":22000,"state":STATE_NONE,},
# 4:{"key":24,"name":"CH4 ","ip":"aqui va la IP","tcp_port":42000,"udp_port":42000,"state":STATE_NONE,},
# 5:{"key":25,"name":"CH5 ","ip":"aqui va la IP","tcp_port":22000,"udp_port":22000,"state":STATE_NONE,},
}
SERVER03_CHANNEL_DICT = {
# 1:{"key":31,"name":"CH1 ","ip":"aqui va la IP","tcp_port":13000,"udp_port":13000,"state":STATE_NONE,},
# 2:{"key":32,"name":"CH2 ","ip":"aqui va la IP","tcp_port":32000,"udp_port":32000,"state":STATE_NONE,},
# 3:{"key":33,"name":"CH3 ","ip":"aqui va la IP","tcp_port":32000,"udp_port":32000,"state":STATE_NONE,},
}
SERVER04_CHANNEL_DICT = {
# 1:{"key":41,"name":"CH1 ","ip":"aqui va la IP","tcp_port":32000,"udp_port":32000,"state":STATE_NONE,},
# 2:{"key":42,"name":"CH2 ","ip":"aqui va la IP","tcp_port":32000,"udp_port":32000,"state":STATE_NONE,},
# 3:{"key":43,"name":"CH3 ","ip":"aqui va la IP","tcp_port":32000,"udp_port":32000,"state":STATE_NONE,},
# 4:{"key":44,"name":"CH4 ","ip":"aqui va la IP","tcp_port":32000,"udp_port":32000,"state":STATE_NONE,},
}
SERVER05_CHANNEL_DICT = {
# 1:{"key":51,"name":"CH1 ","ip":"aqui va la IP","tcp_port":12000,"udp_port":12000,"state":STATE_NONE,},
# 2:{"key":52,"name":"CH2 ","ip":"aqui va la IP","tcp_port":12000,"udp_port":12000,"state":STATE_NONE,},
# 3:{"key":53,"name":"CH3 ","ip":"aqui va la IP","tcp_port":12000,"udp_port":12000,"state":STATE_NONE,},
# 4:{"key":54,"name":"CH4 ","ip":"aqui va la IP","tcp_port":12000,"udp_port":12000,"state":STATE_NONE,},
}
REGION_NAME_DICT = {
0 : "SPAIN",
}
REGION_AUTH_SERVER_DICT = {
0 : {
1 : { "ip":"aqui va la IP", "port":11002, },
2 : { "ip":"aqui va la IP", "port":31002, },
# 3 : { "ip":"aqui va la IP", "port":91004, },
# 4 : { "ip":"aqui va la IP", "port":31000, },
# 5 : { "ip":"aqui va la IP", "port":11000, },
}
}
REGION_DICT = {
0 : {
1 : { "name" : "NOMBRE DEL SERVER", "channel" : SERVER01_CHANNEL_DICT, },
2 : { "name" : "NOMBRE DEL SERVER", "channel" : SERVER02_CHANNEL_DICT, },
# 3 : { "name" : "Alba", "channel" : SERVER03_CHANNEL_DICT, },
# 4 : { "name" : "Solsticio", "channel" : SERVER04_CHANNEL_DICT, },
# 5 : { "name" : "Plenilunio", "channel" : SERVER05_CHANNEL_DICT, },
},
}
MARKADDR_DICT = {
10 : { "ip" : "aqui va la IP", "tcp_port" : 13000, "mark" : "10.tga", "symbol_path" : "10", },
20 : { "ip" : "aqui va la IP", "tcp_port" : 13000, "mark" : "20.tga", "symbol_path" : "10", },
}
TESTADDR = { "ip" : "aqui va la IP", "tcp_port" : 50000, "udp_port" : 50000, }
if locale.IsEUROPE():
name = app.GetLocalePath().replace("/", "_") + ".addr"
path = os.sep.join(("pack", name))
if os.access(path, os.R_OK):
print "load_locale_addr:", path
data = app.LoadLocaleAddr(path)
import cPickle
import cStringIO
info = cPickle.load(cStringIO.StringIO(data))
STATE_NONE = "..."
STATE_DICT = {
0 : "....",
1 : "NORM",
2 : "BUSY",
3 : "FULL"
}
REGION_NAME_DICT = info["NAME"]
REGION_AUTH_SERVER_DICT = info["AUTHADDR"]
REGION_DICT = info["GAMEADDR"]
MARKADDR_DICT = info["MARKADDR"]