NoticeCenter支持安全类型转换,解决监听者参数类型不一致导致的bug

This commit is contained in:
xia-chu
2023-09-02 10:52:07 +08:00
parent c35b5e9215
commit d286ac1d73
22 changed files with 43 additions and 46 deletions

View File

@@ -135,9 +135,9 @@ inline void ShellSession::pleaseInputPasswd() {
});
};
auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastShellLogin,_strUserName,passwd,invoker,static_cast<SockInfo &>(*this));
if(!flag){
//如果无人监听shell登录事件那么默认shell无法登录
auto flag = NOTICE_EMIT(BroadcastShellLoginArgs, Broadcast::kBroadcastShellLogin, _strUserName, passwd, invoker, *this);
if (!flag) {
// 如果无人监听shell登录事件那么默认shell无法登录
onAuth("please listen kBroadcastShellLogin event");
}
return true;