Skip to content

Commit

Permalink
1.50 国服版本更新+3区
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion committed Oct 12, 2013
1 parent 15f5be7 commit b61b421
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
6 changes: 6 additions & 0 deletions config_sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ password =
userid =
session =

[account_cn3]
username =
password =
userid =
session =

[account_cn]
username =
password =
Expand Down
22 changes: 13 additions & 9 deletions maclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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 '',
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions maclient_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
1 change: 1 addition & 0 deletions maclient_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':''
}
Expand Down
3 changes: 2 additions & 1 deletion maclient_smart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=['俠客']
Expand Down

0 comments on commit b61b421

Please sign in to comment.