public override int GetPacketMaxSize() { return(sizeof(byte) * 3 + sizeof(short) * 2 + WORLD_POS.GetMaxSize() + sizeof(int)); }
public bool Pet_SendUseSkillMessage(int petIndex, short idSkill, int idTargetObj, float fTargetX, float fTargetZ) { SDATA_PET pPetData = Pet_GetPet(petIndex); int nPetCount = CDataPool.Instance.Pet_GetCount(); if (pPetData != null) { CObject_PlayerNPC pPet = null; if (pPetData.idServer != uint.MaxValue) { pPet = CObjectManager.Instance.FindServerObject((int)pPetData.idServer) as CObject_PlayerNPC; } if (pPet != null) { CGCharUseSkill msg = NetManager.GetNetManager().CreatePacket((int)PACKET_DEFINE.PACKET_CG_CHARUSESKILL) as CGCharUseSkill; msg.ObjectID = (int)pPetData.idServer; msg.SkillDataID = idSkill * 100; msg.TargetID = idTargetObj; WORLD_POS pos = new WORLD_POS(); pos.m_fX = fTargetX; pos.m_fZ = fTargetZ; msg.PosTarget = pos; // msg.PosTarget.m_fZ = fTargetZ; msg.Dir = -1; msg.GuidTarget = -1; LogManager.LogWarning("Pet_SendUseSkillMessage"); NetManager.GetNetManager().SendPacket(msg); } } return(true); }
public override int GetPacketMaxSize() { return(WORLD_POS.GetMaxSize() + sizeof(int) + sizeof(float) * 2 + sizeof(byte)); }
public override int GetPacketMaxSize() { return(sizeof(uint) + sizeof(int) + WORLD_POS.GetMaxSize() + sizeof(Byte) + WORLD_POS.GetMaxSize() * GAMEDEFINE.MAX_CHAR_PATH_NODE_NUMBER); }
public void addTargetPos(WORLD_POS pPos) { if (m_yNumTargetPos < GAMEDEFINE.MAX_CHAR_PATH_NODE_NUMBER) { m_aTargetPos[m_yNumTargetPos] = pPos; m_yNumTargetPos++; } }
public bool Init(int nLogicCount, int nEndNodeIndex, WORLD_POS Pos) { SetLogicCount(nLogicCount); m_nEndNodeIndex = nEndNodeIndex; m_posEndPos = Pos; SetCommandID(ENUM_OBJECT_COMMAND.OBJECT_COMMAND_STOP_MOVE); return(true); }
public override int getSize() { return(sizeof(uint) + sizeof(int) + WORLD_POS.GetMaxSize() + sizeof(Byte) + WORLD_POS.GetMaxSize() * m_yNumTargetPos); }
public override int GetPacketMaxSize() { int uSize = 0; uSize += sizeof(uint) * 2 + sizeof(int) + WORLD_POS.GetMaxSize() + sizeof(Byte); uSize += sizeof(int) + WORLD_POS.GetMaxSize(); return(uSize); }
public override int getSize() { return(sizeof(uint) + sizeof(int) + WORLD_POS.GetMaxSize() + sizeof(float) + sizeof(int) + sizeof(uint) * m_nPassengerCount); }
public override int GetPacketMaxSize() { return(sizeof(uint) + sizeof(int) + WORLD_POS.GetMaxSize() + sizeof(float) + sizeof(int) + sizeof(uint) * GameStruct_Bus.DEF_BUS_MAX_PASSENGER_COUNT); }
public override int GetPacketMaxSize() { return(sizeof(byte) + sizeof(int) * 3 + sizeof(short) + WORLD_POS.GetMaxSize() * 2 + sizeof(float) + GameUtil.BitFlagSet_T.getMaxSize((uint)GCTargetListAndHitFlags.MAXTARGETLIST.MAX_TARGET_LIST_SIZE) + sizeof(int) * (int)(GCTargetListAndHitFlags.MAXTARGETLIST.MAX_TARGET_LIST_SIZE)); }
public override int getSize() { return(sizeof(byte) + sizeof(int) * 3 + sizeof(short) + WORLD_POS.GetMaxSize() * 2 + sizeof(float) + (int)m_HitFlagList.GetByteSize() + sizeof(int) * m_nTargetNum); }
public bool Init(uint uStartTime, int nLogicCount, int nMagicID, uint nTargetID, WORLD_POS TargetPos, float fTargetDir) { SetStartTime(uStartTime); SetLogicCount(nLogicCount); m_nMagicID = nMagicID; m_nTargetObjID = nTargetID; m_posTarget = TargetPos; m_fTargetDir = fTargetDir; SetCommandID(ENUM_OBJECT_COMMAND.OBJECT_COMMAND_MAGIC_SEND); return(true); }
public override int getSize() { int uSize = 0; uSize += sizeof(uint) * 2 + sizeof(int) + WORLD_POS.GetMaxSize() + sizeof(Byte); if (IsHaveStopInfo()) { uSize += sizeof(int) + WORLD_POS.GetMaxSize(); } return(uSize); }
public bool Init(uint uStartTime, int nLogicCount, int nNodeCount, WORLD_POS[] paposNode) { SetStartTime(uStartTime); SetLogicCount(nLogicCount); m_nNodeCount = nNodeCount; if (m_nNodeCount > 0) { m_paposNode = new WORLD_POS[m_nNodeCount]; m_paposNode = paposNode; } else { m_paposNode = null; } SetCommandID(ENUM_OBJECT_COMMAND.OBJECT_COMMAND_MOVE); return(true); }
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 int GetPacketMaxSize() { return(sizeof(int) * 4 + WORLD_POS.GetMaxSize() * 2 + sizeof(float) + sizeof(short)); }
public override int GetPacketMaxSize() { return(sizeof(int) + WORLD_POS.GetMaxSize()); }
public void setTargetPos(ref WORLD_POS pos) { m_posTarget = pos; }
public void setWorldPos(ref WORLD_POS pos) { m_posWorld = pos; }
public override int GetPacketMaxSize() { return(sizeof(byte) * 2 + sizeof(uint) * 18 + WORLD_POS.GetMaxSize()); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase packet, ref Peer pPlayer) { GCNewItemBox pPacket = (GCNewItemBox)packet; //当前流程是主流程 if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { CObjectManager pObjectManager = CObjectManager.Instance; //检查位置是否合法 fVector2 pos = new fVector2(pPacket.Position.m_fX, pPacket.Position.m_fZ); if (!WorldManager.Instance.ActiveScene.IsValidPosition(ref pos)) { LogManager.LogError("Valid Position @GCNewItemBoxHandler.Execute"); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_ERROR); } if ((int)ITEMBOX_TYPE.ITYPE_DROPBOX == pPacket.ObjectType) { bool bMustCreater = true; CObject pObj = (CObject)(pObjectManager.FindServerObject((int)pPacket.MonsterID)); if (pObj != null && pObj is CObject_Character) { CObject_Character pCharacter = (CObject_Character)pObj; if (!pCharacter.IsDie()) { uint idItemBox = (uint)pPacket.ObjectID; uint idOwner = (uint)pPacket.OwnerID; WORLD_POS posCreate = pPacket.Position; pCharacter.AddDropBoxEvent(idItemBox, idOwner, ref posCreate); bMustCreater = false; } } if (bMustCreater) { //创建ItemBox CTripperObject_ItemBox pBox = (CTripperObject_ItemBox)CObjectManager.Instance.NewTripperItemBox((int)pPacket.ObjectID); pBox.Initial(null); //设置位置 pBox.SetMapPosition(pPacket.Position.m_fX, pPacket.Position.m_fZ); //设置掉落箱的归属 pBox.SetOwnerGUID((uint)pPacket.OwnerID); CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_DROP_ITEMBOX); } } else { //创建矿物生长点 CTripperObject_Resource pResource = (CTripperObject_Resource)CObjectManager.Instance.NewTripperResource((int)pPacket.ObjectID); if (!(pResource.SetResourceID((int)pPacket.ObjectType))) { //非法的资源ID CObjectManager.Instance.DestroyObject(pResource); return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); } pResource.Initial(null); //设置位置 pResource.SetMapPosition(pPacket.Position.m_fX, pPacket.Position.m_fZ); jhCount++; } } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE); }
public override int GetPacketMaxSize() { return(sizeof(byte) + sizeof(uint) + WORLD_POS.GetMaxSize() + sizeof(float) + PET_GUID_t.getMaxSize() + sizeof(byte)); }
public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase packet, ref Peer pPlayer) { //当前流程是主流程 if (GameProcedure.GetActiveProcedure() == (GameProcedure)GameProcedure.s_ProcMain) { GCNewPet_Move pPacket = (GCNewPet_Move)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); } fVector2 targetPos = new fVector2(pPacket.getTargetPos().m_fX, pPacket.getTargetPos().m_fZ); if (!WorldManager.Instance.ActiveScene.IsValidPosition(ref targetPos)) { 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()); 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, 0.0f, 0.0f); pNPC.Initial(initPlayerNPC); } else { pNPC.SetMapPosition(pos.x, pos.y); 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()); // move to command { WORLD_POS[] posTarget = new WORLD_POS[1]; posTarget[0].m_fX = pPacket.getTargetPos().m_fX; posTarget[0].m_fZ = pPacket.getTargetPos().m_fZ; SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_MOVE; cmdTemp.SetValue <uint>(0, 0); cmdTemp.SetValue <int>(1, pPacket.getHandleID()); cmdTemp.SetValue <int>(2, 1); cmdTemp.SetValue <WORLD_POS[]>(3, posTarget); pNPC.PushCommand(cmdTemp); } //放入Ask队列 pObjectManager.LoadQueue.TryAddLoadTask(pNPC.ID); //同步渲染层 string szTemp = "GCNewPet_Move(" + 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) { CObjectManager pObjectManager = CObjectManager.Instance; GCNewMonster_Move newMonsterMovPacket = (GCNewMonster_Move)pPacket; // //检查位置是否合法 // if(!CWorldManager::GetMe().GetActiveScene().IsValidPosition(fVector2(pPacket.getWorldPos().m_fX, pPacket.getWorldPos().m_fZ))) // { // TDThrow("ERROR POSITION @ GCNewMonster_MoveHandler"); // } // if(!CWorldManager::GetMe().GetActiveScene().IsValidPosition(fVector2(pPacket.getTargetPos().m_fX, pPacket.getTargetPos().m_fZ))) // { // TDThrow("ERROR POSITION @ GCNewMonster_MoveHandler target"); // } //创建玩家 CObject_PlayerNPC pNPC = (CObject_PlayerNPC)pObjectManager.FindServerObject((int)newMonsterMovPacket.getObjID()); if (pNPC == null) { pNPC = pObjectManager.NewPlayerNPC((int)newMonsterMovPacket.getObjID()); pNPC.Initial(null); } else { //pNPC.Enable( OSF_VISIABLE ); // pNPC.Disalbe( OSF_OUT_VISUAL_FIELD ); } //设置x z坐标 pNPC.SetMapPosition(newMonsterMovPacket.getWorldPos().m_fX, newMonsterMovPacket.getWorldPos().m_fZ); if (newMonsterMovPacket.getIsNPC()) { pNPC.SetNpcType(ENUM_NPC_TYPE.NPC_TYPE_NPC); } else { pNPC.SetNpcType(ENUM_NPC_TYPE.NPC_TYPE_MONSTER); } pNPC.GetCharacterData().Set_MoveSpeed(newMonsterMovPacket.getMoveSpeed()); // move to command { WORLD_POS[] posTarget = new WORLD_POS[1]; posTarget[0].m_fX = newMonsterMovPacket.getTargetPos().m_fX; posTarget[0].m_fZ = newMonsterMovPacket.getTargetPos().m_fZ; SCommand_Object cmdTemp = new SCommand_Object(); cmdTemp.m_wID = (int)OBJECTCOMMANDDEF.OC_MOVE; cmdTemp.SetValue <uint>(0, 0); cmdTemp.SetValue(1, newMonsterMovPacket.getHandleID()); cmdTemp.SetValue(2, 1); cmdTemp.SetValue <WORLD_POS[]>(3, posTarget); pNPC.PushCommand(cmdTemp); } //放入Ask队列 pObjectManager.LoadQueue.TryAddLoadTask(pNPC.ID); //tempcode // { // //此版不做服务器繁忙客户端延后发消息的处理 // CGCharAskBaseAttrib msgAskBaseAttrib = new CGCharAskBaseAttrib(); // msgAskBaseAttrib.setTargetID( (uint)(int)newMonsterMovPacket.getObjID()); // GameProcedure.s_NetManager.SendPacket(msgAskBaseAttrib ); // // } pNPC.SetMsgTime(GameProcedure.s_pTimeSystem.GetTimeNow()); } return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE);; }
public override int getSize() { return(sizeof(uint) + sizeof(int) + WORLD_POS.GetMaxSize() * 2 + sizeof(float) + sizeof(byte)); }
public override int GetPacketMaxSize() { return(WORLD_POS.GetMaxSize() + sizeof(int) * 4); }
public override int getSize() { return(sizeof(uint) + WORLD_POS.GetMaxSize()); }
public void SetStopInfo(int nLogicCount, WORLD_POS pPos) { m_posStop = pPos; m_nStopLogicCount = nLogicCount; m_byStopMove = 1; }
public override int GetPacketMaxSize() { return(sizeof(uint) + sizeof(float) + WORLD_POS.GetMaxSize() + sizeof(float)); }