Skip to content

Commit

Permalink
release notes for simplified event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
walterhiggins committed Mar 15, 2014
1 parent d59b068 commit aa58d49
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
# 2014 03 12
# 2014 03 15

## Version 2.0.6

## Simplified Event handling code.

The callback function for event handling now only takes 1 single
parameter, the event which triggered the callback. The listener object
is bound to the callback function so within the callback function
`this` refers to the listener object. Unregistering listeners has also
been greatly simplified. You can have an event handler which fires
only once by unregistering itself within the callback like this...

events.on('player.PlayerJoinEvent', function( event ) {

// do something
event.player.sendMessage( "You're the first player to join" );

// unregister so this function is called only once ever.
this.unregister();

});

The `events.on()` function also returns the same listener object as
`this` refered to inside the callback. The listener object has a
single method `unregister()` which can be called to stop listening for
the event.

# 2014 03 12

Added Drone.MAX_VOLUME and Drone.MAX_SIDE properties to specify limits on size of Drone ops.
This is to stop individual players from hogging the CPU in a classrom environment.

Expand Down

0 comments on commit aa58d49

Please sign in to comment.