Move login and logout listening to the new Event system and update plugins to reflect this move, remove previous listening system, fix minor bug in EventListenerChainSet.

This commit is contained in:
Major-
2015-02-27 04:11:08 +00:00
parent 3e4ecb5c73
commit 06b6f5fb74
23 changed files with 174 additions and 220 deletions
@@ -42,7 +42,8 @@ on :message, :remove_friend do |ctx, player, message|
end
# Update the friend server status and send the friend/ignore lists of the player logging in.
on :login do |player|
on :login do |event, context|
player = event.player
player.send(FriendServerStatusMessage.new(ServerStatus::CONNECTING))
player.send(IgnoreListMessage.new(player.ignored_usernames)) if player.ignored_usernames.size > 0
@@ -62,8 +63,8 @@ on :login do |player|
end
# Notifies the player's friends that the player has logged out.
on :logout do |player|
update_friends(player, 0)
on :logout do |event, context|
update_friends(event.player, 0)
end