本文整理汇总了C++中Message::AddTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ Message::AddTarget方法的具体用法?C++ Message::AddTarget怎么用?C++ Message::AddTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Message
的用法示例。
在下文中一共展示了Message::AddTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageResponse
void SessionSrv::MessageResponse(Message* message)
{
CTaskID task_id = *(CTaskID*)message->ReadPayload(0);
GS_INT taskType = (*(GS_INT*)message->ReadPayload(1));
GS_DWORD taskResult = *(GS_DWORD*)message->ReadPayload(2);
GS_DWORD taskDetailedResult = *(GS_DWORD*)message->ReadPayload(3);
#if defined(_XBOX) || defined(_XENON)
GS_DWORD taskExtendedResult = *(GS_DWORD*)message->ReadPayload(4);
#endif
#if defined(_XBOX) || defined(_XENON)
if (ERROR_SUCCESS == taskResult)
#elif defined(_PS3)
if (0 == taskResult)
#endif
{
switch (taskType)
{
case EGSTaskType_SessionCreate:
case EGSTaskType_SessionJoin:
m_IsCreated = TRUE;
break;
case EGSTaskType_SessionStart:
m_IsStarted = TRUE;
break;
case EGSTaskType_SessionEnd:
m_IsStarted = FALSE;
break;
case EGSTaskType_SessionDelete:
case EGSTaskType_SessionLeave:
m_IsCreated = FALSE;
#if defined(_XBOX) || defined(_XENON)
m_hSession = INVALID_HANDLE_VALUE;
#endif
break;
default:
break;
}
}
// Message to Interface
Message* msg = Message::Create(EMessage_CallBackInterface);
if (msg)
{
msg->AddPayload(taskType);
#if defined(_XBOX) || defined(_XENON)
GS_BOOL result = (ERROR_SUCCESS == taskResult) ? TRUE : FALSE;
#elif defined(_PS3)
GS_BOOL result = (0 == taskResult) ? TRUE : FALSE;
#else
GS_BOOL result = TRUE;
#endif
msg->AddPayload(result);
msg->AddTarget(Master::G()->GetInterfaceMgr());
Master::G()->GetMessageMgr()->Send(msg);
}
}