提交 960c6d7c 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

Ready for cross-svr Smartlink dev

上级 f524aa5f
...@@ -195,16 +195,17 @@ namespace ZP_Cluster{ ...@@ -195,16 +195,17 @@ namespace ZP_Cluster{
{ {
qint32 bytesLeft = m_currentHeader.data_length + sizeof(CROSS_SVR_MSG::tag_header) qint32 bytesLeft = m_currentHeader.data_length + sizeof(CROSS_SVR_MSG::tag_header)
-m_currentMessageSize ; -m_currentMessageSize ;
if (m_currentBlock.length()>=64)
emit evt_Message(this,"Debug:" + m_currentBlock.toHex().left(64) + "..." + m_currentBlock.toHex().right(64));
else
emit evt_Message(this,"Debug:" + m_currentBlock.toHex());
const CROSS_SVR_MSG * pMsg =(const CROSS_SVR_MSG *) m_currentBlock.constData(); const CROSS_SVR_MSG * pMsg =(const CROSS_SVR_MSG *) m_currentBlock.constData();
switch(m_currentHeader.messagetype) switch(m_currentHeader.messagetype)
{ {
case 0x00://Heart Beating case 0x00://Heart Beating
break; break;
case 0x01://basicInfo, when connection established, this message should be used case 0x01://basicInfo, when connection established, this message should be used
if (m_currentBlock.length()>=64)
emit evt_Message(this,"Debug:" + m_currentBlock.toHex().left(64) + "..." + m_currentBlock.toHex().right(64));
else
emit evt_Message(this,"Debug:" + m_currentBlock.toHex());
if (bytesLeft==0) if (bytesLeft==0)
{ {
QString strName ((const char *)pMsg->payload.basicInfo.name); QString strName ((const char *)pMsg->payload.basicInfo.name);
...@@ -215,6 +216,7 @@ namespace ZP_Cluster{ ...@@ -215,6 +216,7 @@ namespace ZP_Cluster{
m_addrPublish = QHostAddress((const char *)pMsg->payload.basicInfo.Address); m_addrPublish = QHostAddress((const char *)pMsg->payload.basicInfo.Address);
if (false==m_pTerm->regisitNewServer(this)) if (false==m_pTerm->regisitNewServer(this))
{ {
this->m_strTermName.clear();
emit evt_Message(this,tr("Info: New Svr already regisited. Ignored.")+strName); emit evt_Message(this,tr("Info: New Svr already regisited. Ignored.")+strName);
emit evt_close_client(this->sock()); emit evt_close_client(this->sock());
} }
...@@ -232,6 +234,11 @@ namespace ZP_Cluster{ ...@@ -232,6 +234,11 @@ namespace ZP_Cluster{
} }
break; break;
case 0x02: //Server - broadcast messages case 0x02: //Server - broadcast messages
if (m_currentBlock.length()>=64)
emit evt_Message(this,"Debug:" + m_currentBlock.toHex().left(64) + "..." + m_currentBlock.toHex().right(64));
else
emit evt_Message(this,"Debug:" + m_currentBlock.toHex());
if (bytesLeft==0) if (bytesLeft==0)
{ {
int nSvrs = pMsg->hearder.data_length / sizeof(CROSS_SVR_MSG::uni_payload::tag_CSM_Broadcast); int nSvrs = pMsg->hearder.data_length / sizeof(CROSS_SVR_MSG::uni_payload::tag_CSM_Broadcast);
...@@ -253,6 +260,11 @@ namespace ZP_Cluster{ ...@@ -253,6 +260,11 @@ namespace ZP_Cluster{
} }
break; break;
case 0x03: case 0x03:
if (m_currentBlock.length()>=64)
emit evt_Message(this,"Debug:" + m_currentBlock.toHex().left(64) + "..." + m_currentBlock.toHex().right(64));
else
emit evt_Message(this,"Debug:" + m_currentBlock.toHex());
if (m_currentMessageSize==m_currentBlock.size()) if (m_currentMessageSize==m_currentBlock.size())
{ {
QByteArray arraySend ((const char *)(pMsg) + sizeof(CROSS_SVR_MSG::tag_header), QByteArray arraySend ((const char *)(pMsg) + sizeof(CROSS_SVR_MSG::tag_header),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册