import os
import app
import localeInfo
SERVER_IP = "62.109.3.202"
import os
import app
import localeInfo
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
app.ServerName = None
STATE_NONE = localeInfo.CHANNEL_STATUS_OFFLINE
STATE_DICT = {
0 : localeInfo.SERVER_OFF,
1 : localeInfo.SERVER_NORM,
2 : localeInfo.CHANNEL_STATUS_RECOMMENDED,
3 : localeInfo.SERVER_BUSY,
4 : localeInfo.SERVER_FULL,
}
STATE_REVERSE_DICT = {}
STATE_COLOR_DICT = { "..." : 0xffdadada}
STATE_COLOR_LIST = [ 0xffffffff, 0xffdadada, 0xff00ff00, 0xffffc000, 0xffff0000 ]
idx = 0
for key, value in STATE_DICT.items():
STATE_REVERSE_DICT[value] = key
STATE_COLOR_DICT[value] = STATE_COLOR_LIST[idx%len(STATE_COLOR_LIST)]
idx += 1
SERVER_STATE_DICT = {
"NONE" : 0,
"NEW" : 1,
"SPECIAL" : 2,
"CLOSE" : 3
}
SERVER01_CHANNEL_DICT = {
1 : {
"key" : 11,
"name" : "CH1 ",
"ip" : SERVER_IP,
"tcp_port" : 13001,
"udp_port" : 13001,
"state" : STATE_NONE,
},
2 : {
"key" : 12,
"name" : "CH2 ",
"ip" : SERVER_IP,
"tcp_port" : 13011,
"udp_port" : 13011,
"state" : STATE_NONE,
},
3 : {
"key" : 13,
"name" : "CH3 ",
"ip" : SERVER_IP,
"tcp_port" : 13021,
"udp_port" : 13021,
"state" : STATE_NONE,
},
4 : {
"key" : 14,
"name" : "CH4 ",
"ip" : SERVER_IP,
"tcp_port" : 13031,
"udp_port" : 13031,
"state" : STATE_NONE,
},
5 : {
"key" : 15,
"name" : "CH5 ",
"ip" : SERVER_IP,
"tcp_port" : 13041,
"udp_port" : 13041,
"state" : STATE_NONE,
},
6 : {
"key" : 16,
"name" : "CH6 ",
"ip" : SERVER_IP,
"tcp_port" : 13051,
"udp_port" : 13051,
"state" : STATE_NONE,
},
}
REGION_NAME_DICT = {
0 : "",
}
REGION_AUTH_SERVER_DICT = {
0 : {
1 : { "ip" : SERVER_IP, "port" : 11000, },
}
}
REGION_DICT = {
0 : {
1 : { "name" :"Metin2", "channel" : SERVER01_CHANNEL_DICT, "state" : "SPECIAL",},
},
}
MARKADDR_DICT = {
10 : { "ip" : SERVER_IP, "tcp_port" : 13001, "mark" : "10.tga", "symbol_path" : "10", },
20 : { "ip" : SERVER_IP, "tcp_port" : 13011, "mark" : "10.tga", "symbol_path" : "20", },
30 : { "ip" : SERVER_IP, "tcp_port" : 13021, "mark" : "10.tga", "symbol_path" : "30", },
40 : { "ip" : SERVER_IP, "tcp_port" : 13031, "mark" : "10.tga", "symbol_path" : "40", },
50 : { "ip" : SERVER_IP, "tcp_port" : 13041, "mark" : "10.tga", "symbol_path" : "50", },
60 : { "ip" : SERVER_IP, "tcp_port" : 13051, "mark" : "10.tga", "symbol_path" : "60", },
}