|
|
@ -222,9 +222,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
|
|
|
|
|
|
|
|
_createClass(WebChannel, [{
|
|
|
|
_createClass(WebChannel, [{
|
|
|
|
key: 'leave',
|
|
|
|
key: 'leave',
|
|
|
|
value: function leave() {
|
|
|
|
value: function leave() {}
|
|
|
|
this.topologyService.leave(this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
key: 'send',
|
|
|
|
key: 'send',
|
|
|
|
value: function send(data) {
|
|
|
|
value: function send(data) {
|
|
|
@ -491,6 +489,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
if (webChannel.channels.size === 0) {
|
|
|
|
if (webChannel.channels.size === 0) {
|
|
|
|
webChannel.channels.add(channel);
|
|
|
|
webChannel.channels.add(channel);
|
|
|
|
channel.onclose = function () {
|
|
|
|
channel.onclose = function () {
|
|
|
|
|
|
|
|
webChannel.onLeaving(channel.peerID);
|
|
|
|
webChannel.channels.delete(channel);
|
|
|
|
webChannel.channels.delete(channel);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
resolve(channel.peerID);
|
|
|
|
resolve(channel.peerID);
|
|
|
@ -522,6 +521,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
var channel = webChannel.aboutToJoin.get(id);
|
|
|
|
var channel = webChannel.aboutToJoin.get(id);
|
|
|
|
webChannel.channels.add(webChannel.aboutToJoin.get(id));
|
|
|
|
webChannel.channels.add(webChannel.aboutToJoin.get(id));
|
|
|
|
channel.onclose = function () {
|
|
|
|
channel.onclose = function () {
|
|
|
|
|
|
|
|
webChannel.onLeaving(channel.peerID);
|
|
|
|
webChannel.channels.delete(channel);
|
|
|
|
webChannel.channels.delete(channel);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
//webChannel.aboutToJoin.delete(id)
|
|
|
|
//webChannel.aboutToJoin.delete(id)
|
|
|
@ -602,8 +602,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
key: 'leave',
|
|
|
|
key: 'leave',
|
|
|
|
value: function leave(webChannel) {
|
|
|
|
value: function leave(webChannel) {
|
|
|
|
var protocol = _ServiceProvider2.default.get(cs.EXCHANGEPROTOCOL_SERVICE);
|
|
|
|
this.broadcast(webChannel);
|
|
|
|
this.broadcast(webChannel, protocol.message(cs.LEAVING, { id: webChannel.myID }));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
key: '_generateID',
|
|
|
|
key: '_generateID',
|
|
|
@ -946,6 +945,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
e.channel.webChannel = webChannel;
|
|
|
|
e.channel.webChannel = webChannel;
|
|
|
|
e.channel.onmessage = _this3.protocol.onmessage;
|
|
|
|
e.channel.onmessage = _this3.protocol.onmessage;
|
|
|
|
webChannel.channels.add(e.channel);
|
|
|
|
webChannel.channels.add(e.channel);
|
|
|
|
|
|
|
|
e.channel.onclose = function () {
|
|
|
|
|
|
|
|
webChannel.onLeaving(e.channel.peerID);
|
|
|
|
|
|
|
|
webChannel.channels.delete(e.channel);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
connection.onicecandidate = function (e) {
|
|
|
|
connection.onicecandidate = function (e) {
|
|
|
@ -1158,9 +1161,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
case cs.GET_HISTORY:
|
|
|
|
case cs.GET_HISTORY:
|
|
|
|
webChannel.onPeerMessage(msg.id, msg.code);
|
|
|
|
webChannel.onPeerMessage(msg.id, msg.code);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case cs.LEAVING:
|
|
|
|
|
|
|
|
webChannel.onLeaving(msg.id);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case cs.SERVICE_DATA:
|
|
|
|
case cs.SERVICE_DATA:
|
|
|
|
var service = _ServiceProvider2.default.get(msg.service);
|
|
|
|
var service = _ServiceProvider2.default.get(msg.service);
|
|
|
|
service.onmessage(channel, msg.data);
|
|
|
|
service.onmessage(channel, msg.data);
|
|
|
@ -1178,7 +1178,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
case cs.JOIN_FINISH:
|
|
|
|
case cs.JOIN_FINISH:
|
|
|
|
webChannel.topologyService.addFinish(webChannel, msg.id);
|
|
|
|
webChannel.topologyService.addFinish(webChannel, msg.id);
|
|
|
|
if (msg.id != webChannel.myID) {
|
|
|
|
if (msg.id != webChannel.myID) {
|
|
|
|
console.log('different id');
|
|
|
|
|
|
|
|
webChannel.onJoining(msg.id);
|
|
|
|
webChannel.onJoining(msg.id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1196,9 +1195,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
case cs.GET_HISTORY:
|
|
|
|
case cs.GET_HISTORY:
|
|
|
|
msg.id = data.id;
|
|
|
|
msg.id = data.id;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case cs.LEAVING:
|
|
|
|
|
|
|
|
msg.id = data.id;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case cs.SERVICE_DATA:
|
|
|
|
case cs.SERVICE_DATA:
|
|
|
|
msg.service = data.service;
|
|
|
|
msg.service = data.service;
|
|
|
|
msg.data = Object.assign({}, data.data);
|
|
|
|
msg.data = Object.assign({}, data.data);
|
|
|
|