diff --git a/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs b/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs index f1a892c95f..f3d595c857 100644 --- a/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs +++ b/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs @@ -658,9 +658,9 @@ public abstract partial class CECPlayer : CECObject { // “起? 动作(挥起) - szAct = EC_Utility.BuildActionName(action, weapon_type, "Æð"); + szAct = EC_Utility.BuildActionName(action, weapon_type, ""); EventBus.PublishChannel(m_PlayerInfo.cid, new PlayActionEvent(szAct)); - szAct = EC_Utility.BuildActionName(action, weapon_type, "Âä"); + szAct = EC_Utility.BuildActionName(action, weapon_type, ""); queueActionEvent.SetData(szAct, SetApplyDamage, true, attackEvent); EventBus.PublishChannelClass(m_PlayerInfo.cid, queueActionEvent); //PlayNonSkillActionWithName(iAction, szAct, true, 200, true, ref pActFlag, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);gagága diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs index ccd39c6267..dec6dbe049 100644 --- a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs @@ -395,7 +395,6 @@ namespace CSNetwork } #endif int iHostID = _selectedRole.roleid; - BMLogger.LogError($"### GameDataSend: CMDID {pCmdHeader}"); switch (pCmdHeader) { case CommandID.PLAYER_INFO_2: diff --git a/Assets/Scripts/CECHostPlayer.cs b/Assets/Scripts/CECHostPlayer.cs index 12b5eccc79..3a5998e4b4 100644 --- a/Assets/Scripts/CECHostPlayer.cs +++ b/Assets/Scripts/CECHostPlayer.cs @@ -77,6 +77,7 @@ public partial class CECHostPlayer : CECPlayer List m_aWayPoints = new List(); // Active way points bool m_bIsInKingService = false; // ÊÇ·ñÕýÔÚ½øÐйúÍõ·þÎñ²Ù×÷ CECActionSwitcherBase m_pActionSwitcher; + private bool m_bMelee; // Host is in melee state // ====== Ground cast config ====== [Header("Ground Cast")] @@ -1094,54 +1095,52 @@ public partial class CECHostPlayer : CECPlayer } - private void OnMsgHstStartAttack(in ECMSG Msg) + private void OnMsgHstStartAttack(in ECMSG msg) { -// cmd_host_start_attack pCmd = (cmd_host_start_attack*)Msg.dwParam1; -// ASSERT(pCmd); -// -// // test code... -// // g_pGame->GetRTDebug()->OutputNotifyMessage(RTDCOL_WARNING, _AL("start attack !")); -// -// // Check whether target is the one that we have selected -// if (m_idSelTarget != pCmd->idTarget) -// g_pGame->RuntimeDebugInfo(RTDCOL_WARNING, _AL("Target has changed !")); -// -// // If target turn to be un-attackable, cancel action -// if (!AttackableJudge(pCmd->idTarget, true)) -// { -// g_pGame->GetGameSession()->c2s_CmdCancelAction(); -// g_pGame->RuntimeDebugInfo(RTDCOL_WARNING, _AL("Cannel attacking !")); -// return; -// } -// -// // Synchronize ammo amount -// CECIvtrItem* pItem = m_pEquipPack->GetItem(EQUIPIVTR_PROJECTILE); -// if (pItem) -// { -// if (!pCmd->ammo_remain) -// m_pEquipPack->SetItem(EQUIPIVTR_PROJECTILE, NULL); -// else -// pItem->SetAmount(pCmd->ammo_remain); -// } -// -// CECHPWorkMelee* pWork = (CECHPWorkMelee*)m_pWorkMan->CreateWork(CECHPWork::WORK_HACKOBJECT); -// m_pWorkMan->StartWork_p1(pWork); -// -// m_bMelee = true; -// AP_ActionEvent(AP_EVENT_STARTMELEE); + cmd_host_start_attack pCmd = GPDataTypeHelper.FromBytes((byte[])msg.dwParam1); + // ASSERT(pCmd); + + // test code... +// g_pGame->GetRTDebug()->OutputNotifyMessage(RTDCOL_WARNING, _AL("start attack !")); + + // Check whether target is the one that we have selected + if (m_idSelTarget != pCmd.idTarget) + { + BMLogger.Log("Target has changed !"); + } + + // If target turn to be un-attackable, cancel action + if (AttackableJudge(pCmd.idTarget, true)<=0) + { + UnityGameSession.c2s_CmdCancelAction(); + BMLogger.Log("Cannel attacking !"); + return; + } + + // todo Synchronize ammo amount + // CECIvtrItem pItem = m_pEquipPack->GetItem(EQUIPIVTR_PROJECTILE); + // if (pItem) + // { + // if (!pCmd->ammo_remain) + // m_pEquipPack->SetItem(EQUIPIVTR_PROJECTILE, NULL); + // else + // pItem->SetAmount(pCmd->ammo_remain); + // } + + CECHPWorkMelee pWork = (CECHPWorkMelee)m_pWorkMan.CreateWork(Host_work_ID.WORK_HACKOBJECT); + m_pWorkMan.StartWork_p1(pWork); + + m_bMelee = true; + // AP_ActionEvent(AP_EVENT_STARTMELEE); } private void OnMsgHstStopAttack(in ECMSG Msg) { -// using namespace S2C; -// - // m_bMelee = false; -// -// // if there is an attack event currently, we should let it fire now. + m_bMelee = false; + // if there is an attack event currently, we should let it fire now. ClearComActFlagAllRankNodes(true); cmd_host_stop_attack pCmd = GPDataTypeHelper.FromBytes((byte[])Msg.dwParam1); - // ASSERT(pCmd); /* If attack stopped for target is leave too far, trace it and continue attacking. Stop reason defined as below: