fcr-core 3.11.0-rc.6 → 3.11.0-rc.8

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.
@@ -404,8 +404,9 @@ export interface FcrMicrophoneTrack {
404
404
  /**
405
405
  * Starts the microphone test for the specified device.
406
406
  * @param interval The interval for the microphone test.
407
+ * @param enablePlayback Whether to enable playback during the test.
407
408
  */
408
- startTest(interval: number): number;
409
+ startTest(interval: number, enablePlayback?: boolean): number;
409
410
  /**
410
411
  * Stops the microphone test for the specified device.
411
412
  */
@@ -319,6 +319,10 @@ class FcrPeerSessionControlImpl {
319
319
  const _ref2 = payload,
320
320
  data = _ref2.data,
321
321
  cmd = _ref2.cmd;
322
+ if (cmd !== '1001' && cmd !== '1002' || !data || typeof data.sessionKey !== 'string' || typeof data.sessionUuid !== 'string') {
323
+ this.logger.info("[PeerSession] ignore non peer-session message: cmd=".concat(String(cmd), ", senderId=").concat(senderId, ", payload=").concat(JSON.stringify(payload)));
324
+ return;
325
+ }
322
326
  const logContext = "cmd=".concat(cmd, ", sessionKey=").concat(data.sessionKey, ", sessionId=").concat(data.sessionUuid, ", ") + "action=".concat(String(data.action), ", senderId=").concat(senderId, ", keepAlive=").concat(!!data.keepAlive);
323
327
  this.logger.info("[PeerSession] received peer message: ".concat(logContext, ", payload=").concat(JSON.stringify((_data$payload = data.payload) !== null && _data$payload !== void 0 ? _data$payload : {})));
324
328
  if (cmd === '1001') {
@@ -28,9 +28,9 @@ Object.defineProperty(exports, "__esModule", {
28
28
  value: true
29
29
  });
30
30
  exports.KEEPALIVE_TIMEOUT_MULTIPLIER = exports.FcrRemoteControlImpl = void 0;
31
- require("core-js/modules/es.json.stringify.js");
32
31
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
33
32
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
33
+ require("core-js/modules/es.json.stringify.js");
34
34
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
35
35
  var _type = require("./type");
36
36
  var _imports = require("../imports");
@@ -85,6 +85,10 @@ class FcrRemoteControlImpl {
85
85
  const _ref2 = payload,
86
86
  data = _ref2.data,
87
87
  cmd = _ref2.cmd;
88
+ if (cmd !== '1001' && cmd !== '1002' || !data || typeof data.sessionKey !== 'string' || typeof data.sessionUuid !== 'string') {
89
+ this.logger.info("[RemoteControl] ignore non remote-control message: cmd=".concat(String(cmd), ", senderId=").concat(senderId, ", payload=").concat(JSON.stringify(payload)));
90
+ return;
91
+ }
88
92
  const logContext = "cmd=".concat(cmd, ", sessionKey=").concat(data.sessionKey, ", sessionId=").concat(data.sessionUuid, ", ") + "action=".concat(String(data.action), ", senderId=").concat(senderId, ", keepAlive=").concat(!!data.keepAlive);
89
93
  if (data.sessionKey !== this._remoteControlSessionKey) {
90
94
  this.logger.info("[RemoteControl] ignore peer message because sessionKey does not match remote-control: ".concat(logContext));
@@ -313,6 +313,10 @@ export class FcrPeerSessionControlImpl {
313
313
  const _ref2 = payload,
314
314
  data = _ref2.data,
315
315
  cmd = _ref2.cmd;
316
+ if (cmd !== '1001' && cmd !== '1002' || !data || typeof data.sessionKey !== 'string' || typeof data.sessionUuid !== 'string') {
317
+ this.logger.info("[PeerSession] ignore non peer-session message: cmd=".concat(String(cmd), ", senderId=").concat(senderId, ", payload=").concat(JSON.stringify(payload)));
318
+ return;
319
+ }
316
320
  const logContext = "cmd=".concat(cmd, ", sessionKey=").concat(data.sessionKey, ", sessionId=").concat(data.sessionUuid, ", ") + "action=".concat(String(data.action), ", senderId=").concat(senderId, ", keepAlive=").concat(!!data.keepAlive);
317
321
  this.logger.info("[PeerSession] received peer message: ".concat(logContext, ", payload=").concat(JSON.stringify((_data$payload = data.payload) !== null && _data$payload !== void 0 ? _data$payload : {})));
318
322
  if (cmd === '1001') {
@@ -79,6 +79,10 @@ export class FcrRemoteControlImpl {
79
79
  const _ref2 = payload,
80
80
  data = _ref2.data,
81
81
  cmd = _ref2.cmd;
82
+ if (cmd !== '1001' && cmd !== '1002' || !data || typeof data.sessionKey !== 'string' || typeof data.sessionUuid !== 'string') {
83
+ this.logger.info("[RemoteControl] ignore non remote-control message: cmd=".concat(String(cmd), ", senderId=").concat(senderId, ", payload=").concat(JSON.stringify(payload)));
84
+ return;
85
+ }
82
86
  const logContext = "cmd=".concat(cmd, ", sessionKey=").concat(data.sessionKey, ", sessionId=").concat(data.sessionUuid, ", ") + "action=".concat(String(data.action), ", senderId=").concat(senderId, ", keepAlive=").concat(!!data.keepAlive);
83
87
  if (data.sessionKey !== this._remoteControlSessionKey) {
84
88
  this.logger.info("[RemoteControl] ignore peer message because sessionKey does not match remote-control: ".concat(logContext));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fcr-core",
3
3
  "description": "Core APIs for building online scenes",
4
- "version": "3.11.0-rc.6",
4
+ "version": "3.11.0-rc.8",
5
5
  "module": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "files": [
@@ -42,7 +42,7 @@
42
42
  "@types/lodash": "^4.14.168",
43
43
  "@types/sinon": "^17.0.2",
44
44
  "@types/uuid": "^8.3.0",
45
- "agora-toolchain": "3.11.0-rc.6",
45
+ "agora-toolchain": "3.11.0-rc.8",
46
46
  "core-js": "^3.33.3",
47
47
  "decomment": "^0.9.5",
48
48
  "husky": "^9.0.11",
@@ -62,8 +62,8 @@
62
62
  "@netless/video-js-plugin": "^0.3.8",
63
63
  "@netless/white-snapshot": "^0.4.2",
64
64
  "@netless/window-manager": "^1.0.7-beta.6",
65
- "agora-foundation": "3.11.0-rc.6",
66
- "agora-rte-sdk": "3.11.0-rc.6",
65
+ "agora-foundation": "3.11.0-rc.8",
66
+ "agora-rte-sdk": "3.11.0-rc.8",
67
67
  "await-to-js": "^3.0.0",
68
68
  "dayjs": "^1.10.4",
69
69
  "easemob-websdk": "4.13.0",