int CGameFlyControl::OnGameTimer(UINT_PTR nIDEvent)
{

	int nTimer1=GetTimerID(BIRDMOVETIMER);
	int nTimer2=GetTimerID(BIRDFLYLEVELTIMER);
	if (nIDEvent == nTimer1)
	{
		DrawBirdBody(RGB(40,150,40));
		birdBody->MoveBirdPos();
		DrawBirdBody(dwBirdColor);
		if(birdBody->HasHitWall())
		{
				KillAllTimer();
				return -2;
		}
		if (birdBody->HasHitBird(gunControl->GetGunArry(),gunControl->GetGunWidth(),gunControl->GetGunHight()))
		{
			KillAllTimer();
			return -2;
		}
		ClearLast();
		DrawGunBody(RGB(40,150,40));
		gunControl->MoveGun();
		DrawGunBody(dwGunColor);
		if (gunControl->HasHitBird(birdBody->GetBirdRect()))
		{
			KillAllTimer();
			return -2;
		}
		IncreaseScore(1);
		gunControl->HasHitWall();
		gunControl->ReSetGunPos();
	}
	if (nIDEvent == nTimer2)
	{
		
			if (nHardLevel<21)
			{
				nHardLevel++;
				gunControl->SetMaxGun(nHardLevel);
			}
	}
	if (nIDEvent==GetTimerID(GUNMOVETIMER))
	{
		birdBody->ChangeBirdSpeed(bLButtonDown,0.6);
	}
		
	
	return 2;
}
//---------------------------------------------------------------------------------
 bool CClientGameDlg::OnCloseGame()           //关闭游戏
 {
	 TCHAR sz[200];	
	 KillAllTimer();
	  __super::OnCancel();
	 return true;
 }
// 控件开始按钮被点击
bool CClientGameDlg::OnControlHitBegin()
{
	if ((GetStationParameter()==GS_WAIT_SETGAME||GetStationParameter()==GS_WAIT_NEXT||GetStationParameter()==GS_WAIT_AGREE))
	{
		SendGameData(MDM_GM_GAME_NOTIFY,ASS_GM_AGREE_GAME,0);
	}
	ResetGameStation(RS_GAME_BEGIN);
	KillAllTimer();
	return true;
}
//定时器消息
bool CClientGameDlg::OnGameTimer(BYTE bDeskStation, UINT uTimeID, UINT uTimeCount)
{
	switch (uTimeID)
	{
	case ID_BEGIN_TIME:	//继续游戏定时器
		{
			if (uTimeCount <= 0)
			{

				OnHitBegin(0,0);	//时间到了
			}

			return true;
		}

	case ID_RESULT_TIME:
		{
			if(uTimeCount <= 0)
			{
				KillAllTimer();

				srand(GetTickCount()+GetMeUserInfo()->bDeskStation);

				if(!m_bLeftOrGoOn && m_iGameTimes >= rand()%m_byGameTimes+2)
				{
					OnCancel();
				}
				else
				{
					OnHitBegin(0,0);	//时间到了
				}
			}

			return true;
		}

	case ID_OUT_CARD:	//出牌
		{
			int iViewStation = ViewStation(bDeskStation);

			if (uTimeCount <= 0)	//时间到了
			{
				if(m_iNowOutPeople == GetMeUserInfo()->bDeskStation)
				{
					UserNote();	
				}
				return true;
			}
			
			return true;
		}
	}
	return true;
}
Exemple #5
0
void CPtnZler::OnCrackTout()
{
	KillAllTimer();
	WChess_ExitThreadCrack();
	//还原盘面
	memcpy(board, ptnboard, sizeof(board));
	//保存结果
	SaveToLog(TIMEOUT, 0);
	SaveToFile();
	//按红强进行调整子力
	ProcessPattern(true);
}
Exemple #6
0
void CTraceZler::OnMenuExit()
{
	KillAllTimer();
	WChess_ExitThreadCrack();

	//还原盘面
	memcpy(board, trcboard, sizeof(board));
	SendViewInd_InitState();
	SendMenuInd_InitState();
	g_pGameTable->SetZlerBase(NULL);

	window->MessageBox(L"小倒推已终止", L"小倒推", MB_ICONWARNING | MB_OK);
}
int CGameFlyControl::PauseGame(BOOL bPause)
{
	if (bPause)
	{
		KillAllTimer();
	}
	else
	{
		SetGameTimer(BIRDMOVETIMER,100);
		SetGameTimer(BIRDFLYLEVELTIMER,18000);
		SetGameTimer(GUNMOVETIMER,60);
	}
	return 2;
}
void CClientGameDlg::OnCancel()
{
	//查询状态
	if (! CanLeftDesk())
	{
		return;
	}

	KillAllTimer();

	AFCCloseFrame();

	SendGameData(MDM_GR_USER_ACTION,ASS_GR_USER_UP,0);		//发送起立消息

	__super::OnCancel();
}
//用户处理结果
LRESULT CClientGameDlg::OnHitActiveResult(WPARAM wparam, LPARAM lparam)
{
	if (GetStationParameter() == GS_PLAY_GAME)
	{
		if (m_iNowOutPeople != GetMeUserInfo()->bDeskStation)
			return 0L;

		KillAllTimer();
	
		int ret = (int) wparam;					
		tagUserProcess process;
		process.iVrebType = ret;					// 下注类型
		process.iNote =(__int64)lparam;				// 下注数(只有下注和加注才设置此值)
		SendGameData(&process,sizeof(process),MDM_GM_GAME_NOTIFY,ASS_VREB_CHECK,0);
	}
	return 0L;
}
Exemple #10
0
void CPtnZler::OnMenuExit()
{
	KillAllTimer();
	WChess_ExitThreadCrack();
	//征询是否全部退出
	if (window->MessageBox(L"是否全部退出?", L"定形局", MB_OKCANCEL) == IDCANCEL)
	{
		memcpy(board, ptnboard, sizeof(board));
		ProcessPattern(true);
	}
	else
	{
		//全部退出
		SendViewInd_InitState();
		SendMenuInd_InitState();
		g_pGameTable->SetZlerBase(NULL);
	}
}
Exemple #11
0
void CTraceZler::OnCrackTout()
{
	KillAllTimer();
	WChess_ExitThreadCrack();
	switch (m_nTraceStage)
	{
	case 0:
		ProcessTrace(0); //荒唐小倒推
		break;
	case 1:
		m_bToutFlag = true; //标记小倒推超时
		TrList1[m_nIdxBlk - 1].flag = false;
		ProcessTrList1();
		break;
	case 2:
		m_bToutFlag = true; //标记小倒推超时
		TrList2[m_nIdxRed - 1].flag = false;
		ProcessTrList2();
		break;
	}
}
//重置游戏
void CClientGameDlg::ResetGameStation(int iGameStation)
{
	//数据重置
	m_iNowOutPeople=-1;
	m_iFirstOutPeople=-1;
	KillAllTimer();
	::memset(m_iUserCardCount,0,sizeof(m_iUserCardCount));			//各玩家手上的扑克数
	::memset(m_iUserCard,0,sizeof(m_iUserCard));			//各玩家手上的扑克
	::memset(m_iDeskCardCount,0,sizeof(m_iDeskCardCount));			//桌面扑克的数目
	::memset(m_iDeskCard,0,sizeof(m_iDeskCard));			//桌面的扑克
	::memset(m_bUserReady,0,sizeof(m_bUserReady));
	::memset(m_bPlayer,0x00,sizeof(m_bPlayer));
	::memset(m_byUserOperatorType,0xff,sizeof(m_byUserOperatorType));
	::memset(m_i64UseAllNote,0x00,sizeof(m_i64UseAllNote));				//每个用户下的总注

	switch (iGameStation)
	{
	case RS_ALL_VIEW:
		{
			break;
		}
	case RS_GAME_CUT:
		{
			::memset(m_iDeskCardCount,0,sizeof(m_iDeskCardCount));
			break;
		}
	case RS_GAME_END:
		{
			break;
		}
	case RS_GAME_BEGIN:
		{

			break;
		}
	}

	return __super::ResetGameStation(iGameStation);
}
Exemple #13
0
void CPtnZler::OnCrackEnd(WPARAM wParam, LPARAM lParam)
{
	KillAllTimer();

	TCrackResult tCrackResult = WChess_GetCrackResult();
	if (wParam == BLKLOSE)
	{
		//记录结果并保存文件
		if (tCrackResult.nRound >= PTN_MINROUND)
		{
			SaveToLog(wParam, tCrackResult.nRound);
			SaveToFile();
		}
		//弱化攻势
		ProcessPattern(true);
	}
	else
	{
		//弱化守势
		ProcessPattern(false);
	}
}
Exemple #14
0
void CTraceZler::OnCrackEnd(WPARAM wParam, LPARAM lParam)
{
	KillAllTimer();

	TCrackResult tCrackResult = WChess_GetCrackResult();
	switch (m_nTraceStage)
	{
	case 0:
		if (wParam == REDLOSE)
			ProcessTrace(0);
		else
			ProcessTrace(tCrackResult.nRound);
		break;
	case 1:
		TrList1[m_nIdxBlk - 1].flag = wParam != REDLOSE;
		ProcessTrList1();
		break;
	case 2:
		TrList2[m_nIdxRed - 1].flag = wParam == REDLOSE;
		ProcessTrList2();
		break;
	}
}
//定时器消息
bool CClientGameDlg::OnGameTimer(BYTE bDeskStation, UINT uTimeID, UINT uTimeCount)
{

	switch (uTimeID)
	{
	case ID_BEGIN_TIME:	//继续游戏定时器
		{
			if (uTimeCount<=0)
			{
				//时间到了
				KillAllTimer();
				if (m_iAfterWaitAction == 1)
				{
					OnControlHitBegin();
				}
				else
				{
					SendMessage(WM_CLOSE,0,0);
				}
				return true;
			}
			return true;
		}
	case ID_SET_BOBOTIME:							//定时发关簸簸数据
		{
			KillTimer(ID_SET_BOBOTIME);
			SendBoboData();
			return true;
		}	
	case ID_FOLLOW_TIME:									//定时发送跟信息
		{
			KillTimer(ID_FOLLOW_TIME);
			Bnt_Follow();
			return true;
		}
	case ID_SET_ALL_TIME:									//定时发送敲信息
		{
			KillTimer(ID_SET_ALL_TIME);
			Bnt_Set_All();	
			return true;
		}
	case ID_BIG_TIME:										//定时发送大信息
		{
			KillTimer(ID_BIG_TIME);
			Bnt_Big();	
			return true;
		}
	case ID_STOP_TIME:										//定时发送休信息
		{
			KillTimer(ID_STOP_TIME);
			Bnt_Stop();
			return true;
		}
	case ID_GIVE_UP_TIME:									//定时发送丢信息
		{
			KillTimer(ID_GIVE_UP_TIME);
			Bnt_Give_Up();
			return true;
		}
	case ID_SEPARATE_TIME:
		{
			KillTimer(ID_SEPARATE_TIME);
			SendSeparatorCardData();
			return true;
		}
	}
	return true;
}
//游戏消息处理函数
bool CClientGameDlg::HandleGameMessage(NetMessageHead * pNetHead, void * pNetData, UINT uDataSize, CTCPClientSocket * pClientSocket)
{
	if (pNetHead->bMainID==MDM_GM_GAME_NOTIFY)
	{
		switch (pNetHead->bAssistantID)
		{
		case ASS_GM_AGREE_GAME:
			{
				if(uDataSize!=sizeof(MSG_GR_R_UserAgree))
				{
					return 0;
				}

				MSG_GR_R_UserAgree * pUser=(MSG_GR_R_UserAgree *)pNetData;

				m_bUserReady[pUser->bDeskStation] = true ;  ///游戏玩家准备状态
				m_bPlayer[pUser->bDeskStation] = true;
				m_byGameStation = 0x00;
				memset(m_i64UseAllNote,0x00,sizeof(m_i64UseAllNote));
				return true;
			}	
		case ASS_BEGIN_UPGRADE:		//游戏开始(设置簸簸时间)
			{
				if (uDataSize!=sizeof(BeginUpgradeStruct))
					return FALSE;
				SetStationParameter(GS_SEND_CARD);
				KillAllTimer();
				SetBoboTime(pNetData,uDataSize);
				return true;
			}
		case ASS_SEND_CARD:			//服务器发牌
			{
				if (uDataSize!=sizeof(SendCardStruct)) 
					return FALSE;
				Ass_Send_Card(pNetData,uDataSize);
				return true;
			}
		case ASS_SC_NOTICE_SEND_CARD:						//通知发牌
			{
				if(uDataSize!=sizeof(T_Notice_SendCard)) 
					return FALSE;
				Ass_Sc_Notice_Send_Card(pNetData, uDataSize);
				return true;
			}
		case ASS_SC_SEND_ONE_CARD_FINSH:							//第二次发牌结束
			{
				Ass_Sc_Send_One_Card_Finsh( pNetData, uDataSize);
				return true;
			}
		case ASS_SEND_FINISH:		//发牌完成
			{	
				return true;
			}
		case ASS_GAME_PLAY:		//开始游戏
			{
				//发牌完成,开始下注
				if (uDataSize!=sizeof(BeginPlayStruct)) 
					return FALSE;
				OnHandleGameBegin( pNetData, uDataSize);
				return true;
			}
		case ASS_NOTE:								//玩家押注情况
			{
				if(sizeof(NoteResult) != uDataSize)
				{
					return FALSE;
				}
				OnHandleBet(pNetData,uDataSize);
				return true;
			}
		case ASS_SC_NOTIC_SEPARET_CARD:
			{
				Ass_Sc_Notic_Separe_Card( pNetData, uDataSize);
				return true;
			}
		case ASS_SALE_END:	//游戏安全结束
		case ASS_CUT_END:	//用户强行离开
		case ASS_CONTINUE_END:	//游戏结束
		case ASS_NO_CONTINUE_END:
			{
				SetStationParameter(GS_WAIT_NEXT);
				ResetGameStation(RS_GAME_BEGIN);
				m_iBeginTime = 1;
				SetGameTimer(GetMeUserInfo()->bDeskStation,MyRand()% 5 +2,ID_BEGIN_TIME);					
				return TRUE;
			}
		case ASS_SET_BOBO_DATA:								//处理玩家设置BoBo
			{
				Ass_SetBobo_Data(pNetData,uDataSize);
				return true;
			}
		case ASS_SC_USER_GIVE_UP:
			{
				return true;
			}
		}
	}
	return __super::HandleGameMessage(pNetHead,pNetData,uDataSize, pClientSocket);
}
//退出
void CClientGameDlg::OnCancel()
{
	KillAllTimer();
	AFCCloseFrame();
	__super::OnCancel();
}
//游戏消息处理函数
bool CClientGameDlg::HandleGameMessage(NetMessageHead * pNetHead, void * pNetData, UINT uDataSize, CTCPClientSocket * pClientSocket)
{
	
	if (pNetHead->bMainID == MDM_GM_GAME_NOTIFY)
	{
		switch (pNetHead->bAssistantID)
		{
		case ASS_UG_USER_SET:		//用户设置牌局
			{
				return TRUE;
			}
		case ASS_UG_USER_SET_CHANGE://设置更改
			{				
				return true;
			}
		case ASS_GAME_BEGIN:		//游戏开始
			{
			
				////////////////
				//m_uKanID = ::BZPlayFlash(this,CPoint(100,100),"MiPaiAnima\\miPai.xml",1,"Mipai|res\\animaCfg.xml|45,1,-30,60|17,0|50, 53,33");A
				////////////////
				if (uDataSize != sizeof(GameBeginStruct))
					return FALSE;

				memset((void *)&m_szName, 0,sizeof(m_szName));

				//设置游戏状态
				SetStationParameter(GS_SEND_CARD);
				m_bTimeOutCount = 0;												// 超时次数
				GameBeginStruct * pBegin=(GameBeginStruct *)pNetData;
				m_bIsSuperUser = pBegin->bIsSuperUser;//自己是否超级客户端//lym 2011-11-28

				m_iLimitNote = pBegin->iLimitNote;									// 最大注(一局)
				m_iBaseNote = pBegin->iBaseNote;									// 底注
				m_byCurStyle = 0x00;
				::CopyMemory(m_bUserState,pBegin->bUserState,sizeof(pBegin->bUserState));	//用户状态
				m_bChangeRobotCard = pBegin->bChangeRobotCard;

				Msg("AAAA 总注--%I64d,,,%s",pBegin->iBaseNote,GetMeUserInfo()->szName);

				//下底注
				for(int i = 0; i < PLAY_COUNT; i ++)
				{
					/*if(m_pUserInfo[i] == NULL || false == m_bUserState[i])
						continue;*/
					m_iThisGameNote[i] += m_iBaseNote;//(DOUBLE)m_iLimitNote*0.015;
					m_iUserStation[i] = -1;
				
					lstrcpy(m_szName[i],m_pUserInfo[i]->GameUserInfo.nickName);
				}

				if(m_byGameTimes > 0)
				{
					m_iGameTimes++;
				}

				return TRUE;
			}
		case ASS_NOTE_LIMIE://本轮限注
			{
				return true;
			}
	
		case ASS_SEND_CARD:			//服务器发牌
			{
				if(uDataSize != sizeof(SendOneTurnCardStruct))
				{
					return TRUE;
				}

				SendOneTurnCardStruct  *pSendData = (SendOneTurnCardStruct *)pNetData;

				for(int i = 0 ; i<PLAY_COUNT ; i++)
				{			
					BYTE   bDesk  = ViewStation(i) ; 

					m_iDeskCardCount[ViewStation(i)] = pSendData->iCardCount[i]; 
					memcpy(&m_UserCard[bDesk],&pSendData->iCardList[i],sizeof(BYTE)*pSendData->iCardCount[i]);
					memcpy(&m_DeskCard[bDesk],&pSendData->iCardList[i],sizeof(BYTE)*pSendData->iCardCount[i]);

					//if(!m_bIsSuperUser)//lym 2011-11-28
					//{
					//	m_DeskCard[bDesk][0] = 0x00;	
					//}

				}

				if(m_bIsSuperUser)//超级客户端显示所有的牌
				{
					OutputDebugString("超级客户端:ASS_SEND_CARD");
				}

				CString str;

				for(int i = 0 ; i<PLAY_COUNT;i++)
				{
					BYTE  bdesk = ViewStation(i);
					for(int j = 0 ;j<5 ;j++)
					{
						CString str;
						str.Format("wys423client::pAllCard->iCardList[%d][%d]=%d,m_DeskCard[%d][%d]==%d  %d",i,j,pSendData->iCardList[i][j],bdesk,j,m_DeskCard[bdesk][j],m_iDeskCardCount[bdesk]);
						OutputDebugString(str);
					}
				}
				return TRUE ;

			}
		case ASS_COLLECT_JETON://收集筹码
			{
				
				
				return TRUE;
			}
		case ASS_SEND_A_CARD:
			{
				if(uDataSize != sizeof(SendOneTurnCard))
				{
					return false;
				}
				
				m_iOutCardPeople = 255;
				::memset(m_iThisTurnNote,0,sizeof(m_iThisTurnNote));

				///可能会断线重连,所以重新计算发牌的总数和要发的张数

		
				SendOneTurnCard *pSendOneTurnCard = (SendOneTurnCard *)pNetData ; 

				for(int i = 0;i<PLAY_COUNT;i++)
				{
					BYTE iPos = (pSendOneTurnCard->bStartPos+i)%PLAY_COUNT;

					int desk = ViewStation(iPos);

					CString str;
					Msg("zhtlog:pSendOneTurnCard->iTurnCard[%d]=%d m_bUserState[iPos]=%d m_iUserStation[iPos]=%d",iPos,pSendOneTurnCard->iTurnCard[iPos],m_iUserStation[iPos]);

					if(0 !=pSendOneTurnCard->iTurnCard[iPos] /*&& NULL!=m_pUserInfo[iPos] &&\
						true == m_bUserState[iPos] && TYPE_GIVE_UP!=m_iUserStation[iPos]*/)
					{
						m_DeskCard[desk][m_iDeskCardCount[desk]] = pSendOneTurnCard->iTurnCard[iPos];		//用户手中牌

						m_UserCard[desk][m_iDeskCardCount[desk] ++] = pSendOneTurnCard->iTurnCard[iPos];		//用户手中牌
						//无发牌动画版
						CString strr;
						strr.Format("zhtlog::pSendCard->iTurnCard[%d]==%d",iPos,pSendOneTurnCard->iTurnCard[iPos]);
						OutputDebugString(strr);

					}
				}

			   return true;
			}
		case ASS_SEND_FINISH:		//发牌完成
			{
					return TRUE;
			}

		case ASS_GAME_PLAY:		//开始游戏
			{
				if (uDataSize != sizeof(BeginPlayStruct)) 
				{
					return FALSE;
				}

				SetStationParameter(GS_PLAY_GAME);	//设置游戏状态

				BeginPlayStruct * pBeginInfo=(BeginPlayStruct *)pNetData;

				m_bTimeOutCount = 0;					//超时次数设置
				m_iNowOutPeople = m_iFirstOutPeople = pBeginInfo->bDeskStaton ;
				m_iNowBigNote = 0;							//当前最大押注数
				m_iThisTurnLimit = m_iLimitNote/4; //NOTE_LIMIT+m_iBaseNote; 第一轮下注 第二轮为 是底与全甩的1/4之间
				//第一次下注
				m_iThisNoteTimes = 1;
				//设置时间
				if(m_iNowOutPeople != -1)
				{
					SetGameTimer(m_iNowOutPeople,rand()%3+1,ID_OUT_CARD);
				}

				
				if (true == m_bUserState[GetMeUserInfo()->bDeskStation])
				{
					//modified by yjp.下注按钮根据底注,而不是上限
					__int64 ibt1 = (__int64)(m_iBaseNote*1.0);//(DOUBLE)m_iLimitNote*1.5/100;
					__int64 ibt2 = (__int64)(m_iBaseNote*2.0);//(DOUBLE)m_iLimitNote*3/100;
					__int64 ibt3 = (__int64)(m_iBaseNote*4.0);//(DOUBLE)m_iLimitNote*6/100;
					if (ibt1<= 0)
					{
						ibt1 = 1;
						ibt2 = 2;
						ibt3 = 4;
					}
				}

				// 自己是第一个下注的人
				if (GetMeUserInfo()->bDeskStation == m_iNowOutPeople)
				{	
					SetGameTimer(GetMeUserInfo()->bDeskStation ,rand() % GAME_RAND_TIME + 1,ID_OUT_CARD);
				}
			
				return TRUE;
			}
		case ASS_NOTE:								//玩家押注情况
			{
				if (uDataSize != sizeof(tagUserResult)) 
				{
					return TRUE;
				}

				tagUserResult *pResult = (tagUserResult *) pNetData;

				//用户下注用来显示下注动画,暂不赋值
				m_iNowOutPeople = pResult->iOutPeople;		//当前加注者

				//设置时间
				if (m_iNowOutPeople != -1) 
				{
					SetGameTimer(pResult->iOutPeople,rand()%3+2,ID_OUT_CARD);
				}
//1、	第1轮系统为所有人共同下的底(可设置不通房间不同的最少下底额)
//2、	第2轮下注额,是底与全甩的1/4之间,
//3、	第3轮下注额,是底到全甩的1/2之间,
//4、	第4轮下注额是底和棱哈之间
//5、 第5 轮下注额是底和棱哈之间

				// qy //设置押注上限
				if (1 == pResult->bNoteTimes)  // 第一轮
				{
					m_iThisTurnLimit = m_iLimitNote/4;
				}
				else if (2 == pResult->bNoteTimes)
				{
					m_iThisTurnLimit = m_iLimitNote/2;
				}
				else
				{
					m_iThisTurnLimit = (m_iLimitNote - m_iLimitNote/2 - m_iLimitNote/4-m_iBaseNote);
				}
				//if(pResult->bNoteTimes >= SHOWHA_TIME)
				//	m_iThisTurnLimit = m_iLimitNote;
				//else
				//	m_iThisTurnLimit = NOTE_LIMIT + m_iBaseNote;

				m_iThisNoteTimes = pResult->bNoteTimes;	//系统给他下注次数
				
				m_iNowBigNote = pResult->iNowBigNote;	//当前最大押注

				if (pResult->iOutPeople == GetMeUserInfo()->bDeskStation )
				{
				
					BYTE style = pResult->iNowBigNoteStyle;			//上一玩家最大下注类型
					m_byCurStyle = style;                           // 保存下注类型
					BOOL show = m_iThisNoteTimes >= m_bShowHa;					//第四轮才可以梭
					
					BOOL add;

					add = (/*!pResult->bAddTimes&&*/style != TYPE_SHUTTLE && m_iNowBigNote >= 0);
				                    
					//MyMsgBox("A:%d,%d,%d,%d",!pResult->bAddTimes,style,m_iNowBigNote,m_iThisTurnLimit);

					BOOL note = (m_iNowBigNote == 0);					//下注,只有在第一个下注者,或者本轮没有人下过注
					BOOL follow = (style != TYPE_SHUTTLE /*&& m_iNowBigNote != 0*/);	//没有人梭且下注额非0
					BOOL giveup = 1;
					if (m_bPK)
					{
						giveup= ((m_iThisNoteTimes > m_byUserFollow) && (m_byCurStyle != TYPE_SHUTTLE));
						CString str;
						str.Format("zhtlog:giveup=%d m_byCurStyle=%d",giveup,m_byCurStyle);
						OutputDebugString(str);
					}
					else
					{
						giveup= ((m_iThisNoteTimes > m_byUserFollow) || (m_byCurStyle == TYPE_SHUTTLE));
					}
					
					
					// 大于本论限注,不能加注
					if (m_iNowBigNote >= m_iThisTurnLimit)
					{
						add = FALSE;
					}
					//超过押注次数了 lym 2011-12-13
					if(m_byAddNum>0 && m_byAddNum!=255 && pResult->m_byUserAddNum[GetMeUserInfo()->bDeskStation] >= m_byAddNum)
					{
						add = FALSE;
					}
					char buff[500];
					sprintf(buff,"押注测试:m_byAddNum=%d 当前次数%d  玩家%s",m_byAddNum,pResult->m_byUserAddNum[GetMeUserInfo()->bDeskStation],GetMeUserInfo()->nickName);
					OutputDebugString(buff);

					// 小于2不能梭哈
					if (m_iThisNoteTimes < m_bShowHa)
					{
						show = FALSE;
					}

					// 其他人梭哈时,是可以梭哈的
					if (TYPE_SHUTTLE == style)
					{
						show = TRUE;
					}
					
					//m_PlayView.m_ShowNote.UpdateShowNoteBtn(show,note,add,follow,giveup);
					
					SetGameTimer(GetMeUserInfo()->bDeskStation ,rand() % GAME_RAND_TIME + 1,ID_OUT_CARD);
	}
				return true;
			}
		case ASS_NOTE_RESULT:											//押注结果
			{
				if (uDataSize != sizeof(NoteResult)) 
				{
					return FALSE;
				}

				KillAllTimer();
				NoteResult *noteresult = (NoteResult*)pNetData;
				m_iOutCardPeople = noteresult->iOutPeople;
				int iViewStation = ViewStation(noteresult->iOutPeople);
				::CopyMemory(m_iPerJuTotalNote,noteresult->iPlayerTotalNote,sizeof(noteresult->iPlayerTotalNote));
				
				//如果是放弃则不再显示牌面
				if(noteresult->bNoteStyle == TYPE_GIVE_UP)
				{
				
					m_iUserStation[noteresult->iOutPeople] = TYPE_GIVE_UP;
					Msg("zhtlog: ASS_NOTE_RESULTiViewStation=%d",iViewStation);

					memset(m_DeskCard[iViewStation],0,m_iDeskCardCount[iViewStation]);
					memset(m_UserCard[iViewStation],0,sizeof(m_UserCard[iViewStation]));
									
				}
				else			//更新下注
				{
					//colin090420记录
				    m_TempNote[noteresult->iOutPeople] = noteresult->iCurNote;
					
					//设置某一个人下注总额
					if(m_iThisNoteTimes < m_bShowHa)
						m_iThisGameNote[noteresult->iOutPeople] += noteresult->iCurNote;
					//本轮下注
					   m_iThisTurnNote[noteresult->iOutPeople] += noteresult->iCurNote;
					
				}

				return true;
			}
		case ASS_AI_STATION://弃牌
			{
				if(uDataSize != sizeof(UseAIStation))
					return TRUE;
				UseAIStation *ai = (UseAIStation*)pNetData;
							
				if( m_iNowOutPeople == ai->bDeskStation)
					ReplaceUserNote(ai->bDeskStation);
				BYTE iViewStation = ViewStation(ai->bDeskStation);
				memset(m_DeskCard[iViewStation],0,m_iDeskCardCount[iViewStation]);
				m_bNetCutPlayer[ai->bDeskStation] = TRUE;
				Msg("zhtlog: ASS_NOTE_RESULTiViewStation=%d",iViewStation);
				return true;
			}
		case ASS_NO_WINER://无胜者产生
		case ASS_AHEAD_END://提前结束
		case ASS_SALE_END:	//游戏安全结束
		case ASS_CUT_END:	//用户强行离开	
		case ASS_CONTINUE_END:	//游戏结束
		case ASS_NO_CONTINUE_END:
			{
				SetStationParameter((pNetHead->bAssistantID == ASS_CONTINUE_END) ? GS_WAIT_NEXT : GS_WAIT_ARGEE);

				ResetGameStation(RS_GAME_END);

				KillAllTimer();

				srand(GetMeUserInfo()->bDeskStation);
				BYTE byTemp = 0; 
				if(m_byLeaveThinkTime <= 0)	//没有配置机器人离开时间 就按原来的方式设定计时器
				{
					SetGameTimer(GetMeUserInfo()->bDeskStation,rand()%3+3,ID_BEGIN_TIME);
				}
				else
				{
					byTemp = rand()%m_byLeaveThinkTime; 
					byTemp = byTemp < 2?2:byTemp;
					SetGameTimer(GetMeUserInfo()->bDeskStation,byTemp,ID_RESULT_TIME);
				}

				return TRUE;
			}
	

		case ASS_PLAY_FLASH:
			{
							
				return TRUE;
			}

		case ASS_HAVE_THING:	//用户请求离开
			{
				return TRUE;
			}
		case ASS_LEFT_RESULT:	//请求离开结果 
			{
				return TRUE;
			}
		case ASS_MESSAGE:
			{

				return true;
			}
		case ASS_STOP_THING://对家请求提前结束
			{
				return true;
			}
		case ASS_AGREE_STOP://请求提前结束结果
			{
				return true;
			}

		}
	}
	return __super::HandleGameMessage(pNetHead,pNetData,uDataSize,pClientSocket);
}
//------------------------------------------------------------------------------------
//游戏结束
bool CServerGameDesk::GameFinish(BYTE bDeskStation, BYTE bCloseFlag)
{

	DebugPrintf("happy landowner GameFinish 结束玩家【%d】,结束类型【%d】",bDeskStation,bCloseFlag);

	KillAllTimer();
	
	GameEndStruct s_gameend;

	switch (bCloseFlag)
	{
	case GF_NORMAL:		//游戏正常结束
		{
			CountResultScore(bDeskStation,&s_gameend,GF_NORMAL);	//计算得分

			m_bGameStation = GS_WAIT_ARGEE;

			break;
		}
	case GFF_FORCE_FINISH:	//强制退出结束
		{
			CountResultScore(bDeskStation,&s_gameend,GFF_FORCE_FINISH);	//计算得分

			m_bGameStation = GS_WAIT_ARGEE;	//游戏状态 等待下一盘开始

			bCloseFlag = GF_SALE;

			break;
		}
	case GF_SALE:			//游戏安全结束
		{
			m_bGameStation = GS_WAIT_ARGEE;

			break;
		}

	default:break;
	}
	memcpy(s_gameend.bIsPrepare,m_bIsPrepare,sizeof(s_gameend.bIsPrepare));
	//发送数据
	for (int i=0; i<PLAY_COUNT; ++i) 
	{
		if(NULL == m_pUserInfo[i])
			continue;

		SendGameData(i,&s_gameend,sizeof(GameEndStruct),MDM_GM_GAME_NOTIFY,ASS_CONTINUE_END,0);
	}
	SendWatchData(m_bMaxPeople,&s_gameend,sizeof(GameEndStruct),MDM_GM_GAME_NOTIFY,ASS_CONTINUE_END,0);

	ReSetGameState(bCloseFlag);	//重置数据

	__super::GameFinish(bDeskStation,bCloseFlag);

	for(int i = 0; i < PLAY_COUNT; ++i)
	{
		if(NULL == m_pUserInfo[i])
		{
			m_bIsAuto[i] = false;
		}
	}
	
	return true;
}