@@ -137,7 +137,7 @@ class RootController(BaseController):
137
137
#statuebuilding lev,corn(cae) defenceadd pop time
138
138
statuebuilding = [[27 ,80000 ,600 ,20 ,7200 ],[30 ,- 8 ,700 ,40 ,14400 ]]
139
139
#decorationbuild:cornorcae,人å£ä¸Šé™ï¼Œè§£é”ç‰çº§
140
- decorationbuild = [[10 ,5 ,1 ],[20 ,5 ,1 ],[30 ,5 ,1 ],[50 ,5 ,4 ],[- 1 ,50 ,5 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[200 ,8 ,7 ],[- 3 ,170 ,8 ],[400 ,15 ,9 ],[600 ,20 ,10 ],[800 ,25 ,11 ],[1000 ,30 ,12 ],[900 ,35 ,13 ],[1200 ,40 ,14 ],[2000 ,50 ,15 ],[- 5 ,300 ,10 ],[1500 ,60 ,16 ],[1500 ,60 ,16 ],[1500 ,60 ,16 ],[1600 ,65 ,18 ],[1600 ,65 ,18 ],[1600 ,65 ,18 ],[1600 ,65 ,18 ],[- 3 ,150 ,15 ],[- 3 ,150 ,15 ],[- 3 ,150 ,15 ],[- 3 ,150 ,15 ],[1800 ,70 ,20 ],[1800 ,70 ,20 ],[1800 ,70 ,20 ],[2000 ,80 ,25 ],[2000 ,80 ,25 ],[2000 ,80 ,25 ],[- 10 ,300 ,20 ],[5000 ,90 ,3 ],[- 5 ,150 ,3 ],[- 10 ,300 ,3 ],[2000 ,30 ,17 ],[- 10 ,300 ,20 ]]#corn(or cae),populationupbound
140
+ decorationbuild = [[10 ,5 ,1 ],[20 ,5 ,1 ],[30 ,5 ,1 ],[50 ,5 ,4 ],[- 1 ,50 ,5 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[100 ,6 ,6 ],[200 ,8 ,7 ],[- 3 ,170 ,8 ],[400 ,15 ,9 ],[600 ,20 ,10 ],[800 ,25 ,11 ],[1000 ,30 ,12 ],[900 ,35 ,13 ],[1200 ,40 ,14 ],[2000 ,50 ,15 ],[- 5 ,300 ,10 ],[1500 ,60 ,16 ],[1500 ,60 ,16 ],[1500 ,60 ,16 ],[1600 ,65 ,18 ],[1600 ,65 ,18 ],[1600 ,65 ,18 ],[1600 ,65 ,18 ],[- 3 ,150 ,15 ],[- 3 ,150 ,15 ],[- 3 ,150 ,15 ],[- 3 ,150 ,15 ],[1800 ,70 ,20 ],[1800 ,70 ,20 ],[1800 ,70 ,20 ],[2000 ,80 ,25 ],[2000 ,80 ,25 ],[2000 ,80 ,25 ],[- 10 ,300 ,20 ],[5000 ,90 ,3 ],[- 5 ,150 ,3 ],[- 10 ,300 ,3 ],[2000 ,30 ,17 ],[2000 , 30 , 17 ],[ - 10 ,300 ,20 ]]#corn(or cae),populationupbound
141
141
#农作物list:#corn,exp,food,time,解é”ç‰çº§
142
142
Plant_Price = [[50 ,1 ,20 ,600 ,1 ],[165 ,3 ,50 ,2700 ,1 ],[- 1 ,8 ,120 ,3600 ,5 ],[700 ,7 ,150 ,9360 ,5 ],[1440 ,12 ,300 ,22680 ,7 ],[- 3 ,25 ,430 ,14400 ,7 ],[230 ,5 ,52 ,1800 ,13 ],[600 ,9 ,80 ,5400 ,16 ],[- 2 ,30 ,280 ,9000 ,10 ],[1210 ,15 ,200 ,11520 ,20 ],[3000 ,25 ,410 ,29160 ,25 ],[- 5 ,50 ,650 ,25200 ,15 ]]#corn,food,cae
143
143
beginTime = (2011 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 )
@@ -239,7 +239,7 @@ def fetchMsg(self, uid, start, end):
239
239
else :
240
240
msgs = DBSession .query (Message .mid , Message .uid , Message .mess , Message .time , Message .read , operationalData .otherid ).filter_by (fid = uid ).filter (Message .uid == operationalData .userid ).order_by (desc (Message .time )).slice (start , end ).all ()
241
241
for m in msgs :
242
- print str (m )
242
+ # print str(m)
243
243
ms = DBSession .query (Message ).filter_by (mid = m [0 ]).one ()
244
244
ms .read = 1
245
245
DBSession .flush ()
@@ -4278,6 +4278,8 @@ def warinfo(self,userid):#对外接口,战报
4278
4278
try :
4279
4279
4280
4280
if u .nobility < 0 :
4281
+ u .protecttype = 2
4282
+ u .protecttime = t
4281
4283
mapgrid = newwarmap (u )
4282
4284
#wartask=wartasknew(u.userid)
4283
4285
v = DBSession .query (Victories ).filter_by (uid = userid ).one ()
@@ -5892,16 +5894,18 @@ def productall(self,user_id,city_id):
5892
5894
except InvalidRequestError :
5893
5895
return dict (id = 0 )
5894
5896
@expose ('json' )
5895
- def getfriendall (self ,user_id ,user_kind ,type ):#type=0 normal;type=1 leiji
5897
+ def getfriendall (self ,user_id ,friend_num ,type ):#type=0 normal;type=1 leiji
5898
+ print "getfriend " + str (user_id )
5896
5899
uid = int (user_id )
5897
5900
type = int (type )
5901
+ friend_num = int (friend_num )
5898
5902
u = checkopdata (uid )
5899
5903
cornadd = 0
5900
5904
flag = 0
5901
5905
bonus = 0
5902
5906
k = 0 #the number of the friend
5903
5907
try :
5904
- notvisited = DBSession .query (Papayafriend ).filter_by (uid = uid ).filter_by (visited = 0 ).all ()
5908
+ notvisited = DBSession .query (Papayafriend ).filter_by (uid = uid ).filter_by (visited = 0 ).filter ( "lev > 0" ). all ()
5905
5909
if notvisited == None or len (notvisited )== 0 :
5906
5910
return dict (id = 0 , reason = "do not have not visited friend" )
5907
5911
card = DBSession .query (Card ).filter_by (uid = uid ).one ()
@@ -5932,9 +5936,8 @@ def getfriendall(self,user_id,user_kind,type):#type=0 normal;type=1 leiji
5932
5936
temp_cae = temp_cae + 2
5933
5937
for f in notvisited :
5934
5938
k += 1
5935
- cornadd += 100 + bonus
5936
5939
f .visited = 1
5937
-
5940
+ cornadd = ( 100 + bonus ) * friend_num
5938
5941
else :
5939
5942
return dict (id = 0 , reason = "cae or card invalid" )
5940
5943
else :#cae=10
@@ -5947,6 +5950,7 @@ def getfriendall(self,user_id,user_kind,type):#type=0 normal;type=1 leiji
5947
5950
cornadd += 100 + bonus + 5 * k
5948
5951
k += 1
5949
5952
f .visited = 1
5953
+ cornadd = (100 + bonus )* friend_num + 5 * (friend_num + 1 )* friend_num / 2
5950
5954
if flag == 1 :
5951
5955
u .corn = u .corn + cornadd
5952
5956
u .cae = temp_cae
0 commit comments