@babblevoice/projectrtp 2.5.38 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +15 -0
  2. package/lib/server.js +20 -6
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -140,6 +140,21 @@ class proxy {
140
140
  this._server.clearnodes()
141
141
  }
142
142
 
143
+ /**
144
+ *
145
+ * @param {*} nodes
146
+ */
147
+ setnodes( nodes ) {
148
+ this._server.setnodes( nodes )
149
+ }
150
+
151
+ /**
152
+ *
153
+ */
154
+ getnodes() {
155
+ return this._server.getnodes()
156
+ }
157
+
143
158
  get () {
144
159
  return server.interface.get()
145
160
  }
package/lib/server.js CHANGED
@@ -34,26 +34,22 @@ const nodeconnectiontype = { "listen": 1, "connect": 2 }
34
34
  * @property { channel } left
35
35
  * @property { channel } right
36
36
  * @property { Set< channel > } channels
37
- * @ignore
38
37
  */
39
38
  /**
40
39
  * @typedef { object } nodebridge
41
40
  * @property { Array< channelbridge > } bridges
42
41
  * @property { string } main
43
- * @ignore
44
42
  */
45
43
 
46
44
  /**
47
45
  * The remote (listening) nodes
48
46
  * @type { Array< nodehost > }
49
- * @ignore
50
47
  */
51
48
  let listeningnodes = []
52
49
 
53
50
  /**
54
51
  * Our nodes which have connected to our listening server.
55
52
  * @type { Map< string, nodeconnection > }
56
- * @ignore
57
53
  */
58
54
  let nodes = new Map()
59
55
 
@@ -669,7 +665,9 @@ class channel {
669
665
  }
670
666
 
671
667
  /**
672
- * @ignore
668
+ * @param { number } min
669
+ * @param { number } max
670
+ * @returns { number }
673
671
  */
674
672
  function between( min, max ) {
675
673
  return Math.floor(
@@ -993,11 +991,27 @@ class serverinterface {
993
991
  * Clean up after using remote nodes for us to connect to, switch back to local mode.
994
992
  * @returns { void }
995
993
  */
996
- clearnodes = () => {
994
+ clearnodes() {
997
995
  delete serverinterface._s
998
996
  listeningnodes = []
999
997
  }
1000
998
 
999
+ /**
1000
+ *
1001
+ * @param { Array< nodehost > } nodes
1002
+ */
1003
+ setnodes( nodes ) {
1004
+ listeningnodes = nodes
1005
+ }
1006
+
1007
+ /**
1008
+ *
1009
+ * @returns { Array< nodehost > }
1010
+ */
1011
+ getnodes() {
1012
+ return listeningnodes
1013
+ }
1014
+
1001
1015
  /**
1002
1016
  * Remove our reference to server interface
1003
1017
  * @ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/projectrtp",
3
- "version": "2.5.38",
3
+ "version": "2.6.0",
4
4
  "description": "A scalable Node addon RTP server",
5
5
  "main": "index.js",
6
6
  "directories": {