121 lines
2.8 KiB
C++
121 lines
2.8 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "TableFrameHook.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>
|
|||
|
|
const WORD CTableFrameHook::m_wPlayerCount=MAX_CHAIR; //<2F><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>캯<EFBFBD><ECBAAF>
|
|||
|
|
CTableFrameHook::CTableFrameHook()
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
m_pITableFrame=NULL;
|
|||
|
|
m_pGameServiceOption=NULL;
|
|||
|
|
m_pMatchEventSink=NULL;
|
|||
|
|
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
CTableFrameHook::~CTableFrameHook(void)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>ӿڲ<D3BF>ѯ
|
|||
|
|
void * CTableFrameHook::QueryInterface(const IID & Guid, DWORD dwQueryVer)
|
|||
|
|
{
|
|||
|
|
QUERYINTERFACE(ITableFrameHook,Guid,dwQueryVer);
|
|||
|
|
QUERYINTERFACE(ITableUserAction,Guid,dwQueryVer);
|
|||
|
|
QUERYINTERFACE_IUNKNOWNEX(ITableFrameHook,Guid,dwQueryVer);
|
|||
|
|
return NULL;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//
|
|||
|
|
bool CTableFrameHook::SetMatchEventSink(IUnknownEx * pIUnknownEx)
|
|||
|
|
{
|
|||
|
|
m_pMatchEventSink=QUERY_OBJECT_PTR_INTERFACE(pIUnknownEx,IMatchEventSink);
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>ʼ<EFBFBD><CABC>
|
|||
|
|
bool CTableFrameHook::InitTableFrameHook(IUnknownEx * pIUnknownEx)
|
|||
|
|
{
|
|||
|
|
//<2F><>ѯ<EFBFBD>ӿ<EFBFBD>
|
|||
|
|
ASSERT(pIUnknownEx!=NULL);
|
|||
|
|
m_pITableFrame=QUERY_OBJECT_PTR_INTERFACE(pIUnknownEx,ITableFrame);
|
|||
|
|
if (m_pITableFrame==NULL) return false;
|
|||
|
|
|
|||
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|||
|
|
m_pGameServiceOption=m_pITableFrame->GetGameServiceOption();
|
|||
|
|
ASSERT(m_pGameServiceOption!=NULL);
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>Ϸ<EFBFBD><CFB7>ʼ
|
|||
|
|
bool CTableFrameHook::OnEventGameStart(ITableFrame *pITableFrame, WORD wChairCount)
|
|||
|
|
{
|
|||
|
|
if(m_pMatchEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pMatchEventSink->OnEventGameStart(pITableFrame, wChairCount);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
|
|||
|
|
bool CTableFrameHook::OnEventGameEnd(ITableFrame *pITableFrame, WORD wChairID, IServerUserItem * pIServerUserItem, BYTE cbReason )
|
|||
|
|
{
|
|||
|
|
if(m_pMatchEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pMatchEventSink->OnEventGameEnd(pITableFrame,wChairID,pIServerUserItem,cbReason);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
bool CTableFrameHook::OnActionUserSitDown(WORD wChairID, IServerUserItem * pIServerUserItem, bool bLookonUser)
|
|||
|
|
{
|
|||
|
|
if(m_pMatchEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pMatchEventSink->OnActionUserSitDown(m_pITableFrame->GetTableID(),wChairID, pIServerUserItem, bLookonUser);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
bool CTableFrameHook::OnActionUserStandUp(WORD wChairID, IServerUserItem * pIServerUserItem, bool bLookonUser)
|
|||
|
|
{
|
|||
|
|
if(m_pMatchEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pMatchEventSink->OnActionUserStandUp(m_pITableFrame->GetTableID(),wChairID, pIServerUserItem, bLookonUser);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>û<EFBFBD>ͬ<EFBFBD><CDAC>
|
|||
|
|
bool CTableFrameHook::OnActionUserOnReady(WORD wChairID, IServerUserItem * pIServerUserItem, VOID * pData, WORD wDataSize)
|
|||
|
|
{
|
|||
|
|
if(m_pMatchEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pMatchEventSink->OnActionUserOnReady(m_pITableFrame->GetTableID(),wChairID, pIServerUserItem ,pData ,wDataSize);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
bool CTableFrameHook::OnActionUserFangKaCheck(WORD wChairID, IServerUserItem * pIServerUserItem, SCORE lUserInsure)
|
|||
|
|
{
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|