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) { //LogManager.LogWarning("Receive GCDetailAbilityInfo"); if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { GCDetailAbilityInfo Packet = (GCDetailAbilityInfo)pPacket; for (int i = 0; i < Packet.NumAbility; i++) { CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Set_LifeAbility( Packet.AbilityIDList[i], Packet.Ability[i].m_Level, Packet.Ability[i].m_Exp); } for (int i = 0; i < GAMEDEFINE.MAX_ABILITY_PRESCRIPTION_NUM; i++) { bool bCando = (Packet.PrescrList[i >> 3] & (1 << (i % 8))) != 0; if (!bCando) { continue; } //配方id从“1”开始 CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Set_Prescr(i, true); } } 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.s_ProcMain) { GCPrescription Packet = pPacket as GCPrescription; //加入UI数据池 //CUIDataPool* pDataPool = (CUIDataPool*)(CGameProcedure::s_pDataPool); //SCommand_DPC cmdTemp; //-------------------------------------------------------------- //生活技能配方表刷新 /* * cmdTemp.m_wID = DPC_UPDATE_LIFE_PRESCR; * cmdTemp.m_adwParam[0] = 2; // update a specified recipe * cmdTemp.m_adwParam[1] = pPacket->getPrescription(); * cmdTemp.m_abParam[2] = pPacket->getLearnOrAbandon(); * pDataPool->OnCommand_( &cmdTemp ); */ CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Set_Prescr( (int)Packet.Prescription, Packet.LearnOrAbandom > 0); GameProcedure.s_pEventSystem.PushEvent(GAME_EVENT_ID.GE_UPDATE_PRESCR); } 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) { // 场景资源ID和服务器ID分开,暂时使用相同ID [10/24/2011 Sun] GCNotifyChangeScene Packet = (GCNotifyChangeScene)pPacket; LogManager.Log("RECV GCNotifyChangeScene"); LogManager.Log("RECV GCNotifyChangeScene: id=" + Packet.TargetSceneID); int nSourceID = WorldManager.Instance.GetActiveSceneID(); if (nSourceID != Packet.CurrentSceneID) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } fVector2 pos = new fVector2(Packet.Position.m_fX, Packet.Position.m_fZ); WorldManager.Instance.ChangeScene( Packet.TargetSceneID, Packet.ResID, ref pos, Packet.TargetDir, Packet.Flag); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { try { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { //加入UI数据池 CUIDataPool pUIDataPool = GameProcedure.s_pUIDataPool; GCRemoveCanPickMissionItem newRemoveCanPickMissionItem = (GCRemoveCanPickMissionItem)pPacket; SCommand_DPC cmdTemp = new SCommand_DPC(); cmdTemp.m_wID = DPC_SCRIPT_DEFINE.DPC_REMOVE_CAN_PICK_MISSION_ITEM; cmdTemp.SetValue <uint>(0, newRemoveCanPickMissionItem.ItemDataID); pUIDataPool.OnCommand_(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } catch (Exception e) { LogManager.LogError("--------------------GCRemoveCanPickMissionItemHandler的Execute()方法出错。--------------------"); LogManager.LogError(e.ToString()); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { GCSkillClass Packet = (GCSkillClass)pPacket; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { //CUIDataPool* pDataPool = (CUIDataPool*)(CGameProcedure::s_pDataPool); //确认是自己的数据 CObject_PlayerMySelf pMySelf = CObjectManager.Instance.getPlayerMySelf(); if (pMySelf.ServerID != Packet.ObjectID) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } //刷新到用户数据 _OWN_XINFA[] xinFa = Packet.XinFa; for (short i = 0; i < Packet.numXinFa; i++) { pMySelf.GetCharacterData().Set_SkillClass(xinFa[i].m_nXinFaID, xinFa[i].m_nXinFaLevel); } CActionSystem.Instance.SkillClass_Update(); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_SKILL_UPDATE); LogManager.Log("RECV GCDetailXinFaClass"); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { try { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { CUIDataPool pUIDataPool = GameProcedure.s_pUIDataPool; GCMissionModify newMissionModifyPacket = (GCMissionModify)pPacket; SCommand_DPC cmdTemp = new SCommand_DPC(); cmdTemp.m_wID = DPC_SCRIPT_DEFINE.DPC_UPDATE_MISSION_MODIFY; cmdTemp.SetValue <int>(1, newMissionModifyPacket.Flag); if (newMissionModifyPacket.Flag == (int)GCMissionModify.MISSIONMODIFY.MISSIONMODIFY_MISSION) { cmdTemp.SetValue <_OWN_MISSION>(0, newMissionModifyPacket.GetMission()); } else if (newMissionModifyPacket.Flag == (int)GCMissionModify.MISSIONMODIFY.MISSIONMODIFY_MISSIONDATA) { cmdTemp.SetValue <int[]>(0, newMissionModifyPacket.GetMissionData()); } pUIDataPool.OnCommand_(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } catch (Exception e) { LogManager.LogError("--------------------GCMissionModifyHandler的Execute()方法出错。--------------------"); LogManager.LogError(e.ToString()); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { try { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { GCMissionHaveDoneFlag newMissionHaveDoneFlag = (GCMissionHaveDoneFlag)pPacket; SCommand_DPC cmdTemp = new SCommand_DPC(); cmdTemp.m_wID = DPC_SCRIPT_DEFINE.DPC_UPDATE_MISSION_HAVEDOWN_FALG; cmdTemp.SetValue <int>(0, newMissionHaveDoneFlag.MissionID); cmdTemp.SetValue <int>(1, newMissionHaveDoneFlag.IsHaveDone); CUIDataPool.Instance.OnCommand_(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } catch (Exception e) { LogManager.LogError("--------------------GCMissionHaveDoneFlagHandler的Execute()方法出错。--------------------"); LogManager.LogError(e.ToString()); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { GCBankAcquireList packet = pPacket as GCBankAcquireList; //清空原有商品列表 CDataPool.Instance.UserBank_Clear(); //银行里面的钱数 CDataPool.Instance.UserBank_SetBankMoney(packet.Money); //当前银行的大小 CDataPool.Instance.UserBank_SetBankEndIndex(packet.CurBankSize); GCBankAcquireList._BANK_ITEM[] ItemList = packet.ItemList; int nNum = packet.ItemNum; int bankpos = 0; CObject_Item pItem = null; //添加到数据池中 for (int i = 0; i < nNum; i++) { bankpos = ItemList[i].bankindex; if (ItemList[i].isBlueEquip != 0) { pItem = ObjectSystem.Instance.NewItem(ItemList[i].item_data.m_ItemIndex); if (pItem == null) { throw new NullReferenceException("Bank Item Create failed:" + ItemList[i].item_data.m_ItemIndex); } pItem.SetGUID( (ushort)ItemList[i].item_data.m_ItemGUID.m_World, ItemList[i].item_data.m_ItemGUID.m_Server, (uint)ItemList[i].item_data.m_ItemGUID.m_Serial); CDataPool.Instance.UserBank_SetItem(bankpos, pItem, true); CDataPool.Instance.UserBank_SetItemExtraInfo(bankpos, false, ItemList[i].item_data); } else { pItem = ObjectSystem.Instance.NewItem(ItemList[i].item_guid); if (pItem == null) { throw new NullReferenceException("Bank Item Create failed:" + ItemList[i].item_data.m_ItemIndex); } CDataPool.Instance.UserBank_SetItem(bankpos, pItem, true); } pItem.PosIndex = (short)bankpos; pItem.SetNumber(ItemList[i].byNumber); } CActionSystem.Instance.UserBank_Update(); int nBankNpcId = CDataPool.Instance.UserBank_GetNpcId(); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_TOGLE_BANK, nBankNpcId); UIWindowMng.Instance.GetWindow("StoreWindow"); } 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) { GCDetailSkillList Packet = (GCDetailSkillList)pPacket; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { // CUIDataPool* pDataPool = (CUIDataPool*)(CGameProcedure::s_pDataPool); //确认是自己的数据 CObject_PlayerMySelf pMySelf = CObjectManager.Instance.getPlayerMySelf(); if (pMySelf.ServerID != Packet.ObjectID) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } //清空所有技能 pMySelf.GetCharacterData().Skill_CleanAll(); //刷新到用户数据 _OWN_SKILL[] pOwnerSkill = Packet.Skill; byte[] nLevel = Packet.SkillLevel; for (short i = 0; i < Packet.numSkill; i++) { //LogManager.LogWarning("GCDetailSkillList " + i + " skillID " + pOwnerSkill[i].m_nSkillID + " level " + nLevel[i]); pMySelf.GetCharacterData().Set_Skill(pOwnerSkill[i].m_nSkillID, nLevel[i], true); } //刷新到UI CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_SKILL_UPDATE); //LogManager.Log("RECV GCDetailSkillList"); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { try { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { GCPlayerDie newPlayerDie = (GCPlayerDie)pPacket; int nTime = newPlayerDie.ReliveTime / 1000; //CEventSystem.Instance.PushEvent( GE_RELIVE_SHOW, ((pPacket->IsCanRelive())?("1"):("0")), szText, -1 ); List <string> LString = new List <string>(); LString.Add(newPlayerDie.IfCanRelive > 0 ? "1" : "0"); LString.Add(nTime.ToString()); UIWindowMng.Instance.ShowWindow("ReliveWindow"); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_RELIVE_SHOW, LString); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } catch (Exception e) { LogManager.LogError("--------------------GCPlayerDieHandler的Execute()方法出错。--------------------"); LogManager.LogError(e.ToString()); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } }
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.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) { try { GCMissionList newGCMissionList = (GCMissionList)pPacket; CUIDataPool pUIDataPool = GameProcedure.s_pUIDataPool; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { // 保存任务是否完成标志 if (CDetailAttrib_Player.Instance != null) { CDetailAttrib_Player.Instance.SetMissionHaveDone(newGCMissionList.GetMissionHaveDone()); } SCommand_DPC cmdTemp = new SCommand_DPC(); cmdTemp.m_wID = DPC_SCRIPT_DEFINE.DPC_UPDATE_MISSION_LIST; cmdTemp.SetValue <uint>(0, newGCMissionList.ObjID); cmdTemp.SetValue <uint>(1, newGCMissionList.MissionListFlags); cmdTemp.SetValue <_OWN_MISSION[]>(2, newGCMissionList.GetMissionBuf()); pUIDataPool.OnCommand_(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } catch (Exception e) { LogManager.LogError("--------------------GCMissionListHandler的Execute()方法出错。--------------------"); LogManager.LogError(e.ToString()); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { LogManager.Log("Receive GCDetailBuff Packet"); GCDetailBuff detailBuffPacket = (GCDetailBuff)pPacket; if (detailBuffPacket.Enable != 0) { _BUFF_IMPACT_INFO infoBuffImpact = new _BUFF_IMPACT_INFO(); infoBuffImpact.m_nReceiverID = (uint)detailBuffPacket.RecieverID; infoBuffImpact.m_nSenderID = (uint)detailBuffPacket.SenderID; infoBuffImpact.m_nBuffID = detailBuffPacket.BuffID; infoBuffImpact.m_nSkillID = detailBuffPacket.SkillID; infoBuffImpact.m_nSenderLogicCount = detailBuffPacket.SenderLogicCount; infoBuffImpact.m_nSN = detailBuffPacket.SN; infoBuffImpact.m_nTimer = detailBuffPacket.Continuance; // 接口未实现 CDataPool.Instance.BuffImpact_Add(infoBuffImpact); } else { // 接口未实现 CDataPool.Instance.BuffImpact_Remove((int)detailBuffPacket.SN); } } 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) { try { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { CUIDataPool pUIDataPool = GameProcedure.s_pUIDataPool; GCRetMissionDesc newMissionDesc = (GCRetMissionDesc)pPacket; SCommand_DPC cmdTemp = new SCommand_DPC(); cmdTemp.m_wID = DPC_SCRIPT_DEFINE.DPC_UPDATE_MISSION_DESC; cmdTemp.SetValue <GCRetMissionDesc>(0, newMissionDesc); pUIDataPool.OnCommand_(cmdTemp); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } catch (Exception e) { LogManager.LogError("--------------------GCRetMissionDescHandler的Execute()方法出错。--------------------"); LogManager.LogError(e.ToString()); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { CObjectManager pObjectManager = CObjectManager.Instance; GCAbilityResult packet = pPacket as GCAbilityResult; // //失败! if (packet.Result != (int)OPERATE_RESULT.OR_OK) { CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, GameDefineResult.Instance.GetOResultText((OPERATE_RESULT)packet.Result)); if (packet.Result == (int)OPERATE_RESULT.OR_FAILURE) { //switch(packet.AbilityID) //{ //case 3: // CSoundSystemFMod::_PlayUISoundFunc(22+59); // break; //default: // break; //} CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_CLOSE_SYNTHESIZE_ENCHASE); } // 结束采集操作 [4/18/2012 Ivan] { CAI_MySelf pMySelfAI = (CAI_MySelf)CObjectManager.Instance.getPlayerMySelf().CharacterLogic_GetAI(); pMySelfAI.FinishTripperActive(); } } } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
/// <summary> /// 网络状态改变回调函数 /// </summary> /// <param name="netStatus">改变的网络状态</param> public override void NetStatusChange(NETMANAGER_STATUS netStatus) { if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { SetNetStatus(netStatus); } }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase packet, ref Peer pPlayer) { //当前流程是主流程 if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { GCNewPet pPacket = (GCNewPet)packet; CObjectManager pObjectManager = CObjectManager.Instance; //检查位置是否合法 fVector2 pos = new fVector2(pPacket.getWorldPos().m_fX, pPacket.getWorldPos().m_fZ); if (!WorldManager.Instance.ActiveScene.IsValidPosition(ref pos)) { LogManager.LogError("Valid Position @GCNewPetHandler.Execute"); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } //创建宠物 CObject_PlayerNPC pNPC = (CObject_PlayerNPC)pObjectManager.FindServerObject((int)pPacket.getObjID()); float fFaceDir = pPacket.getDir(); if (pNPC == null) { pNPC = pObjectManager.NewPlayerNPC((int)pPacket.getObjID()); SObjectInit initPlayerNPC = new SObjectInit(); initPlayerNPC.m_fvPos = new Vector3(pos.x, 0, pos.y); initPlayerNPC.m_fvRot = new Vector3(0.0f, fFaceDir, 0.0f); pNPC.Initial(initPlayerNPC); } else { pNPC.SetMapPosition(pos.x, pos.y); pNPC.SetFaceDir(fFaceDir); pNPC.Enable((uint)ObjectStatusFlags.OSF_VISIABLE); pNPC.Disalbe((uint)ObjectStatusFlags.OSF_OUT_VISUAL_FIELD); } pNPC.SetNpcType(ENUM_NPC_TYPE.NPC_TYPE_PET); pNPC.GetCharacterData().Set_MoveSpeed(pPacket.getMoveSpeed()); SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_IDLE; cmdTemp.SetValue <float>(0, pos.x); cmdTemp.SetValue <float>(1, pos.y); cmdTemp.SetValue <bool>(2, false); pNPC.PushCommand(cmdTemp); //放入Ask队列 pObjectManager.LoadQueue.TryAddLoadTask(pNPC.ID); //同步渲染层 string szTemp = "GCNewPet(" + pos.x.ToString() + "," + pos.y.ToString() + ")"; pNPC.PushDebugString(szTemp); pNPC.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 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.s_ProcMain) { GCShopSoldList packet = pPacket as GCShopSoldList; int nNum = packet.MerchadiseNum; if (nNum == 0) {//空的没东西 if (CDataPool.Instance.Booth_GetSoldNumber() != 0) { CDataPool.Instance.Booth_Sold_Clear(); } } else { //清空原有商品列表 CDataPool.Instance.Booth_Sold_Clear(); //CSoundSystemFMod::_PlayUISoundFunc(25+59); //添加到数据池中 for (short i = 0; i < nNum; i++) { GCShopSoldList._MERCHANDISE_ITEM pNewItem = packet.MerchadiseList[i]; CObject_Item pItem = null; pItem = ObjectSystem.Instance.NewItem(pNewItem.item_data.m_ItemIndex); pItem.SetGUID( (ushort)pNewItem.item_data.m_ItemGUID.m_World, (ushort)pNewItem.item_data.m_ItemGUID.m_Server, (uint)pNewItem.item_data.m_ItemGUID.m_Serial); pItem.SetExtraInfo(ref pNewItem.item_data); //设置该物品在货架上的位置因为是回购物品它的位置应该是200 pItem.PosIndex = i; //AxTrace(0,0,"pItem->SetPosIndex = %d",i); //设置该物品的数量(每一组的数量) pItem.SetNumber(pNewItem.item_data.GetItemCount()); //回购物品当然只有一个 pItem.SetMax(1); //加入数据池 CDataPool.Instance.Booth_SetSoldItem(i, pItem); CDataPool.Instance.Booth_SetSoldPrice(i, pNewItem.iPrice); } //设置回购商品的数量 CDataPool.Instance.Booth_SetSoldNumber(nNum); } //更新到ActionSystem CActionSystem.Instance.Booth_Update(); //通知UI CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_UPDATE_BOOTH); } 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) { } 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) { GCUnEquipResult packet = (GCUnEquipResult)pPacket; UnEquipResultCode ret = (UnEquipResultCode)packet.Result; switch (ret) { case UnEquipResultCode.UNEQUIP_SUCCESS: { //--------------------------------------------------- //数据池 CObject_Item pItem = CDataPool.Instance.UserEquip_GetItem((HUMAN_EQUIP)packet.EquipPoint); if (pItem == null) { return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } // 改变物品的id, 以便更新新的action 按钮 ObjectSystem.Instance.ChangeItemClientID(pItem); CDataPool.Instance.UserBag_SetItem((short)packet.BagIndex, pItem, true, false); CDataPool.Instance.UserEquip_SetItem((HUMAN_EQUIP)packet.EquipPoint, null, false); //--------------------------------------------------- //逻辑层 CObjectManager.Instance.getPlayerMySelf().UnEquipItem((HUMAN_EQUIP)packet.EquipPoint); //--------------------------------------- //刷新角色属性 CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Set_Equip( (HUMAN_EQUIP)packet.EquipPoint, -1); // 更新主角身上的装备到ActionSystem CActionSystem.Instance.UserEquip_Update(); CActionSystem.Instance.UserBag_Update(); // 通知界面事件 CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_UPDATE_EQUIP); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_PACKAGE_ITEM_CHANGED); } break; case UnEquipResultCode.UNEQUIP_BAG_FULL: CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, "背包已满"); break; case UnEquipResultCode.UNEQUIP_HAS_ITEM: CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, "该位置已经有物品"); break; default: break; } } 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"); GCLevelUpResult charBuffPacket = (GCLevelUpResult)pPacket; } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer) { GCCharSkillCreateBullet Packet = (GCCharSkillCreateBullet)pPacket; if (GameProcedure.GetActiveProcedure() == GameProcedure.s_ProcMain) { LogManager.Log("RECV GCCharSkillCreateBullet"); } 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) { GCBankAddItem packet = pPacket as GCBankAddItem; if (packet.FromType == (byte)GCBankAddItem.PosType.EQUIP_POS) { } else if (packet.FromType == (byte)GCBankAddItem.PosType.BAG_POS) { CObject_Item pItemFrom = CDataPool.Instance.UserBag_GetItemByIndex(packet.IndexFrom); CObject_Item pItemTo = CDataPool.Instance.UserBank_GetItem(packet.IndexTo); switch ((GCBankAddItem.OperateType)packet.Operatetype) { case GCBankAddItem.OperateType.OPERATE_MOVE: // 移动到空格 { CDataPool.Instance.UserBank_SetItem(packet.IndexTo, pItemFrom, true); CDataPool.Instance.UserBag_SetItem(packet.IndexFrom, null, false, false); } break; case GCBankAddItem.OperateType.OPERATE_SPLICE: // 合并 { //CDataPool::GetMe()->UserBank_SetItem(indexTo, pItemFrom); //CDataPool::GetMe()->UserBag_SetItem(indexFrom, NULL, FALSE); } break; case GCBankAddItem.OperateType.OPERATE_SWAP: // 交换 { CDataPool.Instance.UserBank_SetItem(packet.IndexTo, pItemFrom, false); CDataPool.Instance.UserBag_SetItem(packet.IndexFrom, pItemTo, false, false); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_GET_NEWEQUIP, pItemTo.GetID()); } break; default: break; } CActionSystem.Instance.UserBank_Update(); CActionSystem.Instance.UserBag_Update(); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, "物品存入银行成功"); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_PACKAGE_ITEM_CHANGED); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_UPDATE_BANK); } else if (packet.FromType == (byte)GCBankAddItem.PosType.ERROR_POS) { CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, "物品存入银行失败"); } } 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 GCCharmInfo Packet"); GCCharmInfoFlush CharmInfoFlushPacket = (GCCharmInfoFlush)pPacket; CObjectManager pObjectManager = CObjectManager.Instance; CDataPool.Instance.PlayerCharmInfo = CharmInfoFlushPacket.CharmInfo; } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }