Advertisement
Guest User

test

a guest
Oct 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. import os
  2. import app
  3. import locale
  4. import debugInfo
  5.  
  6. def BuildServerList(orderList):
  7. retMarkAddrDict = {}
  8. retAuthAddrDict = {}
  9. retRegion0 = {}
  10.  
  11. ridx = 1
  12. for region, auth, mark, channels in orderList:
  13. cidx = 1
  14. channelDict = {}
  15. for channel in channels:
  16. key = ridx * 10 + cidx
  17. channel["key"] = key
  18. channelDict[cidx] = channel
  19. cidx += 1
  20.  
  21. region["channel"] = channelDict
  22.  
  23. retRegion0[ridx] = region
  24. retAuthAddrDict[ridx] = auth
  25. retMarkAddrDict[ridx*10] = mark
  26. ridx += 1
  27.  
  28. return retRegion0, retAuthAddrDict, retMarkAddrDict
  29.  
  30. app.ServerName = None
  31. if (locale.IsEUROPE() and app.GetLocalePath()):
  32. STATE_NONE = "Inchis"
  33.  
  34. STATE_DICT = {
  35. 0 : "Inchis",
  36. 1 : "Normal",
  37. 2 : "OCUPAT",
  38. 3 : "PLIN"
  39. }
  40.  
  41. SERVER01_CHANNEL = [
  42. {"name":"CH1 ","ip":"87.243.7.168","tcp_port":19210,"udp_port":19210,"state":STATE_NONE,},
  43. {"name":"CH2 ","ip":"87.243.7.168","tcp_port":19220,"udp_port":19220,"state":STATE_NONE,},
  44. ]
  45. SERVER02_CHANNEL = [
  46. {"name":"CH1 ","ip":"86.105.195.1141","tcp_port":13910,"udp_port":13910,"state":STATE_NONE,},
  47. {"name":"CH2 ","ip":"86.105.195.1141","tcp_port":13920,"udp_port":13920,"state":STATE_NONE,},
  48. {"name":"CH3 ","ip":"86.105.195.1141","tcp_port":13930,"udp_port":13930,"state":STATE_NONE,},
  49. {"name":"CH4 ","ip":"86.105.195.1141","tcp_port":13940,"udp_port":13940,"state":STATE_NONE,},
  50. ]
  51.  
  52.  
  53. SERVER01_MARK = { "ip" : "87.243.7.168", "tcp_port" : 19210, "mark" : "20.tga", "symbol_path" : "20",}
  54. SERVER02_MARK = { "ip" : "87.243.7.168", "tcp_port" : 13910, "mark" : "10.tga", "symbol_path" : "10",}
  55.  
  56.  
  57. SERVER01_AUTH = { "ip":"87.243.7.168", "port":14210, } #PVP World
  58. SERVER02_AUTH = { "ip":"86.105.195.1141", "port":14010, } #PVM World
  59.  
  60.  
  61. SERVER01 = { "name" : "Metin2Fly-Zone Server PVP FUN" }
  62. SERVER02 = { "name" : "Metin2Fly-Zone Server Beta" }
  63.  
  64.  
  65.  
  66. TESTADDR = { "ip" : "210.123.10.153", "tcp_port" : 50000, "udp_port" : 50000, }
  67.  
  68. REGION0_ORDER_LIST = [
  69. (SERVER01, SERVER01_AUTH, SERVER01_MARK, SERVER01_CHANNEL),
  70. (SERVER02, SERVER02_AUTH, SERVER02_MARK, SERVER02_CHANNEL),
  71. ]
  72. # BUILD
  73. NEW_REGION0, NEW_REGION0_AUTH_SERVER_DICT, NEW_MARKADDR_DICT = BuildServerList(REGION0_ORDER_LIST)
  74.  
  75. # RESULT
  76. NEW_REGION_NAME_DICT = {
  77. 0 : "ROMANIA",
  78. }
  79.  
  80. NEW_REGION_AUTH_SERVER_DICT = {
  81. 0 : NEW_REGION0_AUTH_SERVER_DICT,
  82. }
  83.  
  84. NEW_REGION_DICT = {
  85. 0 : NEW_REGION0,
  86. }
  87.  
  88. MARKADDR_DICT = NEW_MARKADDR_DICT
  89. REGION_DICT = NEW_REGION_DICT
  90. REGION_NAME_DICT = NEW_REGION_NAME_DICT
  91. REGION_AUTH_SERVER_DICT = NEW_REGION_AUTH_SERVER_DICT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement