public void Move(Character pUser, CInPacket p) { var dwNpcId = p.Decode4(); var item = this[dwNpcId]; if (item == null) { return; } if (item.Controller != pUser) { return; //TODO: Validate you require controller to move a npc } var act1 = p.Decode1(); var act2 = p.Decode1(); byte[] aMovePath = null; if (p.Available > 0) { aMovePath = p.DecodeBuffer(p.Available); } Field.Broadcast(CPacket.NpcMove(item, act1, act2, aMovePath)); }
private void Handle_MobMove(WvsGameClient c, CInPacket p) { int dwMobId = p.Decode4(); var nMobCtrlSN = p.Decode2(); var v7 = p.Decode1(); //v85 = nDistance | 4 * (v184 | 2 * ((unsigned __int8)retaddr | 2 * v72)); [ CONFIRMED ] var pOldSplit = (v7 & 0xF0) != 0; //this is a type of CFieldSplit var bMobMoveStartResult = (v7 & 0xF) != 0; var pCurSplit = p.Decode1(); var bIllegealVelocity = p.Decode4(); var v8 = p.Decode1(); var bCheatedRandom = (v8 & 0xF0) != 0; var bCheatedCtrlMove = (v8 & 0xF) != 0; p.Decode4(); //Loopy Decode 1 p.Decode4(); //Loopy Decode 2 p.DecodeBuffer(16); var movePath = p.DecodeBuffer(p.Available); //if (pMob->m_pController->pUser != pCtrl // && (!pOldSplit // || pMob->m_bNextAttackPossible // || !CLifePool::ChangeMobController(&v5->m_lifePool, pCtrl->m_dwCharacterID, pMob, 1))) //{ // CMob::SendChangeControllerPacket(v9, v10, 0); // return; //} c.SendPacket(CPacket.MobMoveAck(dwMobId, nMobCtrlSN, bMobMoveStartResult, 0, 0, 0)); var mobMove = CPacket.MobMove(dwMobId, bMobMoveStartResult, pCurSplit, bIllegealVelocity, movePath); c.GetCharField().Broadcast(mobMove, c); }
private void Handle_UserMove(WvsGameClient c, CInPacket p) { var v1 = p.Decode8(); var portalCount = p.Decode1(); //CField::GetFieldKey(v20); var v2 = p.Decode8(); var mapCrc = p.Decode4(); var dwKey = p.Decode4(); var dwKeyCrc = p.Decode4(); var movePath = p.DecodeBuffer(p.Available); c.Character.Position.DecodeMovePath(movePath); c.GetCharField().Broadcast(CPacket.UserMovement(c.Character.CharId, movePath), c); }
//----------------------------------------------------------------------------- private void Handle_ClientDumpLog(WvsLoginClient c, CInPacket p) { //Thank you to Mordred for this handler! var callType = p.Decode2(); var errorCode = p.Decode4(); var backupBufferSize = p.Decode2(); var rawSeq = p.Decode4(); var type = p.Decode2(); var backupBuffer = p.DecodeBuffer(backupBufferSize - 6); var callTypeName = Enum.GetName(typeof(CrashCallType), callType); var logTypeName = Enum.GetName(typeof(SendOps), type); Logger.Write(LogLevel.Trace, "RawSeq: {0} CallType: {1} ErrorCode: {2} BackupBufferSize: {3} Type: {4} - {5} Packet: {6}", rawSeq, callTypeName, errorCode, backupBufferSize, type, logTypeName, Constants.GetString(backupBuffer) ); }
public static void Skip(this CInPacket packet, int length) { packet.DecodeBuffer(length); }