Ejemplo n.º 1
0
//游戏事件
//游戏状态
bool __cdecl CGameClientDlg::OnEventGameScene(BYTE cbGameStation, bool bLookonOther, void * pBuffer, WORD wDataSize)
{
	//要是做成通用是需要相应修改
	/*
	m_pGameFrameControl->m_UserListView.m_wKindID=m_ClientKernelHelper->GetServerAttribute()->wKindID;
	m_pGameFrameControl->m_UserListView.m_wGameGenre=m_ClientKernelHelper->GetServerAttribute()->wGameGenre;
	*/
	return OnGameSceneMessage(cbGameStation,bLookonOther,pBuffer,wDataSize);
}
Ejemplo n.º 2
0
	bool			IAndroid::OnMainSocket(WORD wMainCmdID, WORD wSubCmdID, void * pBuffer, WORD wDataSize)
	{
		switch (wSubCmdID)
		{
		case IPC_SUB_SOCKET_RECV:	//数据接收
			{
				if (wDataSize<sizeof(CMD_Command)) 
					return false;

				//提取数据
				WORD wPacketSize=wDataSize-sizeof(CMD_Command);
				IPC_SocketPackage * pSocketPackage=(IPC_SocketPackage *)pBuffer;

				switch(pSocketPackage->Command.wMainCmdID)
				{
				case MDM_GF_GAME:
					{
						if(wPacketSize == 0)
						{
							return OnGameMessage(pSocketPackage->Command.wSubCmdID);
						}
						else
						{
							return OnGameMessage(pSocketPackage->Command.wSubCmdID,pSocketPackage->cbBuffer,wPacketSize);
						}
					}
				case MDM_GF_FRAME:
					{
						switch(pSocketPackage->Command.wSubCmdID)
						{
						case SUB_GF_OPTION:			//游戏配置
							{
								//效验参数
								if (wPacketSize!=sizeof(CMD_GF_Option)) 
									return 0;

								//消息处理
								CMD_GF_Option* pOption=(CMD_GF_Option *)pSocketPackage->cbBuffer;
								m_bGameStatus = pOption->bGameStatus;

								return true;
							}
						case SUB_GF_SCENE:			//游戏场景
							{
								return OnGameSceneMessage(m_bGameStatus,pSocketPackage->cbBuffer,wPacketSize);
							}
						case SUB_GF_LOOKON_CONTROL:	//旁观控制
							{
								return true;
							}
						case SUB_GF_USER_CHAT:		//聊天信息
							{
								return true;
							}

						case SUB_GF_MESSAGE:		//系统消息
							{
								return true;
							}
						}
					}
				}
			}
		}

		return true;
	}