|
@@ -27,37 +27,37 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- async sendData(e) {
|
|
|
+ async sendData(actionData) {
|
|
|
|
|
|
- //console.log('发送数据:'+JSON.stringify(e))
|
|
|
+ console.log('发送数据:'+JSON.stringify(actionData))
|
|
|
|
|
|
- await this.beforeSend(e);
|
|
|
- const t = util.uuid();
|
|
|
- this.room.networkController.sendRtcData(le(oe({}, e.data), {
|
|
|
- trace_id: t,
|
|
|
+ await this.beforeSend(actionData);
|
|
|
+ const traceId = util.uuid();
|
|
|
+ this.room.networkController.sendRtcData(le(oe({}, actionData.data), {
|
|
|
+ trace_id: traceId,
|
|
|
user_id: this.room.options.userId
|
|
|
}));
|
|
|
|
|
|
- if (e.track === !1)
|
|
|
+ if (actionData.track === !1)
|
|
|
{
|
|
|
return Promise.resolve(null);
|
|
|
}
|
|
|
- const {sampleRate: r=1, timeout: n=2e3, tag: o, data: a, special: s} = e;
|
|
|
+ const { sampleRate=1, timeout=2e3, tag, data, special } = actionData;
|
|
|
return eventsManager.track({
|
|
|
- timeout: n,
|
|
|
- traceId: t,
|
|
|
- event: a.action_type,
|
|
|
- tag: o,
|
|
|
- extra: a
|
|
|
+ timeout,
|
|
|
+ traceId,
|
|
|
+ event: data.action_type,
|
|
|
+ tag,
|
|
|
+ extra: data
|
|
|
}, {
|
|
|
- special: s,
|
|
|
- sampleRate: r,
|
|
|
+ special,
|
|
|
+ sampleRate,
|
|
|
noReport: this.room.viewMode === "serverless" || this.room.options.viewMode === "serverless"
|
|
|
}).finally(()=>{
|
|
|
- QueueActions.includes(e.data.action_type) && (this.currentActiveAction = void 0)
|
|
|
- }
|
|
|
- )
|
|
|
+ QueueActions.includes(actionData.data.action_type) && (this.currentActiveAction = void 0)
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
async beforeSend(e) {
|
|
|
var o;
|
|
|
const t = (o = this.room._userAvatar) == null ? void 0 : o.isMoving
|