⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mapnetworkmsgparser.cpp

📁 墨香最新私服
💻 CPP
📖 第 1 页 / 共 5 页
字号:
			PWMODMGR_OBJ->Peace_WarMode(pPlayer, TRUE);
		}
	break;

	case MP_PEACEWARMODE_WAR:
		{
			PWMODMGR_OBJ->Peace_WarMode(pPlayer, FALSE);
		}
		break;
	}
}

void MP_TACTICMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pTempMsg = (MSGBASE*)pMsg;
	switch(pTempMsg->Protocol)
	{
	case MP_TACTIC_START_SYN:
		{
			SEND_TACTIC_START* pmsg = (SEND_TACTIC_START*)pMsg;
			CPlayer* pPlayer	= (CPlayer *)g_pUserTable->FindUser(pmsg->dwObjectID);
			if(pPlayer == NULL)
				return;

			TACTICMGR->OnTacticStartReceived(pPlayer, pmsg);

		}
		break;
	case MP_TACTIC_JOIN_SYN:
		{
			SEND_TACTIC_JOIN* pmsg = (SEND_TACTIC_JOIN*)pMsg;
			CPlayer* pPlayer	= (CPlayer *)g_pUserTable->FindUser(pmsg->dwObjectID);
			if(pPlayer == NULL)
				return;

			TACTICMGR->OnTacticJoinReceived(pPlayer, pmsg);

		}
		break;
	}
}

void MP_MUNPAMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pTempMsg = (MSGBASE*)pMsg;
	switch(pTempMsg->Protocol)
	{
	case MP_MUNPA_LOAD_MUNPALIST_SYN:
		{
			SEND_MUNPALIST_SYN *msg = (SEND_MUNPALIST_SYN*)pMsg;
			MUNPAMGR->LoadMunpaListSyn(msg);
		}
		break;
	case MP_MUNPA_SEARCHMUNPA_SYN:
		{
			MUNPA_SEARCH_SYN* msg = (MUNPA_SEARCH_SYN*)pMsg;
			MUNPAMGR->SearchMunpa(msg->dwObjectID, msg->SearchKey, msg->GotoPage);
		}
		break;
	case MP_MUNPA_CREATE_SYN:
		{
			MUNPA_CREATE_INFO* msg = (MUNPA_CREATE_INFO*)pMsg;
			MUNPAMGR->CreateMunpa(msg);
		}
		break;
	case MP_MUNPA_BREAKUP_SYN:
		{
			MSG_DWORD* msg = (MSG_DWORD*)pMsg;
			MUNPAMGR->BreakUpMunpa(msg);
		}
		break;
	case MP_MUNPA_CHANGERANK_SYN:
		{
			SEND_MUNPAMEMBER_RANK_CHANGE* msg = (SEND_MUNPAMEMBER_RANK_CHANGE*)pMsg;
			MUNPAMGR->ChangeRank(msg->dwObjectID, msg->TargetID, msg->Rank, msg->MunpaID);
		}
		break;
	case MP_MUNPA_BAN_SYN:
		{
			SEND_MUNPACCEPT_INFO* msg = (SEND_MUNPACCEPT_INFO*)pMsg;
			MUNPAMGR->BanMember(msg->dwObjectID, msg->MunpaID, msg->TargetID, msg->bLast);
		}
		break;

	case MP_MUNPA_SECEDE_SYN:
		{
			MSGBASE* msg = (MSGBASE*)pMsg;
			MUNPAMGR->SecedeMunpa(msg->dwObjectID);
		}
		break;
	case MP_MUNPA_ADDMEMBER_SYN:
		{
			SEND_MUNPACCEPT_INFO* msg = (SEND_MUNPACCEPT_INFO*)pMsg;
			MUNPAMGR->AcceptMember(msg->dwObjectID, msg->MunpaID, msg->TargetID, msg->bLast);
		}
		break;
	case MP_MUNPA_DENYMEMBER_SYN:
		{
			SEND_MUNPACCEPT_INFO* msg = (SEND_MUNPACCEPT_INFO*)pMsg;
			MUNPAMGR->DenyMember(msg->dwObjectID, msg->MunpaID, msg->TargetID, msg->bLast);
		}
		break;
	case MP_MUNPA_JOINMEMBER_SYN:
		{
			MSG_DWORD* msg = (MSG_DWORD*)pMsg;
			MUNPAMGR->JoinMember(msg->dwObjectID, msg->dwData);
		}
		break;
	case MP_MUNPA_JOINMEMBERCANCEL_SYN:
		{
			MSGBASE* msg = (MSGBASE*)pMsg;
			MUNPAMGR->JoinMemberCancel(msg->dwObjectID);
		}
		break;
	case MP_MUNPA_MUNPAHOME_SYN:
		{
			MSG_DWORD* msg = (MSG_DWORD*)pMsg;
			MUNPAMGR->MunpaHomeInfoSyn(msg->dwObjectID, msg->dwData);
		}
		break;
	case MP_MUNPA_REGULARMEMBERS_INFO_SYN:
		{
			MSG_DWORD2* msg = (MSG_DWORD2*)pMsg;
			CPlayer* pPlayer = (CPlayer *)g_pUserTable->FindUser(msg->dwObjectID);
			if(pPlayer == NULL)
				return;

			MUNPAMGR->RegularMembersInfo(pPlayer, msg->dwData1, msg->dwData2);
		}
		break;
	case MP_MUNPA_JOINMEMBERS_INFO_SYN:
		{
			MSG_DWORD2* msg = (MSG_DWORD2*)pMsg;
			MUNPAMGR->JoinMembersInfo(msg->dwObjectID, msg->dwData1, msg->dwData2);
		}
		break;
	case MP_MUNPA_BOARD_INFO_SYN:
		{
			MSG_DWORD* msg = (MSG_DWORD*)pMsg;
			MUNPAMGR->MunpaBoardInfoSyn(msg->dwObjectID, msg->dwData);
		}
		break;
	case MP_MUNPA_CREATEBOARD_SYN:
		{
			SEND_MUNPA_BOARD_RANK_INFO* msg = (SEND_MUNPA_BOARD_RANK_INFO*)pMsg;
			MUNPAMGR->CreateBoard(msg);
		}
		break;
	case MP_MUNPA_DELETEBOARD_SYN:
		{
			SEND_MUNPACCEPT_INFO* msg = (SEND_MUNPACCEPT_INFO*)pMsg;
			MUNPAMGR->DeleteBoard(msg);
		}
		break;
	case MP_MUNPA_BOARDRANK_INFO_SYN:
		{
			MSG_DWORD* msg = (MSG_DWORD*)pMsg;
			MUNPAMGR->BoardRankInfo(msg->dwObjectID, msg->dwData);
		}
		break;
	case MP_MUNPA_BOARD_MODIFYRANK_INFO_SYN:
		{
			SEND_MUNPA_BOARD_RANK_INFO* msg = (SEND_MUNPA_BOARD_RANK_INFO*)pMsg;
			MUNPAMGR->BoardModifyRank(msg);
		}
		break;
	case MP_MUNPA_BOARD_SUBJECTLIST_SYN:
		{
			MSG_DWORD3* msg = (MSG_DWORD3*)pMsg;
			MUNPAMGR->BoardSubjectListSyn(msg);
		}
		break;
	case MP_MUNPA_BOARD_WRITE_SYN:
		{
			SEND_BOARD_CONTENT_INFO* msg = (SEND_BOARD_CONTENT_INFO*)pMsg;
			MUNPAMGR->BoardWriteSyn(msg);
		}
		break;
	case MP_MUNPA_BOARD_MODIFY_SYN:
		{
			SEND_BOARD_CONTENT_INFO* msg = (SEND_BOARD_CONTENT_INFO*)pMsg;
			MUNPAMGR->BoardModifySyn(msg);
		}
		break;
	case MP_MUNPA_BOARD_CONTENTS_SYN:
		{
			MSG_DWORD3* msg = (MSG_DWORD3*)pMsg;
			MUNPAMGR->BoardContentsSyn(msg);
		}
		break;
	case MP_MUNPA_BOARD_DELETE_SYN:
		{
			MSG_DWORD2* msg = (MSG_DWORD2*)pMsg;
			MUNPAMGR->BoardDeleteContentsSyn(msg);
		}
		break;
	case MP_MUNPA_MODIFY_INTROMSG_SYN:
		{
			MUNPA_MODIFY_INTRO* msg = (MUNPA_MODIFY_INTRO*)pMsg;
			MUNPAMGR->ModifyIntroMsg(msg);
		}
		break;
	case MP_MUNPA_PUTIN_MONEY_SYN:
		{
			MSG_DWORD * msg = (MSG_DWORD *)pMsg;
			CPlayer* pPlayer = (CPlayer*)g_pUserTable->FindUser(msg->dwObjectID);
			if(!pPlayer)
				return;
			MUNPAMGR->PutInMoney(pPlayer, msg->dwData);
		}
		break;
	case MP_MUNPA_PUTOUT_MONEY_SYN:
		{
			MSG_DWORD * msg = (MSG_DWORD *)pMsg;
			CPlayer* pPlayer = (CPlayer*)g_pUserTable->FindUser(msg->dwObjectID);
			if(!pPlayer)
				return;
			MUNPAMGR->PutOutMoney(pPlayer, msg->dwData);
		}
		break;
	//notify to mapserver
	case MP_MUNPA_NOTIFY_CHANGERANK_TO_MAPSERVER:
		{
			SEND_MUNPAMEMBER_RANK_CHANGE_ACK* msg = (SEND_MUNPAMEMBER_RANK_CHANGE_ACK*)pMsg;
			MUNPAMGR->NotifyChangeRank(msg->dwObjectID, msg->MunpaID, msg->Rank, msg->Fame);
		}
		break;
	case MP_MUNPA_NOTIFYBAN_TO_MAPSERVER:
		{
			MSG_DWORD2* pmsg = (MSG_DWORD2*)pMsg;
			MUNPAMGR->NotifyBanMember(pmsg->dwObjectID, pmsg->dwData1, pmsg->dwData2);
		}
		break;
	case MP_MUNPA_NOTIFY_ADDMEMBER_TO_MAPSERVER:
		{
			SEND_MUNPA_ACCEPT_TO_MAP* pmsg = (SEND_MUNPA_ACCEPT_TO_MAP*)pMsg;
			MUNPAMGR->NotifyAcceptMember(pmsg);
		}
		break;
	case MP_MUNPA_NOTIFYBREAKUP_TO_MAPSERVER:
		{
			MSG_DWORD2* pmsg = (MSG_DWORD2*)pMsg;
			MUNPAMGR->NotifyBreakupMunpa(pmsg->dwObjectID,pmsg->dwData1, pmsg->dwData2);
		}
		break;
	case MP_MUNPA_NOTIFY_DENYMEMBER_TO_MAPSERVER:
		{
			MSGBASE* pmsg = (MSGBASE*)pMsg;
			MUNPAMGR->NotifyDenyMember(pmsg);
		}
		break;
	}
}


void MP_PYOGUKMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	PYOGUKMGR->NetworkMsgParse(pmsg->Protocol,pMsg);
}

void MP_WANTEDMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	WANTEDMGR->NetworkMsgParse(pmsg->Protocol,pMsg);
}

void MP_JOURNALMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	JOURNALMGR->NetworkMsgParse(pmsg->Protocol,pMsg);
}

void MP_SURYUNMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	SURYUNMGR->NetworkMsgParse(pmsg->Protocol,pMsg);
}

void MP_SkillMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	SKILLMGR->NetworkMsgParse(pmsg->Protocol,pMsg);
}

void MP_EXCHANGEMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	EXCHANGEMGR->NetworkMsgParse( pmsg->Protocol, pMsg );
}

void MP_STREETSTALLMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	STREETSTALLMGR->NetworkMsgParse( pmsg->Protocol, pMsg );
}

void MP_BattleMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	BATTLESYSTEM->NetworkMsgParse( pmsg->Protocol, pmsg );
}

void MP_REVIVEMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pTempMsg = (MSGBASE*)pMsg;
	switch(pTempMsg->Protocol)
	{
	case MP_CHAR_REVIVE_PRESENTSPOT_SYN:
		{
			MSGBASE* pmsg = (MSGBASE*)pMsg;
			CPlayer* pPlayer = (CPlayer*)g_pUserTable->FindUser(pmsg->dwObjectID);
			if(!pPlayer)
				return;
			pPlayer->RevivePresentSpot();
		}
		break;
	case MP_CHAR_REVIVE_LOGINSPOT_SYN:
		{
			MSGBASE* pmsg = (MSGBASE*)pMsg;
			CPlayer* pPlayer = (CPlayer*)g_pUserTable->FindUser(pmsg->dwObjectID);
			if(!pPlayer)
				return;
			pPlayer->ReviveLogIn();
		}
		break;
	}
}


void MP_OPTIONMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pmsg = (MSGBASE*)pMsg;
	OPTIONMGR->NetworkMsgParse( pmsg->Protocol, pMsg );
}

void MP_NPCMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pTempMsg = (MSGBASE*)pMsg;
	switch(pTempMsg->Protocol)
	{
	case MP_NPC_SPEECH_SYN:
		{
			MSG_DWORD* pmsg = (MSG_DWORD*)pMsg;
			CPlayer* pPlayer = (CPlayer*)g_pUserTable->FindUser(pmsg->dwObjectID);

			MSG_DWORD msg = *pmsg;
			msg.Protocol = MP_NPC_SPEECH_ACK;

			// error Check
			if(!pPlayer) return;

			if( pPlayer->GetBattle()->GetBattleKind() != eBATTLE_KIND_NONE )
				goto SPEECH_NACK;

			// State Check
			if( !OBJECTSTATEMGR_OBJ->StartObjectState(pPlayer, eObjectState_Deal, 0) ) goto SPEECH_NACK;

			pPlayer->SendMsg(&msg, sizeof(msg));
			


			return;

SPEECH_NACK:
			MSGBASE NackMsg;
			NackMsg.Category = MP_NPC;
			NackMsg.Protocol = MP_NPC_SPEECH_NACK;
			NackMsg.dwObjectID = pmsg->dwObjectID;

			pPlayer->SendMsg(&msg, sizeof(msg));
		}
		break;
	}
}

void MP_MurimnetMsgParser(DWORD dwConnectionIndex, char* pMsg, DWORD dwLength)
{
	MSGBASE* pTempMsg = (MSGBASE*)pMsg;
	switch(pTempMsg->Protocol)
	{
	//////////////////////////////////////////////////////////////////////////
	// 老馆 甘辑滚俊辑 罐绰 何盒
	case MP_MURIMNET_CHANGETOMURIMNET_SYN:
		{
			MSGBASE* pmsg = (MSGBASE*)pMsg;
			CPlayer* pPlayer = (CPlayer *)g_pUserTable->FindUser(pmsg->dwObjectID);
			if(pPlayer == NULL)
				return;			
			
			g_pServerSystem->RemovePlayer(pTempMsg->dwObjectID);

			MSGBASE msg;
			msg.Category = MP_MURIMNET;
			msg.Protocol = MP_MURIMNET_CHANGETOMURIMNET_ACK;
			msg.dwObjectID = pmsg->dwObjectID;
			
			g_Network.Send2Server(dwConnectionIndex, (char*)&msg, sizeof(msg));
		}
		break;
	//////////////////////////////////////////////////////////////////////////

	//////////////////////////////////////////////////////////////////////////
	// 海撇 辑滚俊辑 罐绰 何盒
	case MP_MURIMNET_PLAYROOM_INFO_SYN:
		{
/*			MSG_MNPLAYROOM_INFO* pmsg = (MSG_MNPLAYROOM_INFO*)pMsg;
			
			MSG_BATTLESETTING_SYN_MUNPAFIELD binfo;
			memset(&binfo,0,sizeof(MSG_BATTLESETTING_SYN_MUNPAFIELD));
			binfo.BattleID = pmsg->nIndex;
			ASSERT(binfo.BattleID != 0);
			binfo.BattleKind = pmsg->nGameKind;
			for(int n=0;n<pmsg->nTotalPlayerNum;++n)
			{
				BYTE Team = pmsg->PlayerInfo[n].cbTeam;
				if(Team == 2)	// 可历滚
				{

				}
				else
				{
					binfo.TeamInfo[Team].AddTeamMember(pmsg->PlayerInfo[n].dwObjectID);
				}
			}
			if(BATTLESYSTEM->CreateBattle(&binfo) == FALSE)
			{	// 海撇 积己 角菩
				ASSERT(0);
			}

			// 己傍 皋技瘤 公覆齿俊 焊辰促.
			pmsg->Protocol = MP_MURIMNET_PLAYROOM_INFO_ACK;
			PACKEDDATA_OBJ->SendToMapServer(dwConnectionIndex,99,pmsg,dwLength);
*/	
			MSG_MNPLAYROOM_INFO* pmsg = (MSG_MNPLAYROOM_INFO*)pMsg;
			
			MSG_BATTLESETTING_SYN_MURIMFIELD bInfo;
			memset( &bInfo, 0, sizeof(MSG_BATTLESETTING_SYN_MURIMFIELD) );
			bInfo.BattleID = pmsg->nIndex;
			ASSERT(bInfo.BattleID != 0);
			bInfo.BattleKind = eBATTLE_KIND_MURIMFIELD;
			bInfo.MurimBattleInfo.wMurimBattleKind = (WORD)pmsg->nGameKind;
			for( int n = 0; n < pmsg->nTotalPlayerNum; ++n )
			{
				BYTE Team = pmsg->PlayerInfo[n].cbTeam;
				if(Team == 2)	// 可历滚
				{
				}
				else
				{
					bInfo.TeamInfo[Team].AddTeamMember( pmsg->PlayerInfo[n].dwObjectID );
				}
			}
			if

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -