Skip to content
Browse files

Added support for an onconnect option, which expects a callback funct…

…ion that takes a single argument. This function will get executed after connect, passing the decaf object in the parameter.
  • Loading branch information...
1 parent cf1d3b3 commit be6f0113fd57a4b29bb1cc23aab38dd31a11fc0c @raelik committed
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/js/decafmud.js
View
5 src/js/decafmud.js
@@ -1411,6 +1411,11 @@ DecafMUD.prototype.socketConnected = function() {
if ( this.ui && this.ui.connected ) {
this.ui.connected(); }
+ var decaf = this;
+ if ( this.options.onconnect ) {
+ setTimeout(function(){decaf.options.onconnect(decaf);},1);
+ }
+
//if ( this.display ) {
// this.display.message('<b>Connected.</b>'.tr(this,host,port),'decafmud socket status'); }
}

0 comments on commit be6f011

Please sign in to comment.
Something went wrong with that request. Please try again.