diff --git a/config_sample.ini b/config_sample.ini index 3f27a07..a443b21 100644 --- a/config_sample.ini +++ b/config_sample.ini @@ -59,6 +59,12 @@ password = userid = session = +[account_cn3] +username = +password = +userid = +session = + [account_cn] username = password = diff --git a/maclient.py b/maclient.py index 0790190..cf7be0b 100644 --- a/maclient.py +++ b/maclient.py @@ -110,8 +110,7 @@ def __init__(self,configfile='',savesession=False): if ua!='': logging.debug('system:ua changed to %s'%(ua)) self.poster=maclient_network.poster(self.loc,logging,ua) - self.cookie=self._read_config('account_%s'%self.loc,'session') - self.poster.set_cookie(self.cookie) + self.load_cookie() if self.cfg_save_traffic: self.poster.enable_savetraffic() #eval @@ -157,6 +156,10 @@ def load_config(self): logging.setlogfile('events_%s.log'%self.loc) self.cfg_delay=float(self._read_config('system','delay')) self.cfg_display_ani=(self._read_config('system','display_ani') or '1')=='1' + + def load_cookie(self): + self.cookie=self._read_config('account_%s'%self.loc,'session') + self.poster.set_cookie(self.cookie) def set_remote(self,remoteInstance): self.remote=remoteInstance @@ -405,7 +408,7 @@ def tasker(self,taskname='',cmd=''): resp,ct=self._dopost('mainmenu')#初始化 def login(self,uname='',pwd='',fast=False): - sessionfile='.%s.session'%self.loc + #sessionfile='.%s.session'%self.loc if os.path.exists(self.playerfile) and self._read_config('account_%s'%self.loc,'session')!='' and uname=='': logging.info(du8('加载了保存的账户XD')) dec=open(self.playerfile,'r').read().encode('utf-8') @@ -818,7 +821,8 @@ def _gacha(self,gacha_type=GACHA_FRIENNSHIP_POINT): rare=['R','R+','SR','SR+'] rare_str=' '+rare[self.carddb[int(mid)][1]-3] else: - rare_str=' ' + rare=['','','','R+','SR','SR+'] + rare_str=' %s'%(rare[self.carddb[int(mid)][1]-1]) excname.append('[%s]%s%s'%( self.carddb[int(mid)][0], self.player.card.sid(card.serial_id).holography =='1' and '-HOLO' or '', @@ -1091,22 +1095,22 @@ def fairy_floor(f=fairy): for k in maclient_smart.name_wake_rare: fairy['wake_rare']=fairy['wake_rare'] or k in fairy.name fairy['wake']= fairy.rare_flg=='1' or fairy['wake_rare'] - if 'attacker' not in fairy.attacker_history: - fairy.attacker_history.attacker=[] - if fairy.attacker_history.attacker==[]: + if 'attacker' not in fairy.attacker_history:#没人打过肯定是自己发现的 + f_attackers=[] disc_name=self.player.name else: + f_attackers=self.tolist(fairy.attacker_history.attacker) ##只有一个的情况 #if 'user_id' in fairy.attacker_history.attacker: # fairy.attacker_history.attacker=[fairy.attacker_history.attacker] - for atk in self.tolist(fairy.attacker_history.attacker): + for atk in f_attackers: if atk.discoverer=='1': disc_name=atk.user_name break hms=lambda x:x>=3600 and time.strftime('%H:%M:%S',time.localtime(x+16*3600)) or time.strftime('%M:%S',time.localtime(x)) logging.info('%s:%sLv%d hp:%d %s:%s %s:%d %s%s %s'%( du8('妖精'),fairy.name,fairy.lv,fairy.hp,du8('发现者'),disc_name, - du8('小伙伴'),len(fairy.attacker_history.attacker),du8('剩余'),hms(fairy.time_limit), + du8('小伙伴'),len(f_attackers),du8('剩余'),hms(fairy.time_limit), fairy.wake and 'WAKE!' or'')) if carddeck: cardd=carddeck diff --git a/maclient_cli.py b/maclient_cli.py index 24caa30..425c4ca 100644 --- a/maclient_cli.py +++ b/maclient_cli.py @@ -187,6 +187,7 @@ def macs(uri,header={},body='',method='GET'): if mod==0: session=read_proxy(work=0) maclient1._write_config('account_%s'%maclient1._read_config('system','server'),'session',session) + maclient1.load_cookie() maclient1.login() mod=(mod+1)%2 elif ch =='4': diff --git a/maclient_network.py b/maclient_network.py index fd373b4..14404d4 100644 --- a/maclient_network.py +++ b/maclient_network.py @@ -20,6 +20,7 @@ print('httplib2 not found in python libs. You can download it here: https://github.com/fffonion/httplib2-plus') serv={'cn':'http://game1-CBT.ma.sdo.com:10001/connect/app/','cn_data':'http://MA.webpatch.sdg-china.com/', 'cn2':'http://game2-CBT.ma.sdo.com:10001/connect/app/','cn2_data':'http://MA.webpatch.sdg-china.com/', + 'cn3':'http://game3-CBT.ma.sdo.com:10001/connect/app/','cn2_data':'http://MA.webpatch.sdg-china.com/', 'tw':'http://game.ma.mobimon.com.tw:10001/connect/app/','tw_data':'http://download.ma.mobimon.com.tw/', 'jp':'http://web.million-arthurs.com/connect/app/','jp_data':'' } diff --git a/maclient_smart.py b/maclient_smart.py index a758464..597d7be 100644 --- a/maclient_smart.py +++ b/maclient_smart.py @@ -13,8 +13,9 @@ } key_jp={'res': 'A1dPUcrvur2CRQyl','helper':'A1dPUcrvur2CRQyl','crypt':'uH9JF2cHf6OppaC1' } -app_ver_cn=app_ver_kr=100 +app_ver_cn=101 app_ver_tw=102 +app_ver_kr=100 app_ver_jp=236 #wake name_wake_rare=['俠客']