oops
This commit is contained in:
parent
a76563a7bc
commit
8190df87a2
@ -1,52 +0,0 @@
|
||||
var events = require('events'),
|
||||
util = require('util'),
|
||||
_ = require('lodash');
|
||||
|
||||
function ReadWriteStream() {
|
||||
events.EventEmitter.call(this);
|
||||
this.readable = true;
|
||||
this.writable = true;
|
||||
}
|
||||
|
||||
util.inherits(ReadWriteStream, events.EventEmitter);
|
||||
|
||||
['end', 'error', 'close', 'setEncoding', 'pause', 'resume', 'destroy', 'drain', 'write', {name: 'rewrite', event: 'data'}, 'destroySoon'].forEach(function(func) {
|
||||
ReadWriteStream.prototype[func.name || func] = (function(func) {
|
||||
var event = func.event || func;
|
||||
return function() {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args.unshift(event);
|
||||
this.emit.apply(this, args);
|
||||
};
|
||||
}(func));
|
||||
});
|
||||
|
||||
function ReadWriteNetStream(specialTimeout) {
|
||||
this.specialTimeout = specialTimeout || false;
|
||||
ReadWriteStream.call(this);
|
||||
this.bufferSize = 0;
|
||||
this.remoteAddress = '';
|
||||
this.remotePort = '';
|
||||
this.bytesRead = '';
|
||||
this.bytesWritten = '';
|
||||
}
|
||||
|
||||
util.inherits(ReadWriteNetStream, ReadWriteStream);
|
||||
|
||||
// Net.Socket
|
||||
['connect', 'setSecure', 'setTimeout', 'setNoDelay', 'setKeepAlive', 'address', 'timeout'].forEach(function(funcName) {
|
||||
ReadWriteNetStream.prototype[funcName.name || funcName] = (function(func) {
|
||||
var event = funcName.event || func;
|
||||
return function(a, b) {
|
||||
if (this.specialTimeout && funcName === 'setTimeout' && _.isFunction(b)) {
|
||||
this.on('timeout', b);
|
||||
}
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args.unshift(event);
|
||||
this.emit.apply(this, args);
|
||||
};
|
||||
}(funcName));
|
||||
});
|
||||
|
||||
module.exports.ReadWriteStream = ReadWriteStream;
|
||||
module.exports.ReadWriteNetStream = ReadWriteNetStream;
|
@ -68,13 +68,5 @@ const replytg = (bot, tmp) => { // muss noch hier raus
|
||||
};
|
||||
};
|
||||
|
||||
const loadIRC = () => {
|
||||
for(let srv in cfg.irc) {
|
||||
rpc.emit('createClient', srv, cfg.irc[srv]);
|
||||
console.log('Loading server', srv);
|
||||
}
|
||||
console.log('All servers have been loaded successfully');
|
||||
};
|
||||
|
||||
util.inherits(wrapper, EventEmitter);
|
||||
export default { wrapper };
|
Loading…
Reference in New Issue
Block a user