public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { GCAbilityAction packet = pPacket as GCAbilityAction; CObjectManager pObjectManager = CObjectManager.Instance; if (pObjectManager == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } CObject pObj = pObjectManager.FindServerObject((int)packet.ObjectID); if (pObj == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } if (packet.BeginOrEnd == (byte)GCAbilityAction.ActionState.ABILITY_BEGIN) { SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_ABILITY; cmdTemp.SetValue(0, 0); cmdTemp.SetValue <int>(1, packet.LogicCount); cmdTemp.SetValue <short>(2, packet.AbilityID); cmdTemp.SetValue <int>(3, packet.PrescriptionID); cmdTemp.SetValue <uint>(4, packet.TargetID); pObj.PushCommand(cmdTemp); } } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { GCCharDirectImpact Packet = (GCCharDirectImpact)pPacket; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { CObject pObj = CObjectManager.Instance.FindServerObject(Packet.RecieverID); if (pObj != null) { _DAMAGE_INFO infoDamage = new _DAMAGE_INFO(); infoDamage.m_nSkillID = Packet.SkillID; infoDamage.m_nTargetID = (uint)Packet.RecieverID; infoDamage.m_nSenderID = (uint)Packet.SenderID; infoDamage.m_nSenderLogicCount = Packet.SenderLogicCount; infoDamage.m_nImpactID = Packet.ImpactID; infoDamage.m_nType = _DAMAGE_INFO.DAMAGETYPE.TYPE_EFFECT; _LOGIC_EVENT logicEvent = new _LOGIC_EVENT(); logicEvent.Init(infoDamage.m_nSenderID, infoDamage.m_nSenderLogicCount, infoDamage); SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_LOGIC_EVENT; cmdTemp.SetValue <object>(0, logicEvent); pObj.PushCommand(cmdTemp); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } LogManager.Log("RECV GCCharDirectImpact"); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { LogManager.Log("Receive GCObjTeleport Packet"); GCObjTeleport Packet = (GCObjTeleport)pPacket; CObject pObj = CObjectManager.Instance.FindServerObject(Packet.ObjID); if (pObj == null || !(pObj is CObject_Character)) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } //if(!GFX.GfxSystem.Instance.IsValidPosition(Packet.PosWorld.m_fX, Packet.PosWorld.m_fZ)) // { // LogManager.LogError("ERROR POSITION @ GCCharIdleHandler"); // } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_TELEPORT; cmdTemp.SetValue <float>(0, Packet.PosWorld.m_fX); cmdTemp.SetValue <float>(1, Packet.PosWorld.m_fZ); pObj.PushCommand(cmdTemp); // 瞬移时,清空寻路节点 [9/2/2011 Sun] //CWorldManager::GetMe()->SetPathNodesDirty(); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { //检查位置是否合法 //const WORLD_POS* pTargetPos = pPacket->GetCurPos(); //if(!CWorldManager::GetMe()->GetActiveScene()->IsValidPosition(fVector2(pTargetPos->m_fX, pTargetPos->m_fZ))) //{ // TDThrow("ERROR POSITION @ GCBusStopMoveHandler target"); //} GCBusStopMove busPacket = pPacket as GCBusStopMove; if (busPacket == null) { LogManager.LogError("GCBusStopMove 收包错误。"); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } CObject pBus = CObjectManager.Instance.FindServerObject((int)busPacket.ObjID); if (pBus == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_BUS_STOP_MOVE; cmdTemp.SetValue(0, busPacket.PosWorld.m_fX); cmdTemp.SetValue(1, -1.0f); cmdTemp.SetValue(2, busPacket.PosWorld.m_fZ); pBus.PushCommand(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { //LogManager.Log("Receive GCLevelUpResult Packet"); GCLevelUp levelUp = (GCLevelUp)pPacket; CObject pObj = CObjectManager.Instance.FindServerObject((int)levelUp.ObjectID); //(CObject*)(pObjectManager->FindServerObject( (INT)pPacket->getObjId() )); if (pObj == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } //pObj->PushDebugString("LevelUp!"); //pObj->SetMsgTime(CGameProcedure::s_pTimeSystem->GetTimeNow()); //if(pObj ==(CObject*) CObjectManager::GetMe()->GetMySelf()) //{ // CGameProcedure::s_pGfxSystem->PushDebugString("LeveUP"); // CSoundSystemFMod::_PlayUISoundFunc(66); //} SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_LEVEL_UP; pObj.PushCommand(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { GCCharSkillSend Packet = (GCCharSkillSend)pPacket; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { CObject pObj = CObjectManager.Instance.FindServerObject(Packet.ObjectID); if (pObj != null) { SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_MAGIC_SEND; cmdTemp.SetValue <uint>(0, 0); cmdTemp.SetValue <int>(1, Packet.nLogicCount); cmdTemp.SetValue <short>(2, Packet.SkillDataID); cmdTemp.SetValue <uint>(3, (uint)Packet.TargetID); cmdTemp.SetValue <float>(4, Packet.posTarget.m_fX); cmdTemp.SetValue <float>(5, Packet.posTarget.m_fZ); cmdTemp.SetValue <float>(6, Packet.Dir); pObj.PushCommand(cmdTemp); //pObj->PushDebugString("GCCharSkill_Send"); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } LogManager.LogWarning("RECV GCCharSkillSend " + Packet.SkillDataID); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { LogManager.Log("Receive GCDetailHealsAndDamages Packet"); GCDetailHealsAndDamages Packet = (GCDetailHealsAndDamages)pPacket; CObject pObj = CObjectManager.Instance.FindServerObject((int)Packet.RecieverID); if (pObj != null) { _DAMAGE_INFO infoDamage = new _DAMAGE_INFO(); infoDamage.m_nSkillID = Packet.SkillID; if (infoDamage.m_nSkillID != MacroDefine.INVALID_ID) { _DBC_SKILL_DATA skillData = CSkillDataMgr.Instance.GetSkillData((uint)infoDamage.m_nSkillID); if (skillData != null) { infoDamage.m_nBulletID = skillData.m_nBulletID; } } infoDamage.m_nTargetID = (uint)Packet.RecieverID; infoDamage.m_nSenderID = (uint)Packet.SenderID; infoDamage.m_nSenderLogicCount = Packet.SenderLogicCount; infoDamage.m_nImpactID = MacroDefine.INVALID_ID; infoDamage.m_nType = _DAMAGE_INFO.DAMAGETYPE.TYPE_HEAL_AND_DAMAGE; if (Packet.IsHpModificationDirty()) { infoDamage.m_bHealthDirty = true; infoDamage.m_nHealthIncrement = Packet.HPModification; } if (Packet.IsMpModificationDirty()) { infoDamage.m_bManaDirty = true; infoDamage.m_nManaIncrement = Packet.MPModification; } if (Packet.IsRageModificationDirty()) { infoDamage.m_bRageDirty = true; infoDamage.m_nRageIncrement = Packet.RageModification; } if (Packet.IsStrikePointModificationDirty()) { infoDamage.m_bStrikePointDirty = true; infoDamage.m_nStrikePointIncrement = Packet.StrikePointModification; } infoDamage.m_bIsCriticalHit = Packet.CriticalHit; _LOGIC_EVENT logicEvent = new _LOGIC_EVENT(); logicEvent.Init((uint)Packet.SenderID, Packet.SenderLogicCount, infoDamage); SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_LOGIC_EVENT; cmdTemp.SetValue <object>(0, logicEvent); pObj.PushCommand(cmdTemp); } } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { //当前流程是主流程 if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { CObjectManager pObjectManager = CObjectManager.Instance; GCDelObject delObjPacket = (GCDelObject)pPacket; //判断是否是本场景 // 将场景ID和资源ID分开,不再使用资源ID代替场景ID [10/24/2011 Sun] if (WorldManager.Instance.GetActiveSceneID() != delObjPacket.getSceneID()) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } //寻找obj CObject pDelObj = pObjectManager.FindServerObject((int)delObjPacket.getObjID()); CObject_Character pObj = pDelObj as CObject_Character; LogManager.Log("GCDelObjectHandler ObjID:" + delObjPacket.getObjID()); if (pObj == null) { CObjectManager.Instance.DestroyObject(pDelObj); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } if (CObjectManager.Instance.GetMainTarget() != null && pObj == CObjectManager.Instance.GetMainTarget()) { CObjectManager.Instance.SetMainTarget(-1, CObjectManager.DESTROY_MAIN_TARGET_TYPE.DEL_OBJECT); } // 判断obj是否在载具上面,在的话需要删除掉 [8/29/2011 Ivan edit] //todo if (pObj.GetCharacterType() == CHARACTER_TYPE.CT_PLAYEROTHER || pObj.GetCharacterType() == CHARACTER_TYPE.CT_PLAYERMYSELF) { if (pObj.GetCharacterData().Get_BusObjID() != MacroDefine.UINT_MAX) { CObject pBus = CObjectManager.Instance.FindServerObject((int)pObj.GetCharacterData().Get_BusObjID()); if (pBus != null) { SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_BUS_REMOVE_PASSENGER; cmdTemp.SetValue <int>(0, pObj.ServerID); pBus.PushCommand(cmdTemp); } } } //删除对象 CObjectManager.Instance.DestroyObject(pObj); //之后不能执行任何代码 } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { //LogManager.Log("Receive GCCharMove Packet"); GCCharMove charMovePacket = (GCCharMove)pPacket; CObjectManager pObjectManager = CObjectManager.Instance; CObject pObj = (CObject)(pObjectManager.FindServerObject((int)charMovePacket.ObjID)); if (pObj == null || !(pObj is CObject_Character)) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); if (charMovePacket.IsHaveStopInfo()) { cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_STOP_MOVE; cmdTemp.SetValue(0, charMovePacket.StopLogicCount); cmdTemp.SetValue(1, 0); cmdTemp.SetValue(2, pObj.GetPosition().x); cmdTemp.SetValue(3, pObj.GetPosition().z); pObj.PushCommand(cmdTemp); } WORLD_POS[] posTarget = new WORLD_POS[1]; posTarget[0].m_fX = charMovePacket.PosTarget.m_fX; posTarget[0].m_fZ = charMovePacket.PosTarget.m_fZ; cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_MOVE; cmdTemp.SetValue(0, charMovePacket.StartTime); cmdTemp.SetValue(1, charMovePacket.HandleID); cmdTemp.SetValue(2, 1); cmdTemp.SetValue(3, posTarget); pObj.PushCommand(cmdTemp); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { LogManager.Log("Receive GCSpecialObjFadeOut Packet"); GCSpecialObjFadeOut Packet = (GCSpecialObjFadeOut)pPacket; CObject pObj = CObjectManager.Instance.FindServerObject(Packet.ObjID); if (pObj == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_SPECIAL_OBJ_DIE; pObj.PushCommand(cmdTemp); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { LogManager.LogWarning("RECV GCCharModifyAction"); if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { GCCharModifyAction packet = pPacket as GCCharModifyAction; CObject obj = CObjectManager.Instance.FindServerObject(packet.ObjectID); if (obj == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_MODIFY_ACTION; cmdTemp.SetValue <int>(0, packet.LogicCount); cmdTemp.SetValue <int>(1, packet.ModifyTime); obj.PushCommand(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { GCCharImpactListUpdate Packet = (GCCharImpactListUpdate)pPacket; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { CObject pObj = CObjectManager.Instance.FindServerObject(Packet.OwnerID); if (pObj != null) { ////如果需要更新资源,尝试放入缓冲队列 //if(pObjectManager->GetLoadQueue()->TryAddLoadTask(pObj->GetID(), pPacket)) // return PACKET_EXE_NOTREMOVE; CObject_Character pChar = (CObject_Character)pObj; if (pChar != null) { pChar.RemoveAllImpact(); } SimpleImpactList ImpactList = new SimpleImpactList(); for (short i = 0; i < Packet.NumImpact; i++) { SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_UPDATE_IMPACT_EX; cmdTemp.SetValue <short>(0, Packet.ImpactID[i]); pObj.PushCommand(cmdTemp); ImpactList.AddImpact(Packet.ImpactID[i]); } //待实现 //CTeamOrGroup* pTeam = CUIDataPool::GetMe()->GetTeamOrGroup(); //if ( pTeam != NULL ) //{ // pTeam->UpdateImpactsList( pPacket->GetOwnerID(), &ImpactList ); //} //pObj->PushDebugString("GCCharImpactListUpdate"); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } LogManager.Log("RECV GCCharImpactListUpdate"); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { LogManager.Log("RECV GCCharJump"); GCCharJump Packet = (GCCharJump)pPacket; CObject pObj = (CObject)(CObjectManager.Instance.FindServerObject(Packet.ObjectID)); if (pObj == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_JUMP; pObj.PushCommand(cmdTemp); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { GCCharSkillGatherModify Packet = (GCCharSkillGatherModify)pPacket; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { CObject pObj = CObjectManager.Instance.FindServerObject(Packet.ObjectID); if (pObj != null) { SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_SKILL_GATHER_MODIFY; cmdTemp.SetValue <float>(0, (float)Packet.SubTime / 1000.0f); pObj.PushCommand(cmdTemp); //pObj->PushDebugString("GCCharSkill_Gather_Modify"); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } } LogManager.Log("RECV GCCharSkillGatherModify"); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { LogManager.Log("Receive GCCharBuff Packet"); GCCharBuff charBuffPacket = (GCCharBuff)pPacket; CObject pObj = CObjectManager.Instance.FindServerObject((int)charBuffPacket.RecieverID); if (pObj == null || !(pObj is CObject_Character)) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_UPDATE_IMPACT; cmdTemp.SetValue <short>(0, charBuffPacket.BuffID); cmdTemp.SetValue <int>(1, charBuffPacket.Enable); cmdTemp.SetValue <int>(2, charBuffPacket.SenderID); pObj.PushCommand(cmdTemp); //待实现 //CTeamOrGroup* pTeam = CUIDataPool::GetMe()->GetTeamOrGroup(); //if ( pTeam != NULL ) //{ // if ( pPacket->GetEnable() ) // { // pTeam->AddImpact( pPacket->GetReceiverID(), pPacket->GetBuffID() ); // } // else // { // pTeam->RemoveImpact( pPacket->GetReceiverID(), pPacket->GetBuffID() ); // } //} //pObj.PushDebugString("GCCharBuff"); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); // 广播更新buff [11/10/2011 Ivan edit] CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_BUFF_UPDATE); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { GCBusRemoveAllPassenger busPacket = pPacket as GCBusRemoveAllPassenger; if (busPacket == null) { LogManager.LogError("GCBusRemoveAllPassenger 收包错误。"); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } CObject pBus = CObjectManager.Instance.FindServerObject((int)busPacket.ObjID); if (pBus == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_BUS_REMOVE_ALL_PASSENGER; pBus.PushCommand(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { GCNotifyTeamInfo packet = pPacket as GCNotifyTeamInfo; CObject pObj = CObjectManager.Instance.FindServerObject((int)packet.ObjectId); if (pObj == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_UPDATE_TEAM_FLAG; cmdTemp.SetValue <byte>(0, packet.TeamFlag); cmdTemp.SetValue <byte>(1, packet.TeamLeaderFlag); cmdTemp.SetValue <byte>(2, packet.TeamFullFlag); pObj.PushCommand(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { GCSpecialObjActNow Packet = (GCSpecialObjActNow)pPacket; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { LogManager.Log("RECV GCSpecialObj_ActNowHandler"); CObject pObj = CObjectManager.Instance.FindServerObject(Packet.ObjID); if (pObj != null) { _ObjID_List listObjID = Packet.ObjIDList; SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_SPECIAL_OBJ_TRIGGER; cmdTemp.SetValue <int>(0, Packet.LogicCount); cmdTemp.SetValue <int>(1, listObjID.m_nCount); cmdTemp.SetValue <object>(2, (object)(listObjID.m_aIDs)); pObj.PushCommand(cmdTemp); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { GCCharStopAction Packet = (GCCharStopAction)pPacket; CObjectManager pObjectManager = CObjectManager.Instance; CObject pObj = (CObject)(pObjectManager.FindServerObject((int)Packet.ObjectID)); if (pObj == null || !(pObj is CObject_Character)) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_STOP_ACTION; cmdTemp.SetValue(0, Packet.LogicCount); cmdTemp.SetValue(1, Packet.StopTime); pObj.PushCommand(cmdTemp); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { LogManager.Log("RECV GCArrive"); GCArrive Packet = (GCArrive)pPacket; CObject pObj = (CObject)(CObjectManager.Instance.FindServerObject(Packet.ObjectID)); if (pObj == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_STOP_MOVE; cmdTemp.SetValue <int>(0, Packet.HandleID); cmdTemp.SetValue <int>(1, 0); cmdTemp.SetValue <float>(2, Packet.PosWorld.m_fX); cmdTemp.SetValue <float>(3, Packet.PosWorld.m_fZ); pObj.PushCommand(cmdTemp); pObj.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { //检查位置是否合法 //if(!CWorldManager::GetMe()->GetActiveScene()->IsValidPosition(fVector2(pPacket->GetCurPos()->m_fX, pPacket->GetCurPos()->m_fZ))) //{ // TDThrow("ERROR POSITION @ GCNewBusHandler"); //} GCNewBus busPacket = pPacket as GCNewBus; if (busPacket == null) { LogManager.LogError("GCNewBus 收包错误。"); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } //创建玩家 CObject pBus = CObjectManager.Instance.FindServerObject((int)busPacket.ObjID); Vector3 fvGame = new Vector3(busPacket.PosWorld.m_fX, 0, busPacket.PosWorld.m_fZ); if (pBus == null) { pBus = CObjectManager.Instance.NewBus((int)busPacket.ObjID); SObject_BusInit tBusInit = new SObject_BusInit(); tBusInit.m_fvPos = fvGame; tBusInit.m_fvRot = new Vector3(0.0f, busPacket.Dir, 0.0f); tBusInit.m_nDataID = busPacket.DataID; pBus.Initial(tBusInit); pBus.SetMapPosition(busPacket.PosWorld.m_fX, busPacket.PosWorld.m_fZ); } else { if (pBus.isVisible()) { if (Math.Abs(pBus.GetPosition().x - fvGame.x) + Math.Abs(pBus.GetPosition().z - fvGame.z) > ObjectDef.DEF_CHARACTER_POS_ADJUST_DIST) { pBus.SetMapPosition(fvGame.x, fvGame.z); } } else { pBus.SetMapPosition(fvGame.x, fvGame.z); pBus.SetFaceDir(busPacket.Dir); //pBus->setVisible(true); } } SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_BUS_ADD_PASSENGER; int i; for (i = 0; i < busPacket.PassengerCount; i++) { cmdTemp.SetValue(0, i); cmdTemp.SetValue(1, busPacket.PassengerIDs[i]); pBus.PushCommand(cmdTemp); } //放入Ask队列 GameProcedure.s_pObjectManager.LoadQueue.TryAddLoadTask(pBus.ID); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }