original_docstring: Handles a position update of this player.
          
          Keyword arguments:
          event -- Further information about what happened
          
          
docstring: Handles a position update of this player.
  Keyword arguments:
  event -- Further information about what happened
docstring_tokens: Handles a position update of this player . Keyword arguments : event -- Further information about what happened
code: def on_pos_update(self, event):
          """Handles a position update of this player.
          
          Keyword arguments:
          event -- Further information about what happened
          
          """
          if self.server.config.capture_the_flag.speed_cap:
              t = datetime.now()
              pos = self.entity.pos
              x = self.old_pos.x - pos.x
              y = self.old_pos.y - pos.y
              z = self.old_pos.z - pos.z
              dif = math.sqrt(x*x + y*y + z*z)
              elapsed = (t - self.old_time).total_seconds()
              if elapsed > MOVEMENT_SPEED_FPS:
                  average_speed = dif / elapsed
                  if average_speed > MOVEMENT_SPEED_CAP:
                      self.parent.game_state.too_fast(self.connection)
                  self.old_pos = pos
                  self.old_time = t
code_tokens: def on_pos_update ( self , event ) : if self . server . config . capture_the_flag . speed_cap : t = datetime . now ( ) pos = self . entity . pos x = self . old_pos . x - pos . x y = self . old_pos . y - pos . y z = self . old_pos . z - pos . z dif = math . sqrt ( x * x + y * y + z * z ) elapsed = ( t - self . old_time ) . total_seconds ( ) if elapsed > MOVEMENT_SPEED_FPS : average_speed = dif / elapsed if average_speed > MOVEMENT_SPEED_CAP : self . parent . game_state . too_fast ( self . connection ) self . old_pos = pos self . old_time = t
short_docstring: Handles a position update of this player.
short_docstring_tokens: Handles a position update of this player .
comment: """Handles a position update of this player.
          
          Keyword arguments:
          event -- Further information about what happened
          
          """