Skip to content

Commit

Permalink
fix: #30 Don't open window when there's no camera
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyuanxiang committed Jan 14, 2025
1 parent 816385e commit 0989cae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/2015Remote/2015RemoteDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ VOID CMy2015RemoteDlg::AddList(CString strIP, CString strAddr, CString strPCName
m_CList_Online.SetItemText(i, ONLINELIST_VERSION, ver);
m_CList_Online.SetItemText(i, ONLINELIST_LOGINTIME, st);
m_CList_Online.SetItemText(i, ONLINELIST_CLIENTTYPE, tp.IsEmpty()?"DLL":tp);

CString data[10] = { strIP, strAddr,strPCName,strOS,strCPU,strVideo,strPing,ver,st,tp };
ContextObject->SetClientInfo(data);
m_CList_Online.SetItemData(i,(DWORD_PTR)ContextObject);

ShowMessage(true,strIP+"主机上线");
Expand Down Expand Up @@ -829,7 +830,10 @@ VOID CMy2015RemoteDlg::SendSelectedCommand(PBYTE szBuffer, ULONG ulLength)
{
int iItem = m_CList_Online.GetNextSelectedItem(Pos);
CONTEXT_OBJECT* ContextObject = (CONTEXT_OBJECT*)m_CList_Online.GetItemData(iItem);

if (szBuffer[0]== COMMAND_WEBCAM && ContextObject->sClientInfo[ONLINELIST_VIDEO] == CString(""))
{
continue;
}
// 发送获得驱动器列表数据包
m_iocpServer->OnClientPreSending(ContextObject,szBuffer, ulLength);
}
Expand Down
7 changes: 7 additions & 0 deletions server/2015Remote/IOCPServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ enum IOType

typedef struct _CONTEXT_OBJECT
{
CString sClientInfo[10];
SOCKET sClientSocket;
WSABUF wsaInBuf;
WSABUF wsaOutBuffer;
Expand All @@ -46,6 +47,12 @@ typedef struct _CONTEXT_OBJECT
memset(&wsaOutBuffer,0,sizeof(WSABUF));
olps = NULL;
}
VOID SetClientInfo(CString s[10]){
for (int i=0; i<sizeof(sClientInfo)/sizeof(CString);i++)
{
sClientInfo[i] = s[i];
}
}
}CONTEXT_OBJECT,*PCONTEXT_OBJECT;

typedef CList<PCONTEXT_OBJECT> ContextObjectList;
Expand Down

0 comments on commit 0989cae

Please sign in to comment.