Skip to content

Commit c42cbb5

Browse files
committed
delete:time publish break field
1 parent 011f461 commit c42cbb5

File tree

5 files changed

+6
-16
lines changed

5 files changed

+6
-16
lines changed

XEngine_Source/MQCore_DBModule/DBModule_Define.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ typedef struct
3535
__int64x nIDMsg; //消息ID
3636
__int64x nIDTime; //发布时间
3737
bool bActive; //是否激活过
38-
bool bBreak; //跳过自身
3938
}XENGINE_DBTIMERELEASE;
4039
//用户消息
4140
typedef struct

XEngine_Source/MQCore_DBModule/DBModule_MQUser/DBModule_MQUser.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ bool CDBModule_MQUser::DBModule_MQUser_TimeInsert(XENGINE_DBTIMERELEASE* pSt_DBI
731731
XCHAR tszSQLStatement[10240];
732732
memset(tszSQLStatement, '\0', sizeof(tszSQLStatement));
733733

734-
_xstprintf(tszSQLStatement, _X("INSERT INTO `UserTime` (tszQueueName,nIDMsg,nIDTime,bActive,bBreak,tszCreateTime) VALUES('%s',%lld,%lld,0,%d,now())"), pSt_DBInfo->tszQueueName, pSt_DBInfo->nIDMsg, pSt_DBInfo->nIDTime, pSt_DBInfo->bBreak);
734+
_xstprintf(tszSQLStatement, _X("INSERT INTO `UserTime` (tszQueueName,nIDMsg,nIDTime,bActive,tszCreateTime) VALUES('%s',%lld,%lld,0,now())"), pSt_DBInfo->tszQueueName, pSt_DBInfo->nIDMsg, pSt_DBInfo->nIDTime);
735735
if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement))
736736
{
737737
DBModule_IsErrorOccur = true;
@@ -804,11 +804,7 @@ bool CDBModule_MQUser::DBModule_MQUser_TimeQuery(XENGINE_DBTIMERELEASE*** pppSt_
804804
}
805805
if (NULL != pptszResult[4])
806806
{
807-
(*pppSt_DBInfo)[i]->bBreak = _ttxoi(pptszResult[4]);
808-
}
809-
if (NULL != pptszResult[5])
810-
{
811-
_tcsxcpy((*pppSt_DBInfo)[i]->tszCreateTime, pptszResult[5]);
807+
_tcsxcpy((*pppSt_DBInfo)[i]->tszCreateTime, pptszResult[4]);
812808
}
813809
}
814810
DataBase_MySQL_FreeResult(xhDBSQL, xhTable);

XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
389389

390390
st_DBTime.nIDMsg = st_DBQueue.nQueueSerial;
391391
st_DBTime.nIDTime = st_MQProtocol.nPubTime;
392-
st_DBTime.bBreak = pSt_ProtocolHdr->wReserve;
393392
_tcsxcpy(st_DBTime.tszQueueName, st_DBQueue.tszQueueName);
394393

395394
BaseLib_OperatorTime_TTimeToStuTime(st_MQProtocol.nPubTime, &st_LibTime);

XEngine_Source/XEngine_MQServiceApp/MQService_Task.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ void CALLBACK MessageQueue_CBTask_TimePublish(XENGINE_DBTIMERELEASE* pSt_DBInfo,
3737
int nNetType = 0;
3838
XCHAR tszUserAddr[128];
3939
memset(tszUserAddr, '\0', sizeof(tszUserAddr));
40-
41-
if (pSt_DBInfo->bBreak)
40+
//是否跳过自己
41+
if (0 == _tcsxncmp(st_DBInfo.tszUserName, ppSt_ListUser[i]->tszUserName, _tcsxlen(st_DBInfo.tszUserName)) && (0 == st_MQProtocol.st_MSGAttr.byAttrSelf))
4242
{
43-
//是否跳过自己
44-
if (0 == _tcsxncmp(st_DBInfo.tszUserName, ppSt_ListUser[i]->tszUserName, _tcsxlen(st_DBInfo.tszUserName)) && (0 == st_MQProtocol.st_MSGAttr.byAttrSelf))
45-
{
46-
continue;
47-
}
43+
continue;
4844
}
4945
SessionModule_Client_GetAddr(ppSt_ListUser[i]->tszUserName, tszUserAddr);
5046
SessionModule_Client_GetType(tszUserAddr, &nNetType);

XEngine_Source/XQueue_ProtocolHdr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ typedef struct
7171
XCHAR tszMQKey[MAX_PATH]; //此消息的KEY,不能为空
7272
XCHAR tszMQUsr[MAX_PATH]; //此消息接受用户
7373
__int64x nSerial; //包序列号
74-
__int64x nPubTime; //发布时间,根据自己需求配置时区
74+
__int64x nPubTime; //发布时间,根据自己需求配置时区,-1表示投递的消息通过用户主动获取,0表示即时发布消息给当前订阅的在线用户,>0表示发布的日期
7575
int nKeepTime; //可用时间,单位秒,>0 超时秒数
7676
XENGINE_PROTOCOL_MSGATTR st_MSGAttr; //消息属性
7777
}XENGINE_PROTOCOL_XMQ, * LPXENGINE_PROTOCOL_XMQ;

0 commit comments

Comments
 (0)