Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
李勇
/
McuClient
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李勇
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
900908ef61926e3b47b6b35d1a242856fa7afb1e
900908ef
1 parent
ab6cd16f
1.人员信息中增加当前使用的sdk版本;2.监听人员信息中增加当前课堂人数
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
21 行增加
和
11 行删除
src/EngineEntrance.js
src/apes/ConferApe.js
src/pdus/pro.js
src/EngineEntrance.js
查看文件 @
900908e
...
...
@@ -35,7 +35,6 @@ import QuestionApe from 'apes/QuestionApe';
import
UTF8
from
'utf-8'
;
let
loger
=
Loger
.
getLoger
(
'McuClient'
);
let
_sdkInfo
=
{
"version"
:
"v1.60.0.20170729"
,
"author"
:
"www.3mang.com"
};
//APE
let
_sass
;
...
...
@@ -58,8 +57,9 @@ export default class MessageEntrance extends Emiter {
constructor
()
{
super
();
//sdk 信息
this
.
sdkInfo
=
_sdkInfo
;
loger
.
warn
(
this
.
sdkInfo
);
GlobalConfig
.
sdkVersion
=
"v1.61.0.20170729"
;
loger
.
warn
(
"sdkVersion:"
+
GlobalConfig
.
sdkVersion
);
//获取设备和系统信息
SystemConfig
.
getSystemInfo
();
...
...
src/apes/ConferApe.js
查看文件 @
900908e
...
...
@@ -26,6 +26,7 @@ class ConferApe extends Ape {
);
this
.
rosters
=
{};
//用户列表
this
.
rosterLen
=
0
;
//当前课堂人数
this
.
timerCounter
=
new
TimerCounter
();
//计时器
//第三方消息控制 parent和Iframe直接的通讯
...
...
@@ -149,6 +150,7 @@ class ConferApe extends Ape {
nodeInfoRecordPdu
.
explorer
=
GlobalConfig
.
explorer
;
nodeInfoRecordPdu
.
explorerVersion
=
GlobalConfig
.
explorerVersion
;
nodeInfoRecordPdu
.
os
=
GlobalConfig
.
os
;
nodeInfoRecordPdu
.
sdkVersion
=
GlobalConfig
.
sdkVersion
||
"未知版本"
;
return
nodeInfoRecordPdu
;
}
...
...
@@ -841,9 +843,9 @@ class ConferApe extends Ape {
//loger.log("自己加入课堂的消息->",nodeId,"role-->", nodeData.role, ApeConsts.userTypes[nodeData.role]);
//自己加入的时候,需要做一下判断操作,如果满足以下3个条件就要暂停课堂:
// 1.当前课堂只有自己;2.自己的身份不是host;3当前的课堂状态为(CLASS_STATUS_STARTED= 1;//直播中)
let
rosterLen
=
Object
.
keys
(
this
.
rosters
).
length
;
GlobalConfig
.
rosterNumber
=
rosterLen
;
//记录当前的总人数
if
(
rosterLen
<
1
&&
!
GlobalConfig
.
isHost
&&
GlobalConfig
.
classStatus
==
ApeConsts
.
CLASS_STATUS_STARTED
)
{
this
.
rosterLen
=
Object
.
keys
(
this
.
rosters
).
length
;
GlobalConfig
.
rosterNumber
=
this
.
rosterLen
;
//记录当前的总人数
if
(
this
.
rosterLen
<
1
&&
!
GlobalConfig
.
isHost
&&
GlobalConfig
.
classStatus
==
ApeConsts
.
CLASS_STATUS_STARTED
)
{
loger
.
warn
(
"当前课堂没有老师->暂停课堂"
);
this
.
pauseClass
({
isForce
:
true
});
this
.
stopRecord
(
true
);
...
...
@@ -910,17 +912,21 @@ class ConferApe extends Ape {
loger
.
log
(
"NR_INVISIBLE"
);
return
;
}
if
(
!
rosterExists
)
{
if
(
!
rosterExists
){
this
.
rosterLen
=
Object
.
keys
(
this
.
rosters
).
length
;
GlobalConfig
.
rosterNumber
=
this
.
rosterLen
;
//记录当前的总人数
newNodeData
.
rosterLen
=
this
.
rosterLen
;
loger
.
log
(
"人员加入->"
,
newNodeData
);
this
.
_emit
(
MessageTypes
.
CLASS_INSERT_ROSTER
,
{
"nodeId"
:
nodeId
,
"nodeData"
:
newNodeData
});
this
.
emitRosterChange
();
}
else
{
//loger.log("更新人员列表数据,rosterExists已经存在",rosterExists);
this
.
rosterLen
=
Object
.
keys
(
this
.
rosters
).
length
;
GlobalConfig
.
rosterNumber
=
this
.
rosterLen
;
//记录当前的总人数
newNodeData
.
rosterLen
=
this
.
rosterLen
;
loger
.
log
(
"人员更新信息->"
,
newNodeData
);
this
.
_emit
(
MessageTypes
.
CLASS_UPDATE_ROSTER
,
{
"nodeId"
:
nodeId
,
"nodeData"
:
newNodeData
});
}
}
//踢出用户
...
...
@@ -984,8 +990,11 @@ class ConferApe extends Ape {
loger
.
log
(
nodeId
,
"->离开课堂->身份->"
,
user
.
role
);
}
delete
this
.
rosters
[
nodeId
];
this
.
rosterLen
=
Object
.
keys
(
this
.
rosters
).
length
;
GlobalConfig
.
rosterNumber
=
this
.
rosterLen
;
//记录当前的总人数
this
.
emitRosterChange
();
this
.
_emit
(
MessageTypes
.
CLASS_DELETE_ROSTER
,
{
"nodeId"
:
nodeId
});
this
.
_emit
(
MessageTypes
.
CLASS_DELETE_ROSTER
,
{
"nodeId"
:
nodeId
,
"rosterLen"
:
this
.
rosterLen
});
//当前人员列表中抽一个人来检查离开人员是否占用频道
for
(
let
key
in
this
.
rosters
)
{
...
...
@@ -993,7 +1002,7 @@ class ConferApe extends Ape {
//如果抽到的人是自己就处理以下操作
if
(
randNodeId
==
GlobalConfig
.
nodeId
)
{
loger
.
log
(
randNodeId
,
"有权限检查离开的人员是否占用channel"
);
this
.
_emit
(
MessageTypes
.
CLASS_NONENTITY_ROSTER
,
{
"nodeId"
:
nodeId
});
this
.
_emit
(
MessageTypes
.
CLASS_NONENTITY_ROSTER
,
{
"nodeId"
:
nodeId
,
"rosterLen"
:
this
.
rosterLen
});
//如果离开的人员是老师,需要暂停当前的课堂
if
(
user
&&
user
.
role
==
ApeConsts
.
NR_HOST
)
{
...
...
src/pdus/pro.js
查看文件 @
900908e
...
...
@@ -920,6 +920,7 @@ message RCNodeInfoRecordPdu {
optional
string
explorer
=
33
;
//浏览器
optional
string
explorerVersion
=
34
;
//浏览器版本
optional
string
os
=
35
;
//系统版本
optional
string
sdkVersion
=
36
;
//SDK版本
}
message
RCVotingPollSettingsPdu
{
...
...
请
注册
或
登录
后发表评论