Guest User

Untitled

a guest
Apr 11th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. class Player < GatherPlugin
  2.  
  3. attr_accessor :nick, :mode, :points
  4.  
  5. def initialize(options = {})
  6. @level = 1
  7. @nick = options[:nick]
  8. @hostmask = options[:hostmask]
  9. @username = options[:username]
  10. @password = options[:password].to_s
  11. @email = options[:email]
  12. @points = 1000
  13. @mode = ""
  14. end
  15.  
  16. # this place is not what i need :). It should return player class with found results or smth like that.
  17. # maybe someone can help me... This class overall layout may be really false ;)
  18. def self.find(source)
  19. key, value = YAML::load_file(PLAYERLIST).find { |key, value| value['hostmask'] == source.hostmask }
  20. # if value is a Hash: value ? new(value) : nil
  21. return value
  22. end
  23.  
  24. end
Add Comment
Please, Sign In to add comment