212 lines
5.4 KiB
C++
212 lines
5.4 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "CTableFramePrivate.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>
|
|||
|
|
const WORD CTableFramePrivate::m_wPlayerCount=MAX_CHAIR; //<2F><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>캯<EFBFBD><ECBAAF>
|
|||
|
|
CTableFramePrivate::CTableFramePrivate()
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
m_pITableFrame=NULL;
|
|||
|
|
m_pGameServiceOption=NULL;
|
|||
|
|
m_pPrivateEventSink=NULL;
|
|||
|
|
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
CTableFramePrivate::~CTableFramePrivate(void)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>ӿڲ<D3BF>ѯ
|
|||
|
|
void * CTableFramePrivate::QueryInterface(const IID & Guid, DWORD dwQueryVer)
|
|||
|
|
{
|
|||
|
|
QUERYINTERFACE(ITableFramePrivate,Guid,dwQueryVer);
|
|||
|
|
QUERYINTERFACE(ITableUserAction,Guid,dwQueryVer);
|
|||
|
|
QUERYINTERFACE_IUNKNOWNEX(ITableFramePrivate,Guid,dwQueryVer);
|
|||
|
|
return NULL;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//
|
|||
|
|
bool CTableFramePrivate::SetPrivateEventSink(IUnknownEx * pIUnknownEx)
|
|||
|
|
{
|
|||
|
|
m_pPrivateEventSink=QUERY_OBJECT_PTR_INTERFACE(pIUnknownEx,IPrivateEventSink);
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>ʼ<EFBFBD><CABC>
|
|||
|
|
bool CTableFramePrivate::InitTableFramePrivate(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 CTableFramePrivate::OnEventGameStart(ITableFrame *pITableFrame, WORD wChairCount)
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnEventGameStart(pITableFrame, wChairCount);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
|
|||
|
|
bool CTableFramePrivate::OnEventGameEnd(ITableFrame *pITableFrame, WORD wChairID, IServerUserItem * pIServerUserItem, BYTE cbReason )
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnEventGameEnd(pITableFrame,wChairID,pIServerUserItem,cbReason);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
//д<><D0B4>
|
|||
|
|
bool CTableFramePrivate::WriteTableScore(ITableFrame* pITableFrame,tagScoreInfo ScoreInfoArray[], WORD wScoreCount,DataStream& kData)
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->WriteTableScore(pITableFrame,ScoreInfoArray,wScoreCount,kData);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
bool CTableFramePrivate::AddPrivateAction(ITableFrame* pTbableFrame,DWORD dwChairID, BYTE bActionIdex)
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->AddPrivateAction(pTbableFrame,dwChairID,bActionIdex);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
//<2F>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
bool CTableFramePrivate::IsAutoUserCountRule(ITableFrame* pTbableFrame, bool bReal)
|
|||
|
|
{
|
|||
|
|
if (m_pPrivateEventSink != NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->IsAutoUserCountRule(pTbableFrame, bReal);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
bool CTableFramePrivate::addPrivatePlayCout(ITableFrame* pTbableFrame, WORD wCout)
|
|||
|
|
{
|
|||
|
|
if (m_pPrivateEventSink != NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->addPrivatePlayCout(pTbableFrame, wCout);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
bool CTableFramePrivate::OnActionUserOffLine(WORD wChairID, IServerUserItem * pIServerUserItem)
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnActionUserOffLine(wChairID,pIServerUserItem);
|
|||
|
|
}
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
bool CTableFramePrivate::OnActionUserSitDown(WORD wChairID, IServerUserItem * pIServerUserItem, bool bLookonUser)
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnActionUserSitDown(m_pITableFrame->GetTableID(),wChairID, pIServerUserItem, bLookonUser);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
bool CTableFramePrivate::OnActionUserStandUp(WORD wChairID, IServerUserItem * pIServerUserItem, bool bLookonUser)
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnActionUserStandUp(m_pITableFrame->GetTableID(),wChairID, pIServerUserItem, bLookonUser);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>û<EFBFBD>ͬ<EFBFBD><CDAC>
|
|||
|
|
bool CTableFramePrivate::OnActionUserOnReady(WORD wChairID, IServerUserItem * pIServerUserItem, VOID * pData, WORD wDataSize)
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnActionUserOnReady(m_pITableFrame->GetTableID(),wChairID, pIServerUserItem ,pData ,wDataSize);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>û<EFBFBD><C3BB><EFBFBD>ʼ<EFBFBD><CABC>Ϸ
|
|||
|
|
bool CTableFramePrivate::OnActionUserOnStart(WORD wChairID, IServerUserItem * pIServerUserItem, VOID * pData, WORD wDataSize)
|
|||
|
|
{
|
|||
|
|
if (m_pPrivateEventSink != NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnActionUserOnStart(m_pITableFrame->GetTableID(), wChairID, pIServerUserItem, pData, wDataSize);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>û<EFBFBD><C3BB><EFBFBD>ʼ<EFBFBD><CABC>Ϸ
|
|||
|
|
bool CTableFramePrivate::OnActionUserStartGame(WORD wChairID, IServerUserItem * pIServerUserItem, VOID * pData, WORD wDataSize)
|
|||
|
|
{
|
|||
|
|
if (m_pPrivateEventSink != NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnActionUserStartGame(m_pITableFrame->GetTableID(), wChairID, pIServerUserItem, pData, wDataSize);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>û<EFBFBD><C3BB><EFBFBD>ȥ<EFBFBD><C8A5>Ϸ
|
|||
|
|
bool CTableFramePrivate::OnEventClientReady(WORD wChairID,IServerUserItem * pIServerUserItem)
|
|||
|
|
{
|
|||
|
|
if(m_pPrivateEventSink!=NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnEventClientReady(wChairID,pIServerUserItem);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
bool CTableFramePrivate::OnEventPrivateRoomInfo(WORD wChairID, IServerUserItem * pIServerUserItem)
|
|||
|
|
{
|
|||
|
|
if (m_pPrivateEventSink != NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnEventPrivateRoomInfo(wChairID, pIServerUserItem);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
|
|||
|
|
bool CTableFramePrivate::OnActionUserFangKaCheck(WORD wChairID, IServerUserItem * pIServerUserItem, SCORE lUserInsure)
|
|||
|
|
{
|
|||
|
|
if (m_pPrivateEventSink != NULL)
|
|||
|
|
{
|
|||
|
|
return m_pPrivateEventSink->OnActionUserFangKaCheck(m_pITableFrame->GetTableID(), wChairID, pIServerUserItem, lUserInsure);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|