860312 混服或合服情况下需要指定修改的平台和服务器,Serverid不填写代表不改变只替换spid
| | |
| | | from Collections import (DataServerPlayerData, )
|
| | | DBConfig = __import__('Config.DBConfig')
|
| | |
|
| | |
|
| | | # 没ææå¡å¨ID æ è¯ä¿æåæ¥ç åªæ¹åspid |
| | | def changeAccID(accID, spid, serverid):
|
| | | result = CheckChangeAccID(accID)
|
| | | if not result:
|
| | | return ""
|
| | | accpeice = accID.split("@")
|
| | | if len(accpeice) < 3:
|
| | | return ""
|
| | |
| | | accID = accID.replace("@%s@%s"%(accpeice[-2], accpeice[-1]), "@%s@%s"%(spid, serverid))
|
| | | return accID
|
| | |
|
| | | # æ··ææåææ
åµä¸éè¦æå®ä¿®æ¹çå¹³å°åæå¡å¨
|
| | | def CheckChangeAccID(accID):
|
| | | if not DBConfig.BeforeSpid:
|
| | | return False
|
| | | accpeice = accID.split("@")
|
| | | if DBConfig.BeforeSpid not in accpeice:
|
| | | return False
|
| | | |
| | | if DBConfig.BeforeServerid and DBConfig.BeforeServerid not in accpeice:
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | | def main():
|
| | |
|
| | | print "Connect %s:%s "%(DBConfig.USER_DB_IP, DBConfig.USER_DB_PORT)
|
| | |
| | |
|
| | | #update
|
| | | "Spid":["test", "update"],
|
| | | "Serverid":["s1", "update"], |
| | | "Serverid":["s1", "update"], # 没ææå¡å¨ID æ è¯ä¿æåæ¥ç åªæ¹åspid |
| | |
|
| | | "BeforeSpid":["test", "update"], |
| | | "BeforeServerid":["s1", "update"], |
| | | }
|
| | |
|
| | |
|
| | |
| | | userdb_pwd=sa
|
| | |
|
| | | [update]
|
| | | BeforeSpid=aoyou
|
| | | BeforeServerid=s3
|
| | | Spid=test
|
| | | Serverid=s15
|
| | |
|