Skip to content
Snippets Groups Projects
Commit 52dd935e authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman :boom:
Browse files

Fixed administrator commands to use the new object_added scheme.

parent 11f4a9d5
No related merge requests found
......@@ -7,12 +7,12 @@ module Aethyr
super(player, commands, *args)
end
def self.admin_object_added(data, klass)
protected
def self.object_added(data, child_class)
return unless (data[:game_object].is_a? Player) && data[:game_object].admin
data[:game_object].subscribe(klass.new(data[:game_object]))
data[:game_object].subscribe(child_class.new(data[:game_object]))
end
protected
#Tail a file
def tail file, lines = 10
require 'util/tail'
......
......@@ -11,7 +11,7 @@ module Aethyr
end
def self.object_added(data)
return Aethyr::Extend::AdminHandler.admin_object_added(data, AlookHandler)
super(data, klass: self)
end
def player_input(data)
......
......@@ -25,9 +25,9 @@ module Aethyr
protected
#event listener parent that listens for when a new user is added to the manager
def self.object_added(data, klass: child_class)
def self.object_added(data, child_class)
return unless data[:game_object].is_a? Player
data[:game_object].subscribe(klass.new(data[:game_object]))
data[:game_object].subscribe(child_class.new(data[:game_object]))
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment