core/event_manager.js
function (event) {

	// if event is not from socket, no need to queue
	// TODO: remove connection-specific code from here
	if (event.conn.type !== 'socket')
		return true;

	var socket = event.conn.connector;

	// if no mechanism to store (such as from a bot), just ignore
	// TODO: this is not clean
	if (typeof socket.queuedEvents === 'undefined')
		socket.queuedEvents = {};

	var queue_size = Object.keys(socket.queuedEvents).length;
	if (queue_size > l_queuedEventsPerSocket) {

		LOG.warn('queued event size: ' + queue_size + ' limit exceeded (' + l_queuedEventsPerSocket + ')', l_name);

		// DEBUG purpose (print out events queued)
		for (var i in socket.queuedEvents)
			LOG.sys('queuedEvents[' + i + '] =' + UTIL.stringify(socket.queuedEvents[i].data), l_name);

		return false;
	}

	// store event with the ID to socket's eventlist
	socket.queuedEvents[event.id] = event;

	return true;
}
function (event) {

	// if event is not from socket, no need to queue
	// TODO: remove connection-specific code from here
	if (event.conn.type !== 'socket')
		return true;

	var socket = event.conn.connector;

	// if no mechanism to store (such as from a bot), just ignore
	// TODO: this is not clean
	if (typeof socket.queuedEvents === 'undefined')
		socket.queuedEvents = {};

	var queue_size = Object.keys(socket.queuedEvents).length;
	if (queue_size > l_queuedEventsPerSocket) {

		LOG.warn('queued event size: ' + queue_size + ' limit exceeded (' + l_queuedEventsPerSocket + ')', l_name);

		// DEBUG purpose (print out events queued)
		for (var i in socket.queuedEvents)
			LOG.sys('queuedEvents[' + i + '] =' + UTIL.stringify(socket.queuedEvents[i].data), l_name);

		return false;
	}

	// store event with the ID to socket's eventlist
	socket.queuedEvents[event.id] = event;

	return true;
}
function ( event ) { // if event is not from socket, no need to queue // TODO: remove connection-specific code from here if ( event . conn . type !== 'socket' ) return true ; var socket = event . conn . connector ; // if no mechanism to store (such as from a bot), just ignore // TODO: this is not clean if ( typeof socket . queuedEvents === 'undefined' ) socket . queuedEvents = { } ; var queue_size = Object . keys ( socket . queuedEvents ) . length ; if ( queue_size > l_queuedEventsPerSocket ) { LOG . warn ( 'queued event size: ' + queue_size + ' limit exceeded (' + l_queuedEventsPerSocket + ')' , l_name ) ; // DEBUG purpose (print out events queued) for ( var i in socket . queuedEvents ) LOG . sys ( 'queuedEvents[' + i + '] =' + UTIL . stringify ( socket . queuedEvents [ i ] . data ) , l_name ) ; return false ; } // store event with the ID to socket's eventlist socket . queuedEvents [ event . id ] = event ; return true ; }
function to store a event pending to send
function to store a event pending to send