Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.08 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. commit a50f7aee7c792c7deac811e592eead151e2170e4
  2. Author: Corbin Simpson <MostAwesomeDude@gmail.com>
  3. Date:   Thu May 26 05:33:07 2011 -0700
  4.  
  5.     identify: Add the login handler class.
  6.    
  7.     To get at the protocol version.
  8.  
  9. diff --git a/burger/toppings/identify.py b/burger/toppings/identify.py
  10. index 3cc0717..c636578 100644
  11. --- a/burger/toppings/identify.py
  12. +++ b/burger/toppings/identify.py
  13. @@ -94,7 +94,17 @@ def identify(buff):
  14.      )
  15.  
  16.      if const:
  17. -        return ("item.superclass", cf.this)    
  18. +        return ("item.superclass", cf.this)
  19. +
  20. +    # Packet-handler class for login. This contains the current protocol
  21. +    # version.
  22. +    const = cf.constants.find_one(
  23. +        ConstantType.STRING,
  24. +        lambda const: "Outdated" in const["string"]["value"]
  25. +    )
  26. +
  27. +    if const:
  28. +        return "handler.login", cf.this
  29.  
  30.  class IdentifyTopping(Topping):
  31.      PROVIDES = [
  32. @@ -104,6 +114,7 @@ class IdentifyTopping(Topping):
  33.          "identify.recipe.inventory",
  34.          "identify.recipe.cloth",
  35.          "identify.item.superclass"
  36. +        "identify.handler.login",
  37.      ]
  38.  
  39.      DEPENDS = []