Beispiel #1
0
    def updatescores(self):
	glicko={}
	innocent_vector=[0,1,2,4,6,9,13,17,23]
	for u in User.select():
	    glicko[u.user_name]=(1500,350,0.06)
	kills=Kill.select()
	gamestart=datetime.datetime(2008,6,13,17,0,0)
	for i in range(42):
	    glicko = glickostep( glicko, [x for x in kills if x.event.datetime >= gamestart + datetime.timedelta(i*14400) and x.event.datetime < gamestart + datetime.timedelta((i+1)*14400)])
	for u in glicko:
	    p=User.by_user_name(u)
	    i = 0
	    for ik in InnocentKill.select():
	    	if(ik.killer==p and not ik.licit):
		    i +=1
	    p.score=glicko[u][0]-glicko[u][1]+p.adjustment - 35 * innocent_vector[min(i,8)]
	return
Beispiel #2
0
 def updatescores(self):
     glicko = {}
     innocent_vector = [0, 1, 2, 4, 6, 9, 13, 17, 23]
     for u in User.select():
         glicko[u.user_name] = (1500, 350, 0.06)
     kills = Kill.select()
     gamestart = datetime.datetime(2008, 6, 13, 17, 0, 0)
     for i in range(42):
         glicko = glickostep(glicko, [
             x for x in kills if x.event.datetime >= gamestart +
             datetime.timedelta(i * 14400) and x.event.datetime <
             gamestart + datetime.timedelta((i + 1) * 14400)
         ])
     for u in glicko:
         p = User.by_user_name(u)
         i = 0
         for ik in InnocentKill.select():
             if (ik.killer == p and not ik.licit):
                 i += 1
         p.score = glicko[u][0] - glicko[u][
             1] + p.adjustment - 35 * innocent_vector[min(i, 8)]
     return
Beispiel #3
0
 def scoresrank(self):
     return {'players': User.select(orderBy='score')}
Beispiel #4
0
 def scorescollege(self):
     return {'players': User.select(orderBy='college')}
Beispiel #5
0
 def scoresname(self):
     return {'players': User.select(orderBy='user_name')}
Beispiel #6
0
 def scoresrank(self):
     return {'players': User.select(orderBy='score')}
Beispiel #7
0
 def scorescollege(self):
     return {'players': User.select(orderBy='college')}
Beispiel #8
0
 def scoresname(self):
     return {'players': User.select(orderBy='user_name')}