sync_game_data/config.py
2020-12-28 17:59:49 +08:00

408 lines
11 KiB
Python

import os
from loguru import logger
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
logger.add(os.path.join(BASE_DIR, 'log.log'), format="{time} {level} {name}:{line} {message}", level="INFO",
rotation="100 MB", retention='7 days',
enqueue=True)
class Config:
# 国外服务器连接时间较长 不要低于3s
TIMEOUT_MS = 5000 # 5秒
TIMEOUT = 5 # 5秒
KV_PREFIX = 'lastActTime_'
SERVER_LIST_URL = "http://gametools.legu.cc/?app=api&act=getServerList&showdb=1"
GAME_MANA_MYSQLDB = {
"host": "10.0.0.5",
"port": 3306,
"user": "root",
"password": "87251326",
"db": "gamemana"
}
PAY_DB = {
'zhengba': {
"host": "zhengbaapi.legu.cc",
"port": 3306,
"user": "root",
"password": "SH9Pjrcr52ZJJhDT",
"db": "zhengbadata"
},
'heros': {
"host": "homm1.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "hommdata"
},
'fengshen': {
"host": "fs1.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "fsdata"
},
'geshouh5': {
"host": "134.175.135.230",
"port": 3306,
"user": "root",
"password": "v4rNd4aeMMftNGf",
"db": "mzgeshou"
},
'geshouccs': {
"host": "gsccsapi.legu.cc",
"port": 3306,
"user": "root",
"password": "v4rNd4aeMMftNGf",
"db": "gsccsdata"
},
'junshibig5': {
"host": "junshibig5.legu.cc",
"port": 3306,
"user": "root",
"password": "i0OBWUsLlLiM",
"db": "jsbig5data"
},
'xiaoying': {
"host": "106.52.175.193",
"port": 3306,
"user": "root",
"password": "KyQCGS9UIrgs",
"db": "yingdata"
},
'xiaoyingmicro': {
"host": "ying.legu.cc",
"port": 3306,
"user": "root",
"password": "2lRZPbspGI5p",
"db": "yingdata"
},
'legusg': {
"host": "homm1.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "legusgdata"
},
'legujs': {
"host": "39.104.110.225",
"port": 3306,
"user": "root",
"password": "PFxqdwDmPhvCUDDe",
"db": "legujsdata"
},
'daqin': {
"host": "daqinapi.legu.cc",
"port": 3306,
"user": "root",
"password": "XZKcs6eG4YMFFPqM",
"db": "daqin"
},
'mzmfmh5': {
"host": "mzhomms.legu.cc",
"port": 3306,
"user": "root",
"password": "jm8dKqsXcxcP42Cd",
"db": "mzhero"
},
'mth5': {
"host": "v3.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "mth5data"
},
'xpet': {
"host": "xpetapi.weirongwl.com",
"port": 3306,
"user": "root",
"password": "a5hsSZU8ELb77f64",
"db": "xpetdata"
},
'shaihai': {
"host": "42.194.158.84",
"port": 3306,
"user": "root",
"password": "EawHvVBmSxhbPKJX",
"db": "shanhaidata"
},
'wow': {
"host": "wow1.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "wowdata"
},
'gods': {
"host": "god1.legu.cc",
"port": 3306,
"user": "root",
"password": "TwmFYZcLhNN3vvK6",
"db": "goddata"
},
'jiushen': {
"host": "jiushenapi.legu.cc",
"port": 3306,
"user": "root",
"password": "9XqfSduK6Wx7359S",
"db": "jiushendata"
},
'sanguo': {
"host": "sanguo1.legu.cc",
"port": 3306,
"user": "root",
"password": "mQaDz8wcvEaKEZAY",
"db": "sgdata"
},
'tank': {
"host": "tankapi.legu.cc",
"port": 3306,
"user": "root",
"password": "lG1x4cJWXyIm",
"db": "tankdata"
},
'mt': {
"host": "mtapi.legu.cc",
"port": 3306,
"user": "root",
"password": "juP4jBaq9VMGVH9F",
"db": "mtdata"
},
'zhengbaen': {
"host": "fbenapi.legu.cc",
"port": 3306,
"user": "root",
"password": "2dGLdzypRZ6YBFaw",
"db": "fbendata"
},
'zhengbavn': {
"host": "fbvnapi.legu.cc",
"port": 3306,
"user": "root",
"password": "q9n3fseQmtfztNnd",
"db": "fbvndata"
},
'zhengbakr': {
"host": "fbkrapi.legu.cc",
"port": 3306,
"user": "root",
"password": "XeuT9QNHyBuR8jE5",
"db": "fbkoredata"
},
'zhengbabig5': {
"host": "fbbig5api.legu.cc",
"port": 3306,
"user": "root",
"password": "4EyM8FyPh6waHhe5",
"db": "fbbig5data"
},
'jqzb': {
"host": "yaolingapi.legu.cc",
"port": 3306,
"user": "root",
"password": "xwjJ6mcMZuWHWs78",
"db": "yaolingdata"
},
'hommh5': {
"host": "hommweb1.legu.cc",
"port": 3306,
"user": "root",
"password": "jMNxqdDpGFLjM8wW",
"db": "hommh5data"
},
'king': {
"host": "homm1.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "kingdata"
},
'zgpromvbt': {
"host": "dzgbt2019115.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "dzgbt2019115"
},
'dzgbt': {
"host": "homm1.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "dzgbt"
},
'dasanguo': {
"host": "homm1.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "dsgdata"
},
'xiyou': {
"host": "ft5.legu.cc",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "xydata"
},
# 'wuxia___':{
# "host":"127.0.0.1", #v3.legu.cc
# "port":3306,
# "user":"root",
# "password":"iamciniao",
# "db":"xydata"
# },
# 'xycsb___':{
# "host":"123.59.138.88",
# "port":3306,
# "user":"root",
# "password":"iamciniao",
# "db":"baigu"
# },
# 'yxwhm___':{
# "host":"115.159.98.163",
# "port":3306,
# "user":"root",
# "password":"iamciniao",
# "db":"xydata"
# },
'mori': {
"host": "119.29.222.234",
"port": 3306,
"user": "root",
"password": "56EnChDEnT9cmC9w",
"db": "shenghuadata"
},
'mfm2': {
"host": "mfmccsapi.legu.cc",
"port": 3306,
"user": "root",
"password": "nyVcHvwFAPjn83yX",
"db": "mfmccsdata"
},
'zhengbath': {
"host": "zhengbathapi.legu.cc",
"port": 3306,
"user": "root",
"password": "q9n3fseQmtfztNnd",
"db": "zbthdata"
},
'geshouccsqd': {
"host": "gsccsqudaoapi.legu.cc",
"port": 3306,
"user": "root",
"password": "NJM4n4hJdQwPwr3d",
"db": "gsccsqddata"
},
'huixie': {
"host": "140.143.150.125",
"port": 3306,
"user": "root",
"password": "Qp4v9NBTbMzKKMuH",
"db": "huixiedata"
},
'lgjsbtcv': {
"host": "39.104.110.225",
"port": 3306,
"user": "root",
"password": "PFxqdwDmPhvCUDDe",
"db": "legujssupervdata"
},
'hxsgjzhaiwai': {
"host": "150.109.21.229",
"port": 3306,
"user": "root",
"password": "64pUdAMhsn4aKcA5",
"db": "hxhaiwaidata"
},
'fengbaoqibing': {
"host": "8.129.229.202",
"port": 3306,
"user": "root",
"password": "GUQv6HJ64dPtvANs",
"db": "fbqbdata"
},
'hanhaih5': {
"host": "buluoh5api.legu.cc",
"port": 3306,
"user": "root",
"password": "sJsxbjdfkn213Sas",
"db": "buluoh5data"
},
'zgzhanchui': {
"host": "zgzhanchuiapi.legu.cc",
"port": 3306,
"user": "root",
"password": "DnSqA69JwdZ29JFv",
"db": "zgzcdata"
},
'jsm5bt': {
"host": "jsm5btapi.legu.cc",
"port": 3306,
"user": "root",
"password": "XZKcs6eG4YMFFPqM",
"db": "jsbtdata"
},
'shenghuajiyuan2': {
"host": "119.29.222.234",
"port": 3306,
"user": "root",
"password": "56EnChDEnT9cmC9w",
"db": "shjy30data"
},
'xinyaoling': {
"host": "xinyaolingapi.legu.cc",
"port": 3306,
"user": "root",
"password": "LtpaL4aLK9nN3N7f",
"db": "xinyaolingdata"
},
# 'mth5bt': {
# "host": "127.0.0.1",
# "port": 3306,
# "user": "root",
# "password": "iamciniao",
# "db": "mtbth5data"
# }
}
class DevConfig(Config):
GAME_MANA_MYSQLDB = {
"host": "10.0.0.5",
"port": 3306,
"user": "root",
"password": "87251326",
"db": "gamemana"
}
PAY_DB = {
'mori': {
"host": "119.29.222.234",
"port": 3306,
"user": "root",
"password": "56EnChDEnT9cmC9w",
"db": "shenghuadata"
},
}
class ProductionConfig(Config):
GAME_MANA_MYSQLDB = {
"host": "127.0.0.1",
"port": 3306,
"user": "root",
"password": "iamciniao",
"db": "gamemana"
}
settings = ProductionConfig()