Imagine serverinfo.py

Cod: Selectaţi tot
import locale
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():
STATE_NONE = '...'
STATE_DICT = {
0 : 'NORM',
1 : 'NORM',
2 : 'BUSY',
3 : 'FULL',
}
CHANNELS1 = [
{'name':'CH1','ip':'192.168.56.100','tcp_port':13080,'udp_port':13080,'state':STATE_NONE,},
{'name':'CH2','ip':'192.168.56.100','tcp_port':13081,'udp_port':13081,'state':STATE_NONE,},
]
CHANNELS2 = [
{'name':'CH1','ip':'192.168.56.100','tcp_port':13080,'udp_port':13080,'state':STATE_NONE,},
{'name':'CH2','ip':'192.168.56.100','tcp_port':13081,'udp_port':13081,'state':STATE_NONE,},
]
MARK1 = { 'ip' : '192.168.56.100', 'tcp_port' : 13000, 'mark' : '120.tga', 'symbol_path' : '120', }
MARK2 = { 'ip' : '192.168.56.100', 'tcp_port' : 13000, 'mark' : '120.tga', 'symbol_path' : '120', }
AUTH1 = {'ip':'192.168.56.100','port':11082, }
AUTH2 = {'ip':'192.168.56.100','port':11082, }
NAME1 = { 'name' : 'Metin2IH'}
NAME2 = { 'name' : 'Metin2IH'}
REGION0_ORDER_LIST = [
(NAME1, AUTH1, MARK1, CHANNELS1),
(NAME2, AUTH2, MARK2, CHANNELS2),
]
NEW_REGION0, NEW_REGION0_AUTH_SERVER_DICT, NEW_MARKADDR_DICT = BuildServerList(REGION0_ORDER_LIST)
# RESULT
NEW_REGION_NAME_DICT = {0 : 'POLAND',}
NEW_REGION_AUTH_SERVER_DICT = {0 : NEW_REGION0_AUTH_SERVER_DICT,}
NEW_REGION_DICT = {0 : NEW_REGION0,}
MARKADDR_DICT = NEW_MARKADDR_DICT
REGION_DICT = NEW_REGION_DICT
REGION_NAME_DICT = NEW_REGION_NAME_DICT
REGION_AUTH_SERVER_DICT = NEW_REGION_AUTH_SERVER_DICT
TESTADDR = { 'ip' : '192.168.56.100', 'tcp_port' : 50000, 'udp_port' : 50000, }
Utilizatori ce ce navighează pe acest forum: Google [Bot] și 52 vizitatori